WordPress Impressive Permalink Functionality

A long time ago I enabled the WordPress permalink functionality so that the links for my blog articles were somewhat human readable.  I used my own custom format, /%category%/%year%/%monthnum%/%day%/%postname%/.

Awhile ago I began regretting that format because if I changed the category of the article then the URL would change and any bookmarks to that article would be broken.

Today I started reorganizing a lot of categories and decided it was time to bite the bullter.  I changed the permalink format to the standard /%year%/%monthnum%/%day%/%postname%/.   What was so impressive is that the old URL’s still worked, they redirected to the new URL.  WordPress rocks.

Stats on Dreamhost with WordPress

Analog: WWW logfile analysisOn my WordPress blogs hosted by Dreamhost to get stats I needed to add this to the .htaccess file.

# BEGIN Stats
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(stats|failed_auth\.html).*$ [NC]
RewriteRule . - [L]
</IfModule>
# END Stats

This is further explained in the Dreamhost Wiki page Making stats accessible with htaccess.

Dreamhost uses Analog to generate web statistics. Other recommended AWStats which seems more powerful. Maybe I’ll switch if I feel the need.

WordPress Contact E-Mail Form

Naively, I put up email addresses for sales, information, and site feedback on the Contact Us page. The spam robots discovered these email addresses and have begun to spam me.

Fortunately there is a WordPress plugin, PXS Mail Form, for email forms that seems quite mature and even protects against exploits. You can see how it is used on this page.

I made only one change to this plugin that allows you to set the subject of the email form using a GET request. Previously you could only do this using a POST request.

***************
*** 58,69 ****
              } else {
              $show_subject = 1;
              $subject = '';
!             if (empty($_POST['your_subject'])) {
              $subject = get_option('pxs_subject');
              $subject = stripslashes($subject);
              $subject_mm = '';
              } else {
!             $subject = $_POST['your_subject'];
              $subject = stripslashes($subject);
              $subject_mm =  ': '.$subject;
              }
--- 58,69 ----
              } else {
              $show_subject = 1;
              $subject = '';
!             if (empty($_REQUEST['your_subject'])) {
              $subject = get_option('pxs_subject');
              $subject = stripslashes($subject);
              $subject_mm = '';
              } else {
!             $subject = $_REQUEST['your_subject'];
              $subject = stripslashes($subject);
              $subject_mm =  ': '.$subject;
              }

WordPress and Gallery2

I installed Gallery2 for one of my clients. I then integrated Gallery2 with WordPress using this plugin.

Everything seemed to go fine except I could not get Gallery2’s URL rewrite to play nicely with the WordPress installation which resulted in thumbnail images not showing up in the sidebar. After much experimentation I finally decided just to turn off Gallery2’s URL rewrite to resolve the problem. I tried using this help page but it didn’t work for me.

I am also unsure how to make the Gallery2 pages look more integrated with the WordPress pages. Right now it’s glaringly obvious that the Gallery2 pages are not part of the rest of the site.

Gallery2 is pretty cool. It is quite improved from the original Gallery. I like how you can set the permissions for individual photos so that certain photos only registered users can see. It was annoying though that I had to type in the group name “Registered Users” instead of being given a choice in a drop down list of which group I want to assign a new permission.

WordPress fun

Plugins

  • WPG2 – embeds Gallery2 within WordPress to share photos, videos and any other Gallery2 content seamlessly into the WordPress Sidebar and Blog entries
  • Croissanga – re-posts your published-status posts to your Xanga site
  • WeatherIcon 2.0 – displays the weather for any place in the world
  • Theme Switcher – allows your readers to switch between your installed themes

Themes

To see different WordPress themes try the WordPress Theme Viewer.