User login
How to Embed Plogger into Drupal 6.x
I have successfully embedded Plogger into Drupal 6x and managed to make it work correctly from with in the Drupal NODE. A few line changes and it works correctly. Working Example - http://2faroffroad.com/gallery
Using Drupal 6.x and Plogger 1.0 RC1
Updated10-4-2010
Upload the plogger install folder into the main Drupal folder
--- drupal folder (yoursite.com)
--- --- plogger folder (yoursite.com/plogger)
Plogger should be set up and working correctly in "yoursite.com/plogger" before starting.
If it is not then the following mod may not work correctly.
Though we should only be messing with the Plogger database, it is still reccomended to Back-Up the Drupal db and the Plogger db before hacking the code.
1st.
Create a new PAGE NODE, name it "gallery"
Important: Fix the URL path to just "gallery" and not "content/gallery"
Add the following to the node content and set the input format to PHP and save.
<?php include("plogger/gallery.php"); ?>
<?php the_gallery_head(); ?>
<?php the_gallery(); ?>
It should be accessable from "yoursite.com/gallery" and should now show your Drupal site with the gallery loaded.
Note: Should give error 404 if gallery is clicked.
Then...
Open and edit "plogger/plog-includes/plog-functions.php"
Around line 29 find
$collections_link = '<a href="'.generate_url('collections').'">'.$title.'</a>';
$collections_name = '<strong>'.$title.'</strong>';
Replace with
$collections_link = '<a href="/gallery">'.$title.'</a>';$collections_name = '<strong>'.$title.'</strong>';
Continue editing "plogger/plog-includes/plog-functions.php"
Find around line 1456
switch($level) {
// Admin section for generate_url
case 'admin':
$rv = $config['baseurl'].'plog-admin/plog-'.$id.'.php?'.substr($args, 5);
break;
// Front end section for generate_url
case 'collection':
$rv = $config['baseurl'].$query.'level=collection&id='.$id.$args; break;
case 'album':
$rv = $config['baseurl'].$query.'level=album&id='.$id.$args; break;
case 'picture':
$rv = $config['baseurl'].$query.'level=picture&id='.$id;
break;
case 'search':
$rv = $config['baseurl'].$query.'level=search'.$args;
break;
case 'collections':
default:
$rv = $config['baseurl'];:
Replace only the yellow highlited $config['baseurl'] shown above with 'gallery'
Do not change the red $config['baseurl']
Note: You must include the ' before and after the folder name = 'gallery' or it will not work.
Example:
fdswitch($level) {
// Admin section for generate_url
case 'admin':
//do not change the frist $config['baseurl']
$rv = $config['baseurl'].'plog-admin/plog-'.$id.'.php?'.substr($args, 5);
break;
// Front end section for generate_url
case 'collection':
$rv = 'gallery'.$query.'level=collection&id='.$id.$args;
break;
case 'album':
$rv = 'gallery'.$query.'level=album&id='.$id.$args;
break;
case 'picture':
$rv = 'gallery'.$query.'level=picture&id='.$id;
break;
case 'search':
$rv = 'gallery'.$query.'level=search'.$args;
break;
case 'collections':
default:
$rv = $config['baseurl'];:
The first and last $config['baseurl'] should be left the same. This allows the admin session to work outside the node.
Save and upload.
Visit "yoursite.com/plogger/plog-admin" to edit the plogger system.
Visit "yoursite.com/gallery" to view the plogger powered gallery.
Here is a working example of the above changes --> http://2faroffroad.com/gallery
About me and the above code..
I am not a drupal coder and only have basic knowledgeable about php.
The above is how I managed to get both to work together.
If you find a error let me know below in the commemts and I'll correct/change it.
Only issue I can see is that Cruft-Free URLs do not work.
I am just happy I got Plogger to work.
Viewing the gallery at "yoursite.com/plogger" should only be used by the admin. It will not work from the user end.
"yoursite.com/gallery" and "yoursite.com/plogger/plog-admin" does as far as I can tell and have tested
What was used.
Drupal 6.15 and Plogger 1.0 RC1 were used.
Download Plogger here! (Version 1.0 RC1, 700 kb)