2012-07-08, 02:34 AM
I'm trying to display the $post['output'] variable in the postbit from the postbit hook, but nothing is being displayed. I am using the following:
It creates the little box from the post_userdetails class, but there is no value in $post['output'] when there should be from the following code:
Any help is appreciated.
Regards,
Shannon
find_replace_templatesets("postbit_author_user", "#".preg_quote('{$post[\'userregdate\']}</div>')."#i", "{\$post['userregdate']}</div>\n<div class=\"post_userdetails\">{\$post['output']}</div>");
It creates the little box from the post_userdetails class, but there is no value in $post['output'] when there should be from the following code:
function currentactivity_postbit(&$post) {
global $templates, $db, $mybb;
$getPostUser = $db->simple_select("posts", "*", "pid='" . $post['pid'] . "'");
$user = $db->fetch_array($getPostUser);
$query = $db->simple_select("current_activity", "*", "uid='" . $user['uid'] . "'");
$array = $db->fetch_array($query);
if ($db->num_rows($query) == 1) {
if ($array['current_act'] == "Listening") {
$post['output'] = "Currently {$array['current_act']} to: {$array['current_obj']}";
//$post['output'] = "<div class=\"post_userdetails\"><label>Currently {$array['current_act']} to: {$array['current_obj']}</label></div>";
} else {
$post['output'] = "Currently {$array['current_act']}: {$array['current_obj']}";
//$post['output'] = "<div class=\"post_userdetails\"><label>Currently {$array['current_act']}: {$array['current_obj']}</label></div>";
}
} else {
$post['output'] = "Currently Playing: ???";
//$post['output'] = "<div class=\"post_userdetails\"><label>Current Playing: ???</label></div>";
}
}
Any help is appreciated.
Regards,
Shannon