Example #1
0
 function addlog($data)
 {
     global $jieqiLsort;
     jieqi_getconfigs('system', 'lsort', 'jieqiLsort');
     if (empty($data) || !is_array($data)) {
         return false;
     }
     $newLogs =& $this->create();
     $logtype = isset($data['logtype']) ? intval($data['logtype']) : 0;
     $newLogs->setVar('logtype', $logtype);
     isset($data['siteid']) ? $newLogs->setVar('siteid', intval($data['siteid'])) : $newLogs->setVar('siteid', JIEQI_SITE_ID);
     isset($data['loglevel']) ? $newLogs->setVar('loglevel', intval($data['loglevel'])) : $newLogs->setVar('loglevel', intval($jieqiLsort[$logtype]['loglevel']));
     isset($data['logtime']) ? $newLogs->setVar('logtime', intval($data['logtime'])) : $newLogs->setVar('logtime', JIEQI_NOW_TIME);
     isset($data['userid']) ? $newLogs->setVar('userid', intval($data['userid'])) : $newLogs->setVar('userid', intval($_SESSION['jieqiUserId']));
     isset($data['username']) ? $newLogs->setVar('username', $data['username']) : $newLogs->setVar('username', $_SESSION['jieqiUserName']);
     isset($data['userip']) ? $newLogs->setVar('userip', $data['userip']) : $newLogs->setVar('userip', jieqi_userip());
     isset($data['targetname']) ? $newLogs->setVar('targetname', $data['targetname']) : $newLogs->setVar('targetname', $jieqiLsort[$logtype]['targetname']);
     isset($data['targetid']) ? $newLogs->setVar('targetid', intval($data['targetid'])) : $newLogs->setVar('targetid', 0);
     isset($data['targettitle']) ? $newLogs->setVar('targettitle', $data['targettitle']) : $newLogs->setVar('targettitle', '');
     isset($data['logurl']) ? $newLogs->setVar('logurl', $data['logurl']) : $newLogs->setVar('logurl', jieqi_addurlvars(array(), false, false));
     isset($data['logcode']) ? $newLogs->setVar('logcode', intval($data['logcode'])) : $newLogs->setVar('logcode', 0);
     isset($data['logtitle']) ? $newLogs->setVar('logtitle', $data['logtitle']) : $newLogs->setVar('logtitle', $jieqiLsort[$logtype]['logtitle']);
     isset($data['logdata']) ? $newLogs->setVar('logdata', $data['logdata']) : $newLogs->setVar('logdata', '');
     isset($data['lognote']) ? $newLogs->setVar('lognote', $data['lognote']) : $newLogs->setVar('lognote', '');
     isset($data['fromdata']) ? $newLogs->setVar('fromdata', $data['fromdata']) : $newLogs->setVar('fromdata', '');
     isset($data['todata']) ? $newLogs->setVar('todata', $data['todata']) : $newLogs->setVar('todata', '');
     return $this->insert($newLogs);
 }
Example #2
0
 function setContent()
 {
     global $jieqiTpl;
     global $jieqiConfigs;
     if (empty($_SESSION['jieqiUserId'])) {
         return false;
     } else {
         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);
         include_once $GLOBALS['jieqiModules']['article']['path'] . '/class/article.php';
         $article_handler =& JieqiArticleHandler::getInstance('JieqiArticleHandler');
         $criteria = new CriteriaCompo(new Criteria('authorid', $_SESSION['jieqiUserId']));
         $article_handler->queryObjects($criteria);
         $articles = array();
         $i = 0;
         while ($v = $article_handler->getObject()) {
             $articles[$i]['url'] = $article_static_url . '/articlemanage.php?id=' . $v->getVar('articleid');
             $articles[$i]['caption'] = $v->getVar('articlename');
             $articles[$i]['goodnum'] = $v->getVar('goodnum');
             $articles[$i]['lastupdate'] = $v->getVar('lastupdate');
             $articles[$i]['id'] = $v->getVar('articleid');
             $i++;
         }
         $jieqiTpl->assign_by_ref('articles', $articles);
     }
 }
Example #3
0
 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');
 }
Example #4
0
 function setContent($isreturn = false)
 {
     global $jieqiTpl;
     global $jieqiConfigs;
     jieqi_getconfigs('obook', 'configs');
     $obook_static_url = empty($jieqiConfigs['obook']['staticurl']) ? $GLOBALS['jieqiModules']['obook']['url'] : $jieqiConfigs['obook']['staticurl'];
     $obook_dynamic_url = empty($jieqiConfigs['obook']['dynamicurl']) ? $GLOBALS['jieqiModules']['obook']['url'] : $jieqiConfigs['obook']['dynamicurl'];
     $jieqiTpl->assign('obook_static_url', $obook_static_url);
     $jieqiTpl->assign('obook_dynamic_url', $obook_dynamic_url);
 }
Example #5
0
 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);
     $jieqiTpl->assign('url_articlesearch', $article_dynamic_url . '/search.php');
 }
Example #6
0
/**
 * 返回用户头像图片url
 * 
 * @param      int         $uid 用户id
 * @param      int         $size 返回类型 'd'=>图片目录, 'l'=>大图(默认), 's'=>小图, 'i'=>图标, 'a'=>返回前面几个合并的数组
 * @param      int         $type 图片类型 -1 系统自动判断,0 无头像 1=>'.gif', 2=>'.jpg', 3=>'.jpeg', 4=>'.png', 5=>'.bmp'
 * @param      bool        $retdft 无头像是否返回默认头像地址,true-是(默认),false-否
 * @access     public
 * @return     mixed
 */
function jieqi_url_system_avatar($uid, $size = 'l', $type = -1, $retdft = true)
{
    global $jieqiConfigs;
    global $jieqi_image_type;
    if (!isset($jieqiConfigs['system'])) {
        jieqi_getconfigs('system', 'configs');
    }
    if (empty($jieqi_image_type)) {
        $jieqi_image_type = array(1 => '.gif', 2 => '.jpg', 3 => '.jpeg', 4 => '.png', 5 => '.bmp');
    }
    if (function_exists('gd_info') && $jieqiConfigs['system']['avatarcut']) {
        $avatar_cut = true;
    } else {
        $avatar_cut = false;
    }
    $base_avatar = '';
    if ($uid == 0 || $type == 0 || $type > 0 && !isset($jieqi_image_type[$type])) {
        if ($retdft) {
            $base_avatar = JIEQI_USER_URL . '/images';
            $type = 2;
            $uid = 'noavatar';
        } else {
            return false;
        }
    } elseif ($type < 0) {
        return JIEQI_USER_URL . '/avatar.php?uid=' . $uid . '&size=' . $size;
    }
    $prefix = $jieqi_image_type[$type];
    if (empty($base_avatar)) {
        $base_avatar = jieqi_uploadurl($jieqiConfigs['system']['avatardir'], $jieqiConfigs['system']['avatarurl'], 'system') . jieqi_getsubdir($uid);
    }
    switch ($size) {
        case 'd':
            return $base_avatar;
            break;
        case 'l':
            return $base_avatar . '/' . $uid . $prefix;
            break;
        case 's':
            return $avatar_cut ? $base_avatar . '/' . $uid . 's' . $prefix : $base_avatar . '/' . $uid . $prefix;
            break;
        case 'i':
            return $avatar_cut ? $base_avatar . '/' . $uid . 'i' . $prefix : $base_avatar . '/' . $uid . $prefix;
            break;
        case 'a':
        default:
            if ($avatar_cut) {
                return array('l' => $base_avatar . '/' . $uid . $prefix, 's' => $base_avatar . '/' . $uid . 's' . $prefix, 'i' => $base_avatar . '/' . $uid . 'i' . $prefix, 'd' => $base_avatar);
            } else {
                return array('l' => $base_avatar . '/' . $uid . $prefix, 's' => $base_avatar . '/' . $uid . $prefix, 'i' => $base_avatar . '/' . $uid . $prefix, 'd' => $base_avatar);
            }
            break;
    }
}
Example #7
0
 function setContent($isreturn = false)
 {
     global $jieqiTpl;
     global $jieqiConfigs;
     global $jieqiSort;
     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);
     include_once $GLOBALS['jieqiModules']['article']['path'] . '/class/article.php';
     //载入相关处理函数
     include_once $GLOBALS['jieqiModules']['article']['path'] . '/include/funarticle.php';
     $article_handler =& JieqiArticleHandler::getInstance('JieqiArticleHandler');
     $criteria = new CriteriaCompo();
     $criteria->add(new Criteria('authorid', $this->blockvars['cacheid']));
     if ($this->exevars['isfull'] == 1) {
         $criteria->add(new Criteria('isfull', 1));
     } elseif ($this->exevars['isfull'] == 2) {
         $criteria->add(new Criteria('isfull', 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);
     $article_handler->queryObjects($criteria);
     $articlerows = array();
     $k = 0;
     while ($v = $article_handler->getObject()) {
         $articlerows[$k] = jieqi_article_vars($v);
         $articlerows[$k]['order'] = $k + 1;
         if ($this->exevars['field'] == 'goodnew') {
             $articlerows[$k]['visitnum'] = $v->getVar('allvisit');
         } else {
             $articlerows[$k]['visitnum'] = $v->getVar($this->exevars['field']);
         }
         if ($this->exevars['field'] == 'size') {
             $articlerows[$k]['visitnum'] = ceil($articlerows[$k]['visitnum'] / 1024) . 'K';
         } elseif ($this->exevars['field'] == 'lastupdate' || $this->exevars['field'] == 'postdate' || $this->exevars['field'] == 'toptime') {
             $articlerows[$k]['visitnum'] = date('m-d', $articlerows[$k]['visitnum']);
         }
         $k++;
     }
     $jieqiTpl->assign_by_ref('articlerows', $articlerows);
     $jieqiTpl->assign('ownerid', $this->blockvars['cacheid']);
 }
Example #8
0
 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);
     $sorts = array('allvisit', 'monthvisit', 'weekvisit', 'dayvisit', 'allauthorvisit', 'monthauthorvisit', 'weekauthorvisit', 'dayauthorvisit', 'allvote', 'monthvote', 'weekvote', 'dayvote', 'postdate', 'lastupdate', 'authorupdate', 'masterupdate', 'goodnum', 'size', 'weekrate', 'monthrate', 'toptime');
     foreach ($sorts as $sort) {
         $jieqiTpl->assign('url_' . $sort, jieqi_geturl('article', 'toplist', 1, $sort));
     }
 }
Example #9
0
 function setContent($isreturn = false)
 {
     global $jieqiTpl;
     global $jieqiConfigs;
     global $jieqiSort;
     include_once $GLOBALS['jieqiModules']['article']['path'] . '/class/article.php';
     //载入相关处理函数
     include_once $GLOBALS['jieqiModules']['article']['path'] . '/include/funarticle.php';
     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);
     $articlerows = array();
     if (count($this->exevars) > 0) {
         $article_handler =& JieqiArticleHandler::getInstance('JieqiArticleHandler');
         $sql = 'SELECT * FROM ' . jieqi_dbprefix('article_article') . ' WHERE articleid IN (0,' . implode(',', $this->exevars) . ')';
         $sql .= ' LIMIT 0, 100';
         $res = $article_handler->db->query($sql);
         $k = 0;
         while ($v = $article_handler->getObject($res)) {
             $articlerows[$k] = jieqi_article_vars($v);
             $articlerows[$k]['order'] = $k + 1;
             $k++;
         }
     }
     $i = 0;
     $maxrow = count($articlerows);
     $sortrows = array();
     foreach ($this->exevars as $aid) {
         $k = 0;
         while ($k < $maxrow && $articlerows[$k]['articleid'] != $aid) {
             $k++;
         }
         if ($k < $maxrow) {
             $articlerows[$k]['order'] = $i + 1;
             $sortrows[$i] =& $articlerows[$k];
             $i++;
         }
     }
     $jieqiTpl->assign_by_ref('articlerows', $sortrows);
 }
Example #10
0
 function setContent($isreturn = false)
 {
     global $jieqiSort;
     global $jieqiTpl;
     global $jieqiConfigs;
     jieqi_getconfigs('article', 'sort');
     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);
     $sortrows = array();
     $jieqiTpl->assign('url_articlelist', jieqi_geturl('article', 'articlelist', 1, 0));
     $i = 0;
     foreach ($jieqiSort['article'] as $k => $v) {
         $sortrows[$i] = array('sortid' => $k, 'sortname' => $v['caption'], 'url_sort' => jieqi_geturl('article', 'articlelist', 1, $k), 'sortlayer' => $v['layer']);
         $i++;
     }
     $jieqiTpl->assign_by_ref('sortrows', $sortrows);
 }
Example #11
0
 function setContent($isreturn = false)
 {
     global $jieqiSort;
     global $jieqiTpl;
     global $jieqiConfigs;
     jieqi_getconfigs('obook', 'sort');
     jieqi_getconfigs('obook', 'configs');
     $obook_static_url = empty($jieqiConfigs['obook']['staticurl']) ? $GLOBALS['jieqiModules']['obook']['url'] : $jieqiConfigs['obook']['staticurl'];
     $obook_dynamic_url = empty($jieqiConfigs['obook']['dynamicurl']) ? $GLOBALS['jieqiModules']['obook']['url'] : $jieqiConfigs['obook']['dynamicurl'];
     $jieqiTpl->assign('obook_static_url', $obook_static_url);
     $jieqiTpl->assign('obook_dynamic_url', $obook_dynamic_url);
     $sortrows = array();
     if ($jieqiConfigs['obook']['fakesort'] == 1) {
         if (!empty($jieqiConfigs['obook']['fakeprefix'])) {
             $tmpvar = '/' . $jieqiConfigs['obook']['fakeprefix'] . 'sort';
         } else {
             $tmpvar = '/files/obook/sort';
         }
         $tmpurl = $obook_dynamic_url . $tmpvar . '/0/1' . $jieqiConfigs['obook']['fakefile'];
     } else {
         $tmpurl = $obook_dynamic_url . '/obooklist.php?class=0';
     }
     $jieqiTpl->assign('url_obookindex', $tmpurl);
     $jieqiTpl->assign('url_obooklist', $tmpurl);
     $i = 0;
     foreach ($jieqiSort['obook'] as $k => $v) {
         if ($jieqiConfigs['obook']['fakesort'] == 1) {
             if (!empty($jieqiConfigs['obook']['fakeprefix'])) {
                 $tmpvar = '/' . $jieqiConfigs['obook']['fakeprefix'] . 'sort';
             } else {
                 $tmpvar = '/files/obook/sort';
             }
             $tmpurl = $obook_dynamic_url . $tmpvar . $k . '/0/1' . $jieqiConfigs['obook']['fakefile'];
         } else {
             $tmpurl = $obook_dynamic_url . '/obooklist.php?class=' . $k;
         }
         $sortrows[$i] = array('sortid' => $k, 'sortname' => $v['caption'], 'url_sort' => $tmpurl, 'sortlayer' => $v['layer']);
         $i++;
     }
     $jieqiTpl->assign_by_ref('sortrows', $sortrows);
 }
Example #12
0
<?php

/**
 * 网站首页
 *
 * 默认首页是载入/configs/blocks.php里面配置的区块
 * 
 * 调用模板:无
 * 
 * @category   jieqicms
 * @package    system
 * @copyright  Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com)
 * @author     $Author: juny $
 * @version    $Id: index.php 344 2009-06-23 03:06:07Z juny $
 */
//定义本页面所属区块
define('JIEQI_MODULE_NAME', 'system');
require_once 'global.php';
//包含区块参数
jieqi_getconfigs(JIEQI_MODULE_NAME, 'blocks', 'jieqiBlocks');
//包含页头页尾
include_once JIEQI_ROOT_PATH . '/header.php';
$jieqiTpl->assign('jieqi_indexpage', 1);
//设置首页标志,便于模板里面可以判断
$jieqiTset['jieqi_contents_template'] = '';
//内容位置不赋值,全部用区块
include_once JIEQI_ROOT_PATH . '/footer.php';
Example #13
0
}
if (!empty($jieqiTset['jieqi_contents_template'])) {
    if (!isset($jieqiTset['jieqi_contents_cacheid'])) {
        $jieqiTset['jieqi_contents_cacheid'] = NULL;
    }
    if (!isset($jieqiTset['jieqi_contents_compileid'])) {
        $jieqiTset['jieqi_contents_compileid'] = NULL;
    }
    $jieqiTpl->include_compiled_inc($jieqiTset['jieqi_contents_template'], $jieqiTset['jieqi_contents_compileid']);
}
//根据模板包含区块配置文件
if (!empty($jieqiTset['jieqi_blocks_config'])) {
    if (!empty($jieqiTset['jieqi_blocks_module'])) {
        jieqi_getconfigs($jieqiTset['jieqi_blocks_module'], $jieqiTset['jieqi_blocks_config'], 'jieqiBlocks');
    } else {
        jieqi_getconfigs(JIEQI_MODULE_NAME, $jieqiTset['jieqi_blocks_config'], 'jieqiBlocks');
    }
}
//区块处理
if (!isset($jieqi_showlblock)) {
    $jieqi_showlblock = false;
}
if (!isset($jieqi_showcblock)) {
    $jieqi_showcblock = false;
}
if (!isset($jieqi_showrblock)) {
    $jieqi_showrblock = false;
}
if (!isset($jieqi_showtblock)) {
    $jieqi_showtblock = false;
}
Example #14
0
 $collect_form->addElement(new JieqiFormTextArea($jieqiLang['article']['rule_article_title'], 'articletitle', htmlspecialchars(jieqi_collectstop($jieqiCollect['articletitle']), ENT_QUOTES), 5, 60), true);
 $collect_form->addElement(new JieqiFormTextArea($jieqiLang['article']['rule_article_author'], 'author', htmlspecialchars(jieqi_collectstop($jieqiCollect['author']), ENT_QUOTES), 5, 60));
 $collect_form->addElement(new JieqiFormTextArea($jieqiLang['article']['rule_article_sort'], 'sort', htmlspecialchars(jieqi_collectstop($jieqiCollect['sort']), ENT_QUOTES), 5, 60));
 if (!is_array($jieqiCollect['sortid'])) {
     $jieqiCollect['sortid'] = array();
 }
 $tmpstr = '';
 foreach ($jieqiCollect['sortid'] as $k => $v) {
     if (!empty($tmpstr)) {
         $tmpstr .= '||';
     }
     $tmpstr .= $k . '=>' . $v;
 }
 $sortelement = new JieqiFormText($jieqiLang['article']['rule_sort_relation'], 'sortid', 60, 10000, htmlspecialchars($tmpstr, ENT_QUOTES));
 $sortelement->setIntro($jieqiLang['article']['rule_sort_note']);
 jieqi_getconfigs(JIEQI_MODULE_NAME, 'sort');
 $sortstr = '';
 foreach ($jieqiSort['article'] as $k => $v) {
     if (!empty($sortstr)) {
         $sortstr .= '||';
     }
     $sortstr .= $v['caption'] . '=>' . $k;
 }
 $sortelement->setDescription(sprintf($jieqiLang['article']['rule_sort_guide'], $sortstr));
 $collect_form->addElement($sortelement);
 $collect_form->addElement(new JieqiFormTextArea($jieqiLang['article']['rule_article_keywords'], 'keyword', htmlspecialchars(jieqi_collectstop($jieqiCollect['keyword']), ENT_QUOTES), 5, 60));
 $collect_form->addElement(new JieqiFormTextArea($jieqiLang['article']['rule_article_intro'], 'intro', htmlspecialchars(jieqi_collectstop($jieqiCollect['intro']), ENT_QUOTES), 5, 60));
 $collect_form->addElement(new JieqiFormTextArea($jieqiLang['article']['rule_article_image'], 'articleimage', htmlspecialchars(jieqi_collectstop($jieqiCollect['articleimage']), ENT_QUOTES), 5, 60));
 $collect_form->addElement(new JieqiFormText($jieqiLang['article']['rule_articleimage_filter'], 'filterimage', 60, 250, htmlspecialchars($jieqiCollect['filterimage'], ENT_QUOTES)));
 $indexelement = new JieqiFormTextArea($jieqiLang['article']['rule_articleindex_url'], 'indexlink', htmlspecialchars(jieqi_collectstop($jieqiCollect['indexlink']), ENT_QUOTES), 5, 60);
 $indexelement->setIntro($jieqiLang['article']['rule_articleindex_note']);
Example #15
0
    $logrows[$k]['logtime'] = $v->getVar('logtime');
    $logrows[$k]['userid'] = $v->getVar('userid');
    $logrows[$k]['username'] = $v->getVar('username');
    $logrows[$k]['userip'] = $v->getVar('userip');
    $logrows[$k]['targetname'] = $v->getVar('targetname');
    $logrows[$k]['targetid'] = $v->getVar('targetid');
    $logrows[$k]['targettitle'] = $v->getVar('targettitle');
    $logrows[$k]['logurl'] = $v->getVar('logurl');
    $logrows[$k]['logcode'] = $v->getVar('logcode');
    $logrows[$k]['logtitle'] = $v->getVar('logtitle');
    $logrows[$k]['logdata'] = $v->getVar('logdata');
    $logrows[$k]['lognote'] = $v->getVar('lognote');
    //$logrows[$k]['fromdata']=$v->getVar('fromdata');
    //$logrows[$k]['todata']=$v->getVar('todata');
    $k++;
}
$jieqiTpl->assign_by_ref('logrows', $logrows);
/*查找日志类型*/
jieqi_getconfigs(JIEQI_MODULE_NAME, 'lsort', 'jieqiLsort');
if (!isset($jieqiLsort)) {
    $jieqiLsort = array();
}
$jieqiTpl->assign_by_ref('logsort', $jieqiLsort);
//处理页面跳转
include_once JIEQI_ROOT_PATH . '/lib/html/page.php';
$jumppage = new JieqiPage($logs_handler->getCount($criteria), $jieqiConfigs['system']['userlogpnum'], $_REQUEST['page']);
$jumppage->setlink('', true, true);
$jieqiTpl->assign('url_jumppage', $jumppage->whole_bar());
$jieqiTpl->setCaching(0);
$jieqiTset['jieqi_contents_template'] = JIEQI_ROOT_PATH . '/templates/admin/logs.html';
include_once JIEQI_ROOT_PATH . '/admin/footer.php';
Example #16
0
             $article_handler->insert($article);
             @clearstatcache();
             //清除文件状态缓存,免得附件删除后还认为存在
             include_once $jieqiModules['article']['path'] . '/class/package.php';
             $package = new JieqiPackage($article->getVar('articleid'));
             $package->editChapter($_POST['chaptername'], $_POST['chaptercontent'], $_REQUEST['chaptertype'], $chapter->getVar('chapterorder'), $chapter->getVar('chapterid'));
             jieqi_jumppage($article_static_url . '/articlemanage.php?id=' . $article->getVar('articleid'), LANG_DO_SUCCESS, $jieqiLang['article']['chapter_edit_success']);
         }
     } else {
         jieqi_printfail($errtext);
     }
     break;
 case 'edit':
 default:
     //包含区块参数(定制区块)
     jieqi_getconfigs('article', 'authorblocks', 'jieqiBlocks');
     include_once JIEQI_ROOT_PATH . '/header.php';
     include_once JIEQI_ROOT_PATH . '/lib/html/formloader.php';
     $jieqiTpl->assign('article_static_url', $article_static_url);
     $jieqiTpl->assign('article_dynamic_url', $article_dynamic_url);
     $jieqiTpl->assign('url_chapteredit', $article_static_url . '/chapteredit.php?do=submit');
     $jieqiTpl->assign('articleid', $article->getVar('articleid'));
     $jieqiTpl->assign('articlename', $article->getVar('articlename'));
     $jieqiTpl->assign('chaptername', $chapter->getVar('chaptername', 'e'));
     $jieqiTpl->assign('authtypeset', $jieqiConfigs['article']['authtypeset']);
     include_once $jieqiModules['article']['path'] . '/class/package.php';
     $package = new JieqiPackage($article->getVar('articleid'));
     $jieqiTpl->assign('chaptercontent', htmlspecialchars($package->getContent($chapter->getVar('chapterid')), ENT_QUOTES));
     $jieqiTpl->assign('canupload', $canupload);
     if ($canupload && is_numeric($jieqiConfigs['article']['maxattachnum']) && $jieqiConfigs['article']['maxattachnum'] > 0) {
         $maxattachnum = intval($jieqiConfigs['article']['maxattachnum']);
Example #17
0
 function setContent($isreturn = false)
 {
     global $jieqiTpl;
     global $jieqiConfigs;
     global $jieqiSort;
     include_once $GLOBALS['jieqiModules']['article']['path'] . '/class/article.php';
     //载入相关处理函数
     include_once $GLOBALS['jieqiModules']['article']['path'] . '/include/funarticle.php';
     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);
     $tmpvar = explode('-', date('Y-m-d', JIEQI_NOW_TIME));
     $daystart = mktime(0, 0, 0, (int) $tmpvar[1], (int) $tmpvar[2], (int) $tmpvar[0]);
     $monthstart = mktime(0, 0, 0, (int) $tmpvar[1], 1, (int) $tmpvar[0]);
     $tmpvar = date('w', JIEQI_NOW_TIME);
     if ($tmpvar == 0) {
         $tmpvar = 7;
     }
     //星期天是0,国人习惯作为作为一星期的最后一天
     $weekstart = $daystart;
     if ($tmpvar > 1) {
         $weekstart -= ($tmpvar - 1) * 86400;
     }
     $article_handler =& JieqiArticleHandler::getInstance('JieqiArticleHandler');
     $sql = 'SELECT * FROM ' . jieqi_dbprefix('article_article') . ' WHERE display=0 AND size>0';
     if (!empty($this->exevars['sortid'])) {
         $sortstr = '';
         $sortnum = 0;
         $sortary = explode('|', $this->exevars['sortid']);
         foreach ($sortary as $v) {
             if (is_numeric($v)) {
                 if (!empty($sortstr)) {
                     $sortstr .= ' OR ';
                 }
                 $sortstr .= 'sortid=' . intval($v);
                 $sortnum++;
             }
         }
         if ($sortnum == 1) {
             $sql .= ' AND ' . $sortstr;
         } elseif ($sortnum > 1) {
             $sql .= ' AND (' . $sortstr . ')';
         }
     }
     if ($this->exevars['isauthor'] == 1) {
         $sql .= ' AND authorid>0';
     } elseif ($this->exevars['isauthor'] == 2) {
         $sql .= ' AND authorid=0';
     }
     if ($this->exevars['isfull'] == 1) {
         $sql .= ' AND fullflag=1';
     } elseif ($this->exevars['isfull'] == 2) {
         $sql .= ' AND fullflag=0';
     }
     //授权许可
     if (strlen($this->exevars['permission']) > 0) {
         $perstr = '';
         $pernum = 0;
         $perary = explode('|', $this->exevars['permission']);
         foreach ($perary as $v) {
             if (is_numeric($v)) {
                 if (!empty($perstr)) {
                     $perstr .= ' OR ';
                 }
                 $perstr .= 'permission=' . intval($v);
                 $pernum++;
             }
         }
         if ($pernum == 1) {
             $sql .= ' AND ' . $perstr;
         } elseif ($pernum > 1) {
             $sql .= ' AND (' . $perstr . ')';
         }
     }
     //是否首发
     if (strlen($this->exevars['firstflag']) > 0) {
         $sql .= ' AND firstflag=' . intval($this->exevars['firstflag']);
     }
     //状态标志
     if (strlen($this->exevars['power']) > 0) {
         $sql .= ' AND power=' . intval($this->exevars['power']);
     }
     switch ($this->exevars['field']) {
         case 'monthvisit':
             $sql .= ' AND lastvisit>=' . $monthstart;
             $sql .= ' ORDER BY ' . $this->exevars['field'];
             break;
         case 'monthvote':
             $sql .= ' AND lastvote>=' . $monthstart;
             $sql .= ' ORDER BY ' . $this->exevars['field'];
             break;
         case 'weekvisit':
             $sql .= ' AND lastvisit>=' . $weekstart;
             $sql .= ' ORDER BY ' . $this->exevars['field'];
             break;
         case 'weekvote':
             $sql .= ' AND lastvote>=' . $weekstart;
             $sql .= ' ORDER BY ' . $this->exevars['field'];
             break;
         case 'dayvisit':
             $sql .= ' AND lastvisit>=' . $daystart;
             $sql .= ' ORDER BY ' . $this->exevars['field'];
             break;
         case 'dayvote':
             $sql .= ' AND lastvote>=' . $daystart;
             $sql .= ' ORDER BY ' . $this->exevars['field'];
             break;
         case 'goodnew':
             $sql .= ' AND postdate>=' . (JIEQI_NOW_TIME - 3600 * 24 * 30);
             $sql .= ' ORDER BY allvisit + allvote * 10 + goodnum * 20';
             break;
         default:
             $sql .= ' ORDER BY ' . $this->exevars['field'];
             break;
     }
     if ($this->exevars['asc'] == 1) {
         $sql .= ' ASC';
     } else {
         $sql .= ' DESC';
     }
     $sql .= ' LIMIT 0, ' . $this->exevars['listnum'];
     $res = $article_handler->db->query($sql);
     $articlerows = array();
     $k = 0;
     while ($v = $article_handler->getObject($res)) {
         $articlerows[$k] = jieqi_article_vars($v);
         $articlerows[$k]['order'] = $k + 1;
         if ($this->exevars['field'] == 'goodnew') {
             $articlerows[$k]['visitnum'] = $v->getVar('allvisit');
         } else {
             $articlerows[$k]['visitnum'] = $v->getVar($this->exevars['field']);
         }
         if ($this->exevars['field'] == 'size') {
             $articlerows[$k]['visitnum'] = ceil($articlerows[$k]['visitnum'] / 1024) . 'K';
         } elseif ($this->exevars['field'] == 'lastupdate' || $this->exevars['field'] == 'postdate' || $this->exevars['field'] == 'toptime' || $this->exevars['field'] == 'lastvote') {
             $articlerows[$k]['visitnum'] = date('m-d', $articlerows[$k]['visitnum']);
         }
         $k++;
     }
     $jieqiTpl->assign_by_ref('articlerows', $articlerows);
     $topsort = $this->exevars['field'];
     if ($topsort == 'lastupdate') {
         if ($this->exevars['isauthor'] == 1) {
             $topsort = 'authorupdate';
         } elseif ($this->exevars['isauthor'] == 2) {
             $topsort = 'masterupdate';
         }
     }
     $jieqiTpl->assign('url_more', jieqi_geturl('article', 'toplist', 1, $topsort));
 }
Example #18
0
if (!isset($_SESSION['jieqiPublishid'])) {
    $local_domain_url = empty($_SERVER['HTTP_HOST']) ? '' : 'http://' . $_SERVER['HTTP_HOST'];
    header('Location: ' . $jieqiModules['obook']['url'] . '/share/sharelogin.php?jumpurl=' . urlencode($local_domain_url . jieqi_addurlvars(array())));
    exit;
}
jieqi_getconfigs(JIEQI_MODULE_NAME, 'publisher');
jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs');
$obook_static_url = empty($jieqiConfigs['obook']['staticurl']) ? $jieqiModules['obook']['url'] : $jieqiConfigs['obook']['staticurl'];
$obook_dynamic_url = empty($jieqiConfigs['obook']['dynamicurl']) ? $jieqiModules['obook']['url'] : $jieqiConfigs['obook']['dynamicurl'];
include_once $jieqiModules['obook']['path'] . '/class/obook.php';
$obook_handler =& JieqiObookHandler::getInstance('JieqiObookHandler');
include_once JIEQI_ROOT_PATH . '/admin/header.php';
$jieqiTpl->assign('obook_static_url', $obook_static_url);
$jieqiTpl->assign('obook_dynamic_url', $obook_dynamic_url);
jieqi_getconfigs(JIEQI_MODULE_NAME, 'sort');
jieqi_getconfigs(JIEQI_MODULE_NAME, 'publisher');
//页码
if (empty($_REQUEST['page']) || !is_numeric($_REQUEST['page'])) {
    $_REQUEST['page'] = 1;
}
$criteria = new CriteriaCompo();
if (!empty($_REQUEST['keyword'])) {
    $_REQUEST['keyword'] = trim($_REQUEST['keyword']);
    if ($_REQUEST['keytype'] == 1) {
        $criteria->add(new Criteria('author', $_REQUEST['keyword'], '='));
    } elseif ($_REQUEST['keytype'] == 2) {
        $criteria->add(new Criteria('poster', $_REQUEST['keyword'], '='));
    } else {
        $criteria->add(new Criteria('obookname', $_REQUEST['keyword'], '='));
    }
}
Example #19
0
function makestaticinfo($article_id)
{
    global $jieqiConfigs;
    global $jieqiSort;
    global $jieqiTpl;
    global $jieqiBlocks;
    global $jieqi_file_postfix;
    global $jieqiOption;
    if (!is_object($jieqiTpl)) {
        $jieqiTpl =& JieqiTpl::getInstance();
    }
    if (empty($article_id) || !is_numeric($article_id)) {
        return false;
    }
    $article_handler =& JieqiArticleHandler::getInstance('JieqiArticleHandler');
    $article = $article_handler->get($article_id);
    if (!$article) {
        return false;
    }
    //包含区块参数(定制)
    jieqi_getconfigs(JIEQI_MODULE_NAME, 'sort');
    jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs');
    $jieqi_pagetitle = $article->getVar('articlename');
    if ($article->getVar('lastvolume') != '') {
        $jieqi_pagetitle .= '-' . $article->getVar('lastvolume');
    }
    $jieqi_pagetitle .= '-' . $article->getVar('lastchapter') . '-' . JIEQI_SITE_NAME;
    $jieqiTpl->assign('jieqi_pagetitle', $jieqi_pagetitle);
    $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);
    $jieqiTpl->assign('articlename', $article->getVar('articlename'));
    $jieqiTpl->assign('postdate', date('Y-m-d', $article->getVar('postdate')));
    $jieqiTpl->assign('lastupdate', date('Y-m-d', $article->getVar('lastupdate')));
    if ($article->getVar('authorid') > 0) {
        $jieqiTpl->assign('author', '<a href="' . jieqi_geturl('system', 'user', $article->getVar('authorid')) . '" target="_blank">' . $article->getVar('author') . '</a>');
    } else {
        $jieqiTpl->assign('author', $article->getVar('author'));
    }
    if ($article->getVar('agentid') > 0) {
        $jieqiTpl->assign('agent', '<a href="' . jieqi_geturl('system', 'user', $article->getVar('agentid')) . '" target="_blank">' . $article->getVar('agent') . '</a>');
    } else {
        $jieqiTpl->assign('agent', $article->getVar('agent'));
    }
    $jieqiTpl->assign('sortid', $article->getVar('sortid'));
    $jieqiTpl->assign('sort', $jieqiSort['article'][$article->getVar('sortid')]['caption']);
    $jieqiTpl->assign('intro', $article->getVar('intro'));
    $jieqiTpl->assign('notice', $article->getVar('notice'));
    $imgflag = $article->getVar('imgflag');
    //小图
    if (($imgflag & 1) > 0) {
        $jieqiTpl->assign('hasimage', 1);
        $jieqiTpl->assign('url_simage', jieqi_uploadurl($jieqiConfigs['article']['imagedir'], $jieqiConfigs['article']['imageurl'], 'article', $article_static_url) . jieqi_getsubdir($article->getVar('articleid')) . '/' . $article->getVar('articleid') . '/' . $article->getVar('articleid') . 's' . $jieqiConfigs['article']['imagetype']);
    } else {
        $jieqiTpl->assign('hasimage', 0);
        $jieqiTpl->assign('url_simage', '');
    }
    //大图
    if (($imgflag & 2) > 0) {
        $jieqiTpl->assign('url_limage', jieqi_uploadurl($jieqiConfigs['article']['imagedir'], $jieqiConfigs['article']['imageurl'], 'article', $article_static_url) . jieqi_getsubdir($article->getVar('articleid')) . '/' . $article->getVar('articleid') . '/' . $article->getVar('articleid') . 'l' . $jieqiConfigs['article']['imagetype']);
    } elseif (($imgflag & 1) > 0) {
        $jieqiTpl->assign('url_limage', jieqi_uploadurl($jieqiConfigs['article']['imagedir'], $jieqiConfigs['article']['imageurl'], 'article', $article_static_url) . jieqi_getsubdir($article->getVar('articleid')) . '/' . $article->getVar('articleid') . '/' . $article->getVar('articleid') . 's' . $jieqiConfigs['article']['imagetype']);
    } else {
        $jieqiTpl->assign('url_limage', '');
    }
    $lastchapter = $article->getVar('lastchapter');
    if ($lastchapter != '') {
        if ($article->getVar('lastvolume') != '') {
            $lastchapter = $article->getVar('lastvolume') . ' ' . $lastchapter;
        }
        $jieqiTpl->assign('url_lastchapter', jieqi_geturl('article', 'chapter', $article->getVar('lastchapterid'), $article->getVar('articleid')));
    } else {
        $jieqiTpl->assign('url_lastchapter', '');
    }
    //显示多个最新章节
    if (is_numeric($jieqiConfigs['article']['infochapternum']) && intval($jieqiConfigs['article']['infochapternum']) > 0) {
        $jieqiConfigs['article']['infochapternum'] = intval($jieqiConfigs['article']['infochapternum']);
        include_once $GLOBALS['jieqiModules']['article']['path'] . '/class/chapter.php';
        $chapter_handler =& JieqiChapterHandler::getInstance('JieqiChapterHandler');
        $criteria = new CriteriaCompo(new Criteria('articleid', $article->getVar('articleid'), '='));
        $criteria->setSort('chapterorder');
        $criteria->setOrder('DESC');
        $criteria->setLimit($jieqiConfigs['article']['infochapternum'] + ceil($jieqiConfigs['article']['infochapternum'] / 4));
        $chapter_handler->queryObjects($criteria);
        $chapterrows = array();
        $k = 0;
        $volumename = $article->getVar('lastvolume');
        while ($chapter = $chapter_handler->getObject()) {
            if ($chapter->getVar('chaptertype') == 1) {
                $volumename = $chapter->getVar('chaptername');
            } else {
                $chapterrows[$k]['volumename'] = $volumename;
                $chapterrows[$k]['chaptername'] = $chapter->getVar('chaptername');
                if ($chapterrows[$k]['volumename'] != '') {
                    $chapterrows[$k]['chapter'] = $chapterrows[$k]['volumename'] . ' ' . $chapterrows[$k]['chaptername'];
                } else {
                    $chapterrows[$k]['chapter'] = $chapterrows[$k]['chaptername'];
                }
                $chapterrows[$k]['chapterid'] = $chapter->getVar('chapterid');
                $chapterrows[$k]['url_chapter'] = jieqi_geturl('article', 'chapter', $chapter->getVar('chapterid'), $article->getVar('articleid'));
                $k++;
                if ($k >= $jieqiConfigs['article']['infochapternum']) {
                    break;
                }
            }
        }
        $jieqiTpl->assign_by_ref('chapterrows', $chapterrows);
    }
    $jieqiTpl->assign('lastchapter', $lastchapter);
    $jieqiTpl->assign('size', $article->getVar('size'));
    $jieqiTpl->assign('size_k', ceil($article->getVar('size') / 1024));
    $jieqiTpl->assign('size_c', ceil($article->getVar('size') / 2));
    $jieqiTpl->assign('dayvisit', $article->getVar('dayvisit'));
    $jieqiTpl->assign('weekvisit', $article->getVar('weekvisit'));
    $jieqiTpl->assign('monthvisit', $article->getVar('monthvisit'));
    $jieqiTpl->assign('allvisit', $article->getVar('allvisit'));
    $jieqiTpl->assign('dayvote', $article->getVar('dayvote'));
    $jieqiTpl->assign('weekvote', $article->getVar('weekvote'));
    $jieqiTpl->assign('monthvote', $article->getVar('monthvote'));
    $jieqiTpl->assign('allvote', $article->getVar('allvote'));
    $jieqiTpl->assign('goodnum', $article->getVar('goodnum'));
    $jieqiTpl->assign('badnum', $article->getVar('badnum'));
    jieqi_getconfigs('article', 'option', 'jieqiOption');
    $tmpvar = $article->getVar('fullflag');
    if (isset($jieqiOption['article']['fullflag']['items'][$tmpvar])) {
        $jieqiTpl->assign('fullflag', $jieqiOption['article']['fullflag']['items'][$tmpvar]);
    } else {
        $jieqiTpl->assign('fullflag', $jieqiOption['article']['fullflag']['items'][$jieqiOption['article']['fullflag']['default']]);
    }
    $tmpvar = $article->getVar('permission');
    if (isset($jieqiOption['article']['permission']['items'][$tmpvar])) {
        $jieqiTpl->assign('permission', $jieqiOption['article']['permission']['items'][$tmpvar]);
    } else {
        $jieqiTpl->assign('permission', $jieqiOption['article']['permission']['items'][$jieqiOption['article']['permission']['default']]);
    }
    $tmpvar = $article->getVar('firstflag');
    if (isset($jieqiOption['article']['firstflag']['items'][$tmpvar])) {
        $jieqiTpl->assign('firstflag', $jieqiOption['article']['firstflag']['items'][$tmpvar]);
    } else {
        $jieqiTpl->assign('firstflag', $jieqiOption['article']['firstflag']['items'][$jieqiOption['article']['firstflag']['default']]);
    }
    //管理
    $jieqiTpl->assign('url_manage', $article_static_url . '/articlemanage.php?id=' . $article->getVar('articleid'));
    //举报
    $tmpstr = sprintf($jieqiLang['article']['article_report_reason'], jieqi_geturl('article', 'article', $article->getVar('articleid'), 'info'));
    $jieqiTpl->assign('url_report', $article_dynamic_url . '/newmessage.php?tosys=1&title=' . urlencode(sprintf($jieqiLang['article']['article_report_title'], $article->getVar('articlename', 'n'))) . '&content=' . urlencode($tmpstr));
    //采集
    $setting = unserialize($article->getVar('setting', 'n'));
    $url_collect = $article_static_url . '/collect.php?toid=' . $article->getVar('articleid', 'n');
    if (is_numeric($setting['fromarticle'])) {
        $url_collect .= '&fromid=' . $setting['fromarticle'];
    }
    if (is_numeric($setting['fromsite'])) {
        $url_collect .= '&siteid=' . $setting['fromsite'];
    }
    $jieqiTpl->assign('url_collect', $url_collect);
    //文章序号
    $jieqiTpl->assign('articleid', $article->getVar('articleid'));
    //点击阅读,全文阅读
    if ($article->getVar('chapters', 'n') > 0) {
        $jieqiTpl->assign('url_read', jieqi_geturl('article', 'article', $article->getVar('articleid'), 'index'));
        if ($jieqiConfigs['article']['makefull'] == 0 || JIEQI_CHAR_SET != JIEQI_SYSTEM_CHARSET) {
            $jieqiTpl->assign('url_fullpage', $article_static_url . '/reader.php?aid=' . $article->getVar('articleid'));
        } else {
            $jieqiTpl->assign('url_fullpage', jieqi_uploadurl($jieqiConfigs['article']['fulldir'], $jieqiConfigs['article']['fullurl'], 'article', $article_static_url) . jieqi_getsubdir($article->getVar('articleid')) . '/' . $article->getVar('articleid') . $jieqiConfigs['article']['htmlfile']);
        }
    } else {
        $jieqiTpl->assign('url_read', '#');
        $jieqiTpl->assign('url_fullpage', '#');
    }
    //放入书架
    $jieqiTpl->assign('url_bookcase', $article_dynamic_url . '/addbookcase.php?bid=' . $article->getVar('articleid'));
    //推荐本书
    $jieqiTpl->assign('url_uservote', $article_dynamic_url . '/uservote.php?id=' . $article->getVar('articleid'));
    //作家专栏
    if ($article->getVar('authorid') > 0) {
        $jieqiTpl->assign('url_authorpage', $article_dynamic_url . '/authorpage.php?id=' . $article->getVar('authorid'));
    } else {
        $jieqiTpl->assign('url_authorpage', '#');
    }
    //打包下载
    if ($article->getVar('chapters', 'n') > 0) {
        if ($jieqiConfigs['article']['makehtml'] == 0) {
            $jieqiTpl->assign('url_download', '#');
        } else {
            $jieqiTpl->assign('url_download', jieqi_uploadurl($jieqiConfigs['article']['zipdir'], $jieqiConfigs['article']['zipurl'], 'article', $article_static_url) . jieqi_getsubdir($article->getVar('articleid')) . '/' . $article->getVar('articleid') . $jieqi_file_postfix['zip']);
        }
    } else {
        $jieqiTpl->assign('url_download', '#');
    }
    //电子书部分
    $articletype = intval($article->getVar('articletype'));
    if (($articletype & 1) > 0) {
        $hasebook = 1;
    } else {
        $hasebook = 0;
    }
    if (($articletype & 2) > 0) {
        $hasobook = 1;
    } else {
        $hasobook = 0;
    }
    if (($articletype & 4) > 0) {
        $hastbook = 1;
    } else {
        $hastbook = 0;
    }
    if ($hasobook == 1) {
        include_once $GLOBALS['jieqiModules']['obook']['path'] . '/class/obook.php';
        $obook_handler =& JieqiObookHandler::getInstance('JieqiObookHandler');
        $criteria = new CriteriaCompo();
        $criteria->add(new Criteria('articleid', $article->getVar('articleid'), '='));
        $obook_handler->queryObjects($criteria);
        $obook = $obook_handler->getObject();
        if (is_object($obook) && $obook->getVar('display') == 0 && $obook->getVar('size') > 0) {
            $jieqiTpl->assign('obook_obookid', $obook->getVar('obookid'));
            $jieqiTpl->assign('obook_lastvolume', $obook->getVar('lastvolume'));
            $jieqiTpl->assign('obook_lastvolumeid', $obook->getVar('lastvolumeid'));
            $jieqiTpl->assign('obook_lastchapter', $obook->getVar('lastchapter'));
            $jieqiTpl->assign('obook_lastchapterid', $obook->getVar('lastchapterid'));
            $jieqiTpl->assign('obook_lastupdate', date(JIEQI_DATE_FORMAT, $obook->getVar('lastupdate')));
            $jieqiTpl->assign('obook_size', $obook->getVar('size'));
            $jieqiTpl->assign('obook_publishid', $obook->getVar('publishid'));
        } else {
            $hasobook = 0;
        }
    }
    $jieqiTpl->assign('articletype', $articletype);
    $jieqiTpl->assign('hasebook', $hasebook);
    $jieqiTpl->assign('hasobook', $hasobook);
    $jieqiTpl->assign('hastbook', $hastbook);
    $jieqiTpl->assign('url_goodreview', $article_dynamic_url . '/review.php?aid=' . $article->getVar('articleid') . '&type=good');
    $jieqiTpl->assign('url_allreview', $article_dynamic_url . '/review.php?aid=' . $article->getVar('articleid') . '&type=all');
    $jieqiTpl->assign('url_review', $article_dynamic_url . '/review.php?aid=' . $article->getVar('articleid'));
    if (!empty($_SESSION['jieqiUserId'])) {
        $jieqiTpl->assign('enablepost', 1);
    } else {
        $jieqiTpl->assign('enablepost', 0);
    }
    $jieqiTpl->setCaching(0);
    $jieqiTpl->assign('jieqi_contents', $jieqiTpl->fetch($GLOBALS['jieqiModules']['article']['path'] . '/templates/staticinfo.html'));
    ob_start();
    include JIEQI_ROOT_PATH . '/footer.php';
    $pagecontent = ob_get_contents();
    ob_end_clean();
    if (!empty($jieqiConfigs['article']['fakeprefix'])) {
        $dirname = JIEQI_ROOT_PATH . '/' . $jieqiConfigs['article']['fakeprefix'] . 'info';
    } else {
        $dirname = JIEQI_ROOT_PATH . '/files/article/info';
    }
    if (!file_exists($dirname)) {
        jieqi_createdir($dirname);
    }
    $dirname = $dirname . jieqi_getsubdir($article->getVar('articleid', 'n'));
    if (!file_exists($dirname)) {
        jieqi_createdir($dirname);
    }
    $dirname .= '/' . $article->getVar('articleid', 'n') . $jieqiConfigs['article']['fakefile'];
    jieqi_writefile($dirname, $pagecontent);
    return true;
}
Example #20
0
 * 手工加虚拟币
 *
 * 手工加虚拟币
 * 
 * 调用模板:/modules/pay/templates/admin/changeegold.html
 * 
 * @category   jieqicms
 * @package    pay
 * @copyright  Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com)
 * @author     $Author: juny $
 * @version    $Id: 99billreturnv2.php 234 2008-11-28 01:53:06Z juny $
 */
define('JIEQI_MODULE_NAME', 'pay');
require_once '../../../global.php';
//检查权限
jieqi_getconfigs('system', 'power');
if (!jieqi_checkpower($jieqiPower['system']['deluser'], $jieqiUsersStatus, $jieqiUsersGroup, true, true) || !jieqi_checkpower($jieqiPower['system']['adminvip'], $jieqiUsersStatus, $jieqiUsersGroup, true, true)) {
    jieqi_printfail(LANG_NO_PERMISSION);
}
if (empty($_REQUEST['uid']) || !is_numeric($_REQUEST['uid'])) {
    jieqi_printfail(LANG_ERROR_PARAMETER);
}
$_REQUEST['uid'] = intval($_REQUEST['uid']);
include_once JIEQI_ROOT_PATH . '/class/users.php';
$users_handler =& JieqiUsersHandler::getInstance('JieqiUsersHandler');
$user = $users_handler->get($_REQUEST['uid']);
if (!is_object($user)) {
    jieqi_printfail(LANG_NO_USER);
}
jieqi_loadlang('egold', JIEQI_MODULE_NAME);
//LANG_ERROR_PARAMETER
Example #21
0
/**
 * 发帖提交后的内容校验
 * 
 * $post_set 相关参数:
 * 'module' - 程序所属模块名
 * 'ownerid' - 论坛或所有者ID
 * 'topicid' - 主题ID
 * 'postid' - 帖子ID
 * 'posttime' - 发帖时间
 * 'title' - 标题在$_POST里面的键名
 * 'content' - 内容在$_POST里面的键名
 * 'checkcode' - 验证码
 * 'attachment' - 附件信息,附件数组serialize后的字符串
 * 'emptytitle' - bool类型,主题贴是都允许不填主题,false-不允许,true-允许
 * 'isnew' - bool类型,true表示发新帖,false表示编辑帖子
 * 'istopic' - bool类型,true表示主题帖子,false表示回复帖子
 * 'istop' - bool类型,是否全区置顶帖子
 * 'sname' - string类型,发帖时间在session里面保存的变量名
 * 'attachfile' - array类型,附件上传信息变量
 * 'oldattach' - array类型,老的附件是否保留信息
 * 
 * $configs 相关参数:
 * 'minposttime' - int类型,发帖最少时间间隔,单位是秒
 * 'badpostwords' - string类型,禁止发表的词语,每个一行
 * 'checkpostrubbish' - bool类型,是否检查灌水贴
 * 'minpostsize' - int类型,帖子内容最少几个字节
 * 'maxpostsize' - int类型,帖子内容最多几个字节
 * 'hidepostwords' - string类型,发表后隐藏的词语,每个一行
 * 
 * @param      array       $post_set 发帖信息设置
 * @param      array       $configs 检查相关参数设置
 * @param      array       $check_errors 错误信息数组
 * @access     public
 * @return     bool
 */
function jieqi_post_checkvar(&$post_set, $configs, &$check_errors)
{
    global $jieqiLang;
    global $jieqiConfigs;
    if (!isset($jieqiLang['system']['post'])) {
        jieqi_loadlang('post', 'system');
    }
    if (!isset($jieqiConfigs['system'])) {
        jieqi_getconfigs('system', 'configs');
    }
    if (!is_array($check_errors)) {
        $check_errors = array();
    }
    $num_errors = count($check_errors);
    include_once JIEQI_ROOT_PATH . '/include/checker.php';
    $checker = new JieqiChecker();
    //提交处理
    if (isset($jieqiConfigs['system']['posttitlemax'])) {
        $jieqiConfigs['system']['posttitlemax'] = intval($jieqiConfigs['system']['posttitlemax']);
    }
    if (empty($jieqiConfigs['system']['posttitlemax']) || $jieqiConfigs['system']['posttitlemax'] <= 10) {
        $jieqiConfigs['system']['posttitlemax'] = 60;
    }
    $post_set['topictitle'] = jieqi_substr(trim($post_set['topictitle']), 0, $jieqiConfigs['system']['posttitlemax'], '...');
    //检查禁止发帖时间段
    if (!empty($jieqiConfigs['system']['postdenytimes'])) {
        if (!$checker->deny_time($jieqiConfigs['system']['postdenytimes'])) {
            $check_errors[] = sprintf($jieqiLang['system']['post_deny_times'], jieqi_htmlstr($jieqiConfigs['system']['postdenytimes']));
        }
    }
    //检查时间间隔,是否允许发贴
    if (!empty($jieqiConfigs['system']['postintervaltime']) && !empty($post_set['isnew'])) {
        if (!$checker->interval_time($jieqiConfigs['system']['postintervaltime'], $post_set['sname'], 'jieqiVisitTime')) {
            $check_errors[] = sprintf($jieqiLang['system']['post_time_limit'], $jieqiConfigs['system']['postintervaltime']);
        }
    }
    //验证码
    if ($jieqiConfigs['system']['postcheckcode'] > 0) {
        if ($post_set['checkcode'] != $_SESSION['jieqiCheckCode']) {
            $check_errors[] = $jieqiLang['system']['post_checkcode_error'];
        }
    }
    //检查禁用单词
    if (!empty($jieqiConfigs['system']['postdenywords'])) {
        $matchwords1 = $checker->deny_words($post_set['topictitle'], $jieqiConfigs['system']['postdenywords'], true);
        $matchwords2 = $checker->deny_words($post_set['posttext'], $jieqiConfigs['system']['postdenywords'], true);
        if (is_array($matchwords1) || is_array($matchwords2)) {
            $matchwords = array();
            if (is_array($matchwords1)) {
                $matchwords = array_merge($matchwords, $matchwords1);
            }
            if (is_array($matchwords2)) {
                $matchwords = array_merge($matchwords, $matchwords2);
            }
            $check_errors[] = sprintf($jieqiLang['system']['post_words_deny'], implode(' ', jieqi_funtoarray('htmlspecialchars', $matchwords)));
        }
    }
    //检查灌水
    if (!empty($jieqiConfigs['system']['postdenyrubbish'])) {
        if (!$checker->deny_rubbish($post_set['posttext'], $jieqiConfigs['system']['postdenyrubbish'])) {
            $check_errors[] = $jieqiLang['system']['post_words_water'];
        }
    }
    //检查标题
    if (!empty($post_set['istopic']) && $checker->is_required($post_set['topictitle']) == false) {
        if ($post_set['emptytitle']) {
            $post_set['topictitle'] = jieqi_substr(str_replace(array("\r", "\n", "\t", " "), '', preg_replace('/\\[[^\\[\\]]+\\]([^\\[\\]]*)\\[\\/[^\\[\\]]+\\]/isU', '\\1', $post_set['posttext'])), 0, 60);
            if (strlen($post_set['emptytitle']) == 0) {
                $post_set['emptytitle'] = '--';
            }
        } else {
            $check_errors[] = $jieqiLang['system']['post_need_title'];
        }
    }
    //检查内容
    if (!$checker->is_required($post_set['posttext'])) {
        $check_errors[] = $jieqiLang['system']['post_need_content'];
    }
    //检查最少字数
    if (!empty($jieqiConfigs['system']['postminsize']) && !$checker->str_min($post_set['posttext'], $jieqiConfigs['system']['postminsize'])) {
        $check_errors[] = sprintf($jieqiLang['system']['post_min_content'], $jieqiConfigs['system']['postminsize']);
    }
    //检查最多字数
    if (!empty($jieqiConfigs['system']['postmaxsize']) && !$checker->str_max($post_set['posttext'], $jieqiConfigs['system']['postmaxsize'])) {
        $check_errors[] = sprintf($jieqiLang['system']['post_max_content'], $jieqiConfigs['system']['postmaxsize']);
    }
    //替换单词
    if (isset($jieqiConfigs['system']['postreplacewords']) && !empty($jieqiConfigs['system']['postreplacewords'])) {
        $checker->replace_words($post_set['topictitle'], $jieqiConfigs['system']['postreplacewords']);
        $checker->replace_words($post_set['posttext'], $jieqiConfigs['system']['postreplacewords']);
    }
    return count($check_errors) > $num_errors ? false : true;
}
Example #22
0
 * @copyright  Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com)
 * @author     $Author: juny $
 * @version    $Id: mylink.php 332 2009-02-23 09:15:08Z juny $
 */
define('JIEQI_MODULE_NAME', 'system');
require_once 'global.php';
jieqi_checklogin();
jieqi_loadlang('userlink', JIEQI_MODULE_NAME);
jieqi_getconfigs('system', 'configs');
if (empty($_REQUEST['page']) || !is_numeric($_REQUEST['page'])) {
    $_REQUEST['page'] = 1;
}
//页码
//获得允许链接数和现有链接数
jieqi_getconfigs('system', 'honors');
jieqi_getconfigs(JIEQI_MODULE_NAME, 'right');
$maxuserlink = isset($jieqiConfigs['system']['maxuserlink']) ? intval($jieqiConfigs['system']['maxuserlink']) : 0;
$honorid = jieqi_gethonorid($_SESSION['jieqiUserScore'], $jieqiHonors);
if ($honorid && isset($jieqiRight['system']['maxuserlink']['honors'][$honorid]) && is_numeric($jieqiRight['system']['maxuserlink']['honors'][$honorid])) {
    $maxuserlink = intval($jieqiRight['system']['maxuserlink']['honors'][$honorid]);
}
//根据头衔设置的消息数
include_once JIEQI_ROOT_PATH . '/class/userlink.php';
$userlink_handler =& JieqiUserlinkHandler::getInstance('JieqiUserlinkHandler');
if (isset($_REQUEST['action'])) {
    switch ($_REQUEST['action']) {
        case 'add':
            $errtext = '';
            if (!empty($maxuserlink)) {
                $nowlink = $userlink_handler->getCount(new Criteria('userid', $_SESSION['jieqiUserId']));
                if ($nowlink >= $maxuserlink) {
Example #23
0
/**
 * 用户登录后处理
 * 
 * @param      object      $jieqiUsers 用户对象
 * @access     public
 * @return     bool
 */
function jieqi_loginprocess($jieqiUsers, $usecookie = 0)
{
    global $jieqiConfigs;
    global $jieqiHonors;
    global $jieqiGroups;
    if (!isset($jieqiConfigs['system'])) {
        jieqi_getconfigs('system', 'configs');
    }
    include_once JIEQI_ROOT_PATH . '/class/users.php';
    $users_handler =& JieqiUsersHandler::getInstance('JieqiUsersHandler');
    //更新在线用户表
    include_once JIEQI_ROOT_PATH . '/class/online.php';
    $online_handler =& JieqiOnlineHandler::getInstance('JieqiOnlineHandler');
    $criteria = new CriteriaCompo(new Criteria('uid', $jieqiUsers->getVar('uid', 'n')));
    $criteria->setSort('updatetime');
    $criteria->setOrder('DESC');
    $online_handler->queryObjects($criteria);
    $online = $online_handler->getObject();
    //读cookie信息
    $jieqi_user_info = array();
    if (!empty($_COOKIE['jieqiUserInfo'])) {
        $jieqi_user_info = jieqi_strtosary($_COOKIE['jieqiUserInfo']);
    } else {
        $jieqi_user_info = array();
    }
    $jieqi_visit_info = array();
    if (!empty($_COOKIE['jieqiVisitInfo'])) {
        $jieqi_visit_info = jieqi_strtosary($_COOKIE['jieqiVisitInfo']);
    } else {
        $jieqi_visit_info = array();
    }
    if (is_object($online)) {
        $ip = jieqi_userip();
        if (JIEQI_SESSION_EXPRIE > 0) {
            $exprie_time = JIEQI_SESSION_EXPRIE;
        } else {
            $exprie_time = @ini_get('session.gc_maxlifetime');
        }
        if (empty($exprie_time)) {
            $exprie_time = 1800;
        }
        if (defined('JIEQI_DENY_RELOGIN') && JIEQI_DENY_RELOGIN == 1 && JIEQI_NOW_TIME - $online->getVar('updatetime') < $exprie_time && $online->getVar('ip', 'n') != $ip && $jieqi_visit_info['jieqiUserId'] != $jieqiUsers->getVar('uid')) {
            return -8;
        }
        $tmpvar = strlen($jieqiUsers->getVar('name', 'q')) > 0 ? $jieqiUsers->getVar('name', 'q') : $jieqiUsers->getVar('uname', 'q');
        $sql = "UPDATE " . jieqi_dbprefix('system_online') . " SET uid=" . $jieqiUsers->getVar('uid', 'q') . ", sid='" . jieqi_dbslashes(session_id()) . "', uname='" . $jieqiUsers->getVar('uname', 'q') . "', name='" . $tmpvar . "', pass='******'pass', 'q') . "',email='" . $jieqiUsers->getVar('email', 'q') . "', groupid=" . $jieqiUsers->getVar('groupid', 'q') . ", updatetime=" . JIEQI_NOW_TIME . ", ip='" . jieqi_dbslashes($ip) . "' WHERE uid=" . $jieqiUsers->getVar('uid', 'q') . " OR sid='" . jieqi_dbslashes(session_id()) . "'";
        $online_handler->db->query($sql);
    } else {
        include_once JIEQI_ROOT_PATH . '/include/visitorinfo.php';
        $online = $online_handler->create();
        $online->setVar('uid', $jieqiUsers->getVar('uid', 'n'));
        $online->setVar('siteid', JIEQI_SITE_ID);
        $online->setVar('sid', session_id());
        $online->setVar('uname', $jieqiUsers->getVar('uname', 'n'));
        $tmpvar = strlen($jieqiUsers->getVar('name', 'n')) > 0 ? $jieqiUsers->getVar('name', 'n') : $jieqiUsers->getVar('uname', 'n');
        $online->setVar('name', $tmpvar);
        $online->setVar('pass', $jieqiUsers->getVar('pass', 'n'));
        $online->setVar('email', $jieqiUsers->getVar('email', 'n'));
        $online->setVar('groupid', $jieqiUsers->getVar('groupid', 'n'));
        $tmpvar = JIEQI_NOW_TIME;
        $online->setVar('logintime', $tmpvar);
        $online->setVar('updatetime', $tmpvar);
        $online->setVar('operate', '');
        $tmpvar = VisitorInfo::getIp();
        $online->setVar('ip', $tmpvar);
        $online->setVar('browser', VisitorInfo::getBrowser());
        $online->setVar('os', VisitorInfo::getOS());
        $location = VisitorInfo::getIpLocation($tmpvar);
        if (JIEQI_SYSTEM_CHARSET == 'big5') {
            include_once JIEQI_ROOT_PATH . '/include/changecode.php';
            $location = jieqi_gb2big5($location);
        }
        $online->setVar('location', $location);
        $online->setVar('state', '0');
        $online->setVar('flag', '0');
        $online_handler->insert($online);
    }
    //删除过期的在线用户
    unset($criteria);
    $criteria = new CriteriaCompo(new Criteria('updatetime', JIEQI_NOW_TIME - $jieqiConfigs['system']['onlinetime'], '<'));
    $online_handler->delete($criteria);
    //检查短消息
    include_once JIEQI_ROOT_PATH . '/class/message.php';
    $message_handler = JieqiMessageHandler::getInstance('JieqiMessageHandler');
    $criteria = new CriteriaCompo(new Criteria('toid', $jieqiUsers->getVar('uid'), '='));
    $criteria->add(new Criteria('isread', 0, '='));
    $criteria->add(new Criteria('todel', 0, '='));
    $newmsgnum = $message_handler->getCount($criteria);
    unset($criteria);
    //有短消息
    //用户信息
    $previewlogin = intval($jieqiUsers->getVar('lastlogin'));
    $jieqiUsers->setVar('lastlogin', JIEQI_NOW_TIME);
    $userset = unserialize($jieqiUsers->getVar('setting', 'n'));
    if (!isset($userset['lastip']) || $userset['lastip'] != jieqi_userip()) {
        $userset['lastip'] = jieqi_userip();
    }
    if (!isset($userset['logindate']) || $userset['logindate'] != date('Y-m-d')) {
        $userset['logindate'] = date('Y-m-d');
        //增加登陆积分
        $jieqiUsers->setVar('experience', $jieqiUsers->getVar('experience') + $jieqiConfigs['system']['scorelogin']);
        $jieqiUsers->setVar('score', $jieqiUsers->getVar('score') + $jieqiConfigs['system']['scorelogin']);
    }
    //如果换月了,清空月积分
    //if(date('Y-m', $previewlogin) != date('Y-m', JIEQI_NOW_TIME)) $jieqiUsers->setVar('monthscore', 0);
    $jieqiUsers->setVar('setting', serialize($userset));
    $jieqiUsers->unsetNew();
    $users_handler->insert($jieqiUsers);
    header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
    //设置SESSION
    jieqi_setusersession($jieqiUsers);
    if ($newmsgnum > 0) {
        $_SESSION['jieqiNewMessage'] = $newmsgnum;
    }
    //后台登录状态
    $jieqi_online_info = empty($_COOKIE['jieqiOnlineInfo']) ? array() : jieqi_strtosary($_COOKIE['jieqiOnlineInfo']);
    if (isset($jieqi_online_info['jieqiAdminLogin']) && $jieqi_online_info['jieqiAdminLogin'] == 1) {
        $_SESSION['jieqiAdminLogin'] = 1;
    }
    $jieqi_user_info['jieqiUserId'] = $_SESSION['jieqiUserId'];
    $jieqi_user_info['jieqiUserUname'] = $_SESSION['jieqiUserUname'];
    $jieqi_user_info['jieqiUserName'] = $_SESSION['jieqiUserName'];
    $jieqi_user_info['jieqiUserGroup'] = $_SESSION['jieqiUserGroup'];
    $jieqi_user_info['jieqiUserGroupName'] = $jieqiGroups[$_SESSION['jieqiUserGroup']];
    $jieqi_user_info['jieqiUserVip'] = $_SESSION['jieqiUserVip'];
    $jieqi_user_info['jieqiUserHonorId'] = $_SESSION['jieqiUserHonorId'];
    $jieqi_user_info['jieqiUserHonor'] = $_SESSION['jieqiUserHonor'];
    if ($newmsgnum > 0) {
        $jieqi_user_info['jieqiNewMessage'] = $newmsgnum;
    }
    if ($usecookie) {
        $jieqi_user_info['jieqiUserPassword'] = $jieqiUsers->getVar('pass', 'n');
    }
    include_once JIEQI_ROOT_PATH . '/include/changecode.php';
    if (JIEQI_SYSTEM_CHARSET == 'gbk') {
        $jieqi_user_info['jieqiUserUname_un'] = jieqi_gb2unicode($_SESSION['jieqiUserUname']);
        $jieqi_user_info['jieqiUserName_un'] = jieqi_gb2unicode($_SESSION['jieqiUserName']);
        $jieqi_user_info['jieqiUserHonor_un'] = jieqi_gb2unicode($_SESSION['jieqiUserHonor']);
        $jieqi_user_info['jieqiUserGroupName_un'] = jieqi_gb2unicode($jieqiGroups[$_SESSION['jieqiUserGroup']]);
    } else {
        $jieqi_user_info['jieqiUserUname_un'] = jieqi_big52unicode($_SESSION['jieqiUserUname']);
        $jieqi_user_info['jieqiUserName_un'] = jieqi_big52unicode($_SESSION['jieqiUserName']);
        $jieqi_user_info['jieqiUserHonor_un'] = jieqi_big52unicode($_SESSION['jieqiUserHonor']);
        $jieqi_user_info['jieqiUserGroupName_un'] = jieqi_gb2unicode($jieqiGroups[$_SESSION['jieqiUserGroup']]);
    }
    $jieqi_user_info['jieqiUserLogin'] = JIEQI_NOW_TIME;
    if ($usecookie < 0) {
        $usecookie = 0;
    } elseif ($usecookie == 1) {
        $usecookie = 315360000;
    }
    if ($usecookie) {
        $cookietime = JIEQI_NOW_TIME + $usecookie;
    } else {
        $cookietime = 0;
    }
    @setcookie('jieqiUserInfo', jieqi_sarytostr($jieqi_user_info), $cookietime, '/', JIEQI_COOKIE_DOMAIN, 0);
    $jieqi_visit_info['jieqiUserLogin'] = $jieqi_user_info['jieqiUserLogin'];
    $jieqi_visit_info['jieqiUserId'] = $jieqi_user_info['jieqiUserId'];
    @setcookie('jieqiVisitInfo', jieqi_sarytostr($jieqi_visit_info), JIEQI_NOW_TIME + 99999999, '/', JIEQI_COOKIE_DOMAIN, 0);
    //更新在线用户
    include_once JIEQI_ROOT_PATH . '/lib/template/template.php';
    $jieqiTpl =& JieqiTpl::getInstance();
    $jieqiTpl->clear_cache(JIEQI_ROOT_PATH . '/templates/online.html');
    return 0;
}
Example #24
0
 * 
 * 调用模板:无
 * 
 * @category   jieqicms
 * @package    pay
 * @copyright  Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com)
 * @author     $Author: juny $
 * @version    $Id: ivancallconfirm.php 234 2008-11-28 01:53:06Z juny $
 */
define('JIEQI_MODULE_NAME', 'pay');
define('JIEQI_PAY_TYPE', 'ivancall');
require_once '../../global.php';
jieqi_loadlang('pay', JIEQI_MODULE_NAME);
jieqi_loadlang(JIEQI_PAY_TYPE, JIEQI_MODULE_NAME);
jieqi_checklogin();
jieqi_getconfigs(JIEQI_MODULE_NAME, JIEQI_PAY_TYPE, 'jieqiPayset');
$phone = trim($_POST['phone']);
include_once $jieqiModules['pay']['path'] . '/class/paylog.php';
$paylog_handler = JieqiPaylogHandler::getInstance('JieqiPaylogHandler');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('buyinfo', $phone));
$criteria->add(new Criteria('payflag', -2));
$paylog_handler->queryObjects($criteria);
$payary = array();
$i = 0;
while ($paylog = $paylog_handler->getObject()) {
    $payary[$i]['payid'] = $paylog->getVar('payid');
    $payary[$i]['money'] = $paylog->getVar('money');
    $payary[$i]['egold'] = $paylog->getVar('egold');
    $i++;
}
Example #25
0
 function makeumd_volume($vk = 0)
 {
     if ((JIEQI_MODULE_VTYPE == '' || JIEQI_MODULE_VTYPE == 'Free') && empty($GLOBALS['jieqi_license_modules']['waparticle']) || $GLOBALS['jieqi_license_modules']['waparticle'] == 'Free') {
         return true;
     }
     if (!function_exists('gzcompress') || !function_exists('iconv')) {
         return false;
     }
     global $jieqiConfigs;
     global $jieqi_file_postfix;
     if (!isset($jieqiSort['article'])) {
         jieqi_getconfigs('article', 'sort');
     }
     include_once JIEQI_ROOT_PATH . '/lib/compress/umd.php';
     $umddir = $this->getDir('umddir', true);
     $txtdir = $this->getDir('txtdir', true, false);
     $vk = intval($vk);
     //$vk = 128; //每卷几K
     $vd = 1;
     //每卷程序占用几K
     $vc = 0.58;
     //压缩比例
     $vinfo = array();
     if (empty($vk) || $vk < $vd) {
         $umd = new JieqiUmd();
         $umd->setcharset(strtoupper(JIEQI_SYSTEM_CHARSET));
         if (!empty($jieqiSort['article'][$this->metas['dc:Sortid']]['caption'])) {
             $sort = $jieqiSort['article'][$this->metas['dc:Sortid']]['caption'];
         } else {
             $sort = '';
         }
         $umd->setinfo(array('id' => $this->id, 'title' => $this->metas['dc:Title'], 'author' => $this->metas['dc:Creator'], 'sort' => $sort, 'publisher' => $this->metas['dc:Publisher'], 'corver' => ''));
         //设置文章信息
         $volume = '';
         $fromvolume = '';
         $fromchapter = '';
         $fromchapterid = 0;
         $tovolume = '';
         $tochapter = '';
         $tochapterid = 0;
         $chapters = 0;
         $volumes = 0;
         $firstflag = true;
         foreach ($this->chapters as $k => $chapter) {
             if ($chapter['content-type'] == 'volume') {
                 $volume = $chapter['id'];
                 if ($firstflag) {
                     $fromvolume = $volume;
                 }
                 $tovolume = $volume;
                 $volumes++;
             } else {
                 $umd->addchapter($volume . ' ' . $chapter['id'], '<' . $volume . ' ' . $chapter['id'] . '>' . "\n" . jieqi_readfile($txtdir . '/' . $chapter['href']));
                 if ($fromchapter == '') {
                     $fromchapter = $chapter['id'];
                 }
                 $tochapter = $chapter['id'];
                 $tmpint = strpos($chapter['href'], '.');
                 if ($tmpint > 0) {
                     $tmpcid = intval(trim(substr($chapter['href'], 0, $tmpint)));
                 } else {
                     $tmpcid = 0;
                 }
                 if ($fromchapterid == 0) {
                     $fromchapterid = $tmpcid;
                 }
                 $tochapterid = $tmpcid;
                 $chapters++;
             }
             $firstflag = false;
         }
         $umd->makeumd($umddir . '/' . $this->id . $jieqi_file_postfix['umd']);
         unset($umd);
         $vinfo['chapters'] = $chapters;
         $vinfo['volumes'] = $volumes;
         $vinfo['fromvolume'] = $fromvolume;
         $vinfo['fromchapter'] = $fromchapter;
         $vinfo['fromchapterid'] = $fromchapterid;
         $vinfo['tovolume'] = $tovolume;
         $vinfo['tochapter'] = $tochapter;
         $vinfo['tochapterid'] = $tochapterid;
         $vinfo['maketime'] = JIEQI_NOW_TIME;
         $vinfo['filesize'] = filesize($umddir . '/' . $this->id . $jieqi_file_postfix['umd']);
         include_once JIEQI_ROOT_PATH . '/lib/xml/xmlarray.php';
         $xmlarray = new XMLArray();
         $xmldata = $xmlarray->array2xml($vinfo);
         jieqi_writefile($umddir . '/' . $this->id . '.xml', $xmldata);
     } elseif ($vk > $vd) {
         $vid = 1;
         //第几卷
         $vnew = true;
         //是否需要新增卷
         $vsize = 0;
         $volume = '';
         foreach ($this->chapters as $k => $chapter) {
             if ($chapter['content-type'] == 'volume') {
                 $volume = $chapter['id'];
                 $vinfo[$vid]['volumes']++;
             } else {
                 $filedata = jieqi_readfile($txtdir . '/' . $chapter['href']);
                 $vcdata = '<' . $volume . ' ' . $chapter['id'] . '>' . "\n";
                 $filelen = strlen($filedata) + strlen($vcdata);
                 if ($vsize > 0 && ($vsize + $filelen) / 1024 * $vc > $vk - $vd) {
                     $umd->makeumd($umddir . '/' . $this->id . '_' . $vk . '_' . $vid . $jieqi_file_postfix['umd']);
                     unset($umd);
                     $vinfo[$vid]['maketime'] = JIEQI_NOW_TIME;
                     $vinfo[$vid]['filesize'] = filesize($umddir . '/' . $this->id . '_' . $vk . '_' . $vid . $jieqi_file_postfix['umd']);
                     $vid++;
                     $vsize = 0;
                     $vnew = true;
                 }
                 if ($vnew) {
                     $umd = new JieqiUmd();
                     $umd->setcharset(strtoupper(JIEQI_SYSTEM_CHARSET));
                     if (!empty($jieqiSort['article'][$this->metas['dc:Sortid']]['caption'])) {
                         $sort = $jieqiSort['article'][$this->metas['dc:Sortid']]['caption'];
                     } else {
                         $sort = '';
                     }
                     $umd->setinfo(array('id' => $this->id, 'title' => $this->metas['dc:Title'] . '_' . $vk . '_' . $vid, 'author' => $this->metas['dc:Creator'], 'sort' => $sort, 'publisher' => $this->metas['dc:Publisher'], 'corver' => ''));
                     //设置文章信息
                     $vnew = false;
                     $vinfo[$vid]['chapters'] = 0;
                     $vinfo[$vid]['volumes'] = 0;
                     $vinfo[$vid]['fromvolume'] = $volume;
                     $vinfo[$vid]['fromchapter'] = $chapter['id'];
                     $tmpint = strpos($chapter['href'], '.');
                     if ($tmpint > 0) {
                         $vinfo[$vid]['fromchapterid'] = intval(trim(substr($chapter['href'], 0, $tmpint)));
                     } else {
                         $vinfo[$vid]['fromchapterid'] = 0;
                     }
                 }
                 $umd->addchapter($volume . ' ' . $chapter['id'], $vcdata . $filedata);
                 $vsize = $vsize + $filelen;
                 $vinfo[$vid]['chapters']++;
                 $vinfo[$vid]['tovolume'] = $volume;
                 $vinfo[$vid]['tochapter'] = $chapter['id'];
                 $tmpint = strpos($chapter['href'], '.');
                 if ($tmpint > 0) {
                     $vinfo[$vid]['tochapterid'] = intval(trim(substr($chapter['href'], 0, $tmpint)));
                 } else {
                     $vinfo[$vid]['tochapterid'] = 0;
                 }
             }
         }
         if (!$vnew) {
             $umd->makeumd($umddir . '/' . $this->id . '_' . $vk . '_' . $vid . $jieqi_file_postfix['umd']);
             $vinfo[$vid]['tovolume'] = $volume;
             $vinfo[$vid]['tochapter'] = $chapter['id'];
             $tmpint = strpos($chapter['href'], '.');
             if ($tmpint > 0) {
                 $vinfo[$vid]['tochapterid'] = intval(trim(substr($chapter['href'], 0, $tmpint)));
             } else {
                 $vinfo[$vid]['tochapterid'] = 0;
             }
             $vinfo[$vid]['maketime'] = JIEQI_NOW_TIME;
             $vinfo[$vid]['filesize'] = filesize($umddir . '/' . $this->id . '_' . $vk . '_' . $vid . $jieqi_file_postfix['umd']);
             unset($umd);
         }
         include_once JIEQI_ROOT_PATH . '/lib/xml/xmlarray.php';
         $xmlarray = new XMLArray();
         $xmldata = $xmlarray->array2xml($vinfo);
         jieqi_writefile($umddir . '/' . $this->id . '_' . $vk . '.xml', $xmldata);
     } else {
         return false;
     }
 }
Example #26
0
 *
 * 我的购买记录
 * 
 * 调用模板:/modules/obook/templates/buylog.html
 * 
 * @category   jieqicms
 * @package    obook
 * @copyright  Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com)
 * @author     $Author: juny $
 * @version    $Id: buylog.php 326 2009-02-04 00:26:22Z juny $
 */
define('JIEQI_MODULE_NAME', 'obook');
require_once '../../global.php';
jieqi_checklogin();
include_once JIEQI_ROOT_PATH . '/header.php';
jieqi_getconfigs('obook', 'configs');
$obook_static_url = empty($jieqiConfigs['obook']['staticurl']) ? $jieqiModules['obook']['url'] : $jieqiConfigs['obook']['staticurl'];
$obook_dynamic_url = empty($jieqiConfigs['obook']['dynamicurl']) ? $jieqiModules['obook']['url'] : $jieqiConfigs['obook']['dynamicurl'];
$jieqiTpl->assign('obook_static_url', $obook_static_url);
$jieqiTpl->assign('obook_dynamic_url', $obook_dynamic_url);
//页码
if (empty($_REQUEST['page']) || !is_numeric($_REQUEST['page'])) {
    $_REQUEST['page'] = 1;
}
include_once $jieqiModules['obook']['path'] . '/class/osale.php';
$osale_handler =& JieqiOsaleHandler::getInstance('JieqiOsaleHandler');
$criteria = new CriteriaCompo(new Criteria('accountid', $_SESSION['jieqiUserId']));
if (!empty($_REQUEST['oid'])) {
    $criteria->add(new Criteria('obookid', intval($_REQUEST['oid'])));
} elseif (!empty($_REQUEST['oname'])) {
    $criteria->add(new Criteria('obookname', $_REQUEST['oname']));
Example #27
0
/**
 * 设置文章的本站推荐标志
 *
 * 设置文章的本站推荐标志
 * 
 * 调用模板:无
 * 
 * @category   jieqicms
 * @package    article
 * @copyright  Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com)
 * @author     $Author: juny $
 * @version    $Id: setgood.php 228 2008-11-27 06:44:31Z juny $
 */
define('JIEQI_MODULE_NAME', 'article');
require_once '../../../global.php';
jieqi_getconfigs(JIEQI_MODULE_NAME, 'power');
jieqi_checkpower($jieqiPower['article']['manageallarticle'], $jieqiUsersStatus, $jieqiUsersGroup, false, true);
jieqi_loadlang('manage', JIEQI_MODULE_NAME);
if (empty($_REQUEST['id'])) {
    jieqi_printfail($jieqiLang['article']['article_not_exists']);
}
include_once $jieqiModules['article']['path'] . '/class/article.php';
$article_handler =& JieqiArticleHandler::getInstance('JieqiArticleHandler');
$article = $article_handler->get($_REQUEST['id']);
if (!is_object($article)) {
    jieqi_printfail($jieqiLang['article']['article_not_exists']);
}
if ($_REQUEST['action'] == 'no') {
    $article->setVar('toptime', 0);
} else {
    $article->setVar('toptime', JIEQI_NOW_TIME);
Example #28
0
@set_time_limit(0);
@session_write_close();
jieqi_loadlang('collect', JIEQI_MODULE_NAME);
if (!isset($_REQUEST['siteid']) || !is_numeric($_REQUEST['siteid'])) {
    jieqi_printfail($jieqiLang['article']['need_collect_siteid']);
}
jieqi_getconfigs(JIEQI_MODULE_NAME, 'collectsite');
if (!array_key_exists($_REQUEST['siteid'], $jieqiCollectsite) || $jieqiCollectsite[$_REQUEST['siteid']]['enable'] != '1') {
    jieqi_printfail($jieqiLang['article']['collect_notsupport_site']);
}
if (!file_exists(JIEQI_ROOT_PATH . '/configs/article/site_' . $jieqiCollectsite[$_REQUEST['siteid']]['config'] . '.php')) {
    jieqi_printfail($jieqiLang['article']['rule_not_exists']);
}
include_once JIEQI_ROOT_PATH . '/configs/article/site_' . $jieqiCollectsite[$_REQUEST['siteid']]['config'] . '.php';
include_once JIEQI_ROOT_PATH . '/lib/text/textfunction.php';
jieqi_getconfigs('article', 'configs');
$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'];
if (!isset($_REQUEST['action'])) {
    $_REQUEST['action'] = 'show';
}
switch ($_REQUEST['action']) {
    case 'collect':
        include_once $jieqiModules['article']['path'] . '/include/collectfunction.php';
        $_REQUEST['collectname'] = intval($_REQUEST['collectname']);
        if (!isset($jieqiCollect['listcollect'][$_REQUEST['collectname']])) {
            jieqi_printfail($jieqiLang['article']['rule_not_exists']);
        }
        if (empty($_REQUEST['collectpagenum']) || !is_numeric($_REQUEST['collectpagenum'])) {
            $_REQUEST['collectpagenum'] = 1;
        }
Example #29
0
//检查打包参数
if (!is_numeric($_REQUEST['id'])) {
    exit;
}
if (!is_array($_REQUEST['packflag']) || count($_REQUEST['packflag']) < 1) {
    exit;
}
$_REQUEST['id'] = intval($_REQUEST['id']);
@ignore_user_abort(true);
@set_time_limit(3600);
@session_write_close();
@ini_set('memory_limit', '64M');
echo '                                                                                                                                                                                                                                                                                                            ';
ob_flush();
flush();
jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs');
include_once $GLOBALS['jieqiModules']['article']['path'] . '/class/article.php';
include_once $GLOBALS['jieqiModules']['article']['path'] . '/class/chapter.php';
include_once $GLOBALS['jieqiModules']['article']['path'] . '/class/package.php';
$article_handler =& JieqiArticleHandler::getInstance('JieqiArticleHandler');
$article = $article_handler->get($_REQUEST['id']);
if (!is_object($article)) {
    exit;
} else {
    $package = new JieqiPackage($_REQUEST['id']);
    $package->initPackage(array('id' => $article->getVar('articleid', 'n'), 'title' => $article->getVar('articlename', 'n'), 'creatorid' => $article->getVar('authorid', 'n'), 'creator' => $article->getVar('author', 'n'), 'subject' => $article->getVar('keywords', 'n'), 'description' => $article->getVar('intro', 'n'), 'publisher' => JIEQI_SITE_NAME, 'contributorid' => $article->getVar('posterid', 'n'), 'contributor' => $article->getVar('poster', 'n'), 'sortid' => $article->getVar('sortid', 'n'), 'typeid' => $article->getVar('typeid', 'n'), 'articletype' => $article->getVar('articletype', 'n'), 'permission' => $article->getVar('permission', 'n'), 'firstflag' => $article->getVar('firstflag', 'n'), 'fullflag' => $article->getVar('fullflag', 'n'), 'imgflag' => $article->getVar('imgflag', 'n'), 'power' => $article->getVar('power', 'n'), 'display' => $article->getVar('display', 'n')), false);
    $chapter_handler =& JieqiChapterHandler::getInstance('JieqiChapterHandler');
    $criteria = new CriteriaCompo(new Criteria('articleid', $_REQUEST['id'], '='));
    $criteria->setSort('chapterorder ASC, chapterid');
    $criteria->setOrder('ASC');
    $res = $chapter_handler->queryObjects($criteria);
Example #30
0
function article_update_static($action, $id, $sortid)
{
    global $jieqiConfigs;
    global $jieqiModules;
    if (!isset($jieqiConfigs['article'])) {
        jieqi_getconfigs('article', 'configs');
    }
    $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'];
    $url = $article_dynamic_url . '/makestatic.php?key=' . urlencode(md5(JIEQI_DB_USER . JIEQI_DB_PASS . JIEQI_DB_NAME)) . '&action=' . urldecode($action) . '&id=' . intval($id) . '&sortid=' . intval($sortid);
    $url = trim($url);
    if (strtolower(substr($url, 0, 7)) != 'http://') {
        $url = 'http://' . $_SERVER['HTTP_HOST'] . $url;
    }
    $ret = jieqi_socket_url1($url);
    //阅读服务器也生成一遍
    /*
    $url=$article_static_url.'/makestatic.php?key='.urlencode(md5(JIEQI_DB_USER.JIEQI_DB_PASS.JIEQI_DB_NAME)).'&action='.urldecode($action).'&id='.intval($id).'&sortid='.intval($sortid);
    $url=trim($url);
    if(strtolower(substr($url,0,7)) == 'http://') jieqi_socket_url1($url);
    */
    return $ret;
}