Jump to the post that solved this thread.
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 11 Years, 1 Month, 4 Weeks ago Disable Signatures for Guests (IF statement inside templates)
#1
Solved: 11 Years, 1 Month, 4 Weeks ago
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.
vBulletin/Wordpress/Magento/MyBB
Developer and Designer
#2
Solved: 11 Years, 1 Month, 4 Weeks ago
Template conditionals aren't default, you'll need the PHP in Templates plugin.
MyReactions - All Plugins

Can you still feel the butterflies?

Free never tasted like pudding.
#3
Solved: 11 Years, 1 Month, 4 Weeks ago
Download for the plugin: http://mybbhacks.zingaburga.com/showthread.php?tid=260 Smile
#4
Solved: 11 Years, 1 Month, 4 Weeks ago
Pretty nice one Smile

Thanks.
vBulletin/Wordpress/Magento/MyBB
Developer and Designer
#5
Solved: 11 Years, 1 Month, 4 Weeks ago
This user has been denied support. This user has been denied support.
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
#6
Solved: 11 Years, 1 Month, 4 Weeks ago
What code you've entered there Glas ?
#7
Solved: 11 Years, 1 Month, 4 Weeks ago
(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.
#8
Solved: 11 Years, 1 Month, 4 Weeks ago
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.
#9
Solved: 11 Years, 1 Month, 4 Weeks ago
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']
#10
Solved: 11 Years, 1 Month, 4 Weeks ago
This user has been denied support. This user has been denied support.
(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
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)