Example #1
0
    $start = 0;
}
if (!isset($checkmode)) {
    $checkmode = '';
}
if (!isset($checkinfo)) {
    $checkinfo = '';
}
if (!isset($pagemode)) {
    $pagemode = '';
}
if (defined('MOD_CLUBBASE')) {
    eval(import_module('clubbase'));
}
$cmd_info = '';
$start = getstart($start, $pagemode);
$resultinfo = '';
if ($command != 'submitedit') {
    $pcdata = dbsearch($start, $checkmode, $checkinfo);
}
if ($command == 'kill' || $command == 'live' || $command == 'del') {
    $operlist = $operlist2 = $dfaillist = $gfaillist = array();
    for ($i = 0; $i < $showlimit; $i++) {
        if (isset(${'pc_' . $i})) {
            if (isset($pcdata[$i]) && $pcdata[$i]['pid'] == ${'pc_' . $i}) {
                if ($command == 'kill') {
                    if ($pcdata[$i]['hp'] > 0) {
                        $operlist[${'pc_' . $i}] = $pcdata[$i]['name'];
                        $pcdata[$i]['hp'] = 0;
                        $pcdata[$i]['state'] = 15;
                        $deathnum++;
Example #2
0
         $limit2 = $L == $db_perpage ? '' : S::sqlLimit(0, $db_perpage - $L);
         if ($toptids) {
             $query = $db->query("SELECT * FROM pw_threads WHERE tid IN({$toptids}) AND topped>0 ORDER BY specialsort DESC,{$orderway} DESC {$limit}");
             while ($rt = $db->fetch_array($query)) {
                 $tpcdb[] = $rt;
             }
             $db->free_result($query);
         }
         unset($toptids, $L, $limit, $toppeddb);
     } else {
         list($st, $lt, $asc, $R) = getstart($start_limit - $rows, $asc, $count);
         $limit2 = S::sqlLimit($st, $lt);
     }
     unset($rows);
 } else {
     list($st, $lt, $asc, $R) = getstart($start_limit, $asc, $count);
     $limit2 = S::sqlLimit($st, $lt);
 }
 if ($limit2) {
     if ($topicsearch == 1) {
         S::gp(array('searchname', 'new_searchname'));
         $searchname && ($new_searchname = StrCode(serialize($searchname)));
         if ($modelid > 0) {
             list($count, $tiddb, $alltiddb) = $postTopic->getSearchvalue($new_searchname, 'one', true);
         } elseif ($pcid > 0) {
             list($count, $tiddb, $alltiddb) = $postCate->getSearchvalue($new_searchname, 'one', true);
         }
         if ($tiddb) {
             $query = $db->query("SELECT * FROM pw_threads WHERE tid IN (" . S::sqlImplode($tiddb) . ")");
             $urladd = "&topicsearch=1&new_searchname={$new_searchname}";
             while ($thread = $db->fetch_array($query)) {
Example #3
0
 function getThreadSortWithToppedThread($allowtop, $start)
 {
     global $count;
     $R = 0;
     $tpcdb = array();
     $asc = $this->threadSearch->asc;
     if ($allowtop) {
         global $foruminfo, $db_perpage;
         $toptids = trim($foruminfo['topthreads'], ',');
         $rows = !$toptids ? 0 : (int) $this->db->get_value("SELECT COUNT(*) FROM pw_threads_img WHERE tid IN({$toptids}) LIMIT 1");
         if ($start < $rows) {
             $L = (int) min($rows - $start, $db_perpage);
             $limit = S::sqlLimit($start, $L);
             $offset = 0;
             $limit2 = $L == $db_perpage ? '' : $db_perpage - $L;
             if ($toptids) {
                 $query = $this->db->query("SELECT t.*,ti.cover,ti.totalnum,ti.collectnum,ti.ifthumb FROM pw_threads_img ti LEFT JOIN pw_threads t ON ti.tid=t.tid WHERE ti.tid IN({$toptids}) ORDER BY ti.topped DESC,ti.tid DESC {$limit}");
                 while ($rt = $this->db->fetch_array($query)) {
                     $tpcdb[] = $rt;
                 }
                 $this->db->free_result($query);
             }
             unset($toptids, $L, $limit);
         } else {
             list($offset, $limit2, $asc, $R) = getstart($start - $rows, $asc, $count);
         }
     } else {
         list($offset, $limit2, $asc, $R) = getstart($start, $asc, $count);
     }
     $this->threadSearch->asc = $asc;
     return array($offset, $limit2, $tpcdb, $R);
 }