Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 01-02-2009, 03:41 PM   #11 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Signature Rotation Code

Quote:
Originally Posted by Tkey View Post
Code:
function randInt(min,max)
{
     var div = (max - min) + 1
     var randNum = Math.random()
     for (var i = 0; i <= div - 1; i++)
     {
          if (randNum >= i / div && randNum < (i+1) / div)
          {return i + min}
     }
}


var abc = randInt(1,5);

if (abc == 1) {

     document.write("<\"Your 1. HTML-Banner-Code\">");

}

if (abc == 2) {

     document.write("<\"Your 2. HTML-Banner-Code\">");

}

if (abc == 3) {

     document.write("<\"Your 3. HTML-Banner-Code\">");

}

if (abc == 4) {

     document.write("<\"Your 4. HTML-Banner-Code\">");

}

if (abc == 5) {

     document.write("<\"Your 5. HTML-Banner-Code\">");

}
Keep in mind that simply copy/pasting this code into an HTML-accepted signature won't do anything, because it is raw Javascript. Also, document.write() will write only that to the page and display nothing else.

Try this out:

Code:
<div id="pics"><img src="http://link-to-picture.jpg" /></div>

<script type="text/javascript">
function randInt(min,max)
{
     var div = (max - min) + 1
     var randNum = Math.random()
     for (var i = 0; i <= div - 1; i++)
     {
          if (randNum >= i / div && randNum < (i+1) / div)
          {return i + min}
     }
}

var i = randInt(0,3);

var pics = new Array(4);

pics[0] = "http://link-to-picture.jpg";
pics[1] = "http://link-to-picture2.jpg";
pics[2] = "http://link-to-picture3.jpg";
pics[3] = "http://link-to-picture4.jpg";


var el = document.getElementById("pics");

el.innerHTML = "<img src=\"" + pics[i] + "\" />";
</script>
EDIT: However, I really don't think that's going to work, most forums don't allow HTML in signatures and even if they do, it usually filters out Javascript.
__________________

Need website help? PM me!
CrazeD is offline  
Old 01-02-2009, 03:45 PM   #12 (permalink)
Peter.Cort's Avatar
 
TF's First DICE User.

Join Date: Jul 2007

Location: Burlington VT

Posts: 3,976

Peter.Cort will become famous soon enough

Send a message via AIM to Peter.Cort Send a message via MSN to Peter.Cort Send a message via Skype™ to Peter.Cort
Default Re: Signature Rotation Code

got it to work. thanks a bajillion

now if it only works in my sig... hmmm ^.^
__________________
MacBook Pro
C2D T8800 @ 2.66GHz | 4GB DDR3 1066MHz | 9600M GT 256MB | 320GB HDD
24" Acer B243w
Cavalry 1TB Firewire800 External

Last edited by Peter.Cort; 01-02-2009 at 03:55 PM.
Peter.Cort is offline  
Old 01-02-2009, 03:55 PM   #13 (permalink)
Mak213's Avatar
 

Join Date: Sep 2004

Location: C:\Windows\System32

Posts: 25,653

Mak213 is a name known to allMak213 is a name known to allMak213 is a name known to allMak213 is a name known to allMak213 is a name known to allMak213 is a name known to all

Default Re: Signature Rotation Code

Wont work on here. HTML is disabled for signatures. We have had issues with HTML signatures breaking the forum so we disabled them.
__________________
R.I.P. Danny L. Trotter
14 Nov 1945 - 4 Sept 2009
Images created by CarnageX | Decaptured...Listen! | Visit Baezware!! | You've been Mak'd! | 儿做好
I do not accept support questions via EMail, PM, IM or my Spaces page! .:|:. This is what happens when an unstoppable force meets an immovable object.
Thanks to all the guys on the staff for your support in my time of need. Hefe you are my personal Hero for your contribution.



<<<< If I help you, or you just like what I said, rep me
Mak213 is offline  
Old 01-02-2009, 04:02 PM   #14 (permalink)
Yek
 
T.F's Resident Cool Guy...

Join Date: Aug 2006

Posts: 1,625

Yek is on a distinguished road

Send a message via AIM to Yek Send a message via MSN to Yek Send a message via Yahoo to Yek Send a message via Skype™ to Yek
Default Re: Signature Rotation Code

Looks like you're going to have to dig out GD then....

Tkey
Yek is offline  
Old 01-02-2009, 04:08 PM   #15 (permalink)
Peter.Cort's Avatar
 
TF's First DICE User.

Join Date: Jul 2007

Location: Burlington VT

Posts: 3,976

Peter.Cort will become famous soon enough

Send a message via AIM to Peter.Cort Send a message via MSN to Peter.Cort Send a message via Skype™ to Peter.Cort
Default Re: Signature Rotation Code

noooo!!!! whats gd? lol.

i got so close in having it work too
__________________
MacBook Pro
C2D T8800 @ 2.66GHz | 4GB DDR3 1066MHz | 9600M GT 256MB | 320GB HDD
24" Acer B243w
Cavalry 1TB Firewire800 External
Peter.Cort is offline  
Old 01-02-2009, 04:12 PM   #16 (permalink)
Yek
 
T.F's Resident Cool Guy...

Join Date: Aug 2006

Posts: 1,625

Yek is on a distinguished road

Send a message via AIM to Yek Send a message via MSN to Yek Send a message via Yahoo to Yek Send a message via Skype™ to Yek
Default Re: Signature Rotation Code

Crazed will be able to help you with GD, i'm not sure if it's even possiable.
Might be better to discuss this futher in you know where.....

Cheers,

~ Tkey
Yek is offline  
Old 01-02-2009, 04:12 PM   #17 (permalink)
Peter.Cort's Avatar
 
TF's First DICE User.

Join Date: Jul 2007

Location: Burlington VT

Posts: 3,976

Peter.Cort will become famous soon enough

Send a message via AIM to Peter.Cort Send a message via MSN to Peter.Cort Send a message via Skype™ to Peter.Cort
Default Re: Signature Rotation Code

ok. sounds good
__________________
MacBook Pro
C2D T8800 @ 2.66GHz | 4GB DDR3 1066MHz | 9600M GT 256MB | 320GB HDD
24" Acer B243w
Cavalry 1TB Firewire800 External
Peter.Cort is offline  
Old 01-02-2009, 04:13 PM   #18 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Signature Rotation Code

Quote:
Originally Posted by Peter.Cort View Post
noooo!!!! whats gd? lol.

i got so close in having it work too
GD is a library for PHP used for working with images. You can make a PHP script to dynamically show your image.

However, I think dynamic images are not allowed here as well.
__________________

Need website help? PM me!
CrazeD is offline  
Old 01-02-2009, 04:15 PM   #19 (permalink)
Yek
 
T.F's Resident Cool Guy...

Join Date: Aug 2006

Posts: 1,625

Yek is on a distinguished road

Send a message via AIM to Yek Send a message via MSN to Yek Send a message via Yahoo to Yek Send a message via Skype™ to Yek
Default Re: Signature Rotation Code

Sure are, GD powers the folding images

Tkey
Yek is offline  
Old 01-02-2009, 04:17 PM   #20 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Signature Rotation Code

Quote:
Originally Posted by Tkey View Post
Sure are, GD powers the folding images

Tkey
Ah, of course... how silly of me.
__________________

Need website help? PM me!
CrazeD is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Signature cards TRDCorolla1 Off Topic Discussion 4 06-15-2008 05:58 AM
PHP: How to modify a downloaded JavaScript code and partly change the code within it? LincolnX Programming Discussions 4 01-25-2008 04:25 PM
Someone take a look at my Java code PnkFloyd27 Programming Discussions 4 06-21-2007 08:11 PM
NEED help with a Javascript code...(mouseover and stuff) Quintox Web Graphics, Design, Digital Images 7 05-02-2007 06:41 PM