Hi,
I have a pretty simple question but don't really know how to answer it. I want to display ads on my forum to non-members only, but am not sure of the correct conditional (if) statement to use here.
Cheers for the help!
if(!$user){
display ad
}
you have to place that after
$user = $userob -> authenticate......
Thanks for that.
Am I correct in saying that there is no way to have *conditional code* in the 'header' HTML include available from the admin control panel?
In other words, if I want a different header for members and non-members then I should simply edit the ubbthreads.php file and replace the following line with my conditional code?
$html -> send_header($config['title'],$Cat,0,$user);
Also, I think this is probably a stupid question, but how do I actually get stuff to be output to the resulting file that is sent to users' browsers? Is it using the $html variable? If so, then how would I print 'Hello' only to non-members?
Actually you want to put it into the template file, not the php file itself.
Cheers,
Is there any way that I can show a different header to members and non-members? I really don't want to have to edit every template file there is, as this will only cause problems down the track.
This is extremely important, as my current members would not put up with ads, but I have 10 times as many non-members as members, and need them to start seeing some advertisements.
>Is there any way that I can show a different header to members and non-members?
I don't know.
> I really don't want to have to edit every template file there is
There really are only a few relevant ones.
ubbthreads.tmpl
postlist.tmpl
showflat.tmpl
showthreaded.tmpl
actually if you want to show a different header to users that say have $user[U_Number] and a nonmember who doesn't.. then throw the code in the ubbt.inc.php in the send_header function...I mean you can put conditional if's into it so that if a $user[U_Number] is detected this happens... and if not then this happens.. just expand the already present capabilites of it