• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP pwLimit函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中pwLimit函数的典型用法代码示例。如果您正苦于以下问题:PHP pwLimit函数的具体用法?PHP pwLimit怎么用?PHP pwLimit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: getReplaysByUser

 /**
  * @param $uid			用户ID
  * @param $page			当前页数
  * @return unknown_type	返回类型
  */
 function getReplaysByUser($uid, $page = 1)
 {
     global $db_ptable;
     $uid = (int) $uid;
     if (!$uid) {
         return array();
     }
     $pw_posts = GetPtable($db_ptable);
     (int) $page < 1 && ($page = 1);
     $start = ($page - 1) * $this->perPage;
     $limit = pwLimit($start, $this->perPage);
     $sql = "SELECT p.pid,p.postdate,t.tid,t.fid,t.subject,t.authorid,t.author,t.replies,t.hits,t.topped,t.digest,t.ifupload\r\n\t\t\t FROM {$pw_posts} p LEFT JOIN pw_threads t USING(tid) WHERE p.fid != 0 AND p.authorid= " . pwEscape($uid) . " \r\n\t\t\t AND p.fid != '0' ORDER BY p.postdate DESC {$limit}";
     return $this->_query($sql, $start, 're');
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:19,代码来源:myspace.db.php


示例2: viewReply

function viewReply($tid, $page, $replies, $per, $max, $ptable, $order)
{
    global $db, $db_shield;
    $page == 'e' && ($page = 65535);
    (int) $page < 1 && ($page = 1);
    $total = ceil($replies / $per);
    $total == 0 ? $page = 1 : ($page > $total ? $page = $total : '');
    $satrt = ($page - 1) * $per;
    $id = $satrt;
    $limit = pwLimit($satrt, $per);
    $posts = '';
    $pw_posts = GetPtable($ptable);
    $sql = "SELECT p.aid,p.pid,p.subject,p.author,p.authorid,p.content,p.postdate,p.anonymous,p.ifshield,m.groupid \n\t\t\tFROM {$pw_posts} p LEFT JOIN pw_members m ON m.uid = p.authorid\n\t\t\tWHERE tid=" . pwEscape($tid) . " \n\t\t\tAND ifcheck=1 ORDER BY postdate {$limit}";
    if ($order == 2) {
        $sql = "SELECT p.aid,p.pid,p.subject,p.author,p.authorid,p.content,p.postdate,p.anonymous,p.ifshield,m.groupid \n\t\t\t\tFROM {$pw_posts} p LEFT JOIN pw_members m ON m.uid = p.authorid\n\t\t\t\tWHERE tid=" . pwEscape($tid) . " \n\t\t\t\tAND ifcheck=1 ORDER BY postdate desc {$limit}";
    }
    $query = $db->query($sql);
    while ($ct = $db->fetch_array($query)) {
        if ($ct['content']) {
            $id++;
            if ($ct['ifshield'] || $ct['groupid'] == 6 && $db_shield) {
                if ($ct['ifshield'] == 2) {
                    $ct['content'] = shield('shield_del_article');
                    $ct['subject'] = '';
                    $tpc_shield = 1;
                } else {
                    $ct['content'] = shield($ct['ifshield'] ? 'shield_article' : 'ban_article');
                    $ct['subject'] = '';
                    $tpc_shield = 1;
                }
            }
            $ct['subject'] = str_replace('&nbsp;', '', wap_cv($ct['subject']));
            $ct['content'] = replySubject($ct['content']);
            list(, $ct['postdate']) = getLastDate($ct['postdate']);
            $ct['id'] = $id;
            if ($order == 2) {
                $ct['id'] = $replies - $id + 1;
            }
            if ($ct['anonymous'] && $ct['authorid'] != $winduid) {
                $ct['author'] = $db_anonymousname;
                $ct['authorid'] = 0;
            }
            $ct['author'] = wap_cv($ct['author']);
            $postdb[] = $ct;
        }
    }
    return $postdb;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:48,代码来源:threadfunction.php


示例3: getRecommendByType

 /**
  * @param $type
  * @param $page
  * @return unknown_type
  */
 function getRecommendByType($type, $page = 1)
 {
     $result = array();
     $where = " WHERE (t.fid != 0 OR t.fid IS NULL) ";
     if ($type) {
         $where .= " AND  p.typeid = " . pwEscape($type);
     }
     (int) $page < 1 && ($page = 1);
     $start = ($page - 1) * $this->perPage;
     $limit = pwLimit($start, $this->perPage);
     $query = $this->db->query("SELECT p.*,t.replies,t.hits,t.author,t.authorid,t.lastposter,t.lastpost FROM pw_wappush p LEFT JOIN pw_threads t ON p.tid = t.tid \r\n\t\t\t\t\t{$where} ORDER BY p.id DESC {$limit}");
     while ($rt = $this->db->fetch_array($query)) {
         $rt['index'] = ++$start;
         list(, $lastDate) = getLastDate($rt['lastpost']);
         $rt['lastpost'] = $lastDate;
         $result[] = $rt;
     }
     return $result;
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:24,代码来源:recommend.db.php


示例4: get

 function get($appid, $uid, $num, $start = 0)
 {
     if ($num == 'all') {
         $num = 500;
     } elseif (!is_numeric($num) || $num < 1) {
         $num = 20;
     } elseif ($num > 500) {
         $num = 500;
     }
     (!is_numeric($start) || $start < 0) && ($start = 0);
     $users = array();
     $query = $this->db->query("SELECT friendid FROM pw_friends WHERE status='0' AND uid=" . pwEscape($uid) . pwLimit($start, $num));
     while ($rt = $this->db->fetch_array($query)) {
         $app = $this->db->get_one("SELECT * FROM pw_userapp WHERE uid=" . pwEscape($rt['friendid']) . " AND appid=" . pwEscape($appid));
         if (empty($app)) {
             $users[] = $rt['friendid'];
         }
     }
     return new ApiResponse($users);
 }
开发者ID:keyu199314,项目名称:php,代码行数:20,代码来源:class_Invite.php


示例5: threadrelated

function threadrelated($relatedcon)
{
    global $db, $db_iftag, $db_threadrelated, $forumset, $fid, $read, $tid, $db_modes, $db_dopen, $db_phopen, $db_share_open, $db_groups_open, $groupid, $timestamp;
    $relatedb = array();
    if (in_array($relatedcon, array('allpost', 'alldigest', 'allhits', 'allreply', 'forumpost', 'forumdigest', 'forumhits', 'forumreply'))) {
        //require_once(R_P.'require/element.class.php');
        //$element = new Element($forumset['relatednums']);
        $element = L::loadClass('element');
        $element->setDefaultNum($forumset['relatednums']);
        switch ($relatedcon) {
            case 'allpost':
                $relatedb = $element->newSubject();
                break;
            case 'alldigest':
                $relatedb = $element->digestSubject();
                break;
            case 'allhits':
                $relatedb = $element->hitSort();
                break;
            case 'allreply':
                $relatedb = $element->replySort();
                break;
            case 'forumpost':
                $relatedb = $element->newSubject($fid);
                break;
            case 'forumdigest':
                $relatedb = $element->digestSubject($fid);
                break;
            case 'forumhits':
                $relatedb = $element->hitSort($fid);
                break;
            case 'forumreply':
                $relatedb = $element->replySort($fid);
                break;
        }
    } elseif ($relatedcon == 'oinfo') {
        //继续改进
        if ($db_modes['o']['ifopen']) {
            require_once "require/app_core.php";
            $addwhere = '';
            if (!$db_dopen) {
                $addwhere .= " AND type!='diary'";
            }
            if (!$db_phopen) {
                $addwhere .= " AND type!='photo'";
            }
            if (!$db_share_open) {
                $addwhere .= " AND type!='share'";
            }
            if (!$db_groups_open) {
                $addwhere .= " AND type!='colony'";
            }
            $query = $db->query("SELECT type,descrip FROM pw_feed WHERE uid=" . pwEscape($read['authorid']) . $addwhere . " ORDER BY timestamp DESC  " . pwLimit(0, $forumset['relatednums']));
            while ($rt = $db->fetch_array($query)) {
                $rt['title'] = parseFeedRead($rt['descrip']);
                $rt['url'] = "u.php?uid={$read['authorid']}";
                unset($rt['type']);
                $relatedb[] = $rt;
            }
        }
    } elseif (in_array($relatedcon, array('pictags', 'hottags'))) {
        $tagid = $tagdbs = array();
        $endtime = $timestamp - 30 * 24 * 3600;
        $sql = 'WHERE t.ifcheck=1 AND t.tid !=' . pwEscape($tid) . ' AND t.postdate >=' . pwEscape($endtime);
        $fidout = array('0');
        $query = $db->query("SELECT fid,allowvisit,password FROM pw_forums WHERE type<>'category'");
        while ($rt = $db->fetch_array($query)) {
            $allowvisit = !$rt['allowvisit'] || $rt['allowvisit'] != str_replace(",{$groupid},", '', $rt['allowvisit']) ? true : false;
            if ($rt['password'] || !$allowvisit) {
                $fidout[] = $rt['fid'];
            }
        }
        $fidout = pwImplode($fidout);
        $fidout && ($sql .= " AND fid NOT IN ({$fidout})");
        if ($db_iftag) {
            if ($read['tags'] && $relatedcon == 'pictags') {
                list($tagdb, $tpc_tag) = explode("\t", $read['tags']);
                $tagdbs = explode(' ', $tagdb);
            } elseif ($relatedcon == 'hottags') {
                @(include_once D_P . 'data/bbscache/tagdb.php');
                $j = 0;
                foreach ($tagdb as $key => $val) {
                    $j++;
                    if ($j > 5) {
                        break;
                    }
                    $tagdbs[] = $key;
                }
                unset($tagdb);
            }
            if ($tagdbs) {
                $query = $db->query("SELECT tagid FROM pw_tags WHERE tagname IN(" . pwImplode($tagdbs) . ')');
                while ($rt = $db->fetch_array($query)) {
                    $tagid[] = $rt['tagid'];
                }
            }
            if ($tagid) {
                $query = $db->query("SELECT t.tid,t.subject FROM pw_tagdata tg LEFT JOIN pw_threads t USING(tid) {$sql} AND tg.tagid IN(" . pwImplode($tagid) . ") GROUP BY tid ORDER BY postdate DESC " . pwLimit(0, $forumset['relatednums']));
                while ($rt = $db->fetch_array($query)) {
                    $rt['title'] = $rt['subject'];
//.........这里部分代码省略.........
开发者ID:adi00,项目名称:wumaproject,代码行数:101,代码来源:read.php


示例6: forum_creditcheck

$metaKeywords = $pw_seoset->getPageMetakeyword($foruminfo['keywords'], $foruminfo['name']);
if ($groupid != 3 && !$foruminfo['allowvisit'] && !admincheck($foruminfo['forumadmin'], $foruminfo['fupadmin'], $windid)) {
    forum_creditcheck();
}
if ($groupid != 3 && $foruminfo['forumsell'] && !admincheck($foruminfo['forumadmin'], $foruminfo['fupadmin'], $windid)) {
    forum_sell($fid);
}
$db_perpage = 100;
$db_maxpage && $page > $db_maxpage && ($page = $db_maxpage);
(!is_numeric($page) || $page < 1) && ($page = 1);
if ($page > 1) {
    $start_limit = ($page - 1) * $db_perpage;
} else {
    $start_limit = 0;
    $page = 1;
}
$startid = $start_limit + 1;
$count = $foruminfo['topic'];
$numofpage = ceil($count / $db_perpage);
if ($numofpage && $page > $numofpage) {
    $page = $numofpage;
}
$pages = PageDiv($count, $page, $numofpage, "{$DIR}f{$fid}", $db_maxpage);
$threaddb = array();
$query = $db->query("SELECT * FROM pw_threads WHERE fid=" . pwEscape($fid) . " AND topped<=3 AND ifcheck='1' ORDER BY topped DESC, lastpost DESC" . pwLimit($start_limit, $db_perpage));
while ($thread = $db->fetch_array($query)) {
    $threaddb[] = $thread;
}
$db->free_result($query);
require_once PrintEot('simple_header');
require_once PrintEot('simple_thread');
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:mod_thread.php


示例7: PostCheck

         //exit;
     }
 } else {
     //require_once(R_P.'require/postfunc.php');
     PostCheck(1, $o_photos_gdcheck, $o_photos_qcheck);
     InitGP(array('pintro'), 'P');
     empty($pintro) && ($pintro = array());
     require_once R_P . 'require/bbscode.php';
     $wordsfb = L::loadClass('FilterUtil');
     foreach ($pintro as $k => $v) {
         if (($banword = $wordsfb->comprise($v)) !== false) {
             Showmsg('content_wordsfb');
         }
     }
     if (!$aid) {
         $albumcheck = $db->get_one("SELECT aid FROM pw_cnalbum WHERE atype='0' AND ownerid=" . pwEscape($winduid) . pwLimit(1));
         if ($albumcheck) {
             Showmsg('colony_albumclass');
         } else {
             $db->update("INSERT INTO pw_cnalbum SET " . pwSqlSingle(array('aname' => getLangInfo('app', 'defaultalbum'), 'atype' => 0, 'ownerid' => $winduid, 'owner' => $windid, 'lasttime' => $timestamp, 'crtime' => $timestamp)));
             $aid = $db->insert_id();
         }
     }
     !$aid && Showmsg('colony_albumclass');
     $rt = $db->get_one("SELECT aname,photonum,ownerid,private,lastphoto FROM pw_cnalbum WHERE atype='0' AND aid=" . pwEscape($aid));
     if (empty($rt)) {
         Showmsg('undefined_action');
     } elseif ($winduid != $rt['ownerid']) {
         Showmsg('colony_phototype');
     }
     $o_maxphotonum && $rt['photonum'] >= $o_maxphotonum && Showmsg('colony_photofull');
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:index.php


示例8: PostCheck

 $pwServer['REQUEST_METHOD'] != 'POST' && PostCheck($verify);
 InitGP(array('step', 'by', 'sendto', 'touser', 'subject', 'atc_content', 'present', 'percount', 'count'));
 $cache_file = D_P . "data/bbscache/" . substr($admin_pwd, 10, 10) . ".txt";
 if (!$step) {
     writeover($cache_file, $atc_content);
 } else {
     $atc_content = readover($cache_file);
 }
 if (empty($subject) || empty($atc_content)) {
     adminmsg('sendmsg_empty');
 }
 $sendmessage = $atc_content;
 !$percount && ($percount = 100);
 empty($step) && ($step = 1);
 $start = ($step - 1) * $percount;
 $limit = pwLimit($start, $percount);
 $creditlist = '';
 $sendmessage .= '<br /><br /><b>' . getLangInfo('other', 'affect') . '</b>';
 foreach ($present as $key => $val) {
     if (empty($val)) {
         continue;
     }
     if (is_numeric($val)) {
         $creditlist .= "&present[{$key}]={$val}";
         $sendmessage .= $credit->cType[$key] . "<font color=#FA891B>(+{$val})</font> ";
     } else {
         adminmsg('credit_isnum');
     }
 }
 if ($by == 0) {
     !$sendto && adminmsg('operate_error');
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:present.php


示例9: array_diff

             $sendGroup[] = $rs['gid'];
         }
         $sendGroup = array_diff($sendGroup, array('-1'));
     }
     $subject = S::escapeChar($subject);
     $sendmessage = S::escapeChar($atc_content);
     $messageInfo = array('create_uid' => $winduid, 'create_username' => $windid, 'title' => $subject, 'content' => $sendmessage);
     $messageServer->createMessageTasks($sendGroup, $messageInfo);
     $count = $db->get_value("SELECT COUNT(*) AS sum FROM pw_members WHERE groupid IN(" . S::sqlImplode($sendto) . ')');
 } else {
     S::gp(array('count'));
 }
 $perpage = 10000;
 $havesend = $step * $perpage;
 $tmpArray = $sendto + array(0);
 $db->query("CREATE TEMPORARY TABLE tmp_datastate SELECT uid FROM pw_members WHERE groupid IN(" . S::sqlImplode($tmpArray) . ')' . pwLimit(($step - 1) * $perpage, $perpage));
 $db->update("INSERT INTO pw_ms_configs (uid) SELECT a.uid FROM tmp_datastate a LEFT JOIN pw_ms_configs b ON a.uid=b.uid WHERE b.uid IS NULL");
 $db->update("UPDATE tmp_datastate a LEFT JOIN pw_members m ON a.uid=m.uid LEFT JOIN pw_ms_configs c ON a.uid=c.uid SET m.newpm=m.newpm+1,c.notice_num=c.notice_num+1");
 //* 清除pw_members缓存 start
 $_num = $db->get_value("SELECT count(*) FROM tmp_datastate");
 if ($_num > 1500) {
     $_cacheService = L::loadClass('cacheservice', 'utility');
     $_cacheService->flush(PW_CACHE_MEMCACHE);
 } else {
     $_query = $db->query("SELECT uid FROM tmp_datastate");
     $_uids = array();
     while ($rt = $db->fetch_array($_query)) {
         $_uids[] = $rt['uid'];
     }
     Perf::gatherInfo('changeMembersWithUserIds', array('uid' => $_uids));
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:sendmsg.php


示例10: IN

        if (count($newtiddb) > 0) {
            $db->update("DELETE FROM {$pcvaluetable} WHERE tid IN(" . pwImplode($newtiddb) . ") AND ifrecycle=0");
        }
        is_array($threadb) && ($alltids = implode(',', $threadb));
        $count = $db->get_value("SELECT COUNT(tid) as count FROM {$pcvaluetable} WHERE ifrecycle=0");
    }
    if ($count > 0) {
        $page < 1 && ($page = 1);
        $numofpage = ceil($count / $db_perpage);
        if ($numofpage && $page > $numofpage) {
            $page = $numofpage;
        }
        $pages = numofpage($count, $page, $numofpage, "{$admin_file}?adminjob=postcate&action=postcate&pcid={$pcid}&newfield={$newfield}&step={$step}&");
        if ($step != 'search') {
            $start = ($page - 1) * $db_perpage;
            $limit = pwLimit($start, $db_perpage);
        }
        $catedb = array();
        $query = $db->query("SELECT pv.tid,t.fid,t.subject,t.author,t.authorid,t.postdate FROM {$pcvaluetable} pv LEFT JOIN pw_threads t ON pv.tid=t.tid WHERE 1 AND ifrecycle=0 {$sql} ORDER BY t.postdate DESC {$limit}");
        while ($rt = $db->fetch_array($query)) {
            $rt['postdate'] = get_date($rt['postdate']);
            $catedb[] = $rt;
        }
    }
    include PrintEot('postcate');
    exit;
} elseif ($_POST['sendmsg'] || $action == 'sendmsg') {
    InitGP(array('step', 'nexto'));
    if (empty($step)) {
        InitGP(array('selid', 'alltids'));
        if ($selid) {
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:postcate.php


示例11: bakupdata

function bakupdata($tabledb, $start = 0)
{
    global $db, $sizelimit, $tableid, $start, $stop, $rows;
    $tableid = $tableid ? $tableid - 1 : 0;
    $stop = 0;
    $t_count = count($tabledb);
    for ($i = $tableid; $i < $t_count; $i++) {
        $ts = $db->get_one("SHOW TABLE STATUS LIKE " . pwEscape($tabledb[$i]));
        $rows = $ts['Rows'];
        $flag = true;
        while ($flag) {
            $limitadd = pwLimit($start, 100000);
            $query = $db->query("SELECT * FROM {$tabledb[$i]} {$limitadd}");
            $num_F = $db->num_fields($query);
            while ($datadb = $db->fetch_array($query, MYSQL_NUM)) {
                $start++;
                $bakupdata .= "INSERT INTO {$tabledb[$i]} VALUES(" . "'" . $db->escape_string($datadb[0]) . "'";
                $tempdb = '';
                for ($j = 1; $j < $num_F; $j++) {
                    $tempdb .= ",'" . $db->escape_string($datadb[$j]) . "'";
                }
                $bakupdata .= $tempdb . ");\n";
                if ($sizelimit && strlen($bakupdata) > $sizelimit * 1000) {
                    $flag = false;
                    break;
                }
            }
            $db->free_result($query);
            if ($start >= $rows) {
                $flag = false;
                $start = 0;
            }
        }
        $bakupdata .= "\n";
        if ($sizelimit && strlen($bakupdata) > $sizelimit * 1000) {
            $stop = 1;
            break;
        }
    }
    if ($stop == 1) {
        $tableid = ++$i;
    }
    return $bakupdata;
}
开发者ID:adi00,项目名称:wumaproject,代码行数:44,代码来源:bakup.php


示例12: Showmsg

 if (!$ifadmin && (!$colony['ifcyer'] || $colony['ifadmin'] == '-1')) {
     Showmsg('colony_cnmenber');
 }
 InitGP(array('aid', 'selaid'));
 $album = $db->get_one("SELECT aname,ownerid,photonum FROM pw_cnalbum WHERE atype='0' AND aid=" . pwEscape($aid));
 if (empty($album) || $album['ownerid'] != $winduid) {
     Showmsg('data_error');
 }
 if (empty($_POST['step'])) {
     $options = '';
     $query = $db->query("SELECT aid,aname FROM pw_cnalbum WHERE atype='1' AND ownerid=" . pwEscape($cyid) . ' ORDER BY aid DESC');
     while ($rt = $db->fetch_array($query)) {
         $options .= "<option value=\"{$rt['aid']}\"" . ($rt['aid'] == $selaid ? ' selected' : '') . ">{$rt['aname']}</option>";
     }
     $cnpho = array();
     $query = $db->query("SELECT pid,path,ifthumb FROM pw_cnphoto WHERE aid=" . pwEscape($aid) . ' ORDER BY pid ' . pwLimit(0, $o_maxphotonum));
     while ($rt = $db->fetch_array($query)) {
         $rt['path'] = getphotourl($rt['path'], $rt['ifthumb']);
         $cnpho[] = $rt;
     }
     list($isheader, $isfooter, $tplname, $isleft) = array(true, true, "m_galbum", true);
 } else {
     InitGP(array('selid'));
     if (!$selid || !is_array($selid)) {
         Showmsg('colony_select_photo');
     }
     if (empty($selaid)) {
         Showmsg('colony_albumclass');
     }
     $selalbum = $db->get_one("SELECT aname,photonum,ownerid,lastphoto FROM pw_cnalbum WHERE atype='1' AND aid=" . pwEscape($selaid));
     if (empty($selalbum)) {
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:m_galbum.php


示例13: array

     $tpcdb = array();
     if ($tiddb) {
         $query = $db->query("SELECT * FROM pw_threads WHERE tid IN (" . pwImplode($tiddb) . ") {$pcsqladd} ORDER BY {$orderway} {$asc}");
         while ($thread = $db->fetch_array($query)) {
             $tpcdb[] = $thread;
         }
         $db->free_result($query);
     }
 } elseif ($limit2) {
     if (empty($urladd) && strtolower($db_datastore) == 'memcache' && !$R && $offset < 980) {
         $threadlist = L::loadClass("threadlist");
         $tmpTpcdb = $threadlist->getThreads($fid, $offset, $limit2);
         $tpcdb = array_merge((array) $tpcdb, (array) $tmpTpcdb);
     } else {
         //$topadd .= $R ? 'topped ASC,' : 'topped DESC,';
         $query = $db->query("SELECT * FROM pw_threads WHERE {$sql} {$searchadd} ORDER BY {$topadd} {$orderway} {$asc} " . pwLimit($offset, $limit2));
         while ($thread = $db->fetch_array($query)) {
             $tpcdb[] = $thread;
         }
         $db->free_result($query);
         $R && ($tpcdb = array_reverse($tpcdb));
     }
 }
 //Start Here pwcache
 if ($db_ifpwcache & 112 && pwFilemtime(D_P . 'data/bbscache/hitsort_judge.php') < $timestamp - 600) {
     include_once D_P . 'data/bbscache/hitsort_judge.php';
     $updatelist = $updatetype = array();
     foreach ($tpcdb as $thread) {
         if ($db_ifpwcache & 16) {
             if ($thread['hits'] > $hitsort_judge['hitsort'][$fid] && $thread['fid'] == $fid) {
                 $updatelist[] = array('hitsort', $fid, $thread['tid'], $thread['hits'], '', 0);
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:thread.php


示例14: IN

     $pwSQL = "WHERE groupid IN(" . pwImplode($pwSendmail['info']) . ")";
 } elseif ($pwSendmail['by'] == 1) {
     require_once R_P . 'require/getonlineuser.php';
     $onlineuser = GetOnlineUser();
     $uids = array();
     foreach ($onlineuser as $key => $value) {
         is_numeric($key) && ($uids[] = $key);
     }
     $pwSQL = "WHERE uid IN(" . pwImplode($uids) . ")";
 } elseif ($pwSendmail['by'] == 2) {
     //TODO Efficiency problems
     $pwSQL = "WHERE regdate BETWEEN" . pwEscape($pwSendmail['info']['stime']) . "AND" . pwEscape($pwSendmail['info']['etime']);
 } else {
     adminmsg('operate_error');
 }
 $limit = pwLimit($pwSendmail['step'] * $pwSendmail['num'], $pwSendmail['num']);
 $query = $db->query("SELECT uid,username,email FROM pw_members {$pwSQL} {$limit}");
 while ($rt = $db->fetch_array($query)) {
     if (!$rt['email'] || !preg_match("/^[-a-zA-Z0-9_\\.]+@([0-9A-Za-z][0-9A-Za-z-]+\\.)+[A-Za-z]{2,5}\$/", $rt['email'])) {
         continue;
     }
     $sendsubject = str_replace(array('$winduid', '$windid', '$email'), array($rt['uid'], $rt['username'], $rt['email']), $pwSendmail['subject']);
     $sendcontent = str_replace(array('$winduid', '$windid', '$email'), array($rt['uid'], $rt['username'], $rt['email']), $pwSendmail['content']);
     sendemail($rt['email'], $sendsubject, $sendcontent, 'email_additional');
 }
 $pwSendmail['step']++;
 $havesend = $pwSendmail['sent'] = $pwSendmail['step'] * $pwSendmail['num'];
 $count = $pwSendmail['count'];
 if ($pwSendmail['count'] > $pwSendmail['sent']) {
     writeover($tmpCachefile, "<?php\r\ndie();\r\n?>\r\n" . serialize($pwSendmail));
     $j_url = "{$basename}&action={$action}";
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:sendmail.php


示例15: getSearchvalue

 function getSearchvalue($field, $type, $alltidtype = false, $backtype = false)
 {
     /*获取搜索结果*/
     global $db_perpage, $page, $modelid, $fid, $basename;
     $field = unserialize(StrCode($field, 'DECODE'));
     $sqladd = '';
     $fid && ($sqladd .= " fid=" . pwEscape($fid));
     $fielddb = postTopic::getFieldData($modelid, $type);
     foreach ($field as $key => $value) {
         if ($value) {
             if (in_array($fielddb[$key]['type'], array('number', 'radio', 'select'))) {
                 $sqladd .= $sqladd ? " AND " . $fielddb[$key]['fieldname'] . "=" . pwEscape($value) : $fielddb[$key]['fieldname'] . "=" . pwEscape($value);
             } elseif ($fielddb[$key]['type'] == 'checkbox') {
                 $checkboxs = '';
                 foreach ($value as $cv) {
                     $checkboxs .= $checkboxs ? ',' . $cv : $cv;
                 }
                 $value = '%,' . $checkboxs . ',%';
                 $sqladd .= $sqladd ? " AND " . $fielddb[$key]['fieldname'] . " LIKE(" . pwEscape($value) . ")" : $fielddb[$key]['fieldname'] . " LIKE(" . pwEscape($value) . ")";
             } elseif ($fielddb[$key]['type'] == 'calendar' && ($value['start'] || $value['end'])) {
                 $value['start'] && ($value['start'] = PwStrtoTime($value['start']));
                 $value['end'] && ($value['end'] = PwStrtoTime($value['end']));
                 if ($value['start'] > $value['end'] && $value['start'] && $value['end']) {
                     Showmsg('calendar_error');
                 }
                 $sqladd .= $sqladd ? " AND " . $fielddb[$key]['fieldname'] . ">=" . pwEscape($value['start']) . " AND " . $fielddb[$key]['fieldname'] . "<=" . pwEscape($value['end']) : $fielddb[$key]['fieldname'] . ">=" . pwEscape($value['start']) . " AND " . $fielddb[$key]['fieldname'] . "<=" . pwEscape($value['end']);
             } elseif (in_array($fielddb[$key]['type'], array('text', 'url', 'email', 'textarea'))) {
                 $value = '%' . $value . '%';
                 $sqladd .= $sqladd ? " AND " . $fielddb[$key]['fieldname'] . " LIKE(" . pwEscape($value) . ")" : $fielddb[$key]['fieldname'] . " LIKE(" . pwEscape($value) . ")";
             } elseif ($fielddb[$key]['type'] == 'range' && $value['min'] && $value['max']) {
                 $sqladd .= $sqladd ? " AND " . $fielddb[$key]['fieldname'] . ">=" . pwEscape($value['min']) . " AND " . $fielddb[$key]['fieldname'] . "<=" . pwEscape($value['max']) : $fielddb[$key]['fieldname'] . ">=" . pwEscape($value['min']) . " AND " . $fielddb[$key]['fieldname'] . "<=" . pwEscape($value['max']);
             } else {
                 $sqladd .= '';
             }
         }
     }
     if ($sqladd) {
         !$page && ($page = 1);
         $start = ($page - 1) * $db_perpage;
         $limit = pwLimit($start, $db_perpage);
         $tablename = GetTopcitable($modelid);
         $sqladd .= $sqladd ? " AND ifrecycle=0" : " ifrecycle=0";
         $count = $this->db->get_value("SELECT COUNT(*) as count FROM {$tablename} WHERE {$sqladd}");
         $query = $this->db->query("SELECT tid FROM {$tablename} WHERE {$sqladd} {$limit}");
         while ($rt = $this->db->fetch_array($query)) {
             $tiddb[] = $rt['tid'];
         }
         if ($alltidtype) {
             $query = $this->db->query("SELECT tid FROM {$tablename} WHERE {$sqladd}");
             while ($rt = $this->db->fetch_array($query)) {
                 $alltiddb[] = $rt['tid'];
             }
         }
         !$count && ($count = -1);
     } else {
         if ($backtype) {
             adminmsg('topic_search_none', "{$basename}&action=topic&modelid={$modelid}");
         }
         Showmsg('topic_search_none');
     }
     return array($count, $tiddb, $alltiddb);
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:62,代码来源:posttopic.class.php


示例16: getFriends

/**
 * 获取好友列表
 *
 * @param int $uid		需要查找的uid;
 * @param int $start	limit条件
 * @param int $num		limit条件
 * @param int $ftype	好友分组
 * @param int $show		是否需要详细数据
 * @return array
 */
function getFriends($uid, $start = 0, $num = 0, $ftype = false, $show = false, $imgtype = 'm')
{
    global $db, $db_onlinetime, $timestamp, $winduid;
    $fild = 'm.uid,m.username,f.ftid,f.iffeed';
    $order = $where = '';
    if ($show) {
        $fild .= ',m.icon as face,m.honor,md.f_num,md.thisvisit,md.lastvisit';
        $left = 'LEFT JOIN pw_memberdata md ON f.friendid=md.uid';
        $order = 'md.thisvisit';
    } else {
        $left = '';
        $order = 'f.joindate';
    }
    if ($ftype !== false && $ftype !== '') {
        $ftype = (int) $ftype;
        $where = ' AND f.ftid=' . pwEscape($ftype);
    }
    $start = (int) $start;
    $num = (int) $num;
    if ($start || $num) {
        !$num && ($num = 8);
        $limit = pwLimit($start, $num);
    } else {
        $limit = '';
    }
    $rs = $db->query("SELECT {$fild} FROM pw_friends f LEFT JOIN pw_members m ON f.friendid=m.uid {$left} WHERE f.uid=" . pwEscape($uid) . " AND f.status=0 {$where} ORDER BY {$order} DESC {$limit}");
    $result = array();
    if ($show) {
        require_once R_P . 'require/showimg.php';
        while ($one = $db->fetch_array($rs)) {
            list($one['face']) = showfacedesign($one['face'], 1, $imgtype);
            $one['honor'] = substrs($one['honor'], 90);
            $one['lastvisit'] = get_date($one['lastvisit']);
            $result[$one['uid']] = $one;
        }
    } else {
        while ($one = $db->fetch_array($rs)) {
            $result[$one['uid']] = $one;
        }
    }
    count($result) == 0 && ($result = false);
    return $result;
}
开发者ID:adi00,项目名称:wumaproject,代码行数:53,代码来源:common.php


示例17: gethotfavor

 function gethotfavor($fid = 0, $num = 0)
 {
     global $timestamp, $forum;
     !$fid && ($fid = getCommonFid());
     $num = intval($num) ? intval($num) : $this->cachenum;
     $sqladd = '';
     $fid && ($sqladd .= " AND fid IN ({$fid}) ");
     isset($forum) || (include D_P . 'data/bbscache/forum_cache.php');
     $favors = array();
     $query = $this->db->query("SELECT tid,fid,author,authorid,subject,postdate,hits,replies,favors FROM pw_threads WHERE favors>0 AND postdate >=" . pwEscape($timestamp - 360 * 24 * 3600) . " {$sqladd} ORDER BY favors DESC " . pwLimit($num));
     while ($rt = $this->db->fetch_array($query)) {
         $favor = array();
         $favor['url'] = 'read.php?tid=' . $rt['tid'];
         $favor['title'] = $rt['subject'];
         $favor['value'] = $rt['favors'];
         $favor['posttime'] = get_date($rt['postdate']);
         $favor['forum'] = $forum[$rt['fid']]['name'];
         $favor['image'] = '';
         $favor['addition'] = $rt;
         $favors[] = $favor;
     }
     return $favors;
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:23,代码来源:getinfo.class.php


示例18: forum_creditcheck

}
if (!$admincheck) {
    !$foruminfo['allowvisit'] && forum_creditcheck();
    #积分限制浏览
    $foruminfo['forumsell'] && forum_sell($fid);
    #出售版块
}
$per = 5;
$start = ($page - 1) * $per;
$tids = array();
/* 置顶贴处理 */
$topTids = $foruminfo['topthreads'];
$topTids = explode(',', $topTids);
if ($topTids && $start < count($topTids)) {
    $L = (int) min(count($topTids) - $start, $per);
    $limit = pwLimit($start, $L);
    $query = $db->query("SELECT * FROM pw_threads WHERE  fid!=0 AND tid IN(" . pwImplode($topTids) . ") ORDER BY specialsort DESC,lastpost DESC {$limit}");
    while ($rt = $db->fetch_array($query)) {
        $id++;
        if ($rt['anonymous'] && $rt['authorid'] != $winduid && !$pwAnonyHide) {
            $rt['author'] = $db_anonymousname;
            $rt['authorid'] = 0;
        }
        $rt['postdate'] = get_date($rt['postdate']);
        $rt['id'] = $id;
        $rt['subject'] = wap_cv(str_replace('&nbsp;', '', $rt['subject']));
        $tids[] = $rt;
    }
    $db->free_result($query);
}
InitGP(array('t'), 'GP');
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:31,代码来源:forum.php


示例19: pwEscape

     $sql .= ' postdate<' . pwEscape($postdate_e);
     $urladd .= "&postdate_e={$postdate_e}";
 }
 $ordertype = $ordertype == 'asc' ? 'asc' : 'desc';
 $urladd .= "&ordertype={$ordertype}&lines={$lines}";
 $count = $db->get_value("SELECT COUNT(*) AS count FROM pw_share WHERE {$sql}");
 empty($count) && adminmsg('share_not_exist', "{$basename}&action=share");
 !is_numeric($lines) && ($lines = 30);
 $page < 1 && ($page = 1);
 $numofpage = ceil($count / $lines);
 if ($numofpage && $page > $numofpage) {
     $page = $numofpage;
 }
 $pages = numofpage($count, $page, $numofpage, "{$basename}&action=share&job=list{$urladd}&");
 $start = ($page - 1) * $lines;
 $limit = pwLimit($start, $lines);
 $query = $db->query("SELECT * FROM pw_share WHERE {$sql} " . "ORDER BY postdate {$ordertype} " . $limit);
 while ($rt = $db->fetch_array($query)) {
     $rt['postdate'] = $rt['postdate'] ? get_date($rt['postdate']) : '-';
     $temp = unserialize($rt['content']);
     $rt['link'] = $temp['link'];
     if ($rt['type'] == 'user') {
         $rt['title'] = "<a href=\"{$rt['link']}\" target=\"_blank\">" . $temp['user']['username'] . "</a>";
     } elseif ($rt['type'] == 'photo') {
         $belong = getLangInfo('app', 'photo_belong');
         $rt['image'] = $temp['photo']['image'];
         $temp_uid = $temp['photo']['uid'];
         $rt['title'] = $belong . "<a href=\"u.php?uid={$temp_uid}\" target=\"_blank\">" . $temp['photo']['username'] . "</a>";
     } elseif ($rt['type'] == 'album') {
         $belong = getLangInfo('app', 'photo_belong');
         $temp_uid = $temp['album']['uid'];
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:admin.php


示例20: appShield

            $rt['descrip'] = appShield('ban_feed');
        }
        $key = get_date($rt['timestamp'], 'y-m-d');
        list($rt['faceurl']) = showfacedesign($rt['icon'], '1', 's');
        $rt['appicon'] = getAppIcon($rt['type']);
        $feeds[$key][] = $rt;
    }
}
$friends = getFriends($u, 0, 18, '', 1);
//$sendfriends = getFriends($winduid,0,0,false,1);
//留言板
if ($privacy['msgboard']) {
    $boards = array();
    require_once R_P . 'require/bbscode.php';
    $wordsfb = L::loadClass('FilterUtil');
    $query = $db->query("SELECT o.*,m.icon as face,m.groupid FROM pw_oboard o LEFT JOIN pw_members m ON o.uid=m.uid WHERE o.touid=" . pwEscape($u) . " ORDER BY o.id DESC " . pwLimit(0, 15));
    while ($rt = $db->fetch_array($query)) {
        $rt['postdate'] = get_date($rt['postdate']);
        list($rt['face']) = showfacedesign($rt['face'], 1, 'm');
        if ($rt['groupid'] == 6 && $db_shield && $groupid != 3) {
            $rt['title'] = appShield('ban_feed');
        } elseif (!$wordsfb->equal($rt['ifwordsfb'])) {
            $rt['title'] = $wordsfb->convert($rt['title'], array('id' => $rt['id'], 'type' => 'oboard', 'code' => $rt['ifwordsfb']));
        }
        if (strpos($rt['title'], '[s:') !== false) {
            $rt['title'] = showface($rt['title']);
        }
        if (strpos($rt['title'], '[url') !== false) {
            $rt['title'] = convert($rt['title'], $db_windpost);
        }
        $boardids[] = $rt['id'];
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:m_user.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP pwOutPut函数代码示例发布时间:2022-05-15
下一篇:
PHP pwJsonEncode函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap