MyBB Community Forums

Full Version: usertitle with announcement
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i am again with my one query  Undecided
without wasting time here is what i want to do. 
i want to add usertitle with profile name in announcement. 
(see attached image)  i want usertitle of announcement poster user in brackets.
This is output of a plugin. Before your question can be answered it is necessary to know which plugin.
(2015-08-05, 04:01 PM)Ad Bakker Wrote: [ -> ]This is output of a plugin. Before your question can be answered it is necessary to know which plugin.

no its not plugin i modified announcement template and added ()  there. also i tried to use 
{$mybb->user['usertitle']}

but it just showing my usertitle for everyone.
Sorry, I will come back to this later
https://github.com/mybb/mybb/blob/featur...y.php#L762 - change that to:
SELECT a.*, u.username, u.usertitle

Then add:
$user_title = '';
if(trim($announcement['usertitle']))
{
    $user_title = ' ('.htmlspecialchars_uni($announcement['usertitle']).')';
}
here: https://github.com/mybb/mybb/blob/featur...y.php#L790 and use {$user_title} in the template.
(2015-08-05, 05:13 PM)Destroy666 Wrote: [ -> ]https://github.com/mybb/mybb/blob/featur...y.php#L762 - change that to:
SELECT a.*, u.username, u.usertitle

Then add:
$user_title = '';
if(trim($announcement['usertitle']))
{
    $user_title = ' ('.htmlspecialchars_uni($announcement['usertitle']).')';
}
here: https://github.com/mybb/mybb/blob/featur...y.php#L790 and use {$user_title} in the template.
+1
perfectly working. 
Thank you so much  Smile

one problem.
Only custom title show if user dosent have any usertitle then it is showing blank. if no usertitle then group default usertitle not showing.