i was experimentig a lil with this random image logo and i was able to do it
i used this random image generator
|
Code:
|
<?php
$dir=opendir("/home/irmin/public_html/baneri/");
$pattern="\.(gif|jpg|jpeg|png|bmp|swf)$";
if(!$dir)
{
die("Failed to read directory");
}
$s=readdir($dir);
$count="0";
$image;
while($s)
{
if(ereg($pattern, $s))
{
$image[$count]=$s;
$count++;
}
$s=readdir($dir);
}
closedir($dir);
//Spit it out
$limit=count($image);
$limit--;
$randNum=rand(0,$limit);
echo "
<img src=\"baneri/$image[$randNum]\">";
?> |
i had to modify it to fit my needs and i uploaded that file to my root directory ( image.php )
then in my theme.php
i found these lines of code
|
Code:
|
echo "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\" bgcolor=\"#003366\">\n"
."<tr>\n"
."<td bgcolor=\"#003366\" align=\"left\" valign=\"top\" width=\"65%\"><a href=\"index.php\"><img src=\"themes/Msn/images/logo.gif\" align=\"left\" alt=\""._WELCOMETO." $sitename\" border=\"0\"></a></td>\n"
."<form action=\"modules.php?name=Search\" method=\"post\">\n"
."<td align=\"right\" valign=\"top\">\n" |
and changed them to this
|
Code:
|
echo "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\" bgcolor=\"#003366\">\n"
."<tr>\n"
."<td bgcolor=\"#003366\" align=\"left\" valign=\"top\" width=\"65%\"><a href=\"index.php\">\n";
include("image.php");
echo "<form action=\"modules.php?name=Search\" method=\"post\">\n"
."<td align=\"right\" valign=\"top\">\n" |
where the "baneri" is the name of the folder with all images
and "irmin" my username or my account name on the server ull have to change those to work for you
im sure there is a better way to do it but this will just give u some ideas how to do it
