View Single Post
Old 08-19-2007, 12:36 AM   #6 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,696
redhead is on a distinguished road
Here is a small PHP snippit I made to show a rotation of banners:
PHP Code:
/* Locate the add to display, and show it */
    
$files = array();
    
$i 0;
    
$path "/var/www/redhead.dk/www/images/adds";
    if (
is_dir($path)) {
      if (
$dh opendir($path)) {
        while ((
$file readdir($dh)) !== false
        {
           if (
$file == "." || $file == ".."
             continue;
           
$files[$i] = $file;
           ++
$i;
        }
        
closedir($path);
        
$add_site =  ereg_replace(".png"""$files[rand(0$i -1)]);
      }
    if(isset(
$add_site) && $add_site != ""
      echo 
"
       <td><img src='/images/icons/transparent.gif' width='10' height='1' alt=''
></td>
       <td valign='top' width='10%'>
        <div align='center' style='white-space: nowrap;'>
         <font size='"
.font_size(-2)."'>
          Advertisement:<br>
          <a href='http://www.{$add_site}'><img src='/images/adds/{$add_site}.png' width='80' height='15' border='0' title='{$add_site}' alt='{$add_site}'></a>
         </font>
        </div>
       </td>
"

But since you didn't wanted scripts, it's probably not what you are looking for
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote