Creativyst® Quote Catcher
Installation Instructions

v 1.0c
  1. Create Directory
  2. Set Script Configuration Variables
  3. Upload Script & Template File
  4. Enter Some Quotes
  5. Edit Quotes
  6. Display Quotes
  7. Sell Creativyst® Quote Catcher






[top]
1. Create Directories

The Quote Catcher script and its template file go in your cgi-bin (aka cgi) directory. Though it is not necessary, we recommend you make a single directory under your cgi-bin directory to hold the script and template ("QCatch.pl" & "QCatch.tpl") files.



[top]
2. Set Script Configuration Variables

There are three script configuration variables which must be set. They are the first three variables defined at the top of the script file ("QCatch.pl"). They are:
  1. $UrlScriptBase
    This is the URL directory where the script resides. Do not incluude the script name, just the URL based path to the directory where the script resides. It is entered in the form "http://...". for example
    "http://www.creativyst.com/cgi-bin/QCatch/"
  2. $FileDataDir
    This is the server FILE location of the directory where you want Quot Catcher to maintian your data files (such as your database of quotes). Note that unlike UrlScriptBase, this is a FILE location, not a URL.
    "/big/dom/xcreativyst/cgi-bin/QCatch/"
  3. $FileJSDir
    This is the server FILE location of the web-visible directory where you want Quot Catcher to place the JavaScript quote feeder file that will be used to display quotes on your webpages. While this is a disk FILE location, it must point to an area of the disk that is visible from the web. That is, it must be part of the disk that is within the document area.
    "/big/dom/xcreativyst/www/Site/"

You will notice that the script itself includes some terse commenting explaining what each variable does. Trailing slashes on directory names are optional.

Note:
User setable variables in Creativyst scripts employ a simple naming convention. Any variable that holds a FILE location relating to your server's DISK DRIVE is prefaced with the word "File" while any variable that is expecting a web address (as it would be typed into a browser's location bar for example) is prefaced with the acronym "Url"




[top]
3. Upload Script & Template File

Now upload the script file ("QCatch.pl") and the template file ("QCatch.tpl") to the directory under cgi-bin (or cgi) that you created in step 1 to hold them.

All files uploaded should be chmod 755.



[top]
4. Enter Some Quotes

Enter the script in your browser's location bar. Include the full path to the script along with the script name, eg:

http://www.mydomain.com/cgi-bin/QCatch/QCatch.pl

You should see a form that allows you to enter a quote along with an attribution. There is also a field labeled ShortList size which can be left blank for now.

You will also see a list of categories with check boxes (you may configure your own set of categories in the future). Check all the categories from the list that are applicable to the quote you are entering.

Enter the quote and attribution (author name) and push the submit button. The quote will be recorded and you will receive the form back with the quote set up for editing. If the quote does not need editing, click on the "New Quote" link to get a blank form. Enter the next new quote in the blank form. Continue on in this fashion until you have entered a few quotes into your database.



[top]
5. Edit Quotes

You may edit quotes you've entered. Type

http://www.mydomain.com/cgi-bin/QCatch/QCatch.pl?Edit=z

into the address bar to view/enter quote number zero. From there you may move forward through the quotes in your database. You may also type the number of the quote in place of 'z' in the address bar, i.e.

http://www.mydomain.com/cgi-bin/QCatch/QCatch.pl?Edit=3

This will begin the edit/view session at the quote number specified. You may still use the next and previous links to move around and view/edit other quotes.



[top]
Note to users of previous versions:
The function name for including message parts in your pages has changed from msg() to cqc.Msg() (note the upper case 'M' and the 'cqc.' preceding it). If you continue to use msg() the quote displayed will be a reminder that you should change to cqc.Msg().
6. Display Quotes

To display quotes in your webpages, include the JSMsg.js JavaScript file created by Quote Catcher in the HEAD section of your HTML file with the script tag and then call the cqc.Msg() functions within the remainder of your html file. Normally only the display functions are required to display information in the body of an HTML document. More advanced presentation can be accmplished using the cqc.Get() functions.

Let's begin. First, include the JSMsg.js script in the header

 <SCRIPT LANGUAGE="JAVASCRIPT"
     SRC="http://www.creativyst.com/Site/quotes/JSMsg.js">
</script>


Use ...Msg() to display parts of a message that changes randomly each time you reload the page.

 <hr>
 <font FACE="Arial, sans-serif" SIZE="2">
 <i>
 <script LANGUAGE="JAVASCRIPT">
     cqc.Msg("Body");
 </SCRIPT>
 </i><br>
 &nbsp; &nbsp; --
 <script LANGUAGE="JAVASCRIPT">
     cqc.Msg("Attrib");
 </SCRIPT>
 </font>


    --

This will display the message "Body" followed by a double dash and the message "Attrib" ("Attribute") for a randomly chosen message. Each time you reload the page, a new message will be selected at random and displayed.




Use ...MsgDay() to display a message that changes once a day.

 <hr>
 <font FACE="Arial, sans-serif" SIZE="2">
 <i>
 <script LANGUAGE="JAVASCRIPT">
     cqc.MsgDay("Body");
 </SCRIPT>
 </i><br>
 &nbsp; &nbsp; --
 <script LANGUAGE="JAVASCRIPT">
     cqc.MsgDay("Attrib");
 </SCRIPT>
 </font>


    --

Unlike the example above that changes every time you re-load the page, this one will only change once a day.




Use ...MsgN() to display the Nth message in the current short list.

 <hr>
 <font FACE="Arial, sans-serif" SIZE="2">
 <i>
 <script LANGUAGE="JAVASCRIPT">
     cqc.MsgN("Body", 10);
 </SCRIPT>
 </i><br>
 &nbsp; &nbsp; --
 <script LANGUAGE="JAVASCRIPT">
     cqc.MsgN("Attrib", 10);
 </SCRIPT>
 </font>


    --

This will display a message that only changes when the current list changes. That is to say, when you run the application that re-builds the JSMsg.js file. If there are less than 10 messages in the current list in the above example, it will wrap around and start counting up from the beginning again.

The ...MsgN() display is very usefull for displaying a formatted list of the top N messages in the list, as you might do for example, in a list of recent news stories.





Use ...Get..() functions in your JavaScript code to retrieve message strings in identical fashion to how the ...Msg..() functions display them.

 <hr>
 <font FACE="Arial, sans-serif" SIZE="2">
 <i>
 <script LANGUAGE="JAVASCRIPT">

     var msg;
     msg = "<B>1: </B>";
     msg += cqc.GetN( "Body", 0 );
     msg += "<BR>&nbsp;--";
     msg += cqc.GetN( "Attrib", 0 );
     msg += "<hr WIDTH=\"35%\">";
     msg += "<B>2: </B>";
     msg += cqc.GetN( "Body", 1 );
     msg += "<BR>&nbsp;--";
     msg += cqc.GetN( "Attrib", 1 );
     msg += "<hr WIDTH=\"35%\">";
     msg += "<B>3: </B>";
     msg += cqc.GetN( "Body", 2 );
     msg += "<BR>&nbsp;--";
     msg += cqc.GetN( "Attrib", 2 );
     msg += "<hr WIDTH=\"35%\">";

     document.write(msg);

 </SCRIPT>
 </font>

You may use ...Get..() functions as well as ...Msg..() functions from within your javascript scripts for nearly unlimited flexibility when displaying message parts.

Had the application constructed a JSMsg file containing a list of news stories in most-recent-first order, the above JavaScript would have shown the three most recent ones. Note also, that the message numbers start at zero.





The random functions; ...Msg() and ...Get() may optionally take an extra offset parameter to add to the random number produced.

 <hr>
 <font FACE="Arial, sans-serif" SIZE="2">
 <i>
 <script LANGUAGE="JAVASCRIPT">

     var msg;
     msg = "<B>1: </B>";
     msg += cqc.Get( "Body", 0 );
     msg += "<BR>&nbsp;--";
     msg += cqc.Get( "Attrib", 0 );
     msg += "<hr WIDTH=\"35%\">";
     msg += "<B>2: </B>";
     msg += cqc.Get( "Body", 1 );
     msg += "<BR>&nbsp;--";
     msg += cqc.Get( "Attrib", 1 );
     msg += "<hr WIDTH=\"35%\">";
     msg += "<B>3: </B>";
     msg += cqc.Get( "Body", 2 );
     msg += "<BR>&nbsp;--";
     msg += cqc.Get( "Attrib", 2 );
     msg += "<hr WIDTH=\"35%\">";

     document.write(msg);

 </SCRIPT>
 </font>

We've used the ...Get() function above, but it would have worked just the same way had we used the ...Msg() function to display the messages directly.

Here, instead of a single message that changes every time the page reloads, there are three messages changing every time the page reloads. You can add as many as you'd like to such a list (they will simply wrap around to the beginning if there aren't enough messages in the JSMsg file).

The field names currently supported by the msg() function are:





[top]
7. Sell Creativyst® Quote Catcher

We have a very generous associates program which approximately splits the profits after transaction and program administration costs.

If you're interested in selling this and other products with us, or have suggestions for making our associates program even better, please refer to our Creativyst Associates Program (CAP™) information page. Your feedback is greatly appreciated.

back to top









  Creativyst™ Quote Catcher   () © Copyright 2001-2002, Creativyst, Inc.