Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Why this cannot work?

Quote Reply
Why this cannot work?
I use the code below:

Code:
<%if user_id ne current_user_id%>it's not your post<%endif%>
But it cannot work. It will show the sentence in his posts.
Quote Reply
Re: [backdream] Why this cannot work? In reply to
Hi,

Try <%if user_id ne $current_user_id%> ... <%endif%>.

You can use also: <%ifnot user_id eq $current_user_id%> ... <%endifnot%>

François Smile
Quote Reply
Re: [Franco] Why this cannot work? In reply to
The problem is that you are using 'eq', where you should be using '==' (without the quotation marks).

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [Franco] Why this cannot work? In reply to
In Reply To:
Hi,

Try <%if user_id ne $current_user_id%> ... <%endif%>.

You can use also: <%ifnot user_id eq $current_user_id%> ... <%endifnot%>
It's can do. But why add a $ to current_user_id?
Quote Reply
Re: [backdream] Why this cannot work? In reply to
You have to add a dollar sign ($) in front of the variable if it's on the right hand side of a comparison, i.e.

<%if a eq $b%>

or if it's an argument for a function call, i.e.
<%my_global($c)%>

Otherwise you can just leave the dollar sign away.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Why this cannot work? In reply to
Thanks, Where are the forum's documents to make plugin or somthing else?
Quote Reply
Re: [backdream] Why this cannot work? In reply to
In your forum admin, click "Help" and go to the table of contents. You will find a lot there, especially the "GT Module Documentation" section is very useful.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Why this cannot work? In reply to
It's good! Thank you very much!