Jan 16 2007

Top 10 WordPress Plugins

1. Akismet by Automattic is probably the best WP plugin out there. Akismet is a comment and trackback spam filter for your WP powered blog. It is a true mathematical equation that your blogs page rank is exponentially proportional to the number of viagra and penis enlargement spam comments you will receive. Akismet blocks them all. One thing to note about Akismet is that it sometimes flags honest comments as spam, so make sure to manage Akismet spam frequently. To use Akismet you will need a free WordPress API key.

2. If you are using Google Analytics to track your blog’s performance I recommend the Google Analytics plugin by Boakes. It is simple to install and configure, just have your Google Analytics User Account handy.
Continue reading


Jan 7 2007

AJAX Header Rotator

The Joomla! installation comes with a neat module called Random Image. The Random Image module accepts an image directory path, and image type and will randomly and dynamically displays one of the images found in the image directory path for every visit.

But if you want to dynamically display images on you Joomla! site, I recommend you take a look at the AJAX Header Rotator module made available by JoomlaWorks. AJAX Header Rotator also requires a image directory path but instead of displaying a single random image, this module will load all the images and display one at a time. The AJAX Header Rotator rotates through images randomly or sequentially. Behind the scenes, AJAX Header Rotator uses jQuery to rotate through the image set.

A note of warning, I had to hack the AJAX Header Rotator module because I felt it lacked a few key parameters. For one, AJAX Header Rotator loads all the images in the image folder and I had felt there should be max number of files that it loads and rotates through on each user visit. I also added a parameter to enter the image alt text. And finally, the module code always displayed the same first image so I had to shuffle the images array to display a distinct image as the initial image.

Technorati Tags: , , , , , , , , ,


Oct 10 2005

Page Redirect

I totally forgot how to redirect to another page using PHP. After trying to remember I had to look it up in the PHP documentation. So if you want to redirect to another page using PHP you write to the header using this bit of code:

header('Location: index.html');

I opted to use PHP solution instead of the HTML meta refresh tag. You can do the same thing by placing this tag in your html output.

<meta
  http-equiv='refresh'
  content='0;URL=http://www.juixe.com'>

Of course, you can redirect to another page in just about in every language, including JavaScript as this snippet of JavaScript code demonstrates it:

document.location.href='index.html'

Sep 27 2005

Import Script, Import CSS, Import PHP

Just because sometimes I forget, here are some code fragments to import JavaScript, CSS, and PHP files.

JavaScript:

<script
   type='text/javascript'
   src='directory/file.js'>
</script>

CSS:

<style type='text/css'  media='all'>
   @import 'directory/file.css';
</style>

Icon:

<link
   rel='Shortcut Icon'
   href='directory/file.ico'
   type='image/x-icon'>

PHP:

<?php @ require_once ('directory/file.html'); ?>

For the PHP import, by placing the @ symbol before require_once suppresses any error messages that might be generated in the included PHP file.

JSP:

<%@ include file='jspfile.jspi' %>

And, well, I guess the list can go on and on. You can use Struts Tiles to include other JSP snippets. I am sure that other languages and frameworks have the same functionality.