1
Bug Fixes & Patches / [1.7.7 - 1.7.9] {categories},{details},{index},{lightbox},etc tags don't work
« on: November 20, 2010, 06:58:39 PM »
Since v1.7.7 4images supports conditional tags that can be used to display/hide content depend on which page is opened:
The fix:
Open includes/page_header.php
Find:
4images v1.7.7
$list = array("categories", "details", "index", "member", "postcards", "register", "search", "top");
$array = array();
foreach ($list as $name)
{
$array[$name] = ($name == $file);
}
4images v1.7.8 - 1.7.9
$array = array(
"categories" => false,
"details" => false,
"index" => false,
"member" => false,
"postcards" => false,
"register" => false,
"search" => false,
"top" => false
);
if ( isset($array[$file]) ) {
$array[$file] = true;
}
Replace with:
$array = array(
"page_categories" => false,
"page_details" => false,
"page_index" => false,
"page_lightbox" => false,
"page_member" => false,
"page_postcards" => false,
"page_register" => false,
"page_search" => false,
"page_top" => false
);
if ( isset($array["page_" . $file]) ) {
$array["page_" . $file] = true;
}
4images v1.7.8 - 1.7.9
Open lightbox.php
Find:
define('ROOT_PATH', './');
Insert below :
define('MAIN_SCRIPT', __FILE__);
After these changes you can use in templates:
{page_categories}
{page_details}
{page_index}
{page_lightbox}
{page_member}
{page_postcards}
{page_register}
{page_search}
{page_top}
For example you can display text only on details.php page:
Or you can display text on all pages except register.php:
Quote from: changes in v1.7.6
- Added more conditional tags (categories, details,index, member, postcards, register, search, top) for using {if index}...{if index} for homepage, {if details}...{endif details} for details.php page, etc.On some pages these tags will not work "properly", because they are overwritten by other parts of the script.
The fix:
Open includes/page_header.php
Find:
4images v1.7.7
$list = array("categories", "details", "index", "member", "postcards", "register", "search", "top");
$array = array();
foreach ($list as $name)
{
$array[$name] = ($name == $file);
}
4images v1.7.8 - 1.7.9
$array = array(
"categories" => false,
"details" => false,
"index" => false,
"member" => false,
"postcards" => false,
"register" => false,
"search" => false,
"top" => false
);
if ( isset($array[$file]) ) {
$array[$file] = true;
}
Replace with:
$array = array(
"page_categories" => false,
"page_details" => false,
"page_index" => false,
"page_lightbox" => false,
"page_member" => false,
"page_postcards" => false,
"page_register" => false,
"page_search" => false,
"page_top" => false
);
if ( isset($array["page_" . $file]) ) {
$array["page_" . $file] = true;
}
4images v1.7.8 - 1.7.9
Open lightbox.php
Find:
define('ROOT_PATH', './');
Insert below :
define('MAIN_SCRIPT', __FILE__);
After these changes you can use in templates:
{page_categories}
{page_details}
{page_index}
{page_lightbox}
{page_member}
{page_postcards}
{page_register}
{page_search}
{page_top}
For example you can display text only on details.php page:
Code: [Select]
{if page_details}this is details.php page{endif page_details}
Or you can display text on all pages except register.php:
Code: [Select]
{ifno page_register}this is not register.php page{endifno page_register}