MyBB Hacks

Full Version: Very new at PHP
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
I'd guess it to be {$folder}
That did it! Thanks.

Not sure how I lived before template conditionals ...
How to check current action in usercp, e.g. action=subscriptions? And to also check if it is usercp.php with NO action.

Code:
<if $mybb->input['action'] == 'subscription' then>

Code:
<if $mybb->input['action'] == '' then>


If you're dealing a lot with conditionals, it may help to have some basic knowledge in PHP by the way.

Great, thank you Zinga!

Yes, I'd really like to learn some PHP ... right now I am working full time and have to finish this project by July 1, so it's really a crunch for me. I didn't expect to use Template Conditionals so much, but it's very useful. Once the new version is out I can take some time to start learning PHP.

I'm sure my questions are becoming exasperating, which is why I went looking for a donation option at least haha
Is there a way to check the character count of a message, or to check if there is any message at all, basically? I want to hide the div that contains the message if there was no message written.
No sure if this will work:

PHP Code:
<if my_strlen($post['message']) > 0 then>
<div>{$post['message']}</div>
</if>


Or maybe:

PHP Code:
<if $post['message'] then>
<div>{$post['message']}</div>
</if>


Or maybe setting up a variable with template conditionals, something I have never done.

second one works, thanks! i assumed it wouldn't work but after reading you also suggest it i decided to try it haha
Pages: 1 2 3 4 5 6
Reference URL's