wordpress plugin, wordpress geotargeting, seo plugin, article posting plugin, ad tracker, ad tracking software, php news script, news script
php cms
custom cms wordpress plugins ad tracker
ad tracker script
custom cms
Company Products Services Articles Free Scripts
article posting plugin
oscommerce development
data mining
move site to another server
Templates

All pages are generated with Smarty Template Engine. You can download Smarty manual and read more about this powerful engine from Smarty Official Page.

Smarty is very flexible and fast engine - it's built in very smart way and it's really fast.

The main idea is to divide php code from html tags so site design can be changed fast and with no change of php files at all! This script works exactly this way - html is separate from php.

Templates can be edited through web control panel (accessible by admin). Main goal of each template is to show variables it gets from php script. In other words, Template is common pure html with some special "tags" used to show variables or to implement simple logic (yes, Smarty have control structures and some of them are used in the system).

Smarty contains such tags besided pure html:
  • {$var} - to show variable assigned from php and named "var"
  • {if} - to implement simple logic
  • {foreach} - to parse array assigned from php script
  • {include} - to include another Smarty (can be useful for headers, ads, menu etc to avoid duplicate data)

Please study Smarty Manual to learn more about special tags. Don't be afraid of it - manual contains special section 'Smarty for template designers' and you don't have to know php at all to design your own smarty template. If you are well in learning by example then you can study our templates - they are simple but use power of Smarty.

So, coming back to our script. Each page is shown with some template. Each template includes (using {include} command) header.tpl and footer.tpl - common header and footer. You can create another header and footer and use both of them just specify what file to include. Currently all templates use same header and footer.

All templates have such variables that they can show (they are assigned to each template):
  • $self - contain base name of current file. No need to use it
  • $CFG - array of all settings you manage on "Site settings nams"
  • $LNG - array of all messages in current language
  • $MSG - usually an error message generated or message to user
Language system
Each message you create through admin interface has it's own id. To show message with id 'error' in template use smarty tag {$LNG.error}. Please enter what language is active for your site on site settings page.
 
 
Site settings
Array contains all general site settings. The most important thing to use is {$CFG.webroot} in the beginning of all image src, links etc because our script is located in 2 folder levels due to 'search-engine-friendly' urls feature. The most important thing is things to use are:
  • {$CFG.webroot} - web path to root of your site
  • {$CFG.sitetitle} - Sitetitle as set in admin
  • {$CFG.hsemail} - site email as set in admin

All other variables are template specific. Now we can divide all templates in 3 classes and 1 separate template:

  • Subtemplates (like header, footer or _top_level_cats)
  • Individual templates - they are used with one page only (index, newsarchive etc)
  • Error template - it simply includes header and footer, header does show {$MSG} variable. Used for example when news with invalid ID is called.

Subtemplates are already described below and you can create your own, and definitely you should to make your site look more individual.

Individual templates are (list of templates and list of variables assigned to each shown):

  • Index page (index.tpl)
    • {$news} - array with top news (amount can be changed in settings)
    • {$pages} - array with links to previous and next page
  • News archive (archive.tpl)
    • {$y_expanded},{$years},{$m_expanded},{$months},{$news} - all archive is built on these parameters

All other templates can exist in more than 1 instance. It means, you can create several news templates and assign specific template for special news. The common templates are news templates. You can assign to news any template which name starts with 'news_'.

    News template receive such data from phpscript:
  • {$attachments} - array of news attachments
  • {$links} - array of links
  • {$news} - array with news itself

back to manual index

offshore web development
ad tracking software See Also
php parser
ad tracker Featured Product
TheRedirector Plugin

TheRedirector Plugin

ver 1.0.2

WordPress plugin that replaces external links inside posts and comments, and keeps track of links that have been clicked. Allows blog owner to specify which links must stay external. The easiest way to hide external links on wordpress blog. More details »

Customer Area
Order #:  Forgot?  
Password:   
 
Latest News
October 2009
July 2008
Article Import Plugin ver 1.19 »»»
June 2008
Article Import Plugin ver 1.18 »»»

 
information
custom development custom PHP PHP development
custom PHP development Webous.com © 2002—2017 All Rights Reserved.
wordpress plugin, wordpress geotargeting, seo plugin, article posting plugin, ad tracker, ad tracking software, php news script, news script