MyBB Hacks

Full Version: Thread Author Sign On Postbit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Requirement: Template Conditionals or PHP in Templates / Complex Templates

Will add an additional image for the Thread Author on postbit/classic.
As an example, we put the code after {$post['onlinestatus']}:

Code:
<if $GLOBALS['thread']['uid'] && $GLOBALS['thread']['uid'] == $post['uid'] && $GLOBALS['thread']['firstpost'] != $post['pid'] then><img src="images/icons/pencil.gif" alt="{$lang->author}" title="{$lang->author}" /></if>

[attachment=661]

With the same method, we can use different layout (background, css class or etc) for it.

I already have this conditional, but as I´m a expert I´m going to asume your is better, compare, and I think I will use this, thanks.
I'm still learning too, Sama34 Biggrin
I use this code:

PHP Code:
<if $thread['uid'] == $post['uid'] then>
<img src="images/icons/pencil.gif" alt="{$lang->author}" title="{$lang->author}" />
</if>


It will add a image to all author posts regardless of it being the first post or not. I think yours is better, as it makes not that much sense to include the image in the fisrt post.

But I still do not undestand what the difference between:

PHP Code:
$GLOBALS['thread']['uid']


PHP Code:
$thread['uid']

They'll be the same if $thread is global'd (I think it always is for a standard postbit).  If not, $thread will be invalid.
Using $GLOBALS will always work if you're unsure.

Note that RateU's conditional also excludes guests.
Thanks for the explanation Zinga Burga Smile
Reference URL's