We help IT Professionals succeed at work.

simple text quote or banner rotator

marglar
marglar asked
on
364 Views
Last Modified: 2012-06-27
I'd like to find a simple application (run on linux) to rotate entries in a text file on my page.  I have a bunch of quotes and I'd like them to rotate every x seconds.

Anyone know of anything simple and (preferably) free?
Comment
Watch Question

CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
wow!  thanks!

now for the confession... I'm a complete neophyte.  

I'm assuming the <script> part goes in the head and the <div> goes where I want the quotes.  Is that right?

One question.  Whats a new line character?

Again, thanks!
CERTIFIED EXPERT

Commented:
It is irrelevant whether the <script> part is above or below the <div> part. I put it that way to make it more readable (you're welcome, by the way :D ).

A newline character is the ASCII representation of this:
"
"
(it's the bit between the quotes)

There is another way of separating two lines which looks identical, and that's with the line feed character, represented as "\r".

It is important to use double quotes for both the newline and line feed character representations. Single quotes will just give you a slash followed by the letter n or the letter r.

Author

Commented:
whew!  Ok!

so, just to make sure I understand...

In my quotes.txt file I should put a \r at the end of each discrete quote?

this is quote #1 /r
This is quote #2 /r

like that?
(sorry to be dense)
CERTIFIED EXPERT

Commented:
No, that's not what I meant. In php, a double-quoted string that includes \r is equivalent to a linefeed. In a text document separating two lines with the enter key is equivalent to a linefeed. Now, whether it's technically equivalent to \r or \n depends on your text editor. It makes sense to just test both ways to see which works.

Author

Commented:
uhhhh.   Ok, now I feel totally stupid.  I have no idea what we are discussing...

I'm cool to drop your script into my page where I want to show the quotes.  That part is straight forward for me.

I see that I can put my quotes into quotes.txt (or change that parameter in the script to what I want).

What I don't understand is how the script can tell one quote from another.  What should quotes.txt look like?

Thanks a million for all the help!

CERTIFIED EXPERT

Commented:
A bird in the hand is worth two in the bush.
All good things must come to an end.
All's well that ends well.
As you sow, so shall you reap
...
Zounds, Watson! The chase is afoot!

Does that make sense? (alphabetizing is totally up to you)

Author

Commented:
Ok then.  I just use plain old carriage returns?

I assume if I want a line break in the quote itself that I should use a <br>..  


Thanks so much for all of your help (and patients)


CERTIFIED EXPERT

Commented:
Yes that's right. You're welcome.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.