We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Change image every reload
Topic Started: Sep 21 2005, 10:44 AM (223 Views)
Beu
Member Avatar
Member
[ *  *  *  *  *  * ]
Can someone give me the HTML code that changes the image everytime you reload the page (It looks like IFSZ use that for the advertisements). :S
Offline Profile Quote Post Goto Top
 
Beu
Member Avatar
Member
[ *  *  *  *  *  * ]
Sorry for the double post but does someone know anything about this?
Offline Profile Quote Post Goto Top
 
Scott T
Member Avatar
Joe10 for Admin.
[ *  *  *  *  *  *  *  * ]
It's a PHP script. I had a good one, but lost it and haven't had time for a recode.

Sorry :S
Offline Profile Quote Post Goto Top
 
sk8rdude2
I dunno what to put here :S
[ *  *  *  * ]
Webmaster made this one

Code:
 
<?php
   
$Ad[0] = '<a href="web-master.deviantart.com" id="link1"><img src="sig.jpg" alt="Sig" border="0" id="link_1" /></a>';
 
$Ad[1] = '<a href="web-master.deviantart.com" id="link2"><img src="12.jpg" alt="Sig" border="0" id="link_2" /></a>';

$Ad[2] = '<a href="web-master.deviantart.com" id="link3"><img src="4.jpg" alt="Sig" border="0" id="link_3" /></a>';

$Ad[3] = '<a href="web-master.deviantart.com" id="link4"><img src="9.jpg" alt="Sig" border="0" id="link_4" /></a>';

$Ad[4] = '<a href="web-master.deviantart.com" id="link5"><img src="1.gif" alt="Sig" border="0" id="link_5" /></a>';

$Ad[5] = '<a href="web-master.deviantart.com" id="link6"><img src="8.jpg" alt="Sig" border="0" id="link_6" /></a>';

   
   $Weight[0]=1;
   $Weight[1]=1;
   $Weight[2]=1;
   $Weight[3]=1;
   $Weight[4]=1;
   $Weight[5]=1;
   $sum =0;
   for($i=0;$i<count($Weight);$i++)
    $sum+=$Weight[$i];
   $ShowAd = rand(0, $sum - 1);
   for($i=0;$i<count($Weight);$i++)
   {
    if($ShowAd<=$Weight[$i])
    {
     $ShowAd=$i;
     break;
    }
    else
     $ShowAd-=$Weight[$i];
   }
   echo $Ad[$ShowAd];
?>
Offline Profile Quote Post Goto Top
 
Beu
Member Avatar
Member
[ *  *  *  *  *  * ]
Where should I put that code? Can I just put it into the footer?
Offline Profile Quote Post Goto Top
 
Scott T
Member Avatar
Joe10 for Admin.
[ *  *  *  *  *  *  *  * ]
.Horus
Sep 26 2005, 10:25 PM
Where should I put that code? Can I just put it into the footer?

Does your host support PHP?
Offline Profile Quote Post Goto Top
 
Beu
Member Avatar
Member
[ *  *  *  *  *  * ]
I use InvisionFree.
Offline Profile Quote Post Goto Top
 
Scott T
Member Avatar
Joe10 for Admin.
[ *  *  *  *  *  *  *  * ]
.Horus
Sep 27 2005, 07:43 PM
I use InvisionFree.

Oh.

You need to upload the script to a server or something that supports PHP (I'm really unsure on the php language. I haven't used a script like this in over 2 years).

As far as IF goes, I have no idea.

Offline Profile Quote Post Goto Top
 
Beu
Member Avatar
Member
[ *  *  *  *  *  * ]
I hope one of the administrators answer or something. Because they use a similar code.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Technology Chat · Next Topic »
Add Reply