Previous Thread
Next Thread
Print Thread
Rate Thread
#285368 05/19/2005 6:14 PM
Joined: Mar 2004
Posts: 26
Junior Member
Junior Member
Offline
Joined: Mar 2004
Posts: 26
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!

Sponsored Links
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
if(!$user){
display ad
}

you have to place that after
$user = $userob -> authenticate......

Joined: Mar 2004
Posts: 26
Junior Member
Junior Member
Offline
Joined: Mar 2004
Posts: 26
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?

Last edited by chuckee; 05/20/2005 1:08 AM.
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
Actually you want to put it into the template file, not the php file itself.

Joined: Mar 2004
Posts: 26
Junior Member
Junior Member
Offline
Joined: Mar 2004
Posts: 26
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.

Sponsored Links
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
>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

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
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


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)