Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-01-22 17:21:27

mattgilbert
Member
Registered: 2006-03-23
Posts: 70

a lot of talk about plogger integration, but anything specific?

hi,

i’ve found many mentions of integrating plogger and textpattern, but nothing very specific. do you install plogger in a subdirectory of your textpattern site? do you add plogger code to a textpattern page? or do you add textpattern tags to a plogger page? or something else entirely? i’ll do my best to document whatever i figure out as well as i can, but can anyone weigh in on how they have/would approach this?

also, can they use the same database?

Last edited by mattgilbert (2007-01-22 18:50:03)

Offline

#2 2007-01-29 22:19:41

mattgilbert
Member
Registered: 2006-03-23
Posts: 70

Re: a lot of talk about plogger integration, but anything specific?

i think i’ve sorted out one way to integrate plogger and textpattern, though it took a bit of editting of the plogger code. i’ll post it here in case it comes in handy for other people, or in case anyone can find problems with it. fair warning, i’m no expert in php, and i have barely any experience editing databases, so proceed with caution and yell if you see anything sloppy.

the way i’m integrating plogger is by installing it in the same home directory as textpattern, and having a section (you might call it “Photo Gallery” or photo_gallery”) for displaying the plogger stuff.

the modified files (only three of them) are available here: http://www.mattgilbert.net/plogger_txp_integration.zip
besides replacing the files, there is a small change you need to make to the mySQL table in phpMyAdmin and you won’t be able to use “cruft-free” urls in plogger’s options (unless you figure out something that I didn’t).

So, here’s what to do:
1) install plogger, leaving out the index.php file, since it would overwrite your site’s textpattern-driven index.php file. also be careful not to overwrite anything else you may want to keep, like the images folder. you should use the same database with plogger as you do with textpattern (accessing 2 different databases seemed to cause chaos).
2) create the section for plogger in textpattern’s admin interface
3) create a page for that section, and on that page include <txp:php> require("gallery.php"); </txp:php> at the top and <txp:php> the_gallery(); </txp:php> wherever you like on the page. this will display the default plogger layout. if you want it changed you’ll have to edit the css and possibly parts of the php that i don’t get into in this post. but it’s all possible, if you know php.
4) replace the appropriate plogger files with the ones included in the zip file (http://www.mattgilbert.net/plogger_txp_integration.zip)
5) edit the database:
5.1) go to phpMyAdmin (usually somewhere in http://yoursite.com/cpanel/)
5.2) select your database
5.3) browsethe plogger_config table and click the “Structure” tab
5.4) add “1” field “at end of table” and click Go
5.5) name the field “txp_section_name”, make it “VARCHAR” with a length of, let’s say 64, and set Null to “Null”. then click save.
6) that should do it, but no guarantees.

If you’ld like to know details about what I’ve edited, here they are:
1) a plogger function in gallery.php called getmicrotime() conflicts with a textpattern function, so I renamed it to plogger_getmicrotime() in it’s definition and the 2 times it was called.
2) the_gallery() in gallery.php wasn’t finding $thumbnail_config, so as a workaround it checks to see if it is set and gets this data from the global $config if it isn’t
3) to support the section urls, the functions generate_url() in plog_functions.php, generate_breadcrumbs() and generate_search_box() in gallery.php, and a few lines in plog_rss.php were edited to include @”?s=whatever_section_name” in the urlvars. look at the files and and search for “TEXTPATTERN” if want to see where I changed things in detail. I’m pretty sure I commented all of them.

Last edited by mattgilbert (2007-06-09 18:58:32)

Offline

Board footer

Powered by FluxBB