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


Disable Signatures for Guests (IF statement inside templates) - Rafael - 2010-10-12

Hello,

I'm trying to remove the guests access to signatures in MyBB 1.6 but this piece of code didn't worked Huh

<hr size="1" width="25%"  align="left" />
<if $GLOBALS['mybb']->user['usergroup'] == 1 then>
You should register in order to see signatures
<else>
{$post['signature']}
</if>

That code is replacing the postbit_signature in the postbit templates, have tried also in the postbit_classic (wich is the one that I'm using) without sucess.
Is that ok?

Thanks.


RE: Disable Signatures for Guests (IF statement inside templates) - Matt - 2010-10-12

Template conditionals aren't default, you'll need the PHP in Templates plugin.


RE: Disable Signatures for Guests (IF statement inside templates) - darkly - 2010-10-12

Download for the plugin: http://mybbhacks.zingaburga.com/showthread.php?tid=260 Smile


RE: Disable Signatures for Guests (IF statement inside templates) - Rafael - 2010-10-12

Pretty nice one Smile

Thanks.


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

sorry for necroposting
but i did this
and iget this error


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


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

What code you've entered there Glas ?


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

(2011-09-02, 03:40 PM)Glas Wrote: sorry for necroposting
but i did this
and iget this error


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

you have to download the plugin.


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

Try this:
<if $mybb->usergroup['gid'] == 1 then>
guest see this content
<else>
{$post['signature']}
</if>

Using Template Conditionals, I suppose it will work using PHP In Templates, which is more advanced.


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

It should be like this Sama;
<if $mybb->user['usergroup'] == "1" then>
// Guests can see this thingy
<else>
{$post['signature']}
</if>

Note the $mybb->user['usergroup']


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

(2011-09-02, 03:47 PM)Everett777 Wrote:
(2011-09-02, 03:40 PM)Glas Wrote: sorry for necroposting
but i did this
and iget this error


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

you have to download the plugin.

i did and even installed


anyway
i've answered myself

this is the fix:

<if $mybb->user['usergroup'] == 1 then>
blah
</if>

(2011-09-02, 03:58 PM)Yaldaram Wrote: It should be like this Sama;
<if $mybb->user['usergroup'] == "1" then>
// Guests can see this thingy
<else>
{$post['signature']}
</if>

Note the $mybb->user['usergroup']

yaldaram, the error is not anymore

but after login the form is still there

website: http://www.beatdj.net/foros/index.php

<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>
<else>
lol prueba // test
</if>

Logged: http://img402.imageshack.us/img402/2121/loggd.png
unlogged: http://img853.imageshack.us/img853/584/unloggd.png