$beginning = 0; } // Calculate back and forward offsets for easy Smarty usage. $offsetback = $offset - 20; if ($offsetback < 0) { $offsetback = 0; } $offsetfwd = $offset += 20; // DB abstraction is amazing. $posts = array(); $posts = $db->getposts($beginning, $isthread, $boardid, $showhidden); usort($posts, 'comp_post_ids'); // THIS SHOULD WORK? // Add images to each post foreach ($posts as &$post) { $post['images'] = $db->getimgs($post['imgidx']); } // Get the boards array, to show a list for filtering $boards = array(); $boards = $db->getboard(); // No parameters means everything gets fetched $sm = sminit("adminrecentposts.tpl", null, "_admin", true); // Admin mode means NO caching. (and we provided a null id anyway) // These can be pretty big, so we're going to assign by reference. $sm->assign_by_ref("posts", $posts); $sm->assign_by_ref("boards", $boards); $sm->assign("board_folder", $board_folder); // name of the folder (for filtering) $sm->assign("boardlink", $boardlink); //some stuff to append for easy link creation $sm->assign("total_count", $count);