Author Topic: [1.7.7 - 1.7.9] {categories},{details},{index},{lightbox},etc tags don't work  (Read 71887 times)

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
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.
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: [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}
« Last Edit: November 28, 2010, 08:52:56 PM by V@no »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Re: [1.7.7 - 1.7.9] {lightbox} tag not registered
« Reply #1 on: November 21, 2010, 08:37:19 PM »
Hi,

is this working for you?
I've done the change for 1.7.9 but the tag is ignored.


Greetz X23

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [1.7.7 - 1.7.9] {lightbox} tag not registered
« Reply #2 on: November 21, 2010, 09:12:01 PM »
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: [Select]
{if lightbox}this only visible at lightbox page{endif lightbox}
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Re: [1.7.7 - 1.7.9] {lightbox} tag not registered
« Reply #3 on: November 21, 2010, 09:52:57 PM »
Code: [Select]
{if lightbox}this only visible at lightbox page{endif lightbox}

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

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [1.7.7 - 1.7.9] {lightbox} tag not registered
« Reply #4 on: November 21, 2010, 10:52:11 PM »
Oh, missed another line in lightbox.php
I've updated original post. Sorry about that.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Re: [1.7.7 - 1.7.9] {lightbox} tag not registered
« Reply #5 on: November 21, 2010, 11:20:14 PM »
Oh, missed another line in lightbox.php
I've updated original post. Sorry about that.

thx no problem the important thing is it's fixed  :thumbup:

Edit:

Hi,

is it possible that {if categories} is also not working? it has no effect for me (1.7.9)


Greetz X23
« Last Edit: November 28, 2010, 07:50:44 AM by x23piracy »

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [1.7.7 - 1.7.9] {lightbox} tag not registered
« Reply #6 on: November 28, 2010, 06:31:28 PM »
Did you upgrade to v1.7.9 or it's a fresh installation? It's working fine on fresh v1.7.9
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Re: [1.7.7 - 1.7.9] {lightbox} tag not registered
« Reply #7 on: November 28, 2010, 08:07:56 PM »
Did you upgrade to v1.7.9 or it's a fresh installation? It's working fine on fresh v1.7.9

Hi,

it's s freah installation, but here it's not working.


Greetz X23

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
You are correct. This bug turned out to be bigger then originally thought...

I've renamed this topic and updated the instructions.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
You are correct. This bug turned out to be bigger then originally thought...

I've renamed this topic and updated the instructions.

Hi,

i try telling things that are true  :mrgreen:
Hope to here again from you with the fix  :thumbup:

Maybe my define category as subcategorie or create them as those don't work problem is another courious bug?
(There is an own thread existing) http://www.4homepages.de/forum/index.php?topic=28296.0


Greetz X23

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

WilliamRU

  • Guest
Òóðèçì
« Reply #10 on: October 24, 2011, 03:04:46 PM »
Ìîãó ÿ ó Âàñ ñïðîñèòü?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Ìîãó ÿ ó Âàñ ñïðîñèòü?
Нет,  не можете, а вот что вы можете - так это получить бан за спам, который также будет распространён на тысячи других форумах.
Первое и последнее предупреждение. Будем продолжать?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline paule

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Hallo,

ich habe den code replaced (1.7.7).
{page_categories}
{page_details}
{page_index}
{page_lightbox}
{page_member}
{page_postcards}
{page_register}
{page_search}
{page_top} funktionieren perfekt.

Ich habe einige neue Templates : Sport, Reise, AGB, Impressum ......
Wie kann ich die neuen Seiten auf die selbe Weise einbinden?

www.kosecki.de

Gruß paule


Rembrandt

  • Guest
Hi!
...Ich habe einige neue Templates : Sport, Reise, AGB, Impressum ......
Wie kann ich die neuen Seiten auf die selbe Weise einbinden?
...
http://www.4homepages.de/forum/index.php?topic=4996.0

mfg Andi

Offline paule

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Hi,

ich glaube ich habe es nicht richtig erklärt was ich will....
Es geht um den Seitentitel-

mein Seitentitel im header.html:

<title>{site_name} {if page_lightbox}- {lang_lightbox}{endif page_lightbox} {if page_search}- {lang_new_images}{endif page_search} {if page_maincategories}- {Images_stories}{endif page_maincategories}{if page_categories}- {cat_name}{endif page_categories} {if page_details}- {cat_name} - {image_name}{endif page_details}</title>

Zeigt im Seitentitel: Seitenname - Datenbank oder Seitentitel - Leuchtkaten oder Seitentitel - Kategorie an.

Jetzt möchte ich auf dem gleichen Weg den Seitentitel der Seiten "Sport", "AGB", "Impressum" und so weiter darstellen.
Die Seiten werden mit <a href="<?=$site_sess->url(ROOT_PATH."index.php?template=AGB")?>">{AGB}</a> aufgerufen.

Kann das mit page_header.php - page_sport oder page_AGB funktionieren?

gruß paule