Placing Quotations on Your Site

Quotations, bon mots, and memorable lines — the world is full of them, and we’re all fond of spouting them on occasion: Benjamin Franklin’s simple wisdom, “When you’re finished changing, you’re finished.” The Duc de La Rochefoucauld’s famous, “One is never as unhappy as one thinks, nor as happy as one hopes.” And who can forget the immortal line of President Richard Nixon, “I have often thought that if there had been a good rap group in those days, I might have chosen a career in music instead of politics.”

Quoting with the Quote Machine

The Quote Machine (www.insanityideas.com/quotemachine/remotequote.html) is incredibly simple to add to your site. You just have to fill out one little form. The following steps describe the process:

1.
Go to www.insanityideas.com/quotemachine/remotequote.html.

The Quote Machine – Remote Quote page appears, as shown in Figure 12-5.

Figure 12-5. Filling out the form for the Quote Machine.


2.
If you want to set a different width than the default value of 200, type the desired value into the Width text box.

3.
In the URL box, type the Web address of the Web page to which you want to add the quotations.

4.
Click the Get Code button.

5.
Copy the HTML code from the text area on the resulting page.

6.
Paste the code into your own Web page where you want the quotation to appear and upload the page to your site.

Figure 12-6 shows the Quote Machine as it appears on your Web site.

Figure 12-6. A quote from the Quote Machine as it appears on your Web site.


Quoting with Quoter

Quoter, a Java applet by Paul Lutus, is simple and versatile. It’s a stand-alone, not connected to any service, so it’s considerably stickier than the Quote Machine because nothing about Quoter can lead people away from your site. It’s also a freebie that its creator distributes under a CareWare license. (What’s CareWare? Check out www.arachnoid.com/careware for details.)

To add Quoter to your site, follow these steps:

1.
Go to www.arachnoid.com/quoter, where you can see the applet in action.

2.
Scroll down to the bottom of the page and click the word Quoter in the sentence that says Download Quoter code/CSS elements (16K).

3.
After you’ve downloaded the file quoter.zip, unzip it into the directory that contains the Web page you plan to add it to.

4.
Add the following code to your Web page where you want the quotation box to appear:

<div align="center">                                                
									<div class="quotebox quotefont" id="quotebox"></div>                
									</div>                                                              

5.
Add this code inside the HEAD element of your Web page:

<link rel="stylesheet" type="text/css" href=                        
									   "quoter.css"/>                                                   
									<script type="text/javascript" src=                                 
									   "quotes.js"></script>                                            
									<script type="text/javascript" src=                                 
									   "quoter.js"></script>                                            

6.
Upload your Web page and the quoter.js, quotes.js, and quoter.css files.

You now have the basic setup, as shown in Figure 12-7.

Figure 12-7. Quoter is a free Java applet that’s easy to install.


Now comes the fun part. If you want more than just the plain vanilla installation, there’s plenty of room for more control. All three of those files you uploaded are editable, which means that you can feel free to jump in and alter any of the settings in the Cascading Style Sheets (.css) or JavaScript (.js) files.

Want to add more quotations? Just open up quotes.js (it’s a plain text file) and type and delete to your heart’s content. Each quotation must be within quotation marks, the whole followed by a comma:

"Man is the only animal that blushes -- or needs to.                     
							        Mark Twain",                                                     

Don’t like the size of the font? Go into quoter.css, where you’ll find all the visual variables to monkey with. Each setting is well-named and easy to spot, so when you see the part that says:

.quotefont {                                                             
							  font-size: 14pt;                                                       
							}                                                                        

. . . you know you’re in the right place. Even without knowing anything about CSS (see Chapter 5), you can easily see where to change the font size. Just make the 14 into whatever other size you want.

The other file, quoter.js, should best be left alone unless you’re skilled at JavaScript programming. The only things you might want to change in it are the speed variables for the quotations. The var char_pause variable sets the time between each character being “typed” on the screen. It’s set to 60 milliseconds by default. The var quote_pause variable tells how long to let the quotation remain on screen. Its default is 8000 milliseconds.

Because Quoter simply displays text from a file that you create, you don’t have to use it for quotations. You can also use it for displaying one-liner jokes, for example. You can put anything that you want in the box, as long as it fits.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.59.187