Exemple #1
0
 function setContent($isreturn = false)
 {
     global $jieqiTpl;
     include_once JIEQI_ROOT_PATH . '/class/ptopics.php';
     $ptopics_handler =& JieqiPtopicsHandler::getInstance('JieqiPtopicsHandler');
     $criteria = new CriteriaCompo();
     $criteria->add(new Criteria('ownerid', $this->blockvars['cacheid']));
     if ($this->exevars['istop'] == 1) {
         $criteria->add(new Criteria('istop', 1));
     } elseif ($this->exevars['istop'] == 2) {
         $criteria->add(new Criteria('istop', 0));
     }
     if ($this->exevars['isgood'] == 1) {
         $criteria->add(new Criteria('isgood', 1));
     } elseif ($this->exevars['isgood'] == 2) {
         $criteria->add(new Criteria('isgood', 0));
     }
     if ($this->exevars['islock'] == 1) {
         $criteria->add(new Criteria('islock', 1));
     } elseif ($this->exevars['islock'] == 2) {
         $criteria->add(new Criteria('islock', 0));
     }
     $criteria->setSort($this->exevars['field']);
     if ($this->exevars['asc'] == 1) {
         $criteria->setOrder('ASC');
     } else {
         $criteria->setOrder('DESC');
     }
     $criteria->setLimit($this->exevars['listnum']);
     $criteria->setStart(0);
     $ptopics_handler->queryObjects($criteria);
     $ptopicrows = array();
     $k = 0;
     while ($v = $ptopics_handler->getObject()) {
         $ptopicrows[$k]['istop'] = $v->getVar('istop');
         $ptopicrows[$k]['isgood'] = $v->getVar('isgood');
         $ptopicrows[$k]['islock'] = $v->getVar('islock');
         $ptopicrows[$k]['topicid'] = $v->getVar('topicid');
         $ptopicrows[$k]['posttime'] = $v->getVar('posttime');
         $ptopicrows[$k]['replytime'] = $v->getVar('replytime');
         $ptopicrows[$k]['posterid'] = $v->getVar('posterid');
         $ptopicrows[$k]['poster'] = $v->getVar('poster');
         $ptopicrows[$k]['title'] = $v->getVar('title');
         $ptopicrows[$k]['views'] = $v->getVar('views');
         $ptopicrows[$k]['replies'] = $v->getVar('replies');
         $ptopicrows[$k]['size'] = $v->getVar('size');
         $ptopicrows[$k]['size_c'] = ceil($v->getVar('size') / 2);
         $ptopicrows[$k]['ownerid'] = $v->getVar('ownerid');
         $k++;
     }
     $jieqiTpl->assign_by_ref('ptopicrows', $ptopicrows);
     $jieqiTpl->assign('ownerid', $this->blockvars['cacheid']);
     $jieqiTpl->assign('url_more', JIEQI_URL . '/ptopics?oid=' . $this->blockvars['cacheid']);
 }
Exemple #2
0
 * 
 * 调用模板:/templates/admin/ptopiclist.html
 * 
 * @category   jieqicms
 * @package    system
 * @copyright  Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com)
 * @author     $Author: juny $
 * @version    $Id: ptopiclist.php 328 2009-02-06 09:24:29Z juny $
 */
define('JIEQI_MODULE_NAME', 'system');
require_once '../global.php';
jieqi_getconfigs(JIEQI_MODULE_NAME, 'power');
jieqi_checkpower($jieqiPower['system']['manageallparlor'], $jieqiUsersStatus, $jieqiUsersGroup, false, true);
jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs');
include_once JIEQI_ROOT_PATH . '/class/ptopics.php';
$ptopics_handler =& JieqiPtopicsHandler::getInstance('JieqiPtopicsHandler');
$query = JieqiQueryHandler::getInstance('JieqiQueryHandler');
//处理置顶、加精、删除
if (isset($_REQUEST['action']) && !empty($_REQUEST['tid'])) {
    $actptopic = $ptopics_handler->get($_REQUEST['tid']);
    if (is_object($actptopic)) {
        $criteria = new CriteriaCompo(new Criteria('topicid', $_REQUEST['tid']));
        switch ($_REQUEST['action']) {
            case 'top':
                $ptopics_handler->updatefields(array('istop' => 1), $criteria);
                break;
            case 'untop':
                $ptopics_handler->updatefields(array('istop' => 0), $criteria);
                break;
            case 'good':
                $ptopics_handler->updatefields(array('isgood' => 1), $criteria);