MyBB Community Forums

Full Version: PHP in Templates and Template Conditionals
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Nice Plugin,

Thanks for Release...
EDIT: Figured it out.
hey this does not seem to work for me,
when i activate the plugin,
it breaks my current theme "Bluefusion"
Any help?

Thanks in Advance
Thank you for this plugin!!! Solve my problem took me 2 whole days!~!! Can I donate to you?
Ugh... I don't have a clue what I'm doing...
I got the plugin installed and activated.

What I want to do:
Disable the Member List and Calendar links unless the user is logged in; guests should not see these links.

I realize I need to edit the 'header' template, as I see the links there. I just don't know what code to insert to check if a user is logged in or not...

Thanks,
Kerry Wano

"True friends stab you in the front." - Oscar Wilde
<?php if(!empty($mybb->user['uid'])){
echo "Your links here";
}
?>

Should work...
Parse error: syntax error, unexpected '{', expecting ',' or ';' in /home/content/62/4727962/html/forums/global.php(438) : eval()'d code(13) : eval()'d code on line 2

This is the error I see when I view the page.
The links are not shown, but something about the error is also preventing the login function from working.

Thanks,
Kerry Wano

"True friends stab you in the front." - Oscar Wilde

EDIT: I figured it out. I was using php, and not the plugin.

My code that works:
<if $mybb->user['uid'] > 0 then>
(Member List link)
(Calendar link)
</if>
oh yes, sorry. I didn't read exactly how this plugin turns it.
Glad you figured it out Smile
Thanks,
Hello!

I have installed and activated your plugin but for some reason, after navigating and refreshing my home page in mybb, the whole site is blank (white). No styling, no code.. nothing. I have yet to even try to add php code, just wanted to see if the plugin made any changes to my theme.

Not even an error message of any sort, just a blank page.

I'm using the latest Mybb v1.4.8.

Does anyone know why this could be occuring?
I have deactivated the plugin for now, but if you want, pm or email me and ill activate it for a min or so to allow others to view the issue at hand. (I have many active members and staff that need to use the website, so I cant leave the plugin enabled as im sure you understand.)

Regards,
Vince

http://www.eternalwolf.com/forums
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22