MyBB Community Forums

Full Version: Disable Signatures for Guests (IF statement inside templates)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I use the same plugin, weird, anyways, try these:

<if $GLOBALS['mybb']->user['usergroup'] == 1 then>
//Guests see this content
</if>

or

<if $mybb->usergroup['gid'] == 1 then>
//Guests see this content
</if>

Good luck.
(2011-09-02, 06:06 PM)Sama34 Wrote: [ -> ]I use the same plugin, weird, anyways, try these:

<if $GLOBALS['mybb']->user['usergroup'] == 1 then>
//Guests see this content
</if>

or

<if $mybb->usergroup['gid'] == 1 then>
//Guests see this content
</if>

Good luck.


1st method outputs:
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


2nd method:
does not show error, but still shows login form


Sad
Second code is suppose to show the login from to guests, it shows the login form to you as a member?

Can you share the exact code inside your template for the ones that show syntax errors?
(2011-09-02, 06:25 PM)Sama34 Wrote: [ -> ]Second code is suppose to show the login from to guests, it shows the login form to you as a member?

Can you share the exact code inside your template for the ones that show syntax errors?

2nd shows to both, users and guests

exact code for error is
<if $GLOBALS['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>

ignoren esto estoy haciendo pruebas
</if> 
Try this
<if $GLOBALS['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>

ignoren esto estoy haciendo pruebas
</if> 
(2011-09-02, 06:33 PM)Sama34 Wrote: [ -> ]Try this
<if $GLOBALS['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>

ignoren esto estoy haciendo pruebas
</if> 



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
I don't what is happening, it is working for me, try asking Yumi, maybe it is a problem with your forum or some plugin you use.
ugh can't contact yumi or log into mybbhacks
always ask me for a captcha where there is no one
Pages: 1 2 3