Author Topic: Tags {if ..} / {endif ..} dont work in footer.html ?  (Read 3828 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
Tags {if ..} / {endif ..} dont work in footer.html ?
« on: January 18, 2003, 02:44:33 AM »
how come?
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 Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Tags {if ..} / {endif ..} dont work in footer.html ?
« Reply #1 on: January 18, 2003, 05:04:35 PM »
Can you give a more specific example?

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

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
Tags {if ..} / {endif ..} dont work in footer.html ?
« Reply #2 on: January 18, 2003, 09:29:37 PM »
well, for example, I use home.html template for error handling.
so, I use
Quote
{if error} blah blah blah {endif error}

to display error messages ( http://come.no-ip.com/blah http://come.no-ip.com/data )
so, as u can see it works ok in the "body" of the page, but when I add same condition to footer.html it just ignores it and displays normal.
I asume that footer.html template generates before the main script (in the example case - index.php) fully executed.
I even tryed delete
Code: [Select]
include(ROOT_PATH.'includes/page_footer.php');
- still footer.html displays.
maybe also that why this happens? :
http://4homepages.de/forum/viewtopic.php?t=2549&highlight=count*+twice
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 Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Tags {if ..} / {endif ..} dont work in footer.html ?
« Reply #3 on: January 20, 2003, 01:56:53 PM »
This is the part in includes/page_header.php where the header and footer is parsed.
Code: [Select]
//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if (isset($main_template) && $main_template) {
  $header = $site_template->parse_template("header");
  $footer = $site_template->parse_template("footer");
  $site_template->register_vars(array(
    "header" => $header,
    "footer" => $footer
  ));
  unset($header);
  unset($footer);
}

You can try to move this part to includes/page_footer.php

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

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
Tags {if ..} / {endif ..} dont work in footer.html ?
« Reply #4 on: January 20, 2003, 10:06:39 PM »
Thx, Jan!
well, it didnt quet worked, because footer.php files execute after template created and printed. but now I just can add footer parse in the main file where I need it.
thx again, it solved now  :D
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)