Archive for January, 2007

Wordpress PDA friendly Plugins

Wednesday, January 31st, 2007

While there are not many people using PDA or smartphone to surf blogs, it is nice to have your blog can reach other internet users too, no matter how they access them.

Handheld device such as smartphone or PDA has a limited display screen and relatively slow internet access speed. They might be turned-off by the full styling and template of your Wordpress blog that isn’t suited for small-screen display.

Luckily somebody has created Wordpress PDA plugin, a relatively simple and small plugin can make your blog PDA friendly. Please read it from Makes your Wordpress Pocket PC PDA-friendly, for more information about the plugin.

No tags for this post.

Additional Spam Karma 2 Plugins

Wednesday, January 31st, 2007

One of the things that I like about Spam Karma 2 compared to Akismet, that SK2 is extensible so you can write new SK2 plugins in order to filter out new spams tailor made for your blog/language.

Here’s some of the additional plugins I write for Spam Karma that you might find useful to in addition to the default spam karma 2 plugins, the Fishy User Agents and Blacklisted IP Address Checker.

Installing these plugins is simple, you just need to uncompress the zip file and copy it into the sk2_plugins inside SK2 folder in your Wordpress plugins directory.

Then check the status of the plugins in Manage->Spam Karma 2->General Settings.

What’s new about these plugins ?

Fishy User-Agent -
A relatively weak plugin, but useful for filtering up dumb bots or browsers that has been infected with spam bots. It checks for known malicious user-agent, and spank it.

Blacklisted IP Address RBL
Checks IP address for open proxy using RBL services from sorbs.net. Blacklisted IP will receive huge spanking.

Hopefully these plugins will help you keep those annoying spammers away from your blog :)

Download zip file at.
papit_sk2plugins.zip

No tags for this post.

Web Badges / Buttons tutorial by ZwahlenDesign

Tuesday, January 30th, 2007

UbuntuRedhatopensuseFreeBsdgentoo

Do you like to put those beautiful badges, buttons on your blog? To show your support on certain projects ,It looks cool anyway right?


Zwahlendesign
gives a very light tutorial on how to create those badges, the standard width and height in pixels to follow and it does provide a lots of badges at his blog too.

No tags for this post.

Our Todo List Plugin

Monday, January 29th, 2007

A simple todo list plugin to share ideas/todos with blog members. All members work together to manage the todo list under “Manage” section in Wordpress administration interface.

A variant derived from AbstractDimension’s Todo List Plugin.

Screenshots

Screenshot: Manage Our Todo ListScreenshot: Our Todo List on DashboardOur Todo List Plugin - OptionsNew!

Download

Download Our Todo List version 2.0

Howto Upgrade to version 2.0

  1. Go to ‘Plugins’, deactivate Our Todo List.
  2. In your server, replace the old ourtodolist.php file (or folder) with the new one.
  3. Refresh ‘Plugins’, activate Our Todo List 2.0.
  4. (For Wordpress 2 users) Go to ‘Options’ > ‘OurTodo’ to decide who can/cannot use the plugin.

Installing

Important: If you are using Abstract Dimension’s Todo List plugin, please read FAQs before installing.

  1. Copy ourtodolist.php to your wp-content/plugins/
  2. Activate the plugin
  3. (Wordpress 1.5 users) Go to ‘Manage’ > ‘OurTodo’. Scroll to the bottom page to ‘Install’ and click the setup script.
  4. (Wordpress 2 users) Go to ‘Options’ > ‘OurTodo’ to decide who can/cannot use the plugin.

Note: For Wordpress 2 users, step 3 should be done automatically. If not, try step 3.

Translating

The plugin comes with a POT file, otd.pot since version 1.5. Please let me know if you publish a translation. So that I can link to you:

Install a Translation

Place the locale (.mo) file under the same directory with ourtodolist.php.

To be more organized, you can place both ourtodolist.php and the .mo file under a subdirectory, e.g. wp-content/plugins/ourtodolist/ .

Bug Reports/Feedbacks

Submit your feedback through comments.

Usage

As requested by BGH Quiz, APIs are added since version 1.2:

  1. To display all tasks (added in version 1.7)

    <?php ourtodolist_all(limit, show_priority, show_author); ?>
    • limit - (integer) number of items. 0 means all items. Default is 0.
    • show_priority - (boolean) show priority label. Default is false.
    • show_author - (boolean) show author’s display name. Default is false.
  2. To display todo tasks only

    <?php ourtodolist(limit, show_priority, show_author); ?>
    • limit - (integer) number of items. 0 means all items. Default is 0.
    • show_priority - (boolean) show priority label. Default is false.
    • show_author - (boolean) show author’s display name. Default is false.
  3. To display completed tasks only

    <?php ourtodolist_completed(limit, show_priority, show_author); ?>
    • limit - (integer) number of items. 0 means all items. Default is 0.
    • show_priority - (boolean) show priority label. Default is false.
    • show_author - (boolean) show author’s display name. Default is false.
  4. Exist any task?

    <?php ourtodolist_exists(is_completed); ?>
    
    /* since version 1.7 */
    <?php ourtodolist_exists(status); ?>
    • is_completed - (boolean) If true, check for completed tasks; if false, check for todo tasks. Default is false.
    • status - (constant value):
      • OTD_ALL - does any tasks exist
      • OTD_TODO - does any todo tasks exist
      • OTD_COMPLETED - does any completed tasks exist

      Default is OTD_TODO.

    • Returns true if exists, otherwise returns false.

Example Code

PHP source code:

<h4>Our Todo Tasks</h4>
<?php if ( ourtodolist_exists() ) : ?>
<ol>
     <?php ourtodolist(); ?>
</ol>
<?php endif; ?>

<?php if ( ourtodolist_exists(OTD_COMPLETED) ) : ?>
<h4>Completed Tasks</h4>
<ul>
    <?php ourtodolist_completed(5, false, true); ?>
</ul>
<?php endif; ?>

Genereated HTML:

Our Todo Tasks

  1. Cook for lunch.
  2. Late-night movie ticket.

Completed Tasks

  • Release Our Todo List plugin version 1.2. ~toydi

Example Code: Classnames & Styling

Since version 1.7, each list item will have a class name.
<li class="otd_completed">..</li> if it’s a completed task,
<li class="otd_todo">..</li> if it’s a todo task.

However, they are not styled by default. Feel free to style them in your current theme’s CSS file.

PHP source code:

<h4>Task List</h4>
<?php if ( ourtodolist_exists(OTD_ALL) ) : ?>
<ol>
    <?php ourtodolist_all(); ?>
</ol>
<?php endif; ?>

CSS sample code:

.otd_completed { text-decoration: line-through; }

Generated HTML:

Task List

  1. Release Our Todo List plugin version 1.7.
  2. Cook for lunch.
  3. Late-night movie ticket.

FAQs

  1. How does it different from Abstract Dimension’s Todo List plugin?

    Our Todo List plugin is built for information sharing within a team of people who trust each other.When a new todo is created, it is visible to all members who login into Wordpress Administration interface. Members are allowed to edit/delete any todo item.For each todo item, it only records who made the last change, not who first created the item.

  2. I’m using Abstract Dimension’s Todo List, how to migrate to this plugin?

    By default, both plugins shares the same database table name. The intend is to make migration easy:

    1. Install Our Todo List, activate it
    2. Deactivate Abstract Dimension’s Todo List
  3. Can I run both Abstract Dimension’s Todo List and Our Todo List separately in my blog?

    Yes, but you MUST change the database table name used by Our Todo List plugin, so that each plugin uses a different table to store data:

    1. Open ourtodolist.php with your favourite editor
    2. Search for the phrase: $otd_tablename = $table_prefix . 'todolist';
    3. Change the 'todolist' to another name (e.g. 'ourtodolist')
    4. Save the changes

Change Log

  • version 2.0
    • Major code clean up.
    • Fixed the plugin to run on WP 1.5.
    • Added a Role-Capability feature! (WP 2.0 and above only)
    • Updated POT file
    • Replaced is_int() with a more appropriate input validation method.
    • Fixed several bugs discovered by Baruchel (a big thank).
  • version 1.7
    • Added a new function ourtodolist_all() to display both todo and completed tasks in single list. (Kretzschmar, sorry for the delayed release!)
    • Changed the input parameter of ourtodolist_exists(). But don’t worry, it is backward-compatible, which means your existing codes will not break. If it does, please let me know.
  • version 1.6
    • Top-level codes are wrapped into a function and hooked to ‘init’ action.
      It should fix Humuhumu’s problem.
  • version 1.5
    • Fixed problems in locale support, a big thank to kretzschmar!
    • Included the plugin’s POT file.
  • version 1.4
    • Added plugin localization support, by calling load_plugin_textdomain().
    • Plugin file is allowed to load when it’s inside an arbirtary subdirectory, e.g. wp-content/plugins/sub_dir/ourtodolist.php. (thanks to kretzschmar for pointing out the problems)
  • version 1.3
    • Cleaned up all global variables by adding ‘otd_’ prefix.
  • version 1.2
    • Added 3 new functions to display todo in blog, as requested by BGH Quiz.
  • version 1.0
    • Released first version.
No tags for this post.

How to add favicon to your website?

Sunday, January 28th, 2007

WPBE faviconhat is favorite icon (favicon)? Did you discover that most of the website have favicon? Observe your browser where you enter url address, you can see a tiny icon with size 16×16. If you are using firefox, when you drag the icon over your bookmark toolbar, the icon will tag along too, how cool is that?

Wordpress by Examples have favicon too, usually favicon is a icon file with 16×16 name favicon.ico under parent directory of the web. But nowadays browser seems to support any size of favicon. You can find our favicon.ico at HERE in size 32×32 pixels.

Good and Bad favicon design
IMHO, a good favicon shouldn’t have any background color, if your icon is not in square shape like del.icio.us or LBE.

Examples of non-transparent favicon, http://wordpress.com/ , http://www.tuxmachines.org/
You will never discover that icon is not transparent until you drag over to your bookmark toolbar or observed at the tab.

Examples of transparent favicon, http://www.debian.org/ , http://www.shoutcast.com/ .
How nice!

How to create favicon ?
I should say, how to create a transparent favicon. Is it difficult to do that? Yes if do it with photoshop in windows or mac platform. Refers the steps for photoshop at here.

To do that in GIMP, it is pretty simple, make sure your image do not have any color background (delete the layer with white background by default), and save as favicon.ico and you are ready to upload to your server.

Add the code bellow into your <head> tag:

<link href='/favicon.ico' rel='icon'/>
<link href='/favicon.ico' rel='shortcut icon'/>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />

It seems that you can locate your favicon.ico at other location even at other server, and favicon is not a “keyword” name, you can name your favicon to any favorite name.

WP tips: You can edit your header at Presentation > Theme Editor > Header.

No tags for this post.

Todo List Plugin: Patch to display todo in Dashboard

Saturday, January 27th, 2007

Abstract Dimension has written an excellent Todo List plugin for each author to manage a personal todo list.

After using it, I thought it would be nice to have my todo appeared on the Dashboard Latest Activity box as the screenshot below:

Screenshot: Todo List displays in Dashboard

So, here’s a patch that does the job. To apply, simply copy and append the code below to the end of the plugin script, admin_todo.php.

The only thing the patch does is to retrieve the first ten todo items (sorted by priority) and display them on the Dashboard. No changes to database, it’s pretty safe to patch.

Welcome to submit bug reports through comments.

The patch source code, tested on Todo List Plugin version 1.2 :

/*
 Patch-To    : Todo List Plugin version 1.2
 Description : To display the first 10 todo items sorted by priority on Dashboard.
 Installation: Append the entire code to the end of admin_todo.php file.
 Author      : Wordpress By Examples
 Author URL  : http://wordpress.byexamples.com
 License     : GPL Version 2
*/
/*
 List top 10 todo in Dashboard Lastest Activity
*/
function atd_todo_in_activity_box() {

  global $table_prefix, $wpdb, $userdata;
  get_currentuserinfo();
  $table_name = $table_prefix . 'todolist';

  echo '<div><h3>'.__('Todo List').
       ' <a href="edit.php?page=admin_todo.php">'.
       __('&raquo;').'</a></h3>';

  $sql = "SELECT id, todotext FROM $table_name ".
         "WHERE status = 0 AND author = $userdata->ID ".
         'ORDER BY priority LIMIT 10';

  $results = $wpdb->get_results($sql);
  if ($results) {
    echo '<ol>';
    foreach ($results as $result) {
      echo "<li>$result->todotext <small>".
           '(<a href="edit.php?page=admin_todo.php&action=edittd&id='.
           $result->id . '&noheader&message=3">'.
           __('Edit')  . '</a>)</small></li>';
    }
    echo '</ol>';
  }
  else  {
    echo '<p>'.__('nothing to do...').'</p>';
  }
  echo '<p style="text-align:right">'.
       '<a href="edit.php?page=admin_todo.php#addtd">'.
       __('New Todo &raquo;').'</a></p></div>';
}

/*
 Wordpress hooks
 */
if (function_exists('add_action')) {
  add_action('activity_box_end', 'atd_todo_in_activity_box');
}
No tags for this post.

Good way to generate traffics, StumbleUpon.

Friday, January 26th, 2007

StumbleUpon is not a website or a firefox extension, It is a community, groups of bloggers, internet surfers, birds of feather, all flops together. It is a system that introduces you great web based on some categories! Don’t you think your blog or website is great? So lets the world knows and submit to StumbleUpon.

How it works?
When a member of StumbleUpon submit a new web to the system based on the categories he chooses, the submitted website will be in the stumble pool last for two to three days. In these two days, his submitted web will be discover by other members that stumble on the categories he chooses. If the member thinks his submitted is great, they will rank it by click on the button “I like it”. As much rank clicked as frequent the web will be discovered, this is important for generating traffics.

For those who are searching ways to do SEO may consider this. For my experience, during the migration of Linux By Examples (LBE) http://linux.byexamples.com from http://lne.blogdns.com/lbe. The traffic was been observed through google analytics. It raises from 113 to 431 and the next day 890 , 580 visits.

After this few days, LBE was no longer in the recent pool, but LBE is still appear in the first page of http://buzz.stubleupon.com under Linux category. And it wons 1727 clicks of “I like it”.

If your page is new, don’t consider to submit first. Build your page nicely before you submit, don’t lose the opportunities to promote your page in that 2 to 3 days.

StumbleUpon

If you do not have any blog or website to submit, you may want to try StumbleUpon too, it really discover great website for you, click “I like it” if you like it.

No tags for this post.

Optimization Tips: Make Your Wordpress loads faster!

Friday, January 26th, 2007

Do you know that you can make more people appreciate your blog by optimizing it to load faster?
Here’s a quick way that can make your blog loads faster by instructing Wordpress to use gzip compression to reduce your blog output size.

  1. Go to your Wordpress Administration Panel
  2. Select Options, then Reading
  3. Check the box that reads “WordPress should compress articles (gzip) if browsers ask for them”

This will ensure that browsers supporting gzip-encoding (Mozilla, Internet Explorer) will get the compressed version of your webpage faster.

This trick is also beneficial in SEO aspect too, as some advance webcrawler supports gzip-encoding to reduce bandwidth utilisation and at the same moment saving precious crawling time.

No tags for this post.

My Top 5 Favorite Wordpress Plugins

Friday, January 26th, 2007

I like using Wordpress as my personal blogging platform mainly because it has loads of convenient features for a blogger like me.

You don’t have to worry about Wordpress not offering certain features that you like, because it is extensible via plugins modules. Below is my Top 5 favorite Wordpress plugins that I use on most of my blogs :

  • Spam Karma 2 - useful for controlling comment spam. I prefer this compared to Akismet because It doesnt rely solely on external service for spam analysis, thus making my site more responsive.
  • Google Sitemaps - Creates Google xml sitemap for googlebot easy indexing automatically each time you posts your blog. Tips: Don’t forget to turn off debug comment for this little beastie!
  • Related Posts - Not so important for a new website, but it will become an asset once your blog has more than 100 posts. This plugin makes it easy for your visitors to find posts that are related to each other, spending more time on your blog appreciating your posts.
  • Subscribe to Comments - Easy way for your blog readers to follow up about their comments and questions on your posts.
  • Smart Update Pinger - Reduces your chance of accidently getting blacklisted when your blog sends xml-rpc pings rapidly to blog update service.

Hopefully you may find those plugins useful for your blogs too :)

No tags for this post.