Archive for the 'WordPress' Category

BEST Way to Integrate eSPG into Wordpress

Monday, June 20th, 2005

There are a few sites out there with instructions on integrating Enhanced Simple PHP Gallery into Wordpress. The method I am going to describe, however, is the best. One key feature of this method that sets it apart is that it makes use of the TITLE tag. Another feature is that when you change the theme of Wordpress, it will change in your eSPG installation as well. It also makes use of the add_filter function in Wordpress to dynamically add the necessary code to the HTML HEAD. Here’s how it’s done:

Make a backup of header.php in your eSPG installation directory. Then, replace its contents with the contents of this file.

Then, make a backup of footer.php. Replace the contents of footer.php with the contents of this file:

You will need to edit sp_styles.css to match your theme. If you do not want to include the sidebar, there are a few more steps involved. If you are interested, leave a comment on here and I will add the steps to this post. Also leave a comment if there are any questions; I will probably end up opening a forum thread for this. As always, please let me know if you use this!

Mentioned in the MicroWiki Documentation!

Wednesday, March 23rd, 2005

Hey hey!! Check this out! I’m mentioned in the mod_rewrite section of the MicroWiki documentation! This is really neat. I’ve always loved the concept of open source and contributing to code, and this is my first time being able to do so and being credited! yay!! :-)

Photo Gallery Working!

Saturday, February 12th, 2005

I’ve decided to go with Exhibit for a photo gallery. I ran into a serious problem with it, so I will post the problem and remedy right here, and hopefully it will help someone else. Since I had made a few posts in the Exhibit section of the WordPress support forums, I’ll just paste the posts that I made on here. Also, I’m going to use this post to test and see if it’s really working :)

Post One:
i have Exhibit 1.1d, and WordPress 1.5-gamma 2005-02-08. Exhibit is not working …. Does it not work with 1.5 yet? Here are other plugins that I have installed and activated: Adhesive 2.1 beta, Countdown 1.0 alpha 5, EzStatic 1.9, Hello Dolly 1.0, Spam Karma 1.18 alpha 3, WP-CC 0.1.1, and WP Plugin Manager 1.6.4.b. I have followed the installation instructions, and Exhibit is activated in the plugin list; However, there is no Exhibit section in the edit post, write post, edit draft, or anywhere. I did notice that when I browse to a comments page for a post in my WordPress, I get a mySQL error:

WordPress database error: [Table ‘example_com.wp_exhibit’ doesn’t exist]
SELECT ID FROM wp_exhibit WHERE post_ID = 11 and preview = 1 ORDER BY picorder;

Warning: array_chunk() expects parameter 1 to be array, null given in /home/ .dir/ myusername/ example.com/ wp-content/ plugins/ exhibitimg/ exhibit10p.php on line 475

I have changed the name of my domain, but that’s the error. So the table does not exist, but there is no Exhibit section in the modify post area that lets me create it. Perhaps I could create it manually knowing the structure, but it’s supposed to be in the admin area so something must be amiss. So, I disable the plugin to get rid of the error… Any idea how to fix this, or is it a matter of WP1.5 incompatibility??

Post Two:
From other posts in here, it appears that Exhibit is compatible with 1.5… I tried disabling all other plugins, still no dice…. I have manually added the Exhibit table in the mySQL database, including the “picorder” column, still no dice…. Adding the table did, however, get rid of the mySQL error in the comments page, so at least now I can keep Exhibit enabled without worrying about errors. I have tried going to Manage Posts and editing a post, the Exhibit section is not there. I’ve tried starting a new post, clicking “save and continue editing,” and it’s still not there. I have tried downloading “asy_exhibit.zip,” and that didn’t work so I put the “exhibit11d.zip” files back up. I’d really like for this to work, as it seems like a really neat and fitting plugin… Any suggestions??

Post Three:
IMPORTANT …. i’ve fixed the problem…. the problem was that PHP was in CGI mode rather than apache module mode …. i found that suggestion in a little post on here somewhere, but i feel like it’s important to know …. luckily, i have the best hosting provider on the planet. i logged in and changed it to apache module mode with a few clicks. the provider recommends CGI mode for greater security, but they list some drawbacks of it in their knowledge base:

  • Custom 404 pages won’t work for .php files with PHP-CGI. Or will they? See n74’s comment below!
  • Variables in the URL won’t work without using mod_rewrite (example.com/blah.php/username/info/variable).
  • Custom php directives in .htaccess files (php_include_dir /home/user;/home/user/example_dir) won’t work.
  • The $_SERVER[’SCRIPT_NAME’] variable will return the php.cgi binary rather than the name of your script

MicroWiki mod_rewrite Code!!

Saturday, February 12th, 2005

After much blood, sweat, and headaches I have gotten MicroWiki to use search engine friendly URLs. The MicroWiki site describes a way to do it with ISAPI, and I quickly found out that the method does not work with Apache mod_rewrite. Well, I wasn’t about to have query strings in my MicroWiki implementation, so I set out on a mission to get the job done myself. It shouldn’t have been as much of a headache as it was, but I am making great progress. I have saved the MicroWiki-specific code in my .htaccess to a text file.

Click here to see the .htaccess code…

I really hope that someone else will be able to use this, let me know if you do! There is one limitation, and it won’t make any difference unless your visiters manually mess around with the URL. It doesn’t work correctly with a trailing slash (yet). So, as of now, the URL “/_wiki/index” produces different results than “/_wiki/index/”. Don’t worry, I won’t stand for this. I’ll be trying to fix it as soon as possible. If any of you mod_rewrite experts out there know of a way to fix it, or of a better way to do the whole thing, don’t hesitate to leave some feedback! During the process of getting this to work, I kind of broke the site for a few hours :); everything should be in working order now, and hopefully I’ll be providing a link to the shiney new Soulpass Wiki very soon!