<?php
/*
random
@@
Usage: $0
Switches: none
Displays a randomly chosen post.
@@
*/
		$q="SELECT `ID` AS c 
			FROM `".$wpdb->posts."` 
			WHERE (`post_status`='publish' OR `post_status`='static') 
			ORDER BY RAND() 
			LIMIT 1"; 
		$r=mysql_query($q);
		if(mysql_num_rows($r)>0 && mysql_result($r,0,'c')	){
			$_SESSION['current']=mysql_result($r,0,'c');
			cat($_SESSION['current']);
		}
?>