Welcome to the E-Blah Community!
We would like to welcome you to our community and invite you to register an account or login.
Being a registered member is important, as it gives you several advantages over the normal Guest status. After registering you will be able to download files and images, post messages, and access member-only portions of the forum - just to name a few. Registration is quick and simple, and only takes about a minute of your time.

E-Blah Community    Modifications    Modification Archive  ›  Random Quote Generator Moderators: 10 Series Support Team
Users Browsing Forum
No Members and 1 Guests

Random Quote Generator  This thread currently has 2,064 views. Print
1 Pages 1 Recommend Thread
thewickedchild
August 26, 2004, 9:06pm Report to Moderator Report to Moderator
E-Blah Member
Posts: 32
Posts Per Day: 0.02
Time Online: 3 hours 18 minutes
I posted about this quite awhile back, but never got anywhere... my users have been really missing this feature we had installed on some of our php boards...

Basically, all it would be is a random quote would be taken from a database somewhere (preferably a simple text file which could be easily edited); this would then be displayed somewhere near the top of the page, probably between the welcome message and the first table.

I found a few javascripts that would do this kind of thing with images or midi files... The following script would be along the lines of what I'd like, but not quite:

http://javascript.internet.com/messages/wisdom-factory.html

However, I don't want a constantly changing text... it would display only one message per page, and it wouldn't change as long as you remained on that page.

If anyone could offer some help on this I would appreciate it... also, even if I had the code, I'm not sure which file(s) I would have to edit... so... give me a hand, please.
Logged Offline
Private Message Private message
thewickedchild
August 26, 2004, 9:10pm Report to Moderator Report to Moderator
E-Blah Member
Posts: 32
Posts Per Day: 0.02
Time Online: 3 hours 18 minutes
Actually, I just found a Random Quote script... how would I go about adding this to the board?

http://www.codelifter.com/main/javascript/randomquote.shtml
Logged Offline
Private Message Private message Reply: 1 - 5
David
August 26, 2004, 10:26pm Report to Moderator Report to Moderator
E-Blah Member
Posts: 250
Posts Per Day: 0.15
Reputation: 71.43%
Time Online: 9 hours 29 minutes
Add it to the main board template via the admin center.
Logged Offline
Private Message Private message Reply: 2 - 5
thewickedchild
August 27, 2004, 4:52am Report to Moderator Report to Moderator
E-Blah Member
Posts: 32
Posts Per Day: 0.02
Time Online: 3 hours 18 minutes
Thanks.
Logged Offline
Private Message Private message Reply: 3 - 5
thewickedchild
August 29, 2004, 3:20pm Report to Moderator Report to Moderator
E-Blah Member
Posts: 32
Posts Per Day: 0.02
Time Online: 3 hours 18 minutes
I figured out a better way to implement the code, for anyone who cares...

This is all you have to do. Insert the following code into your board template where you want the quotes to appear:

Code

<script
type="text/javascript"
language="JavaScript"
src="http://yoursiteadress/filename.js">
</script>


Then upload filename.js to the specified location. This file should include the following:

Code

// ==============================================
// Copyright 2004 by CodeLifter.com
// Free for all; but please leave in this header.
// ==============================================

var Quotation=new Array() // do not change this!

// Set up the quotations to be shown, below.
// To add more quotations, continue with the
// pattern, adding to the array.  Remember
// to increment the Quotation[x] index!

Quotation[0] = "Time is of the essence! Comb your hair.";
Quotation[1] = "Sanity is a golden apple with no shoelaces.";
Quotation[2] = "Repent! The end is coming, $9.95 at Amazon.";
Quotation[3] = "Honesty blurts where deception sneezes.";
Quotation[4] = "Pastry satisfies where art is unavailable.";
Quotation[5] = "Delete not, lest you, too, be deleted.";
Quotation[6] = "O! Youth! What a pain in the backside.";
Quotation[7] = "Wishes are like goldfish with propellors.";
Quotation[8] = "Love the river's \"beauty\", but live on a hill.";
Quotation[9] = "Invention is the mother of too many useless toys.";

// ======================================
// Do not change anything below this line
// ======================================
var Q = Quotation.length;
var whichQuotation=Math.round(Math.random()*(Q-1));
function showQuotation(){document.write(Quotation[whichQuotation]);}
showQuotation();


Note that this is just the original code, minus the script tags. By doing this, you can maintain ONE file while never having to edit your board templates again (provided you never move the script).

A cool learning experience for myself as well.
Logged Offline
Private Message Private message Reply: 4 - 5
Adam
September 1, 2004, 8:15pm Report to Moderator Report to Moderator
JO Roxors
Posts: 31
Posts Per Day: 0.01
Reputation: 100.00%
For one of the forums I made I had a random Bible verse generator.  I just uploaded the java script to replace the news thing, and did some bit of code editing.  Very easy, the hardest part was getting all the verses.
Logged Offline
Private Message Private message AIM AIM Reply: 5 - 5
1 Pages 1 Recommend Thread
Print

E-Blah Community    Modifications    Modification Archive  ›  Random Quote Generator