View Full Version : [Condition] Different picture for guest and for members
cclaerhout
08-30-2004, 10:29 PM
Hello,
I'd like to create a different menu for guests, and another one for members. I don't use the navbar, so i'v created my own buttons.
The problem is that i don't manage to make working the
<if condition="!$bbuserinfo['userid']"> in the adv_portal template.
Let's take an easier exemple :
I write down this in the adv_portal template, just after "$navbar" :
<if condition="!$bbuserinfo['userid']">
test <else> test 2 </if>
If it's a guest, i should see "test 2" printed on the screen and if it's a member, i should see "test 1". That isn't what happens. Both are printed...
That's the same thing for my pictures included in table form.
Can someone help me ?
KW802
08-30-2004, 11:04 PM
You missed a slash after the 'else' tag. Also just realized that you have an exclamation point in your 'if' tag that shouldn't be there. Try.... <if condition="$bbuserinfo[userid]">
test
<else />
test 2
</if>
cclaerhout
08-31-2004, 03:47 AM
Thank you to have answer me so quick. But there's still a problem.
When i'm a ghest, i see "test 2" ; When i'm a member, i see also "test 2" :-(
cclaerhout
08-31-2004, 06:24 AM
Well, i've been to Vbulletin.com website to see how using
Template Conditionals . (http://www.vbulletin.com/docs/html/main/template_conditionals)
I try this code, putting it juste behind the $navbar variable in adv_portal template :
<if condition="$bbuserinfo['userid'] == 0">
<p>Welcome to the forum!<br />
If this is your first visit, we hope you enjoy your stay!</p>
<else />
<p>Welcome back, $bbuserinfo[username].<br />
<a href="search.php?do=getnew">Click here to view new posts</a>.
</if>
And... It still doesn't work :confused:
I've always seen "If this is your first visit, we hope you enjoy your stay!", even if i'm connected.
cclaerhout
08-31-2004, 08:01 AM
Glups... When i insert the code in a new template connected to a new module, it's working. Is there something to do to make it working in the adv_portal template ? Otherwise i couldn't use my own buttons (just behind my header) :(
Maybe you haven't got vba_cmps_include_bottom with bbuserinfo being defined..
cclaerhout
08-31-2004, 08:19 AM
Maybe you haven't got vba_cmps_include_bottom with bbuserinfo being defined..
Thanks Kall,
I've edited the file and it seems to work... I cross my fingers.
I've just "$bbuserinfo" in the ## Function to Print The Page Out ## of the vba_cmps_include_bottom php file.
// ######################### Function to Print The Page Out ##########################
function print_portal_output(&$cmpsoutput, $nonindex = false)
{
global $pages, $stylevar, $headinclude, $header, $footer, $vboptions, $vba_options, $navbar, $cusid, $_REQUEST, $bbuserinfo;
I'm really bad in programmation.
*******EDIT*******
Everything is working now. Great thanks !!!
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.