Hi, I'd like to know how to do the following inside the profile template... If it's possible that is.
I'd like to check the username of the profile I'm viewing, so it'd be the equivalent of...
if ($username == "WhateverISet"){ Then execute my code here }
Can this be achieved?
Thanks.
There should be another = like this;
<if $mybb->user['postnum'] == "50" then>Anything that goes here would be only view able by users with 50 posts or above.</if>
(2011-12-02, 04:56 AM)crazy4cs Wrote: [ -> ]Use this: http://community.mybb.com/thread-31860.html
An example of using it can be:
<if $mybb->user['postnum'] = "50" then>Anything that goes here would be only view able by users with 50 posts or above.</if>
(2011-12-02, 10:15 AM)Yaldaram Wrote: [ -> ]There should be another = like this;
<if $mybb->user['postnum'] == "50" then>Anything that goes here would be only view able by users with 50 posts or above.</if>
You are using a '='/'==' symbol, not '>=' what is what you mentioned.
I know php operator "==" is "Equal" (like "===" is "Identical" etc.) but please to tell me what is the difference in this example between
<if $mybb->user['postnum'] = "50"
and
<if $mybb->user['postnum'] == "50"
?
Which is the correct version or when we can use "=" and when "==" ?
// Later Edit: I'm begginer
(2011-12-02, 10:15 AM)Yaldaram Wrote: [ -> ]There should be another = like this;
<if $mybb->user['postnum'] == "50" then>Anything that goes here would be only view able by users with 50 posts or above.</if>
Sorry, one missed. Yes there should be two equal-to's in the statement.
(2011-12-02, 03:49 AM)networkforfun Wrote: [ -> ]Hi, I'd like to know how to do the following inside the profile template... If it's possible that is.
I'd like to check the username of the profile I'm viewing, so it'd be the equivalent of...
if ($username == "WhateverISet"){ Then execute my code here }
Can this be achieved?
Thanks.
If you use
PHP in Templates / Complex Templates or
Template Conditionals plugin:
<if $memprofile['username'] == 'blah' then>
Your code here will be displayed if the profile owner's username is blah
</if>