$name[$i] = 'n/a'; $value[$i] = 'n/a'; } mysql_free_result($r_posters); eval($TRow->GetTemplate("stats_top10_row")); $stats_top10_row .= "<br>"; } /** top 10 boards **/ $data['title'] = 'Top 10 Boards (nach Posts)'; $name = array(); $value = array(); $a_boards = array(); $i = 0; $r_boards = thwb_query("SELECT b.boardid, b.boardname, b.boardposts, c.categoryname FROM {$pref}" . "board AS b LEFT OUTER JOIN {$pref}" . "category AS c ON c.categoryid = b.categoryid ORDER BY boardposts DESC LIMIT 10"); while ($a_boards = mysql_fetch_array($r_boards)) { $P->set_boardid($a_boards['boardid']); if (!$P->has_permission(P_VIEW)) { continue; } $name[$i] = '<a href="' . build_link('board.php?boardid=' . $a_boards['boardid']) . '">' . $a_boards['boardname'] . '</a>' . ' (Kategorie: ' . $a_boards['categoryname'] . ')'; $value[$i] = $a_boards['boardposts']; $i++; } for (; $i <= 9; $i++) { $name[$i] = 'n/a'; $value[$i] = 'n/a'; } mysql_free_result($r_boards); eval($TRow->GetTemplate("stats_top10_row")); $stats_top10_row .= "<br>"; /** top 10 threads (by posts) **/
function jumpmenu($currentboard = 1) { global $pref, $g_user; $P = new Permission($g_user['groupids']); // precache boards $a_board = array(); $r_board = thwb_query("SELECT boardid, boardname, categoryid\n FROM " . $pref . "board\n WHERE boarddisabled = 0\n ORDER BY boardorder ASC"); while ($board = mysql_fetch_array($r_board)) { $P->set_boardid($board['boardid']); if ($P->has_permission(P_VIEW)) { $a_board[$board['categoryid']][] = $board; } } // category $r_category = thwb_query("SELECT categoryid, categoryname FROM\n " . $pref . "category ORDER BY categoryorder ASC"); $JUMP_MENU = '<select class="tbselect" name="board[boardid]" onChange="Submit.click()">'; while ($category = mysql_fetch_array($r_category)) { if (!empty($a_board[$category['categoryid']]) && $a_board[$category['categoryid']]) { $JUMP_MENU .= '<option value="-' . $category['categoryid'] . '">' . $category['categoryname'] . '</option>'; while (list(, $board) = each($a_board[$category['categoryid']])) { $JUMP_MENU .= '<option value="' . $board['boardid'] . '"' . ($board['boardid'] == $currentboard ? ' selected' : '') . '>- ' . $board['boardname'] . '</option>'; } } } $JUMP_MENU .= '</select> <input class="tbbutton" type="submit" name="Submit" value="Jump">'; return $JUMP_MENU; }
**/ $a_boardids = array(); if (defined(THWB_NEWS_INCLUDED)) { $a_boardids[] = CFG_INCLUDE_BOARD; } else { if (!empty($_GET['limit'])) { $a_boardids = explode(',', $_GET['limit']); } } $r_boards = thwb_query("SELECT boardid FROM {$pref}board " . "WHERE boarddisabled = 0" . (count($a_boardids) ? " AND boardid IN (" . join(',', $a_boardids) . ")" : '')); $a_boards = array(); while ($a_board = mysql_fetch_assoc($r_boards)) { if (count($a_boardids) && !in_array($a_board['boardid'], $a_boardids)) { continue; } $P->set_boardid($a_board['boardid']); if (!$P->has_permission(0)) { continue; } $a_boards[] = $a_board['boardid']; } if (!count($a_boards) && !defined('THWB_NEWS_INCLUDED')) { print '<pre><strong>Fehler</strong> Keine Boards gefunden.</pre>'; exit; } /** * determine the order **/ $orderby = 'threadcreationtime'; if (!empty($_GET['lastchanged'])) {