Log in

View Full Version : vbcode problem


Pagandream
03-28-2006, 06:43 PM
Hi!

I really need help!

I have make a vbcode that shows guest a picture and members a text. But it doesn't work, it always show both the pic and the text.

Here is the code:

<if condition="$show['guest']">
<img src="images/sorry.gif" alt="Sorry" width="120" height="120" border="0" />
<else />
{param}
</if>

Is there anything wrong? Or is there a hack that make this?

Thanks!

Zachery
03-28-2006, 07:24 PM
I'd guess $show[guest] isn't valid... you aren't trying to put this into the custom bbcode settings are you? By default conditionals don't work there, I believe Marco made a hack to change thiws.

Freesteyelz
03-28-2006, 07:32 PM
Let's say you want the code to show up in Member's Info or Postbit replace:


<if condition="$show['guest']">


With


<if condition="is_member_of($bbuserinfo, 1)">


Change "1" to the Usergroup ID for unregistered (guests). There are different conditionals to achieve what you want and this is just one example.

Zachery
03-28-2006, 07:44 PM
You are basicly doing the same coditional though, just checking a differnt way

the easiest way, is <if condition="$bbuserinfo[userid]"> If a users id is not valid, they are a guest. However, as I pointed out, if he is trying to do this in certain tempaltes, or the custom bbcode sertings, he doesn't have access to $bbuserinfo, or possibly any of the $show varibles.

Freesteyelz
03-28-2006, 07:52 PM
You're right, Zachery. :) That was one of the other conditionals which would elimnate all but logged in users. I just have a habit of doing "array" because I add other Usergroups to it.

Pagandream
03-28-2006, 07:57 PM
you aren't trying to put this into the custom bbcode settings are you? By default conditionals don't work there, I believe Marco made a hack to change thiws.

Yep, I try to make custom bbcode. :(

Do you know where I can find the modification from marco?

Oh, <if condition="is_member_of($bbuserinfo, 1)"> and <if condition="$bbuserinfo[userid]"> dosen't work.

I searching now over 7 hours for a solutions of my problem....