MyBB Community Forums
Disable Signatures for Guests (IF statement inside templates) - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html)
+------ Forum: 1.6 General Support (https://community.mybb.com/forum-127.html)
+------ Thread: Disable Signatures for Guests (IF statement inside templates) (/thread-80174.html)

Pages: 1 2 3


RE: Disable Signatures for Guests (IF statement inside templates) - Yaldaram - 2011-09-02

Try this;
<if $mybb->user['usergroup'] == "1" then>
<form action='member.php' method='post'>
<font color="FFFFFF">Usuario: </font><input type='text' name='username' size='9' maxlength='30' />
<text="FFFFFF">ContraseƱa: </text> <input type='password' name='password' size='9' />
<input type='hidden' name='action' value='do_login'>
<input type='hidden' name='url' value='index.php' />
<input type='submit' class='submit' name='submit' value='Conectar' /></form>
</if>



RE: Disable Signatures for Guests (IF statement inside templates) - Glas - 2011-09-02

(2011-09-02, 04:31 PM)Yaldaram Wrote: Try this;
<if $mybb->user['usergroup'] == "1" then>
<form action='member.php' method='post'>
<font color="FFFFFF">Usuario: </font><input type='text' name='username' size='9' maxlength='30' />
<text="FFFFFF">ContraseƱa: </text> <input type='password' name='password' size='9' />
<input type='hidden' name='action' value='do_login'>
<input type='hidden' name='url' value='index.php' />
<input type='submit' class='submit' name='submit' value='Conectar' /></form>
</if>




same problem



RE: Disable Signatures for Guests (IF statement inside templates) - Yaldaram - 2011-09-02

Can you please post your forum's URL and test account ?


RE: Disable Signatures for Guests (IF statement inside templates) - Glas - 2011-09-02

www.beatdj.net/foros

user: test
pass: test


RE: Disable Signatures for Guests (IF statement inside templates) - Omar G. - 2011-09-02

Wait, you want ot hide content from the header to gusts? Then you will need a different code.


RE: Disable Signatures for Guests (IF statement inside templates) - Glas - 2011-09-02

(2011-09-02, 04:43 PM)Sama34 Wrote: Wait, you want ot hide content from the header to gusts? Then you will need a different code.

yup
i want to insert that login and show it only for guests


RE: Disable Signatures for Guests (IF statement inside templates) - Omar G. - 2011-09-02

You can use this, although it is for multiple groups, you can use only one and it will work:
<if in_array($GLOBALS['mybb']->user['usergroup'], array(1)) then>
// code for guests
</if>

I use this for hiding content to multiple groups at once.


RE: Disable Signatures for Guests (IF statement inside templates) - Glas - 2011-09-02

(2011-09-02, 04:48 PM)Sama34 Wrote: You can use this, although it is for multiple groups, you can use only one and it will work:
<if in_array($GLOBALS['mybb']->user['usergroup'], array(1)) then>
// code for guests
</if>

I use this for hiding content to multiple groups at once.

using thisoutputs me this error

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/beatdjn/public_html/foros/global.php(504) : eval()'d code on line 2



RE: Disable Signatures for Guests (IF statement inside templates) - Omar G. - 2011-09-02

Try this:
<if in_array($GLOBALS['mybb']->user['usergroup'], array(1,7)) then>
// code for guests
</if>

For guests and banned (who cares what they see?), if it shows that error again, maybe Template Conditionals (the one I use) and PHP In Templates works different.


RE: Disable Signatures for Guests (IF statement inside templates) - Glas - 2011-09-02

(2011-09-02, 04:56 PM)Sama34 Wrote: Try this:
<if in_array($GLOBALS['mybb']->user['usergroup'], array(1,7)) then>
// code for guests
</if>

For guests and banned (who cares what they see?), if it shows that error again, maybe Template Conditionals (the one I use) and PHP In Templates works different.

i am using this plugin
http://mybbhacks.zingaburga.com/showthread.php?tid=464

and with the new fix
it still outpiuts this
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/beatdjn/public_html/foros/global.php(504) : eval()'d code on line 2