Notices

Overclockers Forums > Software > Programming Tips and Tricks
Programming Tips and Tricks
Forum Jump

2 html questions

Post Reply New Thread Subscribe Search this Thread
 
 
Thread Tools
Old 06-30-03, 10:07 PM Thread Starter   #1
amazon10x
Member



Join Date: Feb 2003
Location: College Park, MD

 
2 html questions


when i go to tribes2.com evertime i reload the page a different qoute is displayed at the top. i would like to know how to randomize something like that.

i am going to be making a webpage and it is going to have a sidebar. i remember seeing somewhere how to get that sidebar onto everypage in your site without actually having to put the code in and it wasnt done with frames
amazon10x is offline   QUOTE Thanks
Old 07-01-03, 12:54 AM   #2
InThrees
Member

 
InThrees's Avatar 

Join Date: Feb 2003
Location: Southeast US

 
Probably tables then, or iFrames.
InThrees is offline   QUOTE Thanks
Old 07-01-03, 06:42 AM   #3
TidyBowl
Member

 
TidyBowl's Avatar 

Join Date: Dec 2002

 
it sounds like they were using either the dreaded frontpage shared borders. Or the much easier SSI (Server Side Includes) its a scripting function that allows you to add files to a page without copying the code -- its common for PHP, ASP, Coldfusion developers to use.

It allows you to have one navigation bar and put it on all your pages. plus when you need to change it you change only one file.

You can use a simple javascript to rotate sayings like that -- most script sites will have that one.

hope this helps.

T
TidyBowl is offline   QUOTE Thanks
Old 07-01-03, 01:10 PM   #4
F4
Red Raccoon Dojo

 
F4's Avatar 

Join Date: Mar 2003
Location: Beamsville

 
And as for the random part, that requires using some form of scripting language. PHP, Javascript, Perl, or something else like that...
F4 is offline   QUOTE Thanks
Old 07-01-03, 03:11 PM   #5
xsquared_uk
Member

 
xsquared_uk's Avatar 

Join Date: Apr 2003
Location: Detonation Boulevard, UK

 
If it helps, I did it by creating an array of 60 items and then making it so the quote depends on which minute you access the page on. The script was like this :

<!-- Begin

var runTime = new Date();
var minutes = runTime.getMinutes();
var numquotes = 59;
quotes = new Array(numquotes+1);
quotes[0] = "This is quote 1";
etc etc
document.write(quotes[minutes]);
// End -->
xsquared_uk is offline   QUOTE Thanks
Old 07-01-03, 03:40 PM Thread Starter   #6
amazon10x
Member



Join Date: Feb 2003
Location: College Park, MD

 
where do i stick all that code? how do i tell where its going to print the quote?
amazon10x is offline   QUOTE Thanks
Old 07-01-03, 04:40 PM   #7
xsquared_uk
Member

 
xsquared_uk's Avatar 

Join Date: Apr 2003
Location: Detonation Boulevard, UK

 
Depends what you're using to write it! It's Javascript, so in Dreamweaver you do 'insert script' and then stick it in there. Wherever your cursor was when you clicked to insert is where it will appear. You can then select it and choose stuff like font, size, colour, etc. If you want the full script as is on an example page, PM me and I'll sort it out.
xsquared_uk is offline   QUOTE Thanks

Post Reply New Thread Subscribe


Overclockers Forums > Software > Programming Tips and Tricks
Programming Tips and Tricks
Forum Jump

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Mobile Skin
All times are GMT -5. The time now is 01:18 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
You can add these icons by updating your profile information to include your Heatware ID, Benching Profile ID or your Folding/SETI profile ID. Edit your profile!
X

Welcome to Overclockers.com

Create your username to jump into the discussion!

New members like you have made this the best community on the Internet since 1998!


(4 digit year)

Why Join Us?

  • Share experience
  • Max out your hardware
  • Best forum members anywhere
  • Customized forum experience

Already a member?