Qoute changer

  • Dragonkai
  • Student
  • Student
  • No Avatar
  • Joined: May 10, 2007
  • Posts: 76
  • Status: Offline

Post May 25th, 2007, 2:27 am

What should I use to change qoutes everytime a person visits my page.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post May 25th, 2007, 2:27 am

Post May 25th, 2007, 5:04 am

What do you mean ... Do you want to display a random quote?
RewriteEngine On

RewriteRule ^(awesome|excellent|extraordinary)$ RT
  • ace5p1d0r
  • Expert
  • Expert
  • User avatar
  • Joined: Apr 19, 2005
  • Posts: 629
  • Loc: UK
  • Status: Offline

Post May 25th, 2007, 7:20 am

Google is your friend:

http://www.codelifter.com/main/javascript/randomquote.shtml

http://www.sabrewebdesign.com/support/scripts/randomquote.php

http://www.hypergurl.com/randomquote.html

http://www.a1javascripts.com/text_effects/randomquote/randomquote.html

http://www.hotscripts.com/PHP/Scripts_and_Programs/Quote_Display/index.html
Webhost Reviews | Honda Civic Forum
  • Dragonkai
  • Student
  • Student
  • No Avatar
  • Joined: May 10, 2007
  • Posts: 76
  • Status: Offline

Post May 25th, 2007, 3:02 pm

How about banners/ images

Can flash do this?

I want it the random qoute/ image to be a link to.

Can I use a database to do it, instead of having the qoutes all one page.

Edit: Hot scripts seem to have the database one, but which one should I use

I basically need say a picture with customer testimonials revolving.

Also can I have some thing that changes quotes while its on the page. I can use flash to do that right?
  • Bogey
  • Disturbed
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 7128
  • Loc: Ozzuland
  • Status: Offline

Post May 25th, 2007, 5:23 pm

Yes, you may use flash, PHP, Javascript, and a number of other languages that i can't think of at the moment.
Learn PHP | I got 10 PHP tutorials! Check them out!
Dreamtale - Farewell
Just a note... I've giving up on web development and that stuff... Just lost all interest in it.
  • Dragonkai
  • Student
  • Student
  • No Avatar
  • Joined: May 10, 2007
  • Posts: 76
  • Status: Offline

Post May 26th, 2007, 11:23 pm

I think Flash should be the answer!
  • ace5p1d0r
  • Expert
  • Expert
  • User avatar
  • Joined: Apr 19, 2005
  • Posts: 629
  • Loc: UK
  • Status: Offline

Post May 26th, 2007, 11:47 pm

I don't. Don't use Flash unless you have to.
Webhost Reviews | Honda Civic Forum
  • Fabinator
  • Proficient
  • Proficient
  • User avatar
  • Joined: May 05, 2007
  • Posts: 467
  • Loc: Holland
  • Status: Offline

Post May 27th, 2007, 2:34 am

PHP (with MySQL ) is an option, but Javascript is simpler. You don't have to create a database, query's etc. Your host has to support PHP and Javascript works always (except when it's turned off by the user, but almost no one does that.)

I should use Javascript if I were you.
"Think like a man of action, act like a man of thought" - Henri Bergson
Onyx Design
  • Bogey
  • Disturbed
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 7128
  • Loc: Ozzuland
  • Status: Offline

Post May 27th, 2007, 2:37 pm

Here's a couple quote changers...

Code: [ Download ] [ Select ]
<!-- START OF SCRIPT -->

<form name="random"><input type="text" name="random" size=78 value=""></form>
<SCRIPT LANGUAGE="JavaScript">
<!--

function getMessage() {
// create array of murphy laws
var ar = new Array(20)
ar[0] = "Nothing is as easy as it looks."
ar[1] = "Everything takes longer than you think."
ar[2] = "Anything that can go wrong will go wrong."
ar[3] = "If there is a possibility of several things going wrong, the one that will cause the most damage will be the one to go wrong."
ar[4] = "If there is a worse time for something to go wrong, it will happen then."
ar[5] = "If anything simply cannot go wrong, it will anyway."
ar[6] = "If you perceive that there are four possible ways in which a procedure can go wrong, and circumvent these, then a fifth way, unprepared for, will promptly develop."
ar[7] = "Left to themselves, things tend to go from bad to worse."
ar[8] = "If everything seems to be going well, you have obviously overlooked something."
ar[9] = "Nature always sides with the hidden flaw."
ar[10] = "Mother nature is a bitch."
ar[11] = "It is impossible to make anything foolproof because fools are so ingenious."
ar[12] = "Whenever you set out to do something, something else must be done first."
ar[13] = "Every solution breeds new problems."
ar[14] = "Trust everybody ... then cut the cards."
ar[15] = "Two wrongs are only the beginning."
ar[16] = "If at first you don't succeed, destroy all evidence that you tried."
ar[17] = "To succeed in politics, it is often necessary to rise above your principles."
ar[18] = "Exceptions prove the rule ... and wreck the budget."
ar[19] = "Success always occurs in private, and failure in full view."

var now = new Date()
var sec = now.getSeconds()
document.random.random.value="Murphy's Law: " + ar[sec % 20]
}
getMessage()
//-->
</SCRIPT>
<!-- END OF SCRIPT -->
  1. <!-- START OF SCRIPT -->
  2. <form name="random"><input type="text" name="random" size=78 value=""></form>
  3. <SCRIPT LANGUAGE="JavaScript">
  4. <!--
  5. function getMessage() {
  6. // create array of murphy laws
  7. var ar = new Array(20)
  8. ar[0] = "Nothing is as easy as it looks."
  9. ar[1] = "Everything takes longer than you think."
  10. ar[2] = "Anything that can go wrong will go wrong."
  11. ar[3] = "If there is a possibility of several things going wrong, the one that will cause the most damage will be the one to go wrong."
  12. ar[4] = "If there is a worse time for something to go wrong, it will happen then."
  13. ar[5] = "If anything simply cannot go wrong, it will anyway."
  14. ar[6] = "If you perceive that there are four possible ways in which a procedure can go wrong, and circumvent these, then a fifth way, unprepared for, will promptly develop."
  15. ar[7] = "Left to themselves, things tend to go from bad to worse."
  16. ar[8] = "If everything seems to be going well, you have obviously overlooked something."
  17. ar[9] = "Nature always sides with the hidden flaw."
  18. ar[10] = "Mother nature is a bitch."
  19. ar[11] = "It is impossible to make anything foolproof because fools are so ingenious."
  20. ar[12] = "Whenever you set out to do something, something else must be done first."
  21. ar[13] = "Every solution breeds new problems."
  22. ar[14] = "Trust everybody ... then cut the cards."
  23. ar[15] = "Two wrongs are only the beginning."
  24. ar[16] = "If at first you don't succeed, destroy all evidence that you tried."
  25. ar[17] = "To succeed in politics, it is often necessary to rise above your principles."
  26. ar[18] = "Exceptions prove the rule ... and wreck the budget."
  27. ar[19] = "Success always occurs in private, and failure in full view."
  28. var now = new Date()
  29. var sec = now.getSeconds()
  30. document.random.random.value="Murphy's Law: " + ar[sec % 20]
  31. }
  32. getMessage()
  33. //-->
  34. </SCRIPT>
  35. <!-- END OF SCRIPT -->


Code: [ Download ] [ Select ]
<!-- START OF SCRIPT -->
<script language="JavaScript">
<!--

function random_content(){
var mycontent=new Array()
//specify random content below.
mycontent[1]='<b>Random content 1</b>'
mycontent[2]='<b>Random content 2</b>'
mycontent[3]='<b>Random content 3</b>'
mycontent[4]='<b>Random content 4</b>'
mycontent[5]='<b>Random content 5</b>'


var ry=Math.floor(Math.random()*mycontent.length)
if (ry==0)
ry=1
document.write(mycontent[ry])
}
random_content()
//-->
</script>

<!-- END OF SCRIPT -->
  1. <!-- START OF SCRIPT -->
  2. <script language="JavaScript">
  3. <!--
  4. function random_content(){
  5. var mycontent=new Array()
  6. //specify random content below.
  7. mycontent[1]='<b>Random content 1</b>'
  8. mycontent[2]='<b>Random content 2</b>'
  9. mycontent[3]='<b>Random content 3</b>'
  10. mycontent[4]='<b>Random content 4</b>'
  11. mycontent[5]='<b>Random content 5</b>'
  12. var ry=Math.floor(Math.random()*mycontent.length)
  13. if (ry==0)
  14. ry=1
  15. document.write(mycontent[ry])
  16. }
  17. random_content()
  18. //-->
  19. </script>
  20. <!-- END OF SCRIPT -->


Code: [ Download ] [ Select ]
<!-- START OF SCRIPT -->

<form name="scriptform"><input name="scriptinput" size=70 style="border-width:1px solid black;font:Arial"></form>

<script>

quotes = new Array();
quotes[0]="Content 1.";
quotes[1]="Content 2"
quotes[2]="Content 3"
quotes[3]="Content 4"
quotes[4]="Content 5"
quotes[5]="Content 6"
quotes[6]="Content 7"
quotes[7]="Content 8"
quotes[8]="Content 9"
quotes[9]="Content 10"
quotes[10]="Content 11"

function randomdisplay(){
randomquote=quotes[Math.floor(Math.random()*quotes.length)]
document.scriptform.scriptinput.value=randomquote
}

setTimeout("randomdisplay()",100)

</script>
<!-- END OF SCRIPT -->
  1. <!-- START OF SCRIPT -->
  2. <form name="scriptform"><input name="scriptinput" size=70 style="border-width:1px solid black;font:Arial"></form>
  3. <script>
  4. quotes = new Array();
  5. quotes[0]="Content 1.";
  6. quotes[1]="Content 2"
  7. quotes[2]="Content 3"
  8. quotes[3]="Content 4"
  9. quotes[4]="Content 5"
  10. quotes[5]="Content 6"
  11. quotes[6]="Content 7"
  12. quotes[7]="Content 8"
  13. quotes[8]="Content 9"
  14. quotes[9]="Content 10"
  15. quotes[10]="Content 11"
  16. function randomdisplay(){
  17. randomquote=quotes[Math.floor(Math.random()*quotes.length)]
  18. document.scriptform.scriptinput.value=randomquote
  19. }
  20. setTimeout("randomdisplay()",100)
  21. </script>
  22. <!-- END OF SCRIPT -->


ace5p1d0r wrote:
I don't. Don't use Flash unless you have to.


I agree, flash only slows down your computer.
Learn PHP | I got 10 PHP tutorials! Check them out!
Dreamtale - Farewell
Just a note... I've giving up on web development and that stuff... Just lost all interest in it.
  • Bogey
  • Disturbed
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 7128
  • Loc: Ozzuland
  • Status: Offline

Post May 27th, 2007, 2:39 pm

Ooops! Forgot to give the credits...

The above codes were provided free of use by Evrsoft First Page 2006. That's where I copied them from. And you know what? They took those codes from http://www.dynamicdrive.com and http://www.javascriptkit.com
Learn PHP | I got 10 PHP tutorials! Check them out!
Dreamtale - Farewell
Just a note... I've giving up on web development and that stuff... Just lost all interest in it.
  • Dragonkai
  • Student
  • Student
  • No Avatar
  • Joined: May 10, 2007
  • Posts: 76
  • Status: Offline

Post May 27th, 2007, 10:12 pm

OK, So what does code 1 do, What does code 2 do and what does code 3 do?

Oh right, they all do the same thing.

Is there a way for Javascript to change images.
  • Fabinator
  • Proficient
  • Proficient
  • User avatar
  • Joined: May 05, 2007
  • Posts: 467
  • Loc: Holland
  • Status: Offline

Post May 28th, 2007, 3:14 am

javascript can swap images. Randomly display an image and such.

But it can't create them. Therefore you'll need PHP. gd-lip of php. Check out http://www.php.net/gd for all image functions
"Think like a man of action, act like a man of thought" - Henri Bergson
Onyx Design
  • Dragonkai
  • Student
  • Student
  • No Avatar
  • Joined: May 10, 2007
  • Posts: 76
  • Status: Offline

Post May 28th, 2007, 10:25 pm

I mean't as in if I uploaded the images, could javascript swap the images around.

You say it can't create them, what do you mean as in create. I thought you make the images using photoshop or something.
  • Bogey
  • Disturbed
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 7128
  • Loc: Ozzuland
  • Status: Offline

Post May 29th, 2007, 12:52 am

Dragonkai wrote:
OK, So what does code 1 do, What does code 2 do and what does code 3 do?

Oh right, they all do the same thing.

Is there a way for Javascript to change images.


Yes, they do the same thing. I just gave you different options on doing the same things. Didn't I?

Dragonkai wrote:
I mean't as in if I uploaded the images, could javascript swap the images around.

You say it can't create them, what do you mean as in create. I thought you make the images using photoshop or something.


There is a way to swap images and show them one at a time changing them at each refresh of the page.

http://javascript.internet.com/miscella ... eload.html - Probably something you didn't want, but... Don't know maybe you can change it to something you did want.
Learn PHP | I got 10 PHP tutorials! Check them out!
Dreamtale - Farewell
Just a note... I've giving up on web development and that stuff... Just lost all interest in it.
  • Dragonkai
  • Student
  • Student
  • No Avatar
  • Joined: May 10, 2007
  • Posts: 76
  • Status: Offline

Post May 31st, 2007, 12:28 am

OK

Theres two different kind of image swap that I want.

One: When ever someone refreshes the page and the image changes.

Two: The Someone doesn't refresh the page and the image swaps after a few seconds.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post May 31st, 2007, 12:28 am

Post Information

  • Total Posts in this topic: 29 posts
  • Users browsing this forum: No registered users and 123 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© Unmelted Enterprises 1998-2009. Driven by phpBB © 2001-2009 phpBB Group.