Beispiel #1
0
 private function loadBoards()
 {
     global $yakbb;
     // Assemble category ids list
     $catids = array(0 => 0);
     // Can view null category always
     foreach ($this->cats as $k => $v) {
         $catsids[] = $v["id"];
     }
     $boards = $yakbb->db->query("\r\n\t\t\tSELECT\r\n\t\t\t\tb.*,\r\n\t\t\t\tv.id AS viewid,\r\n\t\t\t\tu.username AS lpusername, u.displayname AS lpdisplay, u.group AS lpgroup,\r\n\t\t\t\tt.name AS lpthreadname\r\n\t\t\tFROM\r\n\t\t\t\tyakbb_boards b\r\n\t\t\tLEFT JOIN\r\n\t\t\t\tyakbb_boards_views v\r\n\t\t\t\tON (b.id = v.boardid AND v.userid = '" . $yakbb->user["id"] . "')\r\n\t\t\tLEFT JOIN\r\n\t\t\t\tyakbb_users u\r\n\t\t\t\tON (u.id = b.lastpostuserid)\r\n\t\t\tLEFT JOIN\r\n\t\t\t\tyakbb_threads t\r\n\t\t\t\tON (t.id = b.lastpostthreadid)\r\n\t\t\tWHERE\r\n\t\t\t\tb.parenttype = 'c'\r\n\t\t\t\tAND b.hidden = '0'\r\n\t\t\t\tAND b.parentid IN (" . implode($catsids, ",") . ")\r\n\t\t\tORDER BY\r\n\t\t\t\tb.parentorder ASC\r\n\t\t");
     while ($b = $yakbb->db->fetch()) {
         $bperms = unserialize($b["permissions"]);
         if (!isset($bperms[$yakbb->user["group"]]) || $bperms[$yakbb->user["group"]]["view"] == false) {
             continue;
         }
         $b["link"] = link_board($b["id"], $b["name"]);
         $b["url"] = url_board($b["id"], $b["name"]);
         $b["permissions"] = $bperms[$yakbb->user["group"]];
         $b["lpdate"] = makeDate($b["lastposttime"]);
         $b["lplink"] = link_thread($b["lastpostthreadid"], $b["lpthreadname"]);
         $b["lpuserlink"] = link_user($b["lastpostuserid"], $b["lpusername"], $b["lpdisplay"], $b["lpgroup"]);
         $this->cats[$b["parentid"]]["boards"][] = $b;
     }
 }
Beispiel #2
0
function link_board($boardid, $boardname, $page = false)
{
    return '<a href="' . url_board($boardid, $boardname, $page) . '">' . $boardname . '</a>';
}