2007-11-09, 12:32 AM
Seems I am having a tough time adding the mypsdisplay directly into the "postbit_author_user" template. It displays nothing.
I can add $post['mypsdisplay'] directly to postbit but not inside postbit_author_user which of course makes more sense for it to be. Anyone know why?
EDIT: OK...looking deeper into it there are no hooks before the eval of the template. I may have to use a more universal hook. This is an oversight and it should be corrected. The postbit template isn't good enough since it doesn't display any author info in the PM area which is what I want. A hook before that template eval would be nice.
function myps_display(&$post)
{
global $mybb, $db, $lang, $plugins, $post;
$plugins->run_hooks("myps_display_start");
$language = $mybb->settings['bblanguage'];
$lang->load("myps");
$lang->set_language($mybb->settings['bblanguage']);
if ($mybb->settings['myps_status'] != "off" && $post['uid'] != 0){
$result = $db->query("SELECT * FROM `".TABLE_PREFIX."users` WHERE uid='".$post['uid']."'");
$show = $db->fetch_array($result);
$myps = round($show['myps'],$mybb->settings['myps_decimal']);
$post['mypsdisplay'] = $mybb->settings['myps_name'].": <a href=\"myps.php?action=donate&username=". $post['username']. "\">$myps</a>";
if($mybb->user['usergroup'] == "4" && $mybb->settings['myps_allowmod'] == 'mypspermadmin') {
$post['mypsdisplay'] .= "(<a href=\"myps.php?action=moderate&username=". $post['username']. "\">". $lang->myps_edit. "</a>)";
}
if(($mybb->user['usergroup'] == "3" || $mybb->user['usergroup'] == "4") && ($mybb->settings['myps_allowmod'] == 'mypspermsmods')) {
$post['mypsdisplay'] .= "(<a href=\"myps.php?action=moderate&username=". $post['username']. "\">". $lang->myps_edit. "</a>)";
}
if((is_moderator($fid) == "yes") && ($mybb->settings['myps_allowmod'] == 'mypspermall')) {
$post['mypsdisplay'] .= "(<a href=\"myps.php?action=moderate&username=". $post['username']. "\">". $lang->myps_edit. "</a>)";
}
}
$plugins->run_hooks("myps_display_end");
}
I can add $post['mypsdisplay'] directly to postbit but not inside postbit_author_user which of course makes more sense for it to be. Anyone know why?
EDIT: OK...looking deeper into it there are no hooks before the eval of the template. I may have to use a more universal hook. This is an oversight and it should be corrected. The postbit template isn't good enough since it doesn't display any author info in the PM area which is what I want. A hook before that template eval would be nice.