4images Forum & Community

4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: nyiguinyogui on November 28, 2005, 05:24:51 PM

Title: $site_sess variable in footer
Post by: nyiguinyogui on November 28, 2005, 05:24:51 PM
Hello,

In my footer.html I need to use the $site_sess variable but, while it is set in header.html, it seems empty in footer.html.

For example, this code:
Code: [Select]
<? if ($site_sess->user_info['user_level']==ADMIN) { ?>
you are admin
<? } ?>
would work ok in header.html but not in footer.html, as the variable $site_sess seems to be unset.

Can anybody please tell me how to "propagate" this variable, $site_sess, so that it can be used from within footer.html?

Thank you.
Title: Re: $site_sess variable in footer
Post by: V@no on November 29, 2005, 02:25:01 AM
if the user level is only what you need you can use {if is_admin} {endif is_admin} tags

Otherwise, you'll need add
Code: [Select]
<?php
global $site_sess;
?>
Title: Re: $site_sess variable in footer
Post by: nyiguinyogui on November 29, 2005, 09:15:26 AM
Thanks a lot V@no. This is exactly what I needed.

I had been trying to get this by touching page_header.php and didn't get it.
So, now I am curious to know which lines in the code are responsible for the fact that $site_sess is set within header.html.

Thank you.
Title: Re: $site_sess variable in footer
Post by: V@no on November 29, 2005, 02:43:45 PM
none...I dont know why it worked for you in header.html :?
Title: Re: $site_sess variable in footer
Post by: nyiguinyogui on December 02, 2005, 10:30:33 AM
Well, since I installed 4images some months ago, I have been touching the code here and there so that it fits my needs. I installed some mods from the forum, but also did developments on my own for very specific needs.
So, according to what you say, I presume I probably managed to get site_sess readable from header.html (which, I am conscious about it, may lead to a security problem).
Regards.