Exemplo n.º 1
0
        $rt['postdate'] = get_date($rt['postdate'], 'Y-m-d');
        $rt['lastpost'] = get_date($rt['lastpost'], 'Y-m-d');
        $rt['encode_lastposter'] = rawurlencode($rt['lastposter']);
        $threaddb[] = $rt;
    }
    require_once PrintEot('u');
    footer();
} elseif ($action == 'post') {
    include_once D_P . 'data/bbscache/forum_cache.php';
    require_once R_P . 'require/forum.php';
    InitGP(array('ptable', 'page'));
    (!is_numeric($page) || $page < 1) && ($page = 1);
    $limit = pwLimit(($page - 1) * $db_perpage, $db_perpage);
    !isset($ptable) && ($ptable = $db_ptable);
    $pw_posts = GetPtable($ptable);
    $fidoff = $isU ? array(0) : getFidoff($groupid);
    $sqloff = ' AND p.fid NOT IN(' . pwImplode($fidoff) . ')';
    $count = $db->get_value("SELECT COUNT(*) AS count FROM {$pw_posts} p WHERE authorid=" . pwEscape($userdb['uid']) . " {$sqloff}");
    $nurl = "u.php?action=post&uid={$uid}&";
    if ($p_list) {
        $p_table = "";
        foreach ($p_list as $key => $val) {
            $name = $val ? $val : ($key != 0 ? getLangInfo('other', 'posttable') . $key : getLangInfo('other', 'posttable'));
            $p_table .= "<tr><td id=\"up_post{$key}\" class=\"fav\"><a href=\"{$nurl}ptable={$key}\">" . $name . "</a></td></tr>";
        }
        $nurl .= "ptable={$ptable}&";
    }
    $pages = numofpage($count, $page, ceil($count / $db_perpage), $nurl);
    $isGM = CkInArray($windid, $manager);
    $postdb = array();
    $query = $db->query("SELECT p.pid,p.postdate,t.tid,t.fid,t.subject,t.authorid,t.author,t.titlefont,t.anonymous FROM {$pw_posts} p LEFT JOIN pw_threads t USING(tid) WHERE p.authorid=" . pwEscape($userdb['uid']) . " {$sqloff} ORDER BY p.postdate DESC {$limit}");
Exemplo n.º 2
0
            $rt['icon'] = goodsicon($rt['icon']);
            $trade[] = $rt;
        }
    } elseif ($job == 'saled') {
        $count = $db->get_value("SELECT COUNT(*) FROM pw_tradeorder WHERE seller=" . S::sqlEscape($u));
        list($pages, $limit) = pwLimitPages($count, $page, $basename . "a={$a}&job={$job}&");
        $trade = array();
        $query = $db->query("SELECT td.*,t.icon,m.username FROM pw_tradeorder td LEFT JOIN pw_trade t ON td.tid=t.tid LEFT JOIN pw_members m ON td.buyer=m.uid WHERE td.seller=" . S::sqlEscape($u) . ' ORDER BY td.oid DESC ' . $limit);
        while ($rt = $db->fetch_array($query)) {
            $rt['icon'] = goodsicon($rt['icon']);
            $trade[] = $rt;
        }
    }
}
if ($where) {
    $u != $winduid && ($where .= ' AND fid NOT IN(' . S::sqlImplode(getFidoff($groupid)) . ')');
    $count = $db->get_value("SELECT count(*) as count FROM pw_threads WHERE {$where} AND fid != 0");
    if ($count) {
        list($pages, $limit) = pwLimitPages($count, $page, $thisbase);
        !isset($userService) && ($userService = L::loadClass('UserService', 'user'));
        $rs = $db->query("SELECT tid,fid,author,authorid,subject,postdate,lastpost,lastposter,replies,hits,titlefont,anonymous,modelid,special FROM pw_threads {$force} WHERE {$where} AND fid != 0 ORDER BY {$ordertype} DESC {$limit}");
        while ($rt = $db->fetch_array($rs)) {
            $rt['subject'] = substrs($rt['subject'], 45);
            $rt['forum'] = strip_tags($forum[$rt['fid']]['name']);
            $rt['postdate'] = formateDate($rt['postdate']);
            $rt['lastpost'] = formateDate($rt['lastpost']);
            //		$rt['authorid'] == $winduid && $rt['lastposter'] = $windid;
            $rt['pcid'] = $rt['special'] > 20 ? $rt['special'] - 20 : 0;
            if (!$isGM && $rt['anonymous']) {
                $rt['author'] = $rt['authorid'] = '';
            }