function modlog__find($cond = array(), $orderby = array(), $page = 1, $pagesize = 20)
{
    $cond = cond_to_sqladd($cond);
    $orderby = orderby_to_sqladd($orderby);
    $offset = ($page - 1) * $pagesize;
    return db_find("SELECT * FROM `bbs_modlog` {$cond}{$orderby} LIMIT {$offset},{$pagesize}");
}
function forum__find($cond = array(), $orderby = array(), $page = 1, $pagesize = 1000)
{
    $cond = cond_to_sqladd($cond);
    $orderby = orderby_to_sqladd($orderby);
    $offset = ($page - 1) * $pagesize;
    $forumlist = db_find("SELECT * FROM `bbs_forum` {$cond}{$orderby} LIMIT {$offset},{$pagesize}", 'fid');
    return $forumlist;
}
function thread__find($cond = array(), $orderby = array(), $page = 1, $pagesize = 20)
{
    $cond = cond_to_sqladd($cond);
    $orderby = orderby_to_sqladd($orderby);
    $offset = ($page - 1) * $pagesize;
    $arrlist = db_find("SELECT tid FROM `bbs_thread` {$cond}{$orderby} LIMIT {$offset},{$pagesize}");
    if (empty($arrlist)) {
        return array();
    }
    $tids = implode(',', arrlist_values($arrlist, 'tid'));
    return db_find("SELECT * FROM `bbs_thread` WHERE tid IN ({$tids})");
}
示例#4
0
function friendlink_find($cond = array(), $orderby = array(), $page = 1, $pagesize = 1000)
{
    $cond = cond_to_sqladd($cond);
    $orderby = orderby_to_sqladd($orderby);
    $offset = ($page - 1) * $pagesize;
    $friendlinklist = db_find("SELECT * FROM `bbs_friendlink` {$cond}{$orderby} LIMIT {$offset},{$pagesize}", 'linkid');
    if ($friendlinklist) {
        foreach ($friendlinklist as &$friendlink) {
            friendlink_format($friendlink);
        }
    }
    return $friendlinklist;
}