How template works
Indexu is template driven software. It mean every html output is controlled by template files. These files contain html codes and some indexu's variables. When a .php file called, e.g. index.php, then it will find its template file (index.html). Replace indexu's variables inside it then generate html code as is the html code in its template file.
So if you want to change your portal design (web interface), you should change template files. They're located in:
/themes/theme_name/*
You can also use your preferable html editor such as Macromedia Dreamweaver to create your own template files.
Header, footer, and content section
In template folder you'll find header.html and footer.html. These files will be loaded in every page along with the template file which .php called. For example, you run index.php, then it will generate html code from:
- header.html
- index.html
- footer.html
By using header and footer you can easily keep consistency of web design between other pages. You can also leave header and footer empty if you want have more flexibility on design. But you'll get harder to maintain pages consistency.
Indexu's variables
You will see indexu's variables in most every template files. Those variables will be replaced with value from database when the script running. Every variables begin with <% and ends with %>. E.g.:
<%category%>
<%error_msg%>
msg.php file
Inside template folder, you'll find a file named msg.php. If you have used v.2 or earlier, then this file is the replacement of english.php. This file contain all messages and some variables that regular template files could not handle.
Modifying this file is easy. It's PHP code, but no more than variables assignment and comments for usage explaination. If you do not know PHP code, you still do not need to affraid to modify it. It's all well explained and very simple. Just make sure, you always ends each statement with ;
Below is the example of code inside msg.php
As you see above, the message are already arranged by the file name and each have comment that explain its purpose.PHP Code://----------- hot.php -----------
// date format
$msg["10041"] = "d-M-Y";
// hot link path template
$msg["10042"] = "<p><b><font size=3><%category_path%></font></b></p>";
//----------- top_rated.php -----------
// date format
$msg["10051"] = "d-M-Y";
// top_rated link path template
$msg["10052"] = "<p><b><font size=3><%category_path%></font></b></p>";
Inserting PHP code inside template files
To gain more flexibility, you may want to insert some php code inside template files. This could usefull when you want to integrate indexu will other script such as banner management script or news grabber script. You can do this by adding <php>.....</php> tag between your php code. E.g.:
<php>
print @GrabNews("http://phpbuilder.com/rss_feed.php");
</php>


LinkBack URL
About LinkBacks


