Templates are used to separate PHP code from the text and design of your website. This makes it possible to develop any style you wish and extremely easy to integrate with your current web design. The Ventrino Traffic Exchange script template software enables you to write your own PHP code and even includes high level SQL and table statements providing you almost unlimited access to the database and code at any point of your website.
For example if you want to add code anywhere on the site showing how many members you have simple add this line to the point where you want it displayed in the template:-
| <SQL>SELECT COUNT(*) FROM vtp_members</SQL> |
Or the following can be used to list members who have surfed today.
| <GRID> SELECT vtp_members.id, vtp_members.name, vtp_members.email, count(vtp_tracking.id) hits_today FROM vtp_members, vtp_tracking WHERE vtp_tracking.credit_members_id=vtp_members.id AND left(vtp_tracking.action_date,10) = CURDATE() GROUP BY vtp_members.id ORDER BY hits_today DESC </GRID> |
You can also write your own PHP, for example the following code prints the date in long European format.
| <PHP> echo date('d-M-Y'); </PHP> |
Don't worry if this doesn't make much sense, the subject warrants it's own section and will be gone into much detail later. For now keep in mind that you not only have the power to write your own PHP anywhere within the templates and you even have access to high level functions not available in ordinary template system such as <SQL> and <GRID> tags.
As mentioned above they separate code from the design, but what's so good about this? This is a fundemental building block of your site, without templates each time we issue a new patch or add an enhancement you would have to start from scratch again painstakingly interweaving your graphics and text back into the design. As typically we issue new code every 8 to 12 weeks this would rapidly become tedious to the point you would not want to bother upgrading. If that were to happen your competition would soon be ahead of you. Using templates means you have complete control over the design of your site and simplifies the integration of any design you may want, it also means you are not constrained by limits.
There are two ways, through the BCP (see the Template Management section bottom left of the menu on the home page), or the recommended method directly via FTP. Using the BCP is fine for small alterations but is not recommended so in this manual we describe how to edit them using FTP or an HTML editor such as Frontpage.
On a new installation you will find the configuration points to /templates/standard (see BCP --> Configuration --> General Configuration) the first task is to make a backup so that should you messup you can recover. The scope of this article does not cover backups in detail but in most modern HTML editors this is easily done, in Frontpage highlight the standard folder, press Ctrl-C followed by Ctrl-V and the entire directory and files is copied to a new one named Copy of standard.

Once you have a backup move into the standard folder and you will see a couple of files and a 5 folders. Each file represents a major area of your website. The inside.tpl is the main design for pages viewed by your members after they have succesfully logged in and outisde.tpl those areas seen by any visitor or member who is yet to login.
A little exploration will provide information on the contents of the folder and their purpose where it isn't onvious. For this tutorial we will look at the inv and lang folders.
But all I want to do at this stage is change the colors, how do I do that?
Well better than tell you, how about I show you? After reading the above it makes sense to review what we have done and the following video gives a good overview and shows how the colors can be updated at the same time. Click here to watch a video on how to change the colors and work with rounded corners.
Tags are used to display dynamic information such as database records
| {Active} | Displays account active notice |
| {ContentDisplay} | The inner content of the page |
| {BannerDisplay} | Banner code from BCP/Configuration/Promotional Configuration |
| {BannerDisplay2} | Banner code from BCP/Configuration/Promotional Configuration |
| {BannerDisplay3} | Banner code from BCP/Configuration/Promotional Configuration |
| {Slogan} | Slogan code from BCP/Configuration/General Configuration |
| {TopMenu} | Menu across the top of the page |
| {BottomMenu} | Menu along the bottom of the page |
| {TopMessage} | Bread crumb text across the top of the page |
Translating the script is easy as long as you understand English. For instructions on translating the script see this topic.
Checkout the following two forum posts that provide more detail and examples:-
http://forum.ventrino.com/index.php?showtopic=3106
http://forum.ventrino.com/index.php?showtopic=6903
If you have a question that is not covered by these topics then post them here:-
http://forum.ventrino.com/index.php?showforum=28