4images Help / Hilfe > Bug Fixes & Patches
[1.7.7 - 1.7.9] {categories},{details},{index},{lightbox},etc tags don't work
V@no:
Since v1.7.7 4images supports conditional tags that can be used to display/hide content depend on which page is opened:
--- 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.
--- End quote ---
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 :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: ---{if page_details}this is details.php page{endif page_details}
--- End code ---
Or you can display text on all pages except register.php:
--- Code: ---{ifno page_register}this is not register.php page{endifno page_register}
--- End code ---
x23piracy:
Hi,
is this working for you?
I've done the change for 1.7.9 but the tag is ignored.
Greetz X23
V@no:
If you referring to the code you showed (I merged your reply to your original topic), then it's the other tags that not being showed, because they are not registered yet when header.html is parsed. Simply put, you cannot use every tag that available in main template in header.html
To confirm that this fix works, try this:
--- Code: ---{if lightbox}this only visible at lightbox page{endif lightbox}
--- End code ---
x23piracy:
--- Quote from: V@no on November 21, 2010, 09:12:01 PM ---
--- Code: ---{if lightbox}this only visible at lightbox page{endif lightbox}
--- End code ---
--- End quote ---
Hi,
i pasted your code above for testing if tag works into my lightbox.html template file
but the text is not visible if im on the lightbox page.
Hmm...
Greetz X23
V@no:
Oh, missed another line in lightbox.php
I've updated original post. Sorry about that.
Navigation
[0] Message Index
[#] Next page
Go to full version