Site Templates
Template Editing Interface
Editing the site templates is done through the Templates > Site Templates function in the control panel. That interface will look something like this:

Search and Replace
TubeX allows you to make quick changes to your templates in bulk with the Search and Replace function. When you access the Search and Replace function a dialog will appear that will allow you to select the templates that you want to perform this action on, the code to search for in the template, and the replacement code to use. Multiple templates can be selected by holding down the shift or ctrl keys on your keyboard as you click on templates in the selection list. Once you have selected the templates and entered the search and replacement code, press the Apply Changes button to start the task. Once completed a notification message will be displayed letting you know how many replacements were made.
Custom Templates
In addition to the default templates shipped with the software, it is also possible to create custom templates that you can use to display any information that you like. The software ships with an example custom template named custom-rss-feed-newest.tpl which generates an RSS feed of the most recently added videos. Custom templates can be used for any purpose that you like.

Naming
Custom templates will need to be named using the following format: Where TEMPLATE_NAME is the unique name you want to use for the template. The template filenames may contain only English letters, numbers, and the dash (-) character. So, for example, if you wanted to create a custom template to generate an RSS feed of the top rated videos you might use this for the filename:
Creating
Once you have determined the filename you want to use for the custom template, you can simply create an empty file with that name and upload it to the directory containing the template set you have selected. For example, if you are using the Default-Blue-Rewrite template set, you would upload the custom template file to the templates/Default-Blue-Rewrite directory of your TubeX installation. Once the file is uploaded, set it's permissions to 666 which will allow you to edit that file through the control panel interface.

Viewing
Now that the custom template file has been created, you will need to setup the HTML and template code. This can be done just like you were editing any other template file. Before you can view the output from the template it will be necessary to load and save the template so it can be processed and compiled for use by the software.

The custom.php script is responsible for displaying the custom template pages, and accepts the t= parameter as the template name. To view the example custom template custom-rss-feed-newest.tpl you would use this URL format:
Note that you only include the unique portion of the template filename (rss-feed-newest) and not the entire filename for the t= parameter.

It is also possible to use mod_rewrite rules to create search-engine friendly URLs for your custom templates. The default .htaccess file included with the software gives an example of how this can be done for the custom-rss-feed-newest.tpl custom template:

RewriteRule ^feeds/newest/?([0-9]+)?/?$ custom.php?t=rss-feed-newest&p=$2 [L]

You can add as many mod_rewrite rules to the .htaccess file as you need!
Templates & Their Variables
All of the site templates will have the following two variables set: Below you will find a list of all the site templates shipped with the software, a description of when the template is used, and details on the template variables available (if any) on that template.

categories.tpl
global-categories.tpl
global-footer.tpl
global-header.tpl
global-pagination-js.tpl
global-pagination.tpl
global-search-terms.tpl
global-tags.tpl
index.tpl
style.css
upload-complete.tpl
upload-disabled.tpl
upload-flash-complete.tpl
upload-flash-errors.tpl
upload-step-one.tpl
upload-step-two.tpl
user-avatar.tpl
user-confirmed.tpl
user-edit.tpl
user-favorites.tpl
user-login.tpl
user-menu.tpl
user-my-account.tpl
user-my-videos.tpl
user-profile.tpl
user-register-complete.tpl
user-register.tpl
user-reset-confirmed.tpl
user-reset-found.tpl
user-reset.tpl
user-video-edit.tpl
video-comments-iframe.tpl
video-comments.tpl
video-player-flash.tpl
video-player-other.tpl
video-player-quicktime.tpl
video-player-silverlight.tpl
videos-browse.tpl
videos-by-category.tpl
videos-by-search.tpl
videos-by-tag.tpl
videos-newest.tpl
video-watch.tpl