Integrate Plogger into WordPress

I am now going to go over some simple instructions on how to make Plogger look like your WordPress theme. I used Plogger 1.0 Beta 3 and WordPress 2.6.2.

Step 1
Download Plogger and extract files.

Step 2
Upload files to a folder inside your’re WordPress folder. I put mine in /plogger.

Step 3
Install Plogger as is given in the instructions that come with the software.

Now that you have the software uploaded you need to run the installation script. Navigate to the URL http://www.yoursite.com/plogger/_install.php — for whichever path you choose to upload the script to. The installation script will prompt you for your MySQL database connection parameters and a few other basic pieces of information.

Step 4
Open Plogger’s index file, mine was plogger/index.php. Remove all the code, we are going to rebuild it. Add the following lines:

 

Step 5
After those lines, copy in your header.php file from your template. Mine was /wp-content/themes/default/header.php.

Step 6
Before the </head> put:

 

Step 7
After where you copied in your header file, copy in your theme’s index.php file. Mine was /wp-content/themes/default/index.php.

Remove this line:

 

Step 8
Remove the code between and inlcuding:

<!--?php if (have_posts()) : ?-->
/* Code */
<!--?php endif; ?-->

Replace it with:

 

Step 9
Open your ‘plog-globals.php’ file. Mine was plogger/plog-globals.php.

Replace:

require_once("lib/gettext/streams.php");
require_once("lib/gettext/gettext.php");
 
$locale = "en_US";
$mofile = "../plog-translations/" . $locale . ".mo";
 
// If the mo file does not exist or is not readable, or if the locale is
// en_US, do not load the mo.
if ( is_readable($mofile) &amp;&amp; ($locale != 'en_US') ) {
    $input = new FileReader($mofile);
} else {
    $input = false;
}
 
$l10n = new gettext_reader($input);
 
// Return a translated string.
function plog_tr($text) {
    global $l10n;
    return $l10n-&gt;translate($text);
}

With:

if (!class_exists(streamreader)) {
  require_once("lib/gettext/streams.php");
  require_once("lib/gettext/gettext.php");
}
 
if (defined('PLOGGER_LOCALE') &amp;&amp; PLOGGER_LOCALE!=='' &amp;&amp; strlen(PLOGGER_LOCALE) &gt;= 2) {
 $locale = PLOGGER_LOCALE;
} else {
   $locale = "en_US";
}
 
$language = strtolower(substr($locale,0,2));
$mofile = PLOGGER_DIR . "plog-translations/" . $locale . ".mo";
 
// If the mo file does not exist or is not readable, or if the locale is// en_US, do not load the mo.
if (is_readable($mofile) &amp;&amp; ($locale != 'en_US')) {
  $input = new CachedFileReader($mofile);
} else {
    $input = false;
}
 
$plog_l10n = new gettext_reader($input);
 
// Return a translated string.
function plog_tr($text) {
  global $plog_l10n;  
 
  if (isset($plog_l10n)) {
    return $plog_l10n-&gt;translate($text);
  } else {
     return $text;
  }

Final step
Upload the changed index.php and plog-globals.php to where you installed Plogger. So for me, I uploaded it to /plogger.


Leave a Reply