MyBB Hacks

Full Version: Custom Online Location For A Specified User
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is a simple way to add a custom online location for a specified user using Template Conditionals or PHP in Templates / Complex Templates plugin:

online_row template:
Find:

Code:
{$location}

Replace with:

Code:
<if $user['uid'] == 1 then>Sleep<else>{$location}</if>

Modify it as our needs.

member_profile_online template:
Find:

Code:
{$location} @ {$location_time}


Replace with:

Code:
<if $memprofile['uid'] == 1 then>Sleep<else>{$location} @ {$location_time}</if>

Modify it as our needs.

Very good RateU
<!-- edit SOLVED -->
No, I wouldn't use Template Conditionals for that.
<!-- edit SOLVED -->
You could theoretically do almost anything with PHP in Templates, but rearranging data simply doesn't make any sense to be done from a template.
A template just puts out HTML, and HTML doesn't magically rearrange itself into groupings.

I suggest you review your phobia of plugins.
<!-- edit SOLVED -->
There is something better to do with a plugin Smile
What the hell with all the monkeys? but why???

Yes, some things are good as core edits others not, and plugins are not bad - though some can be coded without full care and attention. Those are the ones to avoid as they can cause problems on your board.
<!-- edit SOLVED -->
Reference URL's