Location: PHPKode > projects > FeedMeLinks, Social BookmarkingSince2002 > modules/mascot-image.inc.php
<%
	# $Id: mascot-image.inc.php,v 1.3 2004/11/11 05:55:58 hirokai Exp $

	$dir = "img/new-mascots/";
	$filenames=array();
	$handle=opendir($dir);
	while ($filename = readdir($handle)) {
		if( strstr( $filename , ".jpg" ))
			array_push($filenames, $filename);
}

foreach( $filenames as $filename )
	$c++;

if( $c > 1 ) {
	$idx = rand( 2, $c-1 );
	echo "<!-- read in " . $c . " filenames, picking #" . $idx . ". -->\n";
%>
<img src="/<%= $dir %>/<%=  $filenames[$idx] %>" border="2" />
<% } %>

Return current item: FeedMeLinks, Social BookmarkingSince2002