$thread_b["last_mod"])? -1 : 1); } if ($thread_a["pinned"]) { return -1; } return 1; } $threads = $bbj->thread_index(); usort($threads["data"],"pinned_sort"); foreach($threads["data"] as $thread) { $username = $threads["usermap"][$thread["author"]]["user_name"]; $last_author = $threads["usermap"][$thread["last_author"]]["user_name"]; $time = round($thread['created']); $time = new DateTime("@{$time}"); $time = date_format($time, "Y/m/d H:i"); $mod = round($thread['last_mod']); $mod = new DateTime("@{$mod}"); $mod = date_format($mod, "Y/m/d H:i"); $tt = $thread["title"]; $plural = $thread['reply_count']==1 ? "y" : "ies"; $tid = $thread["thread_id"]; echo "\t\t
".PHP_EOL; echo "\t\t\t

{$tt} by {$username} @ {$time}

".PHP_EOL; echo "\t\t\t

{$thread['reply_count']} repl{$plural}, last post by {$last_author} @ {$mod}

"; echo "\t\t
".PHP_EOL; } ?>