4images Forum & Community

4images Help / Hilfe => Bug Fixes & Patches => Topic started by: V@no on November 20, 2010, 06:58:39 PM

Title: [1.7.7 - 1.7.9] {categories},{details},{index},{lightbox},etc tags don't work
Post by: V@no 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:
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}
Title: Re: [1.7.7 - 1.7.9] {lightbox} tag not registered
Post by: x23piracy 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
Title: Re: [1.7.7 - 1.7.9] {lightbox} tag not registered
Post by: V@no 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}
Title: Re: [1.7.7 - 1.7.9] {lightbox} tag not registered
Post by: x23piracy 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
Title: Re: [1.7.7 - 1.7.9] {lightbox} tag not registered
Post by: V@no on November 21, 2010, 10:52:11 PM
Oh, missed another line in lightbox.php
I've updated original post. Sorry about that.
Title: Re: [1.7.7 - 1.7.9] {lightbox} tag not registered
Post by: x23piracy 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
Title: Re: [1.7.7 - 1.7.9] {lightbox} tag not registered
Post by: V@no 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
Title: Re: [1.7.7 - 1.7.9] {lightbox} tag not registered
Post by: x23piracy 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
Title: Re: [1.7.7 - 1.7.9] {categories},{details},{index},{lightbox},etc tags don't work
Post by: V@no on November 28, 2010, 08:54:43 PM
You are correct. This bug turned out to be bigger then originally thought...

I've renamed this topic and updated the instructions.
Title: Re: [1.7.7 - 1.7.9] {categories},{details},{index},{lightbox},etc tags don't work
Post by: x23piracy on November 28, 2010, 09:18:31 PM
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 (http://www.4homepages.de/forum/index.php?topic=28296.0)


Greetz X23
Title: Òóðèçì
Post by: WilliamRU on October 24, 2011, 03:04:46 PM
Ìîãó ÿ ó Âàñ ñïðîñèòü?
Title: Re: [1.7.7 - 1.7.9] {categories},{details},{index},{lightbox},etc tags don't work
Post by: V@no on October 24, 2011, 03:25:33 PM
Ìîãó ÿ ó Âàñ ñïðîñèòü?
Нет,  не можете, а вот что вы можете - так это получить бан за спам, который также будет распространён на тысячи других форумах.
Первое и последнее предупреждение. Будем продолжать?
Title: Re: [1.7.7 - 1.7.9] {categories},{details},{index},{lightbox},etc tags don't work
Post by: paule on March 25, 2013, 08:13:15 PM
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

Title: Re: [1.7.7 - 1.7.9] {categories},{details},{index},{lightbox},etc tags don't work
Post by: Rembrandt on March 26, 2013, 07:10:49 AM
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
Title: Re: [1.7.7 - 1.7.9] {categories},{details},{index},{lightbox},etc tags don't work
Post by: paule on March 26, 2013, 01:25:02 PM
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


Title: Re: [1.7.7 - 1.7.9] {categories},{details},{index},{lightbox},etc tags don't work
Post by: Rembrandt on March 26, 2013, 01:54:17 PM
alles was du in der page_header machst, wird in deinen templates funktionieren.
wenn es mehr wird würde ich an deiner stelle zugehörige php seiten erstellen.
http://www.4homepages.de/forum/index.php?topic=28819.0

mfg Andi
Title: Re: [1.7.7 - 1.7.9] {categories},{details},{index},{lightbox},etc tags don't work
Post by: paule on March 27, 2013, 04:41:08 PM
Hi,

danke für die Antwort.
Habe alle Seiten als xxx.php erstellt.
Dann an entsprechender Stelle neben dem vorhandenen: {page_categories} {page_details} {page_index}
folgendes geschrieben {page_agb} {page_reise} {page_impressum}

Im page_header funktioniert aber nur {if page_index}- Home{endif page_index}
......aber {if page_reise}- {Reise}{endif page_reise} funktioniert nicht. (if und endif scheint nicht zu funktioieren)  "- Reise" wird bei allen Seiten im Titel dargestellt.

gruß paule
Title: Re: [1.7.7 - 1.7.9] {categories},{details},{index},{lightbox},etc tags don't work
Post by: Rembrandt on March 27, 2013, 05:39:07 PM
.........aber {if page_reise}- {Reise}{endif page_reise} funktioniert nicht. (if und endif scheint nicht zu funktioieren)  "- Reise" wird bei allen Seiten im Titel dargestellt.
...
Du mußt dafür sorgen das die variable "page_reise" wenn sie nicht gebraucht wird, leer ist.
Schau dir das mal an, vielleicht hilft dir das weiter:
http://www.4homepages.de/forum/index.php?topic=28819.msg154776#msg154776

mfg Andi
Title: Re: [1.7.7 - 1.7.9] {categories},{details},{index},{lightbox},etc tags don't work
Post by: paule on March 28, 2013, 03:48:41 PM
Hallo Andi,

wieder einmal vielen Dank!!!!

Es funktioniert alles.
Ein Groß-Kleinschreibfehler war wohl das Problem.

Gruß paule