Index of /tetra/

      Name                                                                             Last modified         Size  Description 
up Parent Directory 13-Mar-2019 02:09 - unknown error_log 24-Aug-2019 17:51 8k [HTM] tetra-carp.php 28-May-2007 18:08 4k [HTM] tetra-js.php 28-May-2007 18:08 8k [HTM] tetra-make-xml.php 28-May-2007 18:08 4k [HTM] tetra-setup.php 28-May-2007 18:08 20k [IMG] tetra.jpeg 28-May-2007 18:08 4k

Tetra - DHTML/JavaScript Scroller with AJAX background updating and RSS feed integration using CaRP Tetra DHTML/JavaScript Scroller
with AJAX background updating and RSS feed integration using CaRP
© 2005-6 Gecko Tribe, LLC

Where to go for help
Installing Tetra
Creating scrollers
Recommendation - use static data
Creating static XML files for scroller data
Technical reference

Thank you for choosing Tetra! This document will help you get Tetra installed and running on your website, and will answer a few of the most common questions that Tetra users ask. If you have other questions, don't hesitate to contact me or visit the Tetra User Forum (links for both can be found below).
- Antone Roundy   
Where to go for help
If you've followed the directions to set up a scroller and it doesn't work, please don't spend too much time struggling with it before asking for help! A Tetra scroller depends on up to four separate pieces of code working together correctly, so tracking down problems can be difficult if you're not familiar with how the system works. Just post the URL of the page where the non-functioning scroller is set up in the forum or email it to me. By viewing the actual page, I can usually spot the source of the problem quickly. If you send me your code, it's much more difficult to figure out, because I won't be able to tell whether the pieces are all in the correct locations.

Tetra User Forum - special thanks to those users who are so helpful in answering others' questions in the forum
Contact Me Directly
Installing Tetra
To install Tetra, upload tetra-js.php, tetra-make-xml.php and tetra-setup.php to any location inside your website directory. If you are going to use Tetra with CaRP to scroll RSS newsfeeds, you will also need to upload tetra-carp.php to your webserver. We recommend putting it inside the CaRP folder (ie. in the same directory as carp.php). That will make it easy to determine the path to tetra-carp.php, since it will be the same as the path to CaRP.

Creating scrollers
To create a scroller, load the copy of tetra-setup.php that you uploaded to your webserver in your web browser. For example, if your website is, your web directory is /home/example/public_html/, and you uploaded tetra-setup.php to the directory /home/example/public_html/tetra/, you would enter the URL "" in your web browser's address bar.

You will see a form with default values already entered. Change any of those values that you wish to change, ensuring that all fields and sections that are not marked "optional" are completed (they are by default), and click any of the three "Create Tetra Code" buttons that are found on the page.

Depending on the settings you enter, four or five bits of HTML, JavaScript, CSS, and perhaps PHP code will be displayed. Each will have instructions telling what to do with it. Follow those instructions to copy that code into the webpage where you want the scroller displayed, or into new files as noted, upload those files to your webserver, and your scroller will be completed.
Recommendation - use static data
Because some older web browsers do not support the "AJAX" technology that enables Tetra to update the contents of the scroller dynamically, we recommend including static data in the scroller, either by integrating with CaRP, or by entering static data in the bottom section of tetra-setup.php. This will ensure that all browsers will display some content, and most will scroll it, even if they don't receive new data from time to time.
Creating static XML files for scroller data
Tetra can read data from specially formatted XML files to update the contents of your scrollers from time to time. The data can all be stored in one XML file, or split between different files, each of which points to the next one. To create the XML files, load the copy of tetra-make-xml.php that you uploaded to your webserver in your web browser . For example, if your website is, your web directory is /home/example/public_html/, and you uploaded tetra-make-xml.php to the directory /home/example/public_html/tetra/, you would enter the URL "" in your web browser's address bar.

You will see a form with fields for a URL and scroller data. If you wish to scroll the data you will be entering in this file for a while, and then dynamically update the scroller with data from another file, enter the URL where the other file will be found in the URL field. Note that due to JavaScript security restrictions, all of the files must be hosted on the same server as the webpage where the scroller appears. For example, if the scroller is to be displayed on the page, all of the XML data files must be hosted on

In the data fields, enter the HTML code and text that you want displayed in the scroller. The form will initially have fields for three scroller segments. If you wish to enter more data, complete those three segments first and click the "Generate XML" button. New fields will be added to the form ensuring that you always have three empty fields available.

When you have finished entering data, click the "Generate XML" button one last time, copy the contents of the field at the top of the resulting page, paste them into an empty file in a plain-text text editor such as Notepad, and save the file, giving it a name ending in ".xml". Upload this file to your webserver in the location pointed to by your Tetra settings or another Tetra XML file.
Technical reference
XML File Format
Tetra's XML file format is extremely simple, and designed to minimize bandwidth usage. It has only three elements, none of which have any attributes. The root element is named "n". The file must begin (after the XML prologue line) and end with <n> and </n> tags.

The most important element is the "i" element (for "item"). Each "i" element contains the data for one scroller section. There must not be line breaks in the "i" element--ie. the data must begin on the same line as the <i> tag. Note that you may of course enter HTML <br> tags and other tags that will result in line breaks when the content is displayed. Any HTML in the "i" element must be escaped. In other words, "&" must be converted to "&amp;", "<" to "&lt;", and ">" to "&gt;". All of these requirements will be met automatically if you use tetra-make-xml.php to create your XML files.

The other element is the "url" element. It is optional. If present, it contains the URL of the next XML file to be loaded after the current file. The must not be line breaks in the URL element--ie. the URL must begin on the same line as the <url> tag.

Arguments to TetraMakeConf
The JavaScript function TetraMakeConf takes twelve arguements. The proper values will be generated automatically by tetra-setup.php, but if you wish to edit the JavaScript by hand after creating a scroller, refer to this reference to determine the meaning of each. If you make changes to the JavaScript, be aware that you may need to update your CSS and CaRP integration code (if any) to match those changes.
  1. name: The name of the scroller. This must be the same as the name of the JavaScript variable that the scroller's configuration is saved in. This same name must also be used in the CSS IDs and class names for the scroller.
  2. url: The URL of the file or script from which to load data into the scroller.
  3. allowUrlChange: This determines whether the XML file or script can indicate a new URL to be used the next time the scroller is updated. Enter 0 to disallow changing of the URL (ie., continue loading the same XML file or script each time), and 1 to allow the URL to be changed dynamically.
  4. origItemCount: The number of scroller items statically coded into the webpage. When the "static" data is actually dynamically generated, as it is when integrating with CaRP, the script that generates the data must set this variable unless it is known in advance that it will always be the same.
  5. boxSize: The height or width in pixels of the entire scroller. If scrolling horizontally, enter the width, and if vertically, the height.
  6. itemSize: The height or width in pixels of each item in the scroller. Each item may fill the entire scroller, or the scroller may hold multiple items at once. It may even hold fractional numbers of items, for example, two and a half at a time.
  7. gap: The amount of space in pixels to leave between items as they scroll.
  8. direction: The direction to scroll the items. All letters in this value must be uppercase. Enter "R2L" for "right to left", "L2R" for "left to right", "B2T" for "bottom to top", or "T2B" for "top to bottom".
  9. itemDelay: The number of seconds to pause on each item.
  10. stepDelay: The amount of time, in thousandths of a second, to pause between each scrolling step. Note that differences in browsers and computers will determine how long it takes to complete each scrolling step--this setting only controls that amount of time between steps.
  11. stepSize: The number of pixels to move the items in each scrolling step. This must be a positive number, regardless of the direction of scrolling. The script will make the number negative if necessary based on the "direction" setting.
  12. refreshDelay: The number of seconds to wait after loading XML data before reloading or loading from the next URL. This should usually be set to something like 300 (five minutes) or higher, unless you have constantly updating data that your want delivered as soon as possible to your site's visitors.
Thank you for using Tetra!
Proudly Served by LiteSpeed Web Server at Port 80