当前位置: 首页>>代码示例>>PHP>>正文


PHP Permission::set_boardid方法代码示例

本文整理汇总了PHP中Permission::set_boardid方法的典型用法代码示例。如果您正苦于以下问题:PHP Permission::set_boardid方法的具体用法?PHP Permission::set_boardid怎么用?PHP Permission::set_boardid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Permission的用法示例。


在下文中一共展示了Permission::set_boardid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: eval

         $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) **/
开发者ID:adrianbroher,项目名称:thwboard,代码行数:31,代码来源:top10.stats.php

示例2: jumpmenu

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;
}
开发者ID:adrianbroher,项目名称:thwboard,代码行数:27,代码来源:functions.inc.php

示例3: array

 **/
$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'])) {
开发者ID:adrianbroher,项目名称:thwboard,代码行数:31,代码来源:thwbnews.php


注:本文中的Permission::set_boardid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。