本文整理汇总了PHP中CriteriaCompo::setTables方法的典型用法代码示例。如果您正苦于以下问题:PHP CriteriaCompo::setTables方法的具体用法?PHP CriteriaCompo::setTables怎么用?PHP CriteriaCompo::setTables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CriteriaCompo
的用法示例。
在下文中一共展示了CriteriaCompo::setTables方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setContent
function setContent($isreturn = false)
{
global $jieqiTpl;
global $jieqiConfigs;
jieqi_getconfigs('article', 'configs');
$article_static_url = empty($jieqiConfigs['article']['staticurl']) ? $GLOBALS['jieqiModules']['article']['url'] : $jieqiConfigs['article']['staticurl'];
$article_dynamic_url = empty($jieqiConfigs['article']['dynamicurl']) ? $GLOBALS['jieqiModules']['article']['url'] : $jieqiConfigs['article']['dynamicurl'];
$jieqiTpl->assign('article_static_url', $article_static_url);
$jieqiTpl->assign('article_dynamic_url', $article_dynamic_url);
jieqi_includedb();
$query = JieqiQueryHandler::getInstance('JieqiQueryHandler');
$criteria = new CriteriaCompo();
$criteria->setFields("r.*,a.articlename");
$criteria->setTables(jieqi_dbprefix('article_reviews') . " AS r LEFT JOIN " . jieqi_dbprefix('article_article') . " AS a ON r.ownerid=a.articleid");
if ($this->exevars['istop'] == 1) {
$criteria->add(new Criteria('r.istop', '1'));
} elseif ($this->exevars['istop'] == 2) {
$criteria->add(new Criteria('r.istop', '0'));
}
if ($this->exevars['isgood'] == 1) {
$criteria->add(new Criteria('r.isgood', '1'));
} elseif ($this->exevars['isgood'] == 2) {
$criteria->add(new Criteria('r.isgood', '0'));
}
$criteria->setSort('r.topicid');
$criteria->setOrder('DESC');
$criteria->setLimit($this->exevars['listnum']);
$criteria->setStart(0);
$query->queryObjects($criteria);
$reviewrows = array();
$i = 0;
while ($v = $query->getObject()) {
$reviewrows[$i]['reviewtitle'] = jieqi_htmlstr(str_replace(array("\r", "\n"), array('', ' '), $v->getVar('title', 'n')));
$reviewrows[$i]['ownerid'] = $v->getVar('ownerid');
$reviewrows[$i]['articlename'] = $v->getVar('articlename');
$reviewrows[$i]['topicid'] = $v->getVar('topicid');
$reviewrows[$i]['url_review'] = $article_dynamic_url . '/reviews.php?aid=' . $v->getVar('ownerid');
$reviewrows[$i]['poster'] = $v->getVar('poster');
$reviewrows[$i]['posterid'] = $v->getVar('posterid');
$reviewrows[$i]['postdate'] = date('m-d H:i', $v->getVar('posttime'));
$reviewrows[$i]['posttime'] = $v->getVar('posttime');
$reviewrows[$i]['replytime'] = $v->getVar('replytime');
$reviewrows[$i]['views'] = $v->getVar('views');
$reviewrows[$i]['replies'] = $v->getVar('replies');
$reviewrows[$i]['islock'] = $v->getVar('islock');
$reviewrows[$i]['istop'] = $v->getVar('istop');
$reviewrows[$i]['isgood'] = $v->getVar('isgood');
$reviewrows[$i]['topictype'] = $v->getVar('topictype');
$reviewrows[$i]['url_articleinfo'] = jieqi_geturl('article', 'article', $v->getVar('ownerid'), 'info');
$reviewrows[$i]['url_articleindex'] = jieqi_geturl('article', 'article', $v->getVar('ownerid'), 'index');
$reviewrows[$i]['url_articleread'] = $reviewrows[$i]['url_articleindex'];
$i++;
}
$jieqiTpl->assign_by_ref('reviewrows', $reviewrows);
$jieqiTpl->assign('url_more', $article_dynamic_url . '/reviewslist.php');
}
示例2: intval
* @package article
* @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com)
* @author $Author: juny $
* @version $Id: voteresult.php 332 2009-02-23 09:15:08Z juny $
*/
define('JIEQI_MODULE_NAME', 'article');
require_once '../../global.php';
if (empty($_REQUEST['id'])) {
jieqi_printfail(LANG_ERROR_PARAMETER);
}
jieqi_loadlang('avote', JIEQI_MODULE_NAME);
$_REQUEST['id'] = intval($_REQUEST['id']);
jieqi_includedb();
$query = JieqiQueryHandler::getInstance('JieqiQueryHandler');
$criteria = new CriteriaCompo();
$criteria->setTables(jieqi_dbprefix('article_avote') . " AS v LEFT JOIN " . jieqi_dbprefix('article_avstat') . " AS s ON v.voteid=s.voteid");
$criteria->add(new Criteria('v.voteid', $_REQUEST['id'], '='));
$criteria->setLimit(1);
$criteria->setSort('v.voteid');
$criteria->setOrder('DESC');
$query->queryObjects($criteria);
$voteres = $query->getObject();
if (!$voteres) {
jieqi_printfail($jieqiLang['article']['avote_not_exists']);
}
//包含区块参数
jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs');
include_once JIEQI_ROOT_PATH . '/header.php';
$article_static_url = empty($jieqiConfigs['article']['staticurl']) ? $jieqiModules['article']['url'] : $jieqiConfigs['article']['staticurl'];
$article_dynamic_url = empty($jieqiConfigs['article']['dynamicurl']) ? $jieqiModules['article']['url'] : $jieqiConfigs['article']['dynamicurl'];
$jieqiTpl->assign('article_static_url', $article_static_url);
示例3: CriteriaCompo
if (!$jieqiUsers) {
jieqi_printfail(LANG_NO_USER);
}
jieqi_loadlang('bookcase', JIEQI_MODULE_NAME);
jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs');
$maxnum = $jieqiConfigs['obook']['bookcasenum'];
include_once $jieqiModules['obook']['path'] . '/class/obookcase.php';
$obookcase_handler =& JieqiObookcaseHandler::getInstance('JieqiObookcaseHandler');
$criteria = new CriteriaCompo(new Criteria('userid', $jieqiUsers->getVar('uid')));
$cot = $obookcase_handler->getCount($criteria);
unset($criteria);
if (!empty($_REQUEST['cid'])) {
//加入书签
$obook_query = JieqiQueryHandler::getInstance('JieqiQueryHandler');
$criteria = new CriteriaCompo(new Criteria('c.ochapterid', $_REQUEST['cid']));
$criteria->setTables(jieqi_dbprefix('obook_ochapter') . ' c LEFT JOIN ' . jieqi_dbprefix('obook_obook') . ' a ON c.obookid=a.obookid');
$obook_query->queryObjects($criteria);
$chapter = $obook_query->getObject();
unset($criteria);
if (!$chapter) {
jieqi_printfail($jieqiLang['obook']['obook_not_exists']);
}
$criteria = new CriteriaCompo(new Criteria('userid', $jieqiUsers->getVar('uid')));
$criteria->add(new Criteria('obookid', $chapter->getVar('obookid')));
$obookcase_handler->queryObjects($criteria);
$obookcase = $obookcase_handler->getObject();
if (!$obookcase) {
if ($cot >= $maxnum) {
jieqi_printfail(sprintf($jieqiLang['obook']['bookcase_is_full'], $maxnum));
}
//没有在书架
示例4: date
$reviewrows[$k]['content'] = jieqi_htmlstr(jieqi_limitwidth($v->getVar('reviewtext', 'n'), $jieqiConfigs['article']['reviewwidth'], $start));
}
$reviewrows[$k]['postdate'] = date(JIEQI_DATE_FORMAT . ' ' . JIEQI_TIME_FORMAT, $v->getVar('postdate'));
$reviewrows[$k]['userid'] = $v->getVar('userid');
$reviewrows[$k]['username'] = $v->getVar('username');
$k++;
}
$jieqiTpl->assign_by_ref('reviewrows', $reviewrows);
$jieqiTpl->assign('url_goodreview', $article_dynamic_url . '/reviews.php?aid=' . $article->getVar('articleid') . '&type=good');
$jieqiTpl->assign('url_allreview', $article_dynamic_url . '/reviews.php?aid=' . $article->getVar('articleid') . '&type=all');
$jieqiTpl->assign('url_review', $article_dynamic_url . '/reviews.php?aid=' . $article->getVar('articleid'));
} elseif ($jieqiConfigs['article']['reviewtype'] == 2) {
$query = JieqiQueryHandler::getInstance('JieqiQueryHandler');
$criteria = new CriteriaCompo(new Criteria('t.ownerid', $article->getVar('articleid')));
$criteria->add(new Criteria('p.istopic', 1));
$criteria->setTables(jieqi_dbprefix('article_reviews') . ' t LEFT JOIN ' . jieqi_dbprefix('article_replies') . ' p ON t.topicid=p.topicid');
$criteria->setSort('t.istop DESC, t.topicid');
$criteria->setOrder('DESC');
$criteria->setLimit($jieqiConfigs['article']['reviewnew']);
$criteria->setStart(0);
$query->queryObjects($criteria);
$reviewrows = array();
$k = 0;
while ($v = $query->getObject()) {
$reviewrows[$k] = jieqi_topic_vars($v);
$k++;
}
/*
$sql="SELECT * FROM ".jieqi_dbprefix('article_userchap')." WHERE articleid=".jieqi_dbslashes($article->getVar('articleid', 'n'))." ORDER BY userchapid DESC LIMIT 0, ".intval($jieqiConfigs['article']['userchapnew']);
$ret=$query->execute($sql);
示例5: for
}
}
$sql='DELETE FROM '.jieqi_dbprefix('article_review').' WHERE '.$where;
$reviews_handler->db->query($sql);
}
*/
}
include_once JIEQI_ROOT_PATH . '/admin/header.php';
$jieqiTpl->assign('article_static_url', $article_static_url);
$jieqiTpl->assign('article_dynamic_url', $article_dynamic_url);
include_once JIEQI_ROOT_PATH . '/lib/text/textfunction.php';
$jieqiTpl->assign('url_review', $article_dynamic_url . '/admin/reviews.php');
$jieqiTpl->assign('checkall', '<input type="checkbox" id="checkall" name="checkall" value="checkall" onclick="javascript: for (var i=0;i<this.form.elements.length;i++){ if (this.form.elements[i].name != \'checkkall\') this.form.elements[i].checked = form.checkall.checked; }">');
$criteria = new CriteriaCompo();
$criteria->setFields("r.*,a.articlename");
$criteria->setTables(jieqi_dbprefix('article_reviews') . " AS r LEFT JOIN " . jieqi_dbprefix('article_article') . " AS a ON r.ownerid=a.articleid");
if (!empty($_REQUEST['keyword'])) {
$_REQUEST['keyword'] = trim($_REQUEST['keyword']);
if ($_REQUEST['keytype'] == 1) {
$criteria->add(new Criteria('r.poster', $_REQUEST['keyword'], '='));
} else {
$criteria->add(new Criteria('a.articlename', $_REQUEST['keyword'], '='));
}
}
if (isset($_REQUEST['type']) && $_REQUEST['type'] == 'good') {
//精华书评
$criteria->add(new Criteria('isgood', 1));
} else {
$_REQUEST['type'] = 'all';
}
//页码
示例6: setContent
function setContent($isreturn = false)
{
global $jieqiTpl;
global $jieqiConfigs;
jieqi_getconfigs('article', 'configs');
jieqi_getconfigs('article', 'sort');
$article_static_url = empty($jieqiConfigs['article']['staticurl']) ? $GLOBALS['jieqiModules']['article']['url'] : $jieqiConfigs['article']['staticurl'];
$article_dynamic_url = empty($jieqiConfigs['article']['dynamicurl']) ? $GLOBALS['jieqiModules']['article']['url'] : $jieqiConfigs['article']['dynamicurl'];
$jieqiTpl->assign('article_static_url', $article_static_url);
$jieqiTpl->assign('article_dynamic_url', $article_dynamic_url);
jieqi_includedb();
$bookcase_query = JieqiQueryHandler::getInstance('JieqiQueryHandler');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('c.userid', intval($this->blockvars['cacheid'])));
if ($this->exevars['flag'] == 1) {
$criteria->add(new Criteria('flag', 1));
} elseif ($this->exevars['flag'] == 2) {
$criteria->add(new Criteria('flag', 0));
}
$criteria->setTables(jieqi_dbprefix('article_bookcase') . ' c LEFT JOIN ' . jieqi_dbprefix('article_article') . ' a ON c.articleid=a.articleid');
$criteria->setFields('c.*, a.articleid, a.lastupdate, a.articlename, a.authorid, a.author, a.sortid, a.typeid, a.lastchapterid, a.lastchapter');
$tmpary = array('articleid' => 'a.articleid', 'lastupdate' => 'a.lastupdate', 'caseid' => 'c.caseid', 'joindate' => 'c.joindate', 'lastvisit' => 'c.lastvisit');
$criteria->setSort($tmpary[$this->exevars['field']]);
if ($this->exevars['asc'] == 1) {
$criteria->setOrder('ASC');
} else {
$criteria->setOrder('DESC');
}
$criteria->setLimit($this->exevars['listnum']);
$criteria->setStart(0);
$bookcase_query->queryObjects($criteria);
unset($criteria);
$bookcaserows = array();
$k = 0;
while ($v = $bookcase_query->getObject()) {
$bookcaserows[$k]['caseid'] = $v->getVar('caseid');
$bookcaserows[$k]['articleid'] = $v->getVar('articleid');
$bookcaserows[$k]['lastchapterid'] = $v->getVar('lastchapterid');
$bookcaserows[$k]['chapterid'] = $v->getVar('chapterid');
$bookcaserows[$k]['sortid'] = $v->getVar('sortid');
$bookcaserows[$k]['typeid'] = $v->getVar('typeid');
$bookcaserows[$k]['sort'] = $jieqiSort['article'][$v->getVar('sortid')]['shortname'];
$bookcaserows[$k]['type'] = $bookcaserows[$k]['sort'];
//$bookcaserows[$k]['type']=$jieqiSort['article'][$v->getVar('sortid')]['types'][$v->getVar('typeid')];
$bookcaserows[$k]['authorid'] = $v->getVar('authorid');
$bookcaserows[$k]['author'] = $v->getVar('author');
$bookcaserows[$k]['checkbox'] = '<input type="checkbox" id="checkid[]" name="checkid[]" value="' . $v->getVar('caseid') . '">';
$tmpvar = $v->getVar('articlename');
if (!empty($tmpvar)) {
$bookcaserows[$k]['url_articleinfo'] = $article_dynamic_url . '/readbookcase.php?aid=' . $v->getVar('articleid') . '&bid=' . $v->getVar('caseid');
$bookcaserows[$k]['url_index'] = $bookcaserows[$k]['url_articleinfo'] . '&indexflag=1';
$bookcaserows[$k]['articlename'] = $v->getVar('articlename');
} else {
$bookcaserows[$k]['url_articleinfo'] = '#';
$bookcaserows[$k]['url_index'] = '#';
$bookcaserows[$k]['articlename'] = $jieqiLang['article']['articlemark_has_deleted'];
}
if ($v->getVar('lastchapter') == '') {
$bookcaserows[$k]['lastchapter'] = '';
$bookcaserows[$k]['url_lastchapter'] = '#';
} else {
$bookcaserows[$k]['lastchapter'] = $v->getVar('lastchapter');
$bookcaserows[$k]['url_lastchapter'] = $article_dynamic_url . '/readbookcase.php?aid=' . $v->getVar('articleid') . '&bid=' . $v->getVar('caseid') . '&cid=' . $v->getVar('lastchapterid');
}
if ($v->getVar('lastupdate') > $v->getVar('lastvisit')) {
$bookcaserows[$k]['hasnew'] = 1;
} else {
$bookcaserows[$k]['hasnew'] = 0;
}
if ($v->getVar('chaptername') == '') {
$bookcaserows[$k]['articlemark'] = '';
$bookcaserows[$k]['url_articlemark'] = '#';
} else {
$bookcaserows[$k]['articlemark'] = $v->getVar('chaptername');
$bookcaserows[$k]['url_articlemark'] = $article_dynamic_url . '/readbookcase.php?aid=' . $v->getVar('articleid') . '&bid=' . $v->getVar('caseid') . '&cid=' . $v->getVar('chapterid');
}
$bookcaserows[$k]['lastupdate'] = $v->getVar('lastupdate');
$bookcaserows[$k]['url_delete'] = jieqi_addurlvars(array('delid' => $v->getVar('caseid')));
$k++;
}
$jieqiTpl->assign_by_ref('bookcaserows', $bookcaserows);
$jieqiTpl->assign('ownerid', $this->blockvars['cacheid']);
}
示例7: CriteriaCompo
* @package system
* @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com)
* @author $Author: juny $
* @version $Id: ptopiclist.php 329 2009-02-07 01:21:38Z juny $
*/
define('JIEQI_MODULE_NAME', 'system');
require_once 'global.php';
jieqi_getconfigs(JIEQI_MODULE_NAME, 'power');
jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs');
include_once JIEQI_ROOT_PATH . '/class/users.php';
$query = JieqiQueryHandler::getInstance('JieqiQueryHandler');
include_once JIEQI_ROOT_PATH . '/header.php';
include_once JIEQI_ROOT_PATH . '/lib/text/textfunction.php';
$criteria = new CriteriaCompo();
$criteria->setFields("t.*,u.uname,u.name");
$criteria->setTables(jieqi_dbprefix('system_ptopics') . " AS t LEFT JOIN " . jieqi_dbprefix('system_users') . " AS u ON t.ownerid=u.uid");
if (!empty($_REQUEST['keyword'])) {
$_REQUEST['keyword'] = trim($_REQUEST['keyword']);
if ($_REQUEST['keytype'] == 1) {
$criteria->add(new Criteria('t.poster', $_REQUEST['keyword'], '='));
}
if ($_REQUEST['keytype'] == 2) {
$criteria->add(new Criteria('t.title', '%' . $_REQUEST['keyword'] . '%', 'LIKE'));
} else {
$criteria->add(new Criteria('u.uname', $_REQUEST['keyword'], '='));
}
}
if (isset($_REQUEST['type']) && $_REQUEST['type'] == 'good') {
$jieqiTpl->assign('type', 'good');
//精华书评
$criteria->add(new Criteria('isgood', 1));
示例8: CriteriaCompo
//头衔
//头像参数
if (!isset($jieqiConfigs['system'])) {
jieqi_getconfigs('system', 'configs');
}
//是否使用徽章
if (!empty($jieqiModules['badge']['publish']) && is_file($jieqiModules['badge']['path'] . '/include/badgefunction.php')) {
include_once $jieqiModules['badge']['path'] . '/include/badgefunction.php';
$jieqi_use_badge = 1;
$jieqiTpl->assign('jieqi_use_badge', 1);
} else {
$jieqi_use_badge = 0;
$jieqiTpl->assign('jieqi_use_badge', 0);
}
$criteria = new CriteriaCompo(new Criteria('r.topicid', $_REQUEST['rid']));
$criteria->setTables(jieqi_dbprefix('article_replies') . ' r LEFT JOIN ' . jieqi_dbprefix('system_users') . ' u ON r.posterid=u.uid');
$criteria->setSort('r.postid');
$criteria->setOrder('ASC');
$criteria->setLimit($_REQUEST['pagerows']);
$query_count = $article_query->getCount($criteria);
if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'last') {
$_REQUEST['page'] = ceil($query_count / $_REQUEST['pagerows']);
} elseif (empty($_REQUEST['page']) || !is_numeric($_REQUEST['page'])) {
$_REQUEST['page'] = 1;
}
$criteria->setStart(($_REQUEST['page'] - 1) * $_REQUEST['pagerows']);
$article_query->queryObjects($criteria);
include_once JIEQI_ROOT_PATH . '/lib/text/textconvert.php';
$ts = TextConvert::getInstance('TextConvert');
$replyrows = array();
$k = 0;
示例9: intval
$maxnum = intval($jieqiRight['article']['maxbookmarks']['honors'][$honorid]);
}
$jieqiTpl->assign('checkall', '<input type="checkbox" id="checkall" name="checkall" value="checkall" onclick="javascript: for (var i=0;i<this.form.elements.length;i++){ if (this.form.elements[i].name != \'checkkall\') this.form.elements[i].checked = form.checkall.checked; }">');
jieqi_includedb();
$bookcase_query = JieqiQueryHandler::getInstance('JieqiQueryHandler');
$criteria = new CriteriaCompo(new Criteria('userid', $_SESSION['jieqiUserId']));
$criteria->setTables(jieqi_dbprefix('article_bookcase'));
$jieqiTpl->assign('nowbookcase', $bookcase_query->getCount($criteria));
unset($criteria);
$criteria = new CriteriaCompo(new Criteria('c.userid', $_SESSION['jieqiUserId']));
if (is_numeric($_REQUEST['classid'])) {
$criteria->add(new Criteria('c.classid', $_REQUEST['classid']));
}
if ($jieqiModules['obook']['publish']) {
//有电子书时候查询电子书最新章节
$criteria->setTables(jieqi_dbprefix('article_bookcase') . ' c LEFT JOIN ' . jieqi_dbprefix('article_article') . ' a ON c.articleid=a.articleid LEFT JOIN ' . jieqi_dbprefix('obook_obook') . ' o ON a.articleid=o.articleid');
$criteria->setFields('c.*, a.articleid, a.lastupdate, a.articlename, a.lastchapterid, a.lastchapter, o.obookid, o.lastvolume as obookvolume, o.lastvolumeid as obookvolumeid, o.lastchapter as obookchapter, o.lastchapterid as obookchapterid, o.lastupdate as obookupdate, o.size as obooksize, o.publishid as obookpublishid');
$criteria->setSort('o.lastupdate DESC, a.lastupdate');
$criteria->setOrder('DESC');
} else {
$criteria->setTables(jieqi_dbprefix('article_bookcase') . ' c LEFT JOIN ' . jieqi_dbprefix('article_article') . ' a ON c.articleid=a.articleid');
$criteria->setFields('c.*, a.articleid, a.lastupdate, a.articlename, a.authorid, a.author, a.sortid, a.typeid, a.lastchapterid, a.lastchapter');
$criteria->setSort('a.lastupdate');
$criteria->setOrder('DESC');
}
$bookcase_query->queryObjects($criteria);
unset($criteria);
$bookcaserows = array();
$k = 0;
while ($v = $bookcase_query->getObject()) {
//电子书部分信息
示例10: getbadgeurl
$avatar = $jieqiUsers->getVar('avatar');
$jieqiTpl->assign('avatar', $avatar);
//徽章
if (!empty($jieqiModules['badge']['publish']) && is_file($jieqiModules['badge']['path'] . '/include/badgefunction.php')) {
include_once $jieqiModules['badge']['path'] . '/include/badgefunction.php';
//等级徽章
$jieqiTpl->assign('jieqi_group_imageurl', getbadgeurl(1, $jieqiUsers->getVar('groupid'), 0, true));
//头衔徽章
$jieqiTpl->assign('jieqi_honor_imageurl', getbadgeurl(2, $honorid, 0, true));
//自定义徽章
$jieqi_jieqi_badgerows = array();
$badgeary = unserialize($jieqiUsers->getVar('badges', 'n'));
if (is_array($badgeary) && count($badgeary) > 0) {
$award_query = JieqiQueryHandler::getInstance('JieqiQueryHandler');
$criteria = new CriteriaCompo();
$criteria->setTables(jieqi_dbprefix('badge_award') . ' a LEFT JOIN ' . jieqi_dbprefix('badge_badge') . ' b ON a.badgeid=b.badgeid');
$criteria->add(new Criteria('a.toid', $_SESSION['jieqiUserId']));
$criteria->setSort('b.btypeid ASC, a.awardid');
$criteria->setOrder('ASC');
$award_query->queryObjects($criteria);
$k = 0;
while ($award = $award_query->getObject()) {
$jieqi_badgerows[$k]['imageurl'] = getbadgeurl($award->getVar('btypeid', 'n'), $award->getVar('linkid', 'n'), $award->getVar('imagetype', 'n'));
$jieqi_badgerows[$k]['caption'] = jieqi_htmlstr($award->getVar('caption'));
$k++;
}
}
$jieqiTpl->assign_by_ref('jieqi_badgerows', $jieqi_badgerows);
$jieqiTpl->assign('jieqi_use_badge', 1);
} else {
$jieqiTpl->assign('jieqi_use_badge', 0);
示例11: intval
}
//是否使用徽章
if (!empty($jieqiModules['badge']['publish']) && is_file($jieqiModules['badge']['path'] . '/include/badgefunction.php')) {
include_once $jieqiModules['badge']['path'] . '/include/badgefunction.php';
$jieqi_use_badge = 1;
$jieqiTpl->assign('jieqi_use_badge', 1);
} else {
$jieqi_use_badge = 0;
$jieqiTpl->assign('jieqi_use_badge', 0);
}
$_REQUEST['pagerows'] = intval($jieqiConfigs['system']['ppostpnum']);
if (empty($_REQUEST['pagerows'])) {
$_REQUEST['pagerows'] = 10;
}
$criteria = new CriteriaCompo(new Criteria('p.topicid', $_REQUEST['tid']));
$criteria->setTables(jieqi_dbprefix('system_pposts') . ' p LEFT JOIN ' . jieqi_dbprefix('system_users') . ' u ON p.posterid=u.uid');
$criteria->setSort('p.postid');
$criteria->setOrder('ASC');
$criteria->setLimit($_REQUEST['pagerows']);
$query_count = $post_query->getCount($criteria);
if ($_REQUEST['page'] == 'last') {
$_REQUEST['page'] = ceil($query_count / $_REQUEST['pagerows']);
} elseif (empty($_REQUEST['page']) || !is_numeric($_REQUEST['page'])) {
$_REQUEST['page'] = 1;
}
$criteria->setStart(($_REQUEST['page'] - 1) * $_REQUEST['pagerows']);
$post_query->queryObjects($criteria);
$ppostrows = array();
$k = 0;
while ($ppost = $post_query->getObject()) {
$addvars = array('order' => ($_REQUEST['page'] - 1) * $_REQUEST['pagerows'] + $k + 1);