Archive for the 'WordPress' Category

Easy Inline SWF plugin updated to version 1.0.2

Sunday, October 1st, 2006

The new version fixes problems with resolving local path to .swf in situations when WordPress is not installed at site's root (ie: http://mydomain.com/wordpress, etc)

Get the info and download the new version at this link.

EasySWF plugin for WordPress update to version 1.0.1

Friday, September 22nd, 2006

I have updated the EasySWF plugin to version 1.0.1 today. New version contains exactly 2 fixes:

  • a fix for reading dimensions of .swf file hosted on local filesystem of the server, in case when server doesn't set the DOCUMENT_ROOT environment variable (thanks to Michael Small for pointing out the problem and helping in resolving it!)
  • updated Flash generation code so that it is automatically "activated" in IE for Windows (ie no need to click on Flash in order to be able to click on links inside it, if there are any)

You can download the update here.

More info on the plugin is available here.

What you can do with WordPress

Wednesday, September 20th, 2006

Friday last week, we have finally finished working on one site here at Media Japan where I currently work at. An ordinary site actually, but this is the first time we have used WordPress to build anything big.

The site is for construction company here in Nagoya. And the link follows, so you can look at the site and how it works (everything is in Japanese though..):

WordPress is thought of as just a personal blogging system, mostly, and many people don't think about it as of a system you can use for building a full-fledged corporate site. Well, although there may be other system more oriented to building corporate sites, WordPress was doing just fine for us.What we have created with WordPress:
  • Pages based static pages structure to present static content. Pages are organized into hierarchy, and Fold Page List plugin is used to auto-unfold list of subpages of the selected category.
  • There are 3 different page templates used in total (top level, and 2 templates for showing 2nd and 3rd level pages); as well there are special templates for displaying contact forms (totalling 4 on the site).
  • Forms are not easily processed by WordPress (you do have an ability to get an ordinary contact form processed, but there are no plugins to process free-form content forms), so I had to write a special form processor, which I will hopefully make available to public after some code cleanup and translation to English :) These forms are all processed without a single page refreshes using the AJAX technology. You can see an example if you click this link.
  • We have also used Google Maps to show location of company offices, as you can observe at this page. Unfortunately, I couldn't find any easy to use Google Maps plugins so I wrote one myself, and you can get more info and download at this link.
  • Also, as it turned out, there was no easy to use Flash embedding plugin, so again I wrote one myself. You can see the real-life example here, and download the plugin here.
  • We have added the auto-updating sitemap page to the site using Dagon Design Sitemap Generator (by slightly modifying the source, though..)
  • There are Google Sitemap support added by means of fantastic Google Sitemaps plugin.
  • In order to show closeups of pictures in posts, we have used the cool Lightbox 2.0 plugin.
  • In order to show thumbnails of pictures of a post on front page, we have used (although it needed to be heavily modified) the Post Image plugin.
  • There are also other plugins we have used to show various content in user-accessible area, like Author Image(s), Fuzzy Recent Posts, Fuzzy Recent Comments, and Fancy Excerpt.
  • There are several simple support functions I had to write in order to add various functionality to the site, but the total line count is about 150 lines of PHP code, so it is not really a big deal (and you can get away just fine without these functions in most cases).
  • Regarding administrative area, I have used the following plugins in order to track statistics on the site: Counterize, WP-SlimStat.
  • Since there is also a "Staff blog" set up on the site (and blogs, even on corporate sites, even if nobody actually reads them, are good because they keep search engines attention on the site, and if updated regularily, can be a very good tool to rank up the site on search engines listings). So.. since there is also Staff blog updated to several different people, we needed to limit access of these people to any categories except for blog, and news (news is just a blog category). Moreover, only one person is allowed to make posts to news, and all others are just allows to post to blog. I have used the Limit Categories plugin in order to implement this functionality.
  • There was just one more problem with WordPress admin panel - all users could see each others posts, which is not a very good thing (they couldn't edit each others posts though, but could see them in listings). I had to hack the WordPress code a little bit in order to "fix" this problem You can read about it following this link.

That's basically all we have done in order to build the forementioned WordPress-driven site. It all might look pretty complicated, and actually it was at the beginning (I never used WordPress to build anything big before), so I had to learn and search, search and learn, write plugins and workarounds. So it took about 2 months to complete this project. But I'm sure our next WordPress-based site will be a breathe to build - all required plugins are found, all missing plugins are written, etc.. Out client is happy and site working very smoothely. What else do I need? :)

So.. it might be a long entry, but the point is - you can build pretty complex sites in WordPress, and it is actually not very hard, and doesn't take lots of time to do that, once you understand the basics of how WordPress works.

Anyway, hope this info will be of use. :)

Inline Google Maps plugin updated to version 1.1

Friday, September 15th, 2006

I have updated my Inline Google Maps plugin to version 1.1 today. The hightlight of the new version is much improved handling of HTML inside the marker description field. You can now basically use any HTML you want for description, unless it contains single quotes :)

Have fun with your maps! :)

Easy Inline SWF 1.0 Plugin for WordPress

Wednesday, September 13th, 2006

There are several plugins to display Flash content for WordPress, but they don't make it easy for a user to insert Flash. They ask you to put some weird tags into your post, set Flash dimensions.. Well… NO MORE OF THIS PAIN! :) (cool CM huh ;) (more…)

WordPress: how to hide other users' posts in admin panel

Monday, September 11th, 2006

I am working on another WordPress-based system currently, and have faced a problem when I have many users who can log into WordPress admin panel to post their blog entries. But doing so, they all can see each others posts, even though not being able to edit any post but their own's.

From users  point of view, it is not the best thing in the world to look for your own posts in the list, especially if there are lots of users in the system.

So, here's a simple solution for the problem - after logging into the system, non-admin users will be able to only see their own posts in the Admin -> Manage panel. The only thing is that I seems no plugin solultion is possible so you have to add 3 lines to one file.

The file you have to add these lines is located in /wp-admin/edit.php file in your WordPress installation. You have to go to line 150 (or near it, where it says:

if ($posts) {
$bgcolor = '';
foreach ($posts as $post)…..

..etc

Now, just add the following code ABOVE the one mentioned above:

if ($userdata->user_level<10) {
    $posts = query_posts("author=".$userdata->ID);
}

So, in the end you will get something like that:

<?php

if ($userdata->user_level<10) {
    $posts = query_posts("author=".$userdata->ID);
}

if ($posts) {
$bgcolor = '';
foreach ($posts as $post) { start_wp();
$class = ('alternate' == $class) ? '' : 'alternate';

You're done! Now all non-admin users will see only their own posts :) Simple and easy. Have fun. 

Inline Google Maps for WordPress

Friday, September 8th, 2006

There are several WordPress plugins for showing Google maps on blog pages exist, but unfortunately, they are all kind of do "too much" :) Like displaying your posts on a Google map, or something like that. What I needed is just a simple plugin which would allow me to embed a Google map into my WordPress blog pages, anywhere I want, preferrably with a single line of simple code. There was nothing like that so I have wrote my own plugin. It's easy to use and install, and works fine so.. here we go :)

(more…)