MyBB Hacks

Full Version: If profilefieldid exist show//ifusergroup is
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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 =(

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>

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)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)
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>

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)
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.
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)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 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
Pages: 1 2
Reference URL's