Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 If profilefieldid exist show//ifusergroup is
Glas Offline
Member
***
Posts: 106
Joined: Jul 2010
Post: #1
If profilefieldid exist show//ifusergroup is
Hi guys, i've tried this two methods

neither work (actually work, displays for ALL USERS in the thread), it need it displays for all users of course but that only displays on X user/usergroup/user (who has X FID edited) postbit_classic

i need that only the user who has the custom thread field or is in the group has it



Code:
<if $mybb->user['usergroup'] = 36 then>
Nivel de Paltosidad<img src="http://www.beatdj.net/foros/images/palta.png" />: 99%
</if>


Code:
<if $userfields['fid22'] then>Nivel de Paltosidad<img src="http://www.beatdj.net/foros/images/palta.png" />: 99%</if>

<br>




Code:
<if $GLOBALS['mybb']->user['usergroup'] == 36 then>
Nivel de Paltosidad<img src="http://www.beatdj.net/foros/images/palta.png" />: 99%
</if>


I would really appreciate some help with this =(

(This post was last modified: 04-03-2013 02:49 PM by Glas.)
04-03-2013 02:35 PM
Find all posts by this user Quote this message in a reply
Seabody Offline
Member
***
Posts: 54
Joined: Aug 2012
Post: #2
RE: If profilefieldid exist show//ifusergroup is
First one needs to have == instead of =. = is an assignment operator, whereas == is a comparison operator (= is used in $this = 'that' and == is used in if($foo == 'bar')).

Try

Code:
<if $mybb->usergroup['gid'] == 36 then>
Nivel de Paltosidad<img src="http://www.beatdj.net/foros/images/palta.png" />: 99%
</if>


Or if that fails:

Code:
<if $mybb->usergroup['gid'] == '36' then>
Nivel de Paltosidad<img src="http://www.beatdj.net/foros/images/palta.png" />: 99%
</if>

04-03-2013 03:40 PM
Find all posts by this user Quote this message in a reply
Glas Offline
Member
***
Posts: 106
Joined: Jul 2010
Post: #3
RE: If profilefieldid exist show//ifusergroup is
Thanks for the reply Seabody

It seems both fails, it would be beacuse this GID (36) is setted up as additional group?
04-03-2013 04:16 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: If profilefieldid exist show//ifusergroup is
(04-03-2013 04:16 PM)Glas Wrote:  would be beacuse this GID (36) is setted up as additional group?
Yes, as MyBB handles additional groups differently than to the primary group (you'll notice this when you edit a user in the ACP that they're separate fields).
http://mybbhacks.zingaburga.com/showthre...http://mybbhacks.zingaburga.com/showthread.php?tid=851&pid=1055
(make sure you use the correct variable as I doubt $memprofile is what you want)

My Blog
04-03-2013 05:34 PM
Find all posts by this user Quote this message in a reply
Glas Offline
Member
***
Posts: 106
Joined: Jul 2010
Post: #5
RE: If profilefieldid exist show//ifusergroup is
i've checked older posts and google and seems $memprofile is the variable,  but this makes the text doesn't display to any user, even the one where is member of 36 GID

Code:
<if (stripos(','.$memprofile['additionalgroups'].',', ',36,') !== false) then>
Nivel de Paltosidad<img src="http://www.beatdj.net/foros/images/palta.png" />: 99%
</if>

04-03-2013 10:41 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #6
RE: If profilefieldid exist show//ifusergroup is
If you want it on this area:
(04-03-2013 02:35 PM)Glas Wrote:  postbit_classic
then
(04-03-2013 05:34 PM)ZiNgA BuRgA Wrote:  (make sure you use the correct variable as I doubt $memprofile is what you want)

04-04-2013 04:00 AM
Find all posts by this user Quote this message in a reply
Glas Offline
Member
***
Posts: 106
Joined: Jul 2010
Post: #7
RE: If profilefieldid exist show//ifusergroup is
Thanks RateU i will search about what are the available variables and test one by one as i don't know exactly what i need to make it show on postbit_classic, if i am asking here on hacks.com is beacuse i ran out of ideas

a filter by useruid of each postbit would work too, but welp, gonna research.
04-04-2013 04:44 AM
Find all posts by this user Quote this message in a reply
Destroy666 Offline
Junior Member
**
Posts: 27
Joined: Jul 2012
Post: #8
RE: If profilefieldid exist show//ifusergroup is
You want to display something to only one group? If yes, use $mybb->user['usergroup'] not $mybb->usergroup['gid'] - it doesn't exist.

Code:
<if $mybb->user['usergroup'] == 36 || $mybb->user['additionalgroups'] == 36 then>
Nivel de Paltosidad<img src="http://www.beatdj.net/foros/images/palta.png" />: 99%
</if>

04-04-2013 07:39 AM
Find all posts by this user Quote this message in a reply
Glas Offline
Member
***
Posts: 106
Joined: Jul 2010
Post: #9
RE: If profilefieldid exist show//ifusergroup is
(04-04-2013 07:39 AM)Destroy666 Wrote:  You want to display something to only one group? If yes, use $mybb->user['usergroup'] not $mybb->usergroup['gid'] - it doesn't exist.

Code:
<if $mybb->user['usergroup'] == 36 || $mybb->user['additionalgroups'] == 36 then>
Nivel de Paltosidad<img src="http://www.beatdj.net/foros/images/palta.png" />: 99%
</if>


no no, the idea is that

"shows the content inside, to all users, but displays only in the postbit of users who have X UID or X addionalgroup membership"
04-04-2013 09:57 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #10
RE: If profilefieldid exist show//ifusergroup is
(04-04-2013 04:44 AM)Glas Wrote:  i need to make it show on postbit_classic
If you look inside the template, you'll see that the most variables there use $post

04-05-2013 12:42 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: