Posts Categorized: web design

Website Statistics with Visitors

As a useful addition to the webstats armory Visitors offers a quick way of getting a HTML report of site usage from server logs. We mainly use AWstats, Webalizer and Analytics products (Google Analytics, Piwik) but I found Visitors useful today. Install from Synaptic or with: sudo apt-get install visitors Then run it against your… Read more »

Opera Mini on Ubuntu

I’m using Ubuntu 9.04 and I wanted to be able to run Opera Mini for testing web sites: Download MicroEmulator from here (or direct version 2.0.3) Extract the tar file and run the jar with: java -jar microemulator.jar In the Window that opens from the menubar choose Options > Select Device > Add Browse to… Read more »

Example robots.txt

Not all crawlers obey all of these rules but as a reference point. The crawl delay is the number of seconds between requests and the newer request-rate is set here to not more than 1 every 5 seconds. The crawlers are also asked to visit during the night. User-agent: *Disallow: /media/Crawl-delay: 10Request-rate: 1/5Visit-time: 2100-0545

Printing Random Array Elements in PHP and Javascript

Non-dynamic tag cloud?  <script language=”JavaScript” type=”text/javascript”>                                var mytags = new Array(                                “histories”,”names”,                                “land”,”lists”,”free”                                );                                var randomseed=Math.floor(Math.random()*8)                                for(i=0;i<mytags.length;i++){                                        var randomnumber=Math.floor(Math.random()*141)                                        randomnumber=randomnumber+40;                                        if(randomnumber%randomseed!=0){                                        document.write(“<a style=’font-size:”+ randomnumber +”%;’>”+ mytags[i] + “</a> “);                                        }                                }                        </script> <?php$input = array(“histories”,”names”,                                “land”,”lists”,”free”);$rand_keys = array_rand($input, 30);for($i;$i<30;$i++){$randomnumber=rand(40,181);echo “<a style=’font-size:”.$randomnumber.”%;’>”.$input[$rand_keys[$i]] . “</a>\n”;}?>

Debugging PHP Errors

To debug PHP without having to amend the php.ini for all websites add the following in a .htaccess file in the directory of the application. Easy to switch on and off: php_value display_errors 1php_value display_startup_errors 1 or php_flag display_errors onphp_value error_reporting 2039 More examples hereGood IBM article here about error reporting levels etc

WordPress Theme Tutorial

This tutorial is useful for converting an existing design to a WordPress theme quickly:http://jonathanwold.com/tutorials/wordpress_theme/

Privacy Policies

Great tutorial on using the IBM privacy policy editor for standards compliance:http://www.awardsites.com/tutorials/w3c/p3p_privacy-01.htm