MyBB Community Forums

Full Version: Using IF within Template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I'm trying to do something fairly easy but I'm not sure how I should go about doing it with MyBB. What I'm trying to do is create an IF/ELSE statement in PHP that would only show certain fields if they have been filled out by a user. For example on the member profile page it shows all the messenger ID's. What I want is to only show them if they have entered something under the field. So if someone entered their MSN it would show it, if it was left empty then it wouldn't be shown. Can I just use PHP within the template files or do I actually have to go into the PHP files?
There's a plugin that allows PHP in templates: http://community.mybboard.net/thread-31860.html
Ah, alright. I installed it but I haven't got it to work just yet. I'll keep playing around with it and see what I can do. Just in case are there any other known methods?
I did that with PHP In Templates plugin. I prefer using conditional than PHP.
Humm.. I've been hearing a lot about conditionals. I'm still fairly new to all this so would you have any resources I could use to learn about conditionals in MyBB?
I've been playing around with it and managed to get it working. Thanks for all the help... it's very much appreciated!
Here is the Author's site:

http://mybbhacks.zingaburga.com/

And there is v1.5 now for the plugin. You can find it here:

http://mybbhacks.zingaburga.com/showthread.php?tid=260

You can post there if you have any question about it.

And here is a live demo for using it in Contact Details and Additional Info:

http://mynie.6te.net/demo/member.php?act...file&uid=1
Thanks for all the help and the extra links. I've got it working great and it does exactly what I wanted it to do.