15/8/2010
New Template Engine Formats
- new template engine expanding variables like %%NAME%% or %%name%%, file extension of .pct
- new template engine to allow embedding of grid as static html table ala smartthumbs, format is like #photo:5:webcams# which will expand to the photo url for the 5th webcam model in the grid, file extension is .tgp
- php code can be embedded in both .tgp and .pct format templates. the php code is executed first
- template maker to create basic html and variables for the new .tgp template format
- ability to loop round data (ala wordpress or tgpx) by calling zestoi_select_result(type,id) and then the usual calls to zestoi_val(fieldname) will work
- * example: while ($post < zestoi_val('page_matches')) { zestoi_select_result('webcams', $post++); echo zestoi_val('name'); }
New Theme Engine Features
- templates can be stored in the theme dir as well as 'templates' and will take precedance if exist with same name in both locations
- any template format can now be used for theme files, i.e: index.php, index.tpl, index.tgp and index.pct are all valid (files are searched for in that order)
- * since webcams_profile is the urlconfig name for a webcams profile and the default template is webcams_profile.tpl an exception has been added in for this name, so that webcams_profile.* will not be searched for, but instead will default back to single.* as before
- data can be embedded directly into a theme file now, so for example single.pct could be loaded for a profile page and contain variables like %%LINK%% etc
- theme files are now also cached if cache_enabled is set to 1 in the site settins page (prior to this only 'templates' files were cached)
- all template files, from 'templates' or the theme dir can be selected from the webcams global settings page (css, php, tpl, tgp, pct)
- themes can now contain a settings.txt file to update settings that are needed for the theme to work properly
- new themes selector/browser displaying info and a preview of how a new theme looks
- themes can now optionally contain a preview.jpg and/preview.txt file that is viewed via the theme browser
Minor Updates
- new empty template called null.php should be selected in the webcams global settings if embedding data directly in the page, to avoid rendering of html not needed
- new script smarty2php.pl to convert from existing smarty templates into php and/or php+pct format, since smarty plugins do not yet exist to enable smarty templates to easily be used as theme files with inline/embedded template content (will not convert 100% of smarty constructs)
- * example: smarty2php.pl -pct webcams_profile.tpl single.pct
- new function zestoi_setvals() which is called after data is extracted but before html rendering takes place to allow for included templates to access the same data
- themes can optionally contain a settings.txt file to update items such as rows+cols needed for it to be used correctly
- new urlconfig type of 'none' that does nothing except load the theme file with the same name as the urlconfig entry
- the command line utility zestoi.php now searches to find config.php so ZTOP no longer needs setting so long as run from the zestoi/bin dir
- templates editor moved to top level menu 'Templates' and now allows editting any template from current theme and global templates dir
- added new urlconfig entry (for new installs) that will preload the zestoi data and load a home.* theme file
- * the fields are: home | / | webcams | status=!offline | load webcams for the home page
- * without this urlconfig entry home.* will still be searched for if the url is / but home.* will be responsible for calling zestoi() to extract data (as before)
- * all templates now have the extra code commented out in their home.* files, so either add the urlconfig entry or uncomment out that line
- zestoi_val('urlconfig_name') can be used which return the name of the current page urlconfig item: webcams_profile, webcams_niche, etc
- * used in the themes/*/functions.php file when choosingf correct page title
Bug Fixes
- current theme was not being selected in the global site settings page
- replace mycams livefeed code with livejasmin code in templates/webcams_livefeed_livejasmin.tpl
- change to the logon code to prevent the data loss to config files that can happen depending on the page loaded after logon
- fixed bug in sitemaps generator for more than one sitemap
New Themes
- webcams_tgp, using a tgp template for the grid and a pct one for the profile page - both inline templates
- webcams_orange, using pct templates
- webcams_blue, using smarty templates
- webcams_dark, using zestoi_select_result() to loop round data to build up the grid direct from a theme file, profile template uses inline php
- webcams_pink, manually looping round the grid elements but letting zestoi prerender them all via an external template
Issues
- when using the tgp format for a grid layout you need to ensure that the webcams default rows/cols are set to find the same number of models
- in a tgp template, if not enough data cells exist, 'image' is replaced by the hardcoded /nopic.jpg to avoid broken images
- if you change to a new theme that uses a template with the same name as an old one you need to clean out your smarty cache (or update timestamp on new one)
- all templates now assume the new / urlconfig entry and so any home.* template doesn't extract data explicitly
|