Log in

View Full Version : Is this If statement correct?


Injektilo
01-26-2006, 11:34 PM
<if condition="($show['member']) && ($post[postcount] = 0)">

is it correct? I want to show something "if the member viewing is a member and also if the member has 0 posts"

harmor19
01-26-2006, 11:38 PM
No need for parentheses.
<if condition="$bbuserinfo[userid] != 0">

Is saying "If the userid is not zero (zero is guest) show text"

Injektilo
01-26-2006, 11:42 PM
No need for parentheses.
<if condition="$bbuserinfo[userid] != 0">

Is saying "If the userid is not zero (zero is guest) show text"

not the userid. The user post count.

Let me rephrase. I want to show a message, If is a member and if postcount is equal to 0

Paul M
01-26-2006, 11:48 PM
You probably don't need the brackets round each condition, and I would use AND, not &&.

Injektilo
01-26-2006, 11:51 PM
You probably don't need the brackets round each condition, and I would use AND, not &&.


<if condition="$show['member'] AND $post[postcount] = 0"> ?

harmor19
01-26-2006, 11:58 PM
two equal signs

<if condition="$show['member'] AND $post[postcount] == 0">

Injektilo
01-27-2006, 12:00 AM
two equal signs

<if condition="$show['member'] AND $post[postcount] == 0">

i've tried this but the message still showing up for all members. and i want it to show only for 0 post members :(

Paul M
01-27-2006, 12:02 AM
Where are you actually putting this ?

Injektilo
01-27-2006, 12:04 AM
Where are you actually putting this ?


pm sent :)

Paul M
01-27-2006, 12:10 AM
You need to change $post[postcount] to $bbuserinfo[posts] .

Injektilo
01-27-2006, 12:12 AM
You need to change $post[postcount] to $bbuserinfo[posts] .


thanks man ! :) i really appreciate this