How can I get PHP code into the template file?
I want to have a global user (phpbb) if statement to show or not to show a link, depending on if there logged in or not.
insert this into your template file:
{CUSTOM_HEADER}
where you want the php to appear.
stick this in your theme file just before // Displays a picture
:
function pageheader($section, $meta = '')
{
global $CONFIG, $THEME_DIR;
global $template_header, $lang_charset, $lang_text_dir;
if(empty($custom_header)){
Put your PHP CODE HERE
}
if this isn't clear enough try searching, it is explained in the docs too
Ok, so far so good, Thank you. But now how does CPG check if a user is logged in?
<?php
if( $userdata['session_logged_in'] )
{
echo('some code');
}
else{
echo('some code');
}
?>
search this forum for "universal login" or "login box"... something along those lines...this has been discussed before.
Found it, works like a charm. Thank you again..
The result is as follows:
<?php
if (USER_ID)
{
echo('some code');
}
else{
echo('some code');
}
?>