3/5/2011
Custom Tags
One area that had always been tricky in zestoi, was how to easily define what should be displayed for the title or meta tags etc on each/any page. This has now been solved by the addition of Custom Tags.
In each edit page (articles, dating, videos, webcams) you will now see at the bottom of the page a Custom Tags table with 3 colums. The Single column is used when a single article or webcam profile etc is displayed while the Multiple one for a blog feed or grid of videos etc.
You can define any named tags. To solve the title issue a sensible named tag might be page_title which you would then define in each of the modules settings pages.
Variables from the URL and from decoded content can be used via smarty style tags like {$name}. If the current page doesn't contain that variable then it will be removed so it is safe to define something like this for videos multiple:
{$site}{$category}{$tags} Videos
Separate options may be delimitted with a pipe | character and then one is chosen at random and will remain at that choice for every subsequent page load.
Examples
For example these could be used to define page_title for each type:
- Article
- Single {$title}
- Multi {$channel} channel
- Dating
- Single {$name} from {$city}, {$country}|{$name}
- Multi dating {$country}{$city}{$site}
- Videos
- Single {$title} {$tags} {$category} {$mode}
- Multi {$tags} {$category} {$mode} videos
- Webcams
- Single {$name} model from {$site}|sexy {$age} year old {$name} camgirl
- Multi {$niche}{$site} webcams|sexy {$niche}{$site} cams
To use this new variable in your templates you would use:
- Smarty: {$page_title}
- PHP: zestoi_val('page_title')
- PCT: %%page_title%% or %%PAGE_TITLE%%
Capitalization
The custom tags do not support full Smarty syntax - only basic variable substitution, but also has a method for capitalization by simply capitalizing the variable. e.g: for the "all-online" webcams niche:
- {$niche} results in "all online"
- {$Niche} results in "All Online"
- {$NICHE} results in "ALL ONLINE"
Functions
Two new functions have been added, though will only need to be called explicitely in rare circumstances:
- zestoi_expand_customtags() which sets any custom tags you have defined based on the current URL and decoded data. Automatically called unless you are using a custom page where you have set the URL type to be "none".
- zestoi_get_customtags() which returns (or sets to a variable if you use the Smarty equivalelent of {customtags var=myvar}) an array() of all the custom tags you have defined via the web interface.
Articles/RSS Feeds
To move the articles more inline with the rest of the plugins the following changes have been made:
- The urlconfig types of feed and article have been replaced by the single articles type. There is no need to update your urlconfig, the new code is triggered from the old types.
- The old menu options under Settings > RSS Feeder have been moved to Settings > Articles
- New menu options Settings > Articles > Edit Settings that contains options for
- Default Feed Template (the old feed type)
- Default Article Template (the old article type)
- Max Articles - to display in a page
- Use UL Tags - to use UL/LI tags etc in a list of articles. default is to not wrap these tags.
- New cron: php cron.php -m articles to process the rssfeeds (and more article related things in the future). The rssimporter can still be run via php cron.php -m rssfeeder if needed
- Extra option Publish Immediately available for each RSS feed to allow items to be added but not published. They can then be manually editted and/or published via the article editor or published via the zestoi.php CLI.
- The new Custom Tags functionality can also be specified for each Channel via Settings > Articles > List Channels
- You can now delete a Channel and all articles in it from the new List Channels page.
Webcams
- The new Custom Tags functionality can also be specified for each individual webcams niche that you create. Edit any niche via Settings > Webcams > List Niches and clicking on a niche.
- A new option of max_models arg for the camworld feed to limit how many models are requested per cron run as with other feeds that support it.
- more intelligent algorithm for calculating number of online for niches
New Variable $URL
- Decoded args from the current page URL are no longer avaiable via {$channel} etc in a url like /blog/%channel%/%page% though {$page} is the one exception and still is
- If you want to access data from the URL you now need to explicitely use the new variable $URL like {$URL.args.channel}
- This is due to data like $channel previously overwriting data from the current blog item etc, where a blog item can have multiple channels
- You can still also access the content of $URL by the functions zestoi_decode_url() and {decode_url}
Query Args now Decoded from URL
- It was always ticky to easily paginate from a search page, so now the url args like ?hair_color=blonde are included as part of the decode for defining the content to be displayed
- This now means that this url config rule:
/category/%niche%/%page%
- Will match the following URL:
/category/girls/?age=18..22&hair_color=blonde
- Filtering the content to only display ages between 18 and 22 and hair color of blonde. For pagination the value of {$URL.page_nav_url} will be set to
/category/girls/%page%?age=18..22&hair_color=blonde
- Smarty {expand_url template=$URL.page_nav_url page=$pagenum}
- PHP zestoi_expand_url($URL['page_nav_url'], "page=$pagenum")
- PHP zestoi_expand_url($URL['page_nav_url'], array('page' => $pagenum))
Cron
- A new cron task has been added that optimizes all the zestoi database tables. Running this cron task every 24hrs should be enough.
- To run this cron use the command:
php cron.php -m optimize
- Click on Help in your admin panel to get the exact code for your crontab. It should look something like this, which will run the task at midnight each day.
0 0 * * * cd /path/to/zestoi/bin && php cron.php -m optimize
New URL Config Tester
Often in a complicated setup with many different plugins enabled (webcams, videos, dating, articles) it can be difficult to understand why the page you expected to load doesn't. To rectify this we have added a url config tester linked to from the main url config page Settings > URL Config.
It allows you to enter a URL from your main zestoi site and it will test against each rule you have defined and show you the content that will be decoded/displayed for that URL.
Example:
Testing URL: /category/girls/4
Checking Rule 1: blog_channel = /feed/%channel%/%page%
Checking Rule 2: webcams_niche = /category/%niche%/%page%
The URL Matches Rule 2! Zestoi will decode/display webcams for this page
Setting {$niche} to 'girls'
Setting {$page} to '4'
We have some extra-args for this Rule:
Setting {$status} = !offline
We have some query args to add:
Setting {$hair_color} = blonde
Config Export
From Settings > URL Config page you can now save all the settings so they can be reimported later on.
By default it will save to settings.txt in your current theme dir but can be changed to save anywhere under the themes directory.
The URL Config can be saved either in a format so that the new site loads exactly what you saved, or alternately in a format that will attempt to add/merge/update entries on the new site so you don't lose the order of the items and any extra entries when loaded.
You can also choose to save the settings for articles, dating, videos and webcams as well as youyr Custom Tags.
Misc
- New function zestoi_have_module('webcams') and the smarty {have_module name='webcams'} to allow new themes to be developed that contain content for all modules while still looking good with only the modules that a user has installed. The full list of modules (that affect web display directly) is now:
- articles
- dating
- videos
- webcams
9/2/2011
General
Set default vals for important global settings data if missing when loading the global settings page (some old sites have some fields missing due to an old bug that has since been fixed)
The paths being searched for no first install for some executables was incorrect - which has been fixed.
New function zestoi_list_vals() (and 'list_vals' for smarty) to access all the values in the database for a particular field. e.g:
$hair_colors = zestoi_list_vals('webcams', 'hair_color');
These values can then be used to display a tag cloud or use for an advanced search form as shown here for the dating plugin on the wiki.
Webcams
The photos array was not being set correctly and so no photos after the first one were being displayed. This bug seems to have been introduced recently.
The Livejasmin feed was incorrectly requesting 5 photos per model. This version now requests all models and then creates the URL's to each photo a model has. See this thread for more info http://board.awempire.com/showthread.php?t=11553
New webcam feed for camworld from datecamcash - though currently their feed contains models who are both online and some offline - so waiting for a response to fix this. You can reduce the number of models to request in the feed - which should remove some offline ones.
Articles
It now supports the 'more' (html comment) tag used by wordpress to break an article into an excerpt and the full contents. When used $excerpt (or zestoi_val('excerpt') etc) will contain the summary while $body will still contain the full contents. If the tag is not used then $excerpt will be the same as $body.
See here for an example.
Dating
A new plugin that currently supports feeds from anastasia.com, fiance.com and elenasmodels. See a demo here datingcamgirls.com
15/1/2011
A minor update but an important one if you have upgraded to 1.2.0 already. This fixes an issue with the webcams counts of online models that can cause the webpage to not display. The issue has not been seen in any version prior to 1.2.0, though the webcams counts code was added in 1.1.1.
See the full 1.2.0 release not here.
3/1/2011
Upgrade Notes
- Unzip/Copy the files over your current install
- Go to Settings > Site Settings and click Save
- Go to Settings > Webcams > Edit Defaults and click Save (if you have the Webcams plugin)
Updates
- template anti-tamper code
- new videos/tube module
- added new site settings: rpc_key, template_key, maintenance_redirect_url, tmpl_checksums_enabled
- add videos as urlconfig type
- add date picker jquery lib to admin header and add template checksums menu options
- add template checksum status to template list
- add videos overview status to overview admin page
- calculate all matched rows in search() by using SQL_CALC_FOUND_ROWS and store in $this->total_matches = $total_matches
- append default sort of 'id DESC' to search() after 'publishedon DESC'
- changed error message to 'unable to find document' in extract()
- in add() add default values for any required key if not present
- new arg to sql functions to optionally disable caching
- add calls to Zestoi::check_template_checksum() to template rendering functions
- new funcs display_syndication(), array2url() and remove_diacritics()
- print same format to stdout as log file in syslog()
- get_urlconfig() will now display syndication feed and terminate if a matching url is requested
- new function get_urlconfig_rule()
- don't list dotfiles in list_templates() and list_theme_templates()
- getopt() now dies if a needed param is missing
- new template checksum functions
- new smarty modifier {remove_diacritics}
- new smarty function {url_encode}
- new zestoi public func zestoi_url_encode()
- new defines ZLIBM, ZTHEMES, ZTENMPLATES
- new templates for outbound syndication feeds
- new htaccess files to prevent direct file access to themes/templates
- allow skip param to be passed directly into feed instead of page param
- functional change: webcams cron no longer run as part of main cron
- prevent call_user_func from being called when the plugin is not loaded
- added needed urlconfig video entries
- added VAL_NOMATCH_ADD_KEYVAL option for theme settings files
- urlconfig keys are reindexed on save
- new videos zestoi call {videos_related} and new id_list parameter to 'videos'
- ZestoiMeta::set() can now also accept an array()
- new smarty function {template}
- replaced call to ZestoiRender::transform_smarty_template() with new zestoi_template() in smarty2php.pl
- the get-from-title button floated down to the next line in the article editor
- log file pruner to keep log files at no more than 100 entries
- new function zestoi_time_ago() and smarty plugin called {time_ago} to create strings from a timestamp like "3 minutes ago"
- dont try and call webcams and videos overview pages if they are not installed
- custom fields not being saved by the article editor
- custom fields not being rendered for articles
- display current server time in logs pages
- decode new tags field from xlovecam into the kinky_attribs field
- initial checkin of new webcams_tube theme
- also check for a theme file called MODULE_index.* or MODULE_single.* based on how many we find
- bug in videos rendering causing sub templates in smarty nuking vals in the higher level one
- only list non-empty channels in list channels
- allow a url-type set of args to be passed to url_encode as well as a php array
- call zestoi_setvals() from within zestoi to set vals instead of doing so directly
- prepend 'empty' channel name for use in the admin menus due to change to list_channels()
- don't allow install.php or zestoi.php to be run via a web browser
- add code to search for config.php from install.php
- added videos_tag urlconfig type to install code
- decode_url() now calls urldecode() instead of htmlspecialchars()
- output meaningful message if unable to locate php template
- add check for webcams_single into themes functions.php file (if exists) but leave webcams_profile check in
- update theme settings files to rename webcams_profile to webcams_single
- fixed bug in livejasmin webcams feed where fewer models were found in 'lite' mode
- function zestoi_config() now only ever returns a single item, use zestoi_configs() to return more than one
- dont allow spaces in channel names - rssfeeder
- new webcams and videos option to not use table code for grid layouts
- new code to remove non-printable characters from webcam feeds to prevent xml parsing errors
- return empty array, not die(), if attempting to extract a doc that doesn't exist
- use internal http request function where file_get_contents() had been used, so we can attempt various methods (curl etc) to get a page over http
5/9/2010
New Smarty Extensions
In general a smarty function now exists with the same name as the php zestoi function minus the zestoi_ prefix.e.g: the smarty {select_result} is the same as the php function zestoi_select_result().
unless the function is purely to set data, like {setval} then the extension will output the data unless a val= parameter is provided; in which case that variable will be set.
- {expand_url template="/%site%/%seoname%.html" site=livejasmin seoname=SexyGirl} will output the url in place
- {expand_url template="/%site%/%seoname%.html" site=livejasmin seoname=SexyGirl var=my_url} will assign the url to {$my_url}
Use the argument '_args' if you have an array that represents the args,
Example:
{foreach from=$webcams_results item=model}
{expand_url template=/%site%/%seoname%.html _args=$model}
{/foreach}
Function List
{append_results} {config} {configs} {select_result} {results} {vals} {val} {setval} {decode_url} {urlconfig} {list_channels} {expand_url} {ucfirst_sentence} {article} {feed} {webcams}
the {webcams} extension has changed from 1.1.2 in that it will display the grid *unless* the var= parameter is provided, print= is left in for compatibility with the php version of the extension/function
documentation to follow
31/8/2010
- write htaccess on changing theme and map /theme/ to the current theme dir
- * allows a theme file to refer to urls like /theme/style.css etc to pick up files from the chosen theme
- * only the zestoi content in the htaccess file is changed, i.e: between "## BEGIN Zestoi" and "## END Zestoi"
- create robots.txt file on setup that references the sitemap file
- new function zestoi_results() that returns an array of all models data from the current search
this can then be looped round within php code like the smarty example below instead of using a combination of zestoi_select_result() and zestoi_vals() or zestoi_val() example: $models = zestoi_results('webcams')
- new smarty extension {webcams} for displaying webcams (will be extended to other plugins)
- * passing in print=1 will display the data inline ala
- * a new parameter 'max' has been added that can be used instead of rows+cols (also works via php call to zestoi('webcams', 'max=10') etc
- * new parameter 'var' to select the name of the data set by {webcams}
- ** if the parameter 'var' is not passed into the {webcams} smarty function (as is the case when the data is automatically built based on
the current page urlconfig rules) the data can still be accessed as $webcams_multi
Bugfix
- call to zestoi_config() at end of webcams cron should be zestoi_configs() else causes error when only a single sponsor used
Smarty Examples
- select and display data using an external template which will be used to render each grid element:
{webcams gender=female status=!offline print=1 template=webcams_grid.tpl rows=2 cols=5 print=1}
- select/extract data and then loop round within the template itself (like tgpx):
{* select the data we want, but don't print it yet *}
{webcams gender=female status=!offline max=15 var=my_grid}
{* loop round the cells *}
{foreach from=$my_grid item=model name=grid}
{* model link *}
{$model.link|htmlspecialchars}
{* model photo *}
{$model.photo|htmlspecialchars}
{/foreach}
28/8/2010
- new function to access number of online and totals for each niche and site - zestoi_webcams_online_counts()
- array key 'online' contains online counts and 'total' contains all models count
- totals are calculated at the end of the cron run and cached so no impact on page load times
- zestoi_webcams_online_counts() returns all counts
- zestoi_webcams_online_counts('all-online') returns counts for the all-online niche
- zestoi_webcams_online_counts('all-online', 'online') returns just the number of online models for the all-online niche
- new function zestoi_webcams_niches() that includes online and total counts
- new function zestoi_webcams_sites() that includes online and total counts
- default theme 'webcams' now uses these new functions to display online counts (not totals)
21/8/2010
- new function zestoi_append_results(type, query) for use in .tgp template format to ensure enough data to fill the grid
- * example: zestoi_append_results('webcams', 'gender=female')
- remove use of $site as loop variable in webcams_pink/header.pct since this overwrites the name of the current site (this caused incorrect livefeed to load in 1.1.0)
- make sure all global variables from webapp.php are made available as global from a php (php/pct/tgp) template
- make loop code more readable in webcams_pink theme
- increase width of table/box for displaying required crontab entries
- suppress warning if themes settings.txt file does not exist
- remove error when zestoi_select_result() is called with an array index out of bounds
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
8/8/2010
- allow custom keywords to be searched in free form text fields when defining a niche. this allows for example an 'eastern european' niche by searching for 'russia ukraine poland moldova' etc in addition to the regular niche search parameters.
- convert any non-apha to white space before performing niche keyword search
25/7/2010
- remove hardcoded prefix of zestoi_ from sql in bin/webapp.php for search
25/7/2010
- remove hardcoded prefix of zestoi_ from sql in webcams module for niche edit
21/7/2010
- allow QueryID to be specified for sexier.com feed
11/7/2010
- add template=rssitem.tpl to urlconfig for blog posts
- make the all-online niche default in the home.php theme file
- xml feed error handler not working correctly
- add syslog::warning calls in the awe decoder to track transient http errors
- incorrectly used 'value' instead of 'content' in the meta tags in themes/webcams/header.php
6/7/2010
- the value of {$link} was not correctly flipping to {$profile_url} when the model was offline
4/7/2010
- allow theme to define a page to load whos name matches the name in the urlconfig entries
30/6/2010
- remove privatecamz feed - url and format has changed
- missing DIRSEP after info in config.php
- Do not allow setup to run while config.php exists
- Include popt.php from config to allow for external scripts to be used more easily
23/6/2010
- remove hardcoded xlc_idc var from xlovecam decoder
23/6/2010
-
use zestoi_ucfirst_sentence to prettify the sponsor names
22/6/2010
- webcams feeds error handling state not being displayed in form - missing php tags
- remove incorrect commit - xlovecam specific iframe
- webcams sitemap not working when num models less than chunk size
- some models have breats bigger than 99cm....
- wasnt showing blogs when only 1 channel existed
- new admin option to keep models online if a XML feed fails
- tweaks to sidebar.php
- make bare.tpl have a white bg and 100% width
- if the site for the current model has been delete then skip the model, stop an error being output, the model will be deleted on next cron run anyway
- check to update/refresh photos was incorrect
- sql to delete webcam feeds we incorrect when none exsted anymore
- misc xlovecam tweaks
- add zestoi version to overview page
- allow cache to be dyanmically disabled
- force search to not be cached and search model names
- force cams.com feeds to be in english
- added xlovecam xml feed
- add link to live site from overview page
- ensure we are being installed into a subdir called zestoi
- missing %page% from blog_channel urlconfig item