Dev Corner

Software Developer’s Notepad

In SQLite there is no class used for storing date and time. But there are still some handful functions, which are for working with time information.

Read the rest of this entry »

You need to add icons to your search results, archives or simply to enable the Facebook Open Graph protocol on your blog site. This task can be accomplished by extracting the URL of the first image, used in post. If you follow certain conventions, this can always be the post or page thumbnail. I have seen many solutions to this relatively simple problem. Unfortunately most of them are incorrect. Here is the right PHP code to get the first image URL from the post content. Read the rest of this entry »

There are many WordPress plugins that can add the Facebook button to your site. With this plugin you can not only add Like button. You can use different methods, customize the look and feel and enable the Facebook Open Graph protocol support. Read the rest of this entry »

Frequently Asked Questions for Facebook Import Comments to WordPress plugin

Q. I have some ideas about the plugin. What to do?

A. Great! The plugin is distributed under the GPL license. Everyone can contribute to it. There are many types of contributions. For example:
* comments to existing features
* suggestions for new features
* ideas
* translations in different human languages
* direct code contribution

If you have critiques, please share your opinion with me. I would be glad to here your opinion. Maybe I am wrong, or maybe you. Who knows? :-) Let’s make the world a better place – together.

Q. What happens if a Facebook user removes its comment for my blog post? What action I should take in this case?

A. Since version 1.1 of the plugin Import Mode control setting allows you to specify the plugin’s behavior in this case. By default when user removes a comment from facebook, it is also removed from the blog comment’s list. You can change this behavior by using the “Append new” option.

Q. Is the plugin aligned with the Facebook policies?

A. The plugin is aligned with all known Facebook policies and respects user rights. If you think there are some issues with Facebook policies and user rights, I would be glad to hear about them and introduce necessary changes.
In addition some unique plugin features might be useful in this direction:
* “Delete All Imported Facebook Comments”
* Import Mode setting

Q. Can I separate comments comming from WordPress and from Facebook comments social plugin.

A. Yes, you modify your theme to visually and physically separate both types of comments. The plugin stores special value in the “comment_agent” database field which begins with “facebook-seo-comments”. You can use this fact to modify behavior and visual appearance.

Q. Why the plugin stores the comments into the WordPress database?

A. There are three reasons
* The most important reason is performance. The WordPress database is used to cache Facebook API requests. The result is significant reduce in Facebook engine hits and reduced website traffic.
* Improved user experience.
* Seamless integration for comments posted through Facebook comments social plugin and WordPress comment features.

Many sites are using the popular Facebook Comments Social Plugin. The Facebook Import Comments WordPress plugin allows comments generated by the blog visitors to be imported as WordPress comments.

Some visitors prefer to post comments to Facebook Social Plugin as these comments are becoming part of their social activity and are displayed on their wall.

Other visitors prefer not to use Facebook comments. They would like to post their comments to your WordPress blog.

The Facebook Import Comments combines both type of plugins and makes them part of your WordPress blog.

Search Engine Optimization (SEO) benefits should also be considered. Your site will be more dynamic and more attractive for spiders. As a result it will rate higher in search engine results. According to Facebook SEO (Search Engine Optimization) community is the reason for extending the Facebook Social Plugin to be extended to provide an interface for retrieving the comments.

Author: Ivan Georgiev
Download: Download From WordPress.org

See also:
* The Frequently Asked Questions page.

Changelog

= 1.1 =
* New Feature: Import Mode which allows "append new" and "append new and delete missing" synchronization modes.
* Workaround: WordPress uses global variable $id. In some themes and plugins this variable is overwritten and the function get_the_ID() returns incorrect result.
* Changed default language settings: "Retrieve blog locale = No", "Retrieve additional locales = ''". Facebook fixed their API so locale parameter is not anymore required when querying the Facebook comments.

= 1.0 =
* Language options for Facebook connection.
* Protect plugin directory from browsing.

= 0.2.1 =
* Description changed to more distinguishable.

= 0.2 =
* Refresh Interval to reduce bandwidth consumption.

* Administrative interface

* Refresh Interval can be changed through the administrative interface.

* All imported comments can be removed through the administrative interface.

* The administrative interface displays the number of currently imported comments.

Associative Arrays

DECLARE
  TYPE population_type IS TABLE OF NUMBER INDEX BY VARCHAR2(64);
  country_population population_type;
  continent_population population_type;
  howmany NUMBER;
  which VARCHAR2(64);
 
BEGIN
  country_population('Greenland') := 100000;
  country_population('Iceland') := 750000;
  howmany := country_population('Greenland');
 
  continent_population('Australia') := 30000000;
  continent_population('Antarctica') := 1000; -- Creates new entry
  continent_population('Antarctica') := 1001; -- Replaces previous value
  dbms_output.put_line('Count: ' || continent_population.count);
 
  which := continent_population.FIRST; -- Returns 'Antarctica'
 
-- as that comes first alphabetically.
  which := continent_population.LAST; -- Returns 'Australia'
  howmany := continent_population(continent_population.LAST);
-- Returns the value corresponding to the last key, in this
-- case the population of Australia.
 
  -- Traverse Continents Associative Array
  dbms_output.put_line('Elements in continent_population: ' || continent_population.count);
  which := continent_population.FIRST;
  WHILE which IS NOT NULL LOOP
    dbms_output.put_line(which || ': ' || continent_population(which));
    which := continent_population.NEXT(which);
  END LOOP;
  -- Outputs:
  --   Count: 2
  --   Elements in continent_population: 2
  --   Antarctica: 1001
  --   Australia: 30000000
 
END;

Extend Oracle PL/SQL Collection

DECLARE
  TYPE CourseList IS TABLE OF VARCHAR2(10);
  courses CourseList := CourseList();
BEGIN
  dbms_output.put_line('Initial count= ' || courses.count ||
                       ', first= ' || courses.first ||
                       ', last= ' || courses.last ||
                       '');
  courses.extend(5);
  dbms_output.put_line('After extend(5) count= ' || courses.count ||
                       ', first= ' || courses.first ||
                       ', last= ' || courses.last ||
                       '');
  dbms_output.put_line('After extend(5) count: ' || courses.count);
 
END;
Initial count= 0, first= , last=
After extend(5) count= 5, first= 1, last= 5
After extend(5) count: 5

Multitable INSERT SQL can insert simultaneously into more than one tables. You can also specify optional conditions which determine which values are inserted into which tables. Read the rest of this entry »

The following SQL shows the SQL text for the SQL being executed by a session. Read the rest of this entry »

The following SQL can be used by Oracle Database Administrator (DBA) to retrieve information about the currently active sessions with longest execution. The SQL statement is designed to run with SQL*Plus. Read the rest of this entry »