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.

Using Drupal 6.15 and Plogger 1.0 RC1

Upload the plogger install folder into the main Drupal folder

public_html (site.com)
--- drupal folder (site.com/drupal)
--- --- plogger folder (site.com/drupal/plogger)

Plogger should be set up and working correctly in site.com/drupal/plogger before starting.
If it is not then the following mod may not work correctly.

Back up EVERYTHING (Site, Drupal db, & Plogger db) before hacking the code. 

1st.
Create a new NODE, name it "gallery"
Add the following to the node content and set the input format to PHP.

<?php include("plogger/gallery.php"); ?>
<?php the_gallery_head(); ?>
<?php the_gallery(); ?>

Then...

Open and edit drupal/plogger/plog-includes/plog-functions.php

Around line 29 find of plog-functions.php


$collections_link = '<a href="'.generate_url('collections').'">'.$title.'</a>';
$collections_name = '<strong>'.$title.'</strong>';

Replace <a href="'.generate_url('collections').'"> with  <a href="/drupal/gallery">
Note: if drupal is in the main domain directory then leave /drupal out. just use /gallery


$collections_link = '<a href="/drupal/gallery">'.$title.'</a>';
$collections_name = '<strong>'.$title.'</strong>';


Around line 1456 of plog-functions.php 
look for the below.

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&amp;id='.$id.$args; break;
case 'album':
$rv = $config['baseurl'].$query.'level=album&amp;id='.$id.$args; break;
case 'picture':
$rv = $config['baseurl'].$query.'level=picture&amp;id='.$id;
break;
case 'search':
$rv = $config['baseurl'].$query.'level=search'.$args;
break;
case 'collections':
default:

Replace $config['baseurl'] with 'plogger'
You must include the ' before and after the folder name = 'plogger' or it will not work.

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 = 'gallery'.$query.'level=collection&amp;id='.$id.$args;
break;
case 'album':
$rv = 'gallery'.$query.'level=album&amp;id='.$id.$args;
break;
case 'picture':
$rv = 'gallery'.$query.'level=picture&amp;id='.$id;
break;
case 'search':
$rv = 'gallery'.$query.'level=search'.$args;
break;
case 'collections':
default:

The first $config['baseurl'] under admin should be left the same. This allows the admin session to work outside the node.

Save and upload.

Visit site.com/drupal/plogger/plog-admin to edit the plogger system.
Visit site.com/drupal/gallery to view the plogger powered gallery.

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.

Please fully back-up your site, drupal db, and plogger db before installing this mod.
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 site.com/drupal/plogger may not work 100%, but 
site.com/drupal/gallery and site.com/drupal/plogger/plog-admin does as far as I can tell.

What was used.
Drupal 6.15 and Plogger 1.0 RC1 were used.

Drupal.org - Plogger.org

Download Plogger here! (Version 1.0 RC1, 700 kb)

Comments

Figured it out...

You can ignore/delete the previous comment.  Epiphanies always hit after pressing "submit".

I forgot I install plogger within my theme's directory, rather than at the root.  Therefore, though example.com renders my theme to the browser, to access plogger where I put it I have to go to example.com/sites/all/themes/mytheme/plog-admin.

Ay.

How do you administer?

Thanks for the writeup, helped a lot.  I installed it and set up some galleries, and it all works fine, only now, a day later, the galleries still work but I can't figure out how to login to plogger to add new ones. ?  I believe something in my drupal template is blocking it (if I try to go to example.com/plog-admin or a plogger page it gives me a "page not found" error).  I know they're there.  Do I have to include something in php somewhere?  Or do I just not know the right url?

Thanks if you can help. I imagine it's something to do with my template, so I will keep looking at it.  It worked when I first installed, but I never navigated away from the set up page the install opened.

wrong location..

 

Does example.com reslove to your main plogger directory?
It should be something like example.com/path-to-plogger/plog-admin!

example.com/gallery-node will not allow admin to work from it!

thanks

thanks for this, really helped.  you should shoot an email to the plogger people to link this from their site, really useful.

wow this is great!!! thanks

Wow, it worked great. thanks.