break; case 'edit': default: //包含区块参数(定制区块) jieqi_getconfigs('obook', 'authorblocks', 'jieqiBlocks'); include_once JIEQI_ROOT_PATH . '/header.php'; include_once JIEQI_ROOT_PATH . '/lib/html/formloader.php'; $jieqiTpl->assign('obook_static_url', $obook_static_url); $jieqiTpl->assign('obook_dynamic_url', $obook_dynamic_url); $chapter_form = new JieqiThemeForm(sprintf($jieqiLang['obook']['chapter_edit'], $typename), 'chapteredit', $obook_static_url . '/chapteredit.php'); $chapter_form->addElement(new JieqiFormLabel($jieqiLang['obook']['table_ochapter_obookname'], $obook->getVar('obookname'))); $chapter_form->addElement(new JieqiFormText(sprintf($jieqiLang['obook']['chapter_volume_title'], $typename), 'chaptername', 50, 50, $chapter->getVar('chaptername', 'e')), true); if ($chapter->getVar('chaptertype') == 1) { $tmpvar = '1'; } else { if (jieqi_checkpower($jieqiPower['obook']['customprice'], $jieqiUsersStatus, $jieqiUsersGroup, true)) { $priceobj = new JieqiFormText($jieqiLang['obook']['table_ochapter_saleprice'], 'saleprice', 20, 10, $chapter->getVar('saleprice', 'e')); $priceobj->setDescription(JIEQI_EGOLD_NAME . $jieqiLang['obook']['chapter_saleprice_note']); $chapter_form->addElement($priceobj, false); } if ($jieqiConfigs['obook']['authtypeset'] == 1) { $typeset = new JieqiFormRadio($jieqiLang['obook']['table_ochapter_typeset'], 'typeset', $jieqiConfigs['obook']['autotypeset']); $typeset->addOption('1', $jieqiLang['obook']['auto_typeset']); $typeset->addOption('0', $jieqiLang['obook']['no_typeset']); $chapter_form->addElement($typeset); } $tmpvar = '0'; include_once $jieqiModules['obook']['path'] . '/class/ocontent.php'; $content_handler =& JieqiOcontentHandler::getInstance('JieqiOcontentHandler'); $criteria = new CriteriaCompo(new Criteria('ochapterid', $_REQUEST['id'])); $criteria->setLimit(1);
} //检查权限 jieqi_getconfigs(JIEQI_MODULE_NAME, 'power'); $canedit = jieqi_checkpower($jieqiPower['article']['manageallarticle'], $jieqiUsersStatus, $jieqiUsersGroup, true); if (!$canedit && !empty($_SESSION['jieqiUserId'])) { //除了斑竹,作者、发表者和代理人可以修改文章 $tmpvar = $_SESSION['jieqiUserId']; if ($tmpvar > 0 && ($article->getVar('authorid') == $tmpvar || $chapter->getVar('posterid') == $tmpvar || $article->getVar('agentid') == $tmpvar)) { $canedit = true; } } if (!$canedit) { jieqi_printfail(sprintf($jieqiLang['article']['noper_edit_chapter'], $typename)); } //检查上传权限 $canupload = jieqi_checkpower($jieqiPower['article']['articleupattach'], $jieqiUsersStatus, $jieqiUsersGroup, true); jieqi_getconfigs(JIEQI_MODULE_NAME, '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'] = 'edit'; } switch ($_REQUEST['action']) { case 'update': $_POST['chaptername'] = trim($_POST['chaptername']); $errtext = ''; //检查标题 if (strlen($_POST['chaptername']) == 0) { $errtext .= $typename . $jieqiLang['article']['need_chapter_title'] . '<br />'; } //检查标题和内容有没有违禁单词
$criteria->setTables(jieqi_dbprefix('badge_badge') . ' b LEFT JOIN ' . jieqi_dbprefix('badge_award') . ' a ON b.badgeid=a.badgeid'); $criteria->add(new Criteria('a.toid', $_REQUEST['id'])); $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); } //检查是否斑竹权限 jieqi_getconfigs(JIEQI_MODULE_NAME, 'power'); if (jieqi_checkpower($jieqiPower['system']['adminuser'], $jieqiUsersStatus, $jieqiUsersGroup, true)) { $ismaster = 1; } else { $ismaster = 0; } $jieqiTpl->assign('ismaster', $ismaster); $jieqiTpl->setCaching(0); $jieqiTset['jieqi_contents_template'] = JIEQI_ROOT_PATH . '/templates/userinfo.html'; include_once JIEQI_ROOT_PATH . '/footer.php'; } else { jieqi_printfail(LANG_NO_USER); }
$users_handler->insert($jieqiUsers); //发送短信扣积分 if (isset($userset['msgdate']) && $userset['msgdate'] == $today && (int) $userset['msgnum'] >= (int) $maxdaymsg && $jieqiConfigs['system']['sendmsgscore'] > 0) { $users_handler->changeScore($_SESSION['jieqiUserId'], $jieqiConfigs['system']['sendmsgscore'], false, false); } } jieqi_jumppage(JIEQI_URL . '/message.php?box=outbox', LANG_DO_SUCCESS, $jieqiLang['system']['message_send_seccess']); } } else { jieqi_printfail($errtext); } break; case 'message': default: if (!isset($_REQUEST['tosys']) || $_REQUEST['tosys'] != 1) { jieqi_checkpower($jieqiPower['system']['sendmessage'], $jieqiUsersStatus, $jieqiUsersGroup, false); } //如果已发短信大于做大限制,直接提示禁止发送或者提示扣分 $sendneedscore = false; if (!empty($maxdaymsg) && isset($userset['msgdate']) && $userset['msgdate'] == $today && (int) $userset['msgnum'] >= (int) $maxdaymsg) { if ($jieqiConfigs['system']['sendmsgscore'] > 0) { $sendneedscore = true; } else { jieqi_printfail(sprintf($jieqiLang['system']['day_message_limit'], $maxdaymsg)); } } include_once JIEQI_ROOT_PATH . '/header.php'; //获得允许消息数和现有消息数 jieqi_getconfigs('system', 'honors'); jieqi_getconfigs(JIEQI_MODULE_NAME, 'right'); $maxmessage = $jieqiConfigs['system']['messagelimit'];
* 调用模板:/templates/admin/logs.html * * @category jieqicms * @package system * @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com) * @author $Author: juny $ * @version $Id: logs.php 344 2009-06-23 03:06:07Z juny $ */ //用户日志 define('JIEQI_MODULE_NAME', 'system'); require_once '../global.php'; //检查权限 include_once JIEQI_ROOT_PATH . '/class/power.php'; $power_handler =& JieqiPowerHandler::getInstance('JieqiPowerHandler'); $power_handler->getSavedVars('system'); jieqi_checkpower($jieqiPower['system']['adminuserlog'], $jieqiUsersStatus, $jieqiUsersGroup, false, true); //暂时用管理用户日志权限限制 include_once JIEQI_ROOT_PATH . '/class/logs.php'; $logs_handler = JieqilogsHandler::getInstance('JieqilogsHandler'); jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs'); if (empty($_REQUEST['page']) || !is_numeric($_REQUEST['page'])) { $_REQUEST['page'] = 1; } include_once JIEQI_ROOT_PATH . '/admin/header.php'; $criteria = new CriteriaCompo(); if (!empty($_REQUEST['keyword'])) { if ($_REQUEST['keytype'] == 1) { $criteria->add(new Criteria('toname', $_REQUEST['keyword'], '=')); } else { $criteria->add(new Criteria('fromname', $_REQUEST['keyword'], '=')); }
* 我的文章管理 * * 显示作家自己的文章 * * 调用模板:/modules/article/templates/masterpage.html * * @category jieqicms * @package article * @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com) * @author $Author: juny $ * @version $Id: masterpage.php 332 2009-02-23 09:15:08Z juny $ */ define('JIEQI_MODULE_NAME', 'article'); require_once '../../global.php'; jieqi_getconfigs('article', 'power'); jieqi_checkpower($jieqiPower['article']['authorpanel'], $jieqiUsersStatus, $jieqiUsersGroup, false); jieqi_loadlang('list', JIEQI_MODULE_NAME); include_once JIEQI_ROOT_PATH . '/header.php'; include_once $jieqiModules['article']['path'] . '/class/article.php'; $article_handler =& JieqiArticleHandler::getInstance('JieqiArticleHandler'); jieqi_getconfigs(JIEQI_MODULE_NAME, 'sort'); jieqi_getconfigs(JIEQI_MODULE_NAME, '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']; //载入相关处理函数 include_once $jieqiModules['article']['path'] . '/include/funarticle.php'; $jieqiTpl->assign('article_static_url', $article_static_url); $jieqiTpl->assign('article_dynamic_url', $article_dynamic_url); //页码 if (empty($_REQUEST['page']) || !is_numeric($_REQUEST['page'])) { $_REQUEST['page'] = 1;
if (empty($_REQUEST['id'])) { jieqi_printfail(LANG_ERROR_PARAMETER); } jieqi_loadlang('manage', JIEQI_MODULE_NAME); include_once $jieqiModules['article']['path'] . '/class/article.php'; $article_handler =& JieqiArticleHandler::getInstance('JieqiArticleHandler'); $article = $article_handler->get($_REQUEST['id']); if (!$article) { jieqi_printfail($jieqiLang['article']['article_not_exists']); } //检查权限 jieqi_getconfigs(JIEQI_MODULE_NAME, 'power'); $canedit = jieqi_checkpower($jieqiPower['article']['delallarticle'], $jieqiUsersStatus, $jieqiUsersGroup, true); if (!$canedit && !empty($_SESSION['jieqiUserId'])) { //除了斑竹,作者、发表者和代理人可以删除文章 $tmpvar = $_SESSION['jieqiUserId']; if ($tmpvar > 0 && ($article->getVar('authorid') == $tmpvar || $article->getVar('posterid') == $tmpvar || $article->getVar('agentid') == $tmpvar)) { $canedit = jieqi_checkpower($jieqiPower['article']['delmyarticle'], $jieqiUsersStatus, $jieqiUsersGroup, true); } } if (!$canedit) { jieqi_printfail($jieqiLang['article']['noper_clean_article']); } //清理章节 include_once $jieqiModules['article']['path'] . '/include/operatefunction.php'; jieqi_article_clean($_REQUEST['id'], false); if (!empty($_REQUEST['collecturl'])) { jieqi_jumppage($_REQUEST['collecturl'], LANG_DO_SUCCESS, $jieqiLang['article']['article_clean_collect']); } else { jieqi_jumppage($article_static_url . '/articlemanage.php?id=' . $_REQUEST['id'], LANG_DO_SUCCESS, $jieqiLang['article']['article_clean_success']); }
jieqi_loadlang('users', JIEQI_MODULE_NAME); $_REQUEST['id'] = intval($_REQUEST['id']); include_once JIEQI_ROOT_PATH . '/class/users.php'; $users_handler =& JieqiUsersHandler::getInstance('JieqiUsersHandler'); $user = $users_handler->get($_REQUEST['id']); if (!is_object($user)) { jieqi_printfail(LANG_NO_USER); } if ($user->getVar('groupid') == JIEQI_GROUP_ADMIN && $jieqiUsersGroup != JIEQI_GROUP_ADMIN) { jieqi_printfail($jieqiLang['system']['cant_manage_admin']); } if (jieqi_checkpower($jieqiPower['system']['deluser'], $jieqiUsersStatus, $jieqiUsersGroup, true, true)) { $adminlevel = 4; } elseif (jieqi_checkpower($jieqiPower['system']['adminvip'], $jieqiUsersStatus, $jieqiUsersGroup, true, true)) { $adminlevel = 3; } elseif (jieqi_checkpower($jieqiPower['system']['changegroup'], $jieqiUsersStatus, $jieqiUsersGroup, true, true)) { $adminlevel = 2; } else { $adminlevel = 1; } if (!isset($_REQUEST['action'])) { $_REQUEST['action'] = 'edit'; } switch ($_REQUEST['action']) { case 'update': $_POST['reason'] = trim($_POST['reason']); $_POST['pass'] = trim($_POST['pass']); $_POST['repass'] = trim($_POST['repass']); if (strlen($_POST['reason']) == 0) { $errtext .= $jieqiLang['system']['change_user_reason'] . '<br />'; }
$tmpstr .= $val['caption']; $sort_select->addOption($key, $tmpstr); } $obook_form->addElement($sort_select, true); jieqi_getconfigs(JIEQI_MODULE_NAME, 'publisher'); if (isset($jieqiPublisher) && count($jieqiPublisher) > 1) { $publisher_select = new JieqiFormSelect($jieqiLang['obook']['table_obook_publishid'], 'publishid', $obook->getVar('publishid', 'e')); foreach ($jieqiPublisher as $key => $val) { $publisher_select->addOption($key, $val['name']); } $obook_form->addElement($publisher_select, false); } $_POST['obookname'] = new JieqiFormText($jieqiLang['obook']['table_obook_keywords'], 'keywords', 30, 50, $obook->getVar('keywords', 'e')); $_POST['obookname']->setDescription($jieqiLang['obook']['keywords_note']); $obook_form->addElement($_POST['obookname']); if (jieqi_checkpower($jieqiPower['obook']['transobook'], $jieqiUsersStatus, $jieqiUsersGroup, true)) { $authorname = new JieqiFormText($jieqiLang['obook']['table_obook_author'], 'author', 30, 30, $obook->getVar('author', 'e')); //$authorname->setDescription('发表自己作品请留空'); $obook_form->addElement($authorname); if ($obook->getVar('authorid') > 0) { $tmpvar = '1'; } else { $tmpvar = '0'; } $authorflag = new JieqiFormRadio($jieqiLang['obook']['obook_author_flag'], 'authorflag', $tmpvar); $authorflag->addOption('1', $jieqiLang['obook']['auth_to_author']); $authorflag->addOption('0', $jieqiLang['obook']['not_auth_author']); $obook_form->addElement($authorflag); } $agent = new JieqiFormText($jieqiLang['obook']['table_obook_agent'], 'agent', 30, 30, $obook->getVar('agent', 'e')); $agent->setDescription($jieqiLang['obook']['author_note']);
* 后台电子书购买记录 * * 后台电子书购买记录 * * 调用模板:/modules/obook/templates/admin/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_getconfigs(JIEQI_MODULE_NAME, 'power'); jieqi_checkpower($jieqiPower['obook']['viewbuylog'], $jieqiUsersStatus, $jieqiUsersGroup, false, true); include_once JIEQI_ROOT_PATH . '/admin/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['uname'])) { $jieqiTpl->assign('uname', htmlspecialchars($_REQUEST['uname'], ENT_QUOTES)); } if (!empty($_REQUEST['oname'])) { $jieqiTpl->assign('oname', htmlspecialchars($_REQUEST['oname'], ENT_QUOTES)); } //页码 if (empty($_REQUEST['page']) || !is_numeric($_REQUEST['page'])) { $_REQUEST['page'] = 1;
$chaptercontent = $userchap->getVar('content', 'e'); $userchappid = $userchap->getVar('posterid'); } } elseif (!empty($_REQUEST['ochapterid'])) { include_once $jieqiModules['obook']['path'] . '/class/ochapter.php'; $chapter_handler =& JieqiOchapterHandler::getInstance('JieqiOchapterHandler'); $ochapter = $chapter_handler->get($_REQUEST['ochapterid']); if (is_object($ochapter)) { $obookid = $ochapter->getVar('obookid', 'n'); include_once $jieqiModules['obook']['path'] . '/class/obook.php'; $obook_handler =& JieqiObookHandler::getInstance('JieqiObookHandler'); $obook = $obook_handler->get($obookid); if (is_object($obook)) { //检查权限 jieqi_getconfigs('obook', 'power'); $canedit = jieqi_checkpower($jieqiPower['obook']['delallobook'], $jieqiUsersStatus, $jieqiUsersGroup, true); if (!$canedit && !empty($_SESSION['jieqiUserId'])) { //除了斑竹,作者、发表者和代理人可以删除电子书 $tmpvar = $_SESSION['jieqiUserId']; if ($tmpvar > 0 && ($obook->getVar('authorid') == $tmpvar || $chapter->getVar('posterid') == $tmpvar || $obook->getVar('agentid') == $tmpvar)) { $canedit = true; } } if ($canedit) { $chaptername = $ochapter->getVar('chaptername', 'e'); $userchappid = $ochapter->getVar('posterid'); include_once $jieqiModules['obook']['path'] . '/class/ocontent.php'; $content_handler =& JieqiOcontentHandler::getInstance('JieqiOcontentHandler'); $criteria = new CriteriaCompo(new Criteria('ochapterid', $_REQUEST['ochapterid'])); $criteria->setLimit(1); $content_handler->queryObjects($criteria);
$buyinfo = $buyinfo_handler->getObject(); if (!is_object($buyinfo)) { $freeread = false; //没有购买,看看是不是可以免费阅读 $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); $ochapter = $obook_query->getObject(); if (is_object($ochapter)) { if (!empty($_SESSION['jieqiUserId']) && ($_SESSION['jieqiUserId'] == $ochapter->getVar('authorid') || $_SESSION['jieqiUserId'] == $ochapter->getVar('agentid') || $_SESSION['jieqiUserId'] == $ochapter->getVar('posterid'))) { $freeread = true; } else { jieqi_getconfigs(JIEQI_MODULE_NAME, 'power'); if (isset($jieqiPower['obook']['freeread'])) { $freeread = jieqi_checkpower($jieqiPower['obook']['freeread'], $jieqiUsersStatus, $jieqiUsersGroup, true); } } } if (!$freeread) { exit; } } include_once JIEQI_ROOT_PATH . '/lib/text/textfunction.php'; include_once $jieqiModules['obook']['path'] . '/class/ocontent.php'; $content_handler =& JieqiOcontentHandler::getInstance('JieqiOcontentHandler'); $criteria = new CriteriaCompo(new Criteria('ochapterid', $_REQUEST['cid'])); $criteria->setLimit(1); $content_handler->queryObjects($criteria); unset($criteria); $content = $content_handler->getObject();
jieqi_post_newset($post_set, $newReply); $replies_handler->insert($newReply); $addnewreply = 1; $_REQUEST['page'] = 'last'; //增加书评积分 if (!empty($jieqiConfigs['article']['scorereview'])) { include_once JIEQI_ROOT_PATH . '/class/users.php'; $users_handler =& JieqiUsersHandler::getInstance('JieqiUsersHandler'); $users_handler->changeScore($_SESSION['jieqiUserId'], $jieqiConfigs['article']['scorereview'], true); } } else { jieqi_printfail(implode('<br />', $check_errors)); } } //检查是否有管理书评权力 $canedit = jieqi_checkpower($jieqiPower['article']['manageallreview'], $jieqiUsersStatus, $jieqiUsersGroup, true); if (!$canedit && !empty($_SESSION['jieqiUserId'])) { //除了斑竹,作者、发表者和代理人可以管理书评 $tmpvar = $_SESSION['jieqiUserId']; if ($tmpvar > 0 && ($topic->getVar('authorid') == $tmpvar || $topic->getVar('posterid') == $tmpvar || $topic->getVar('agentid') == $tmpvar)) { $canedit = true; } } //处理删除回复 if ($canedit && isset($_REQUEST['action']) && isset($_REQUEST['did']) && $_REQUEST['action'] == 'del' && is_numeric($_REQUEST['did'])) { include_once $jieqiModules['article']['path'] . '/class/replies.php'; $replies_handler =& JieqiRepliesHandler::getInstance('JieqiRepliesHandler'); //减少书评积分 if (!empty($jieqiConfigs['article']['scorereview'])) { $replyobj = $replies_handler->get(intval($_REQUEST['did'])); if (is_object($replyobj)) {
jieqi_post_newset($post_set, $newPost); $pposts_handler->insert($newPost); $addnewreply = 1; $_REQUEST['page'] = 'last'; //增加回复积分 if (!empty($jieqiConfigs['system']['scoreptopic'])) { include_once JIEQI_ROOT_PATH . '/class/users.php'; $users_handler =& JieqiUsersHandler::getInstance('JieqiUsersHandler'); $users_handler->changeScore($_SESSION['jieqiUserId'], $jieqiConfigs['system']['scoreptopic'], true); } } else { jieqi_printfail(implode('<br />', $check_errors)); } } //检查是否有管理帖子权力 $canedit = jieqi_checkpower($jieqiPower['system']['manageallparlor'], $jieqiUsersStatus, $jieqiUsersGroup, true); if (!$canedit && !empty($_SESSION['jieqiUserId'])) { //除了斑竹,会客室主人可以惯了 $tmpvar = $_SESSION['jieqiUserId']; if ($tmpvar > 0 && $ownerid == $tmpvar) { $canedit = true; } } //处理删除回复 if ($canedit && $_REQUEST['action'] == 'del' && is_numeric($_REQUEST['pid'])) { include_once JIEQI_ROOT_PATH . '/class/pposts.php'; $pposts_handler =& JieqiPpostsHandler::getInstance('JieqiPpostsHandler'); //减少回复积分 if (!empty($jieqiConfigs['system']['scoreptopic'])) { $ppostobj = $pposts_handler->get(intval($_REQUEST['pid'])); if (is_object($ppostobj)) {
* * 手工加虚拟币 * * 调用模板:/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 if (!isset($_REQUEST['action'])) {
* * 调用模板:/modules/pay/templates/admin/paylog.html * * @category jieqicms * @package pay * @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com) * @author $Author: juny $ * @version $Id: paylog.php 326 2009-02-04 00:26:22Z juny $ */ define('JIEQI_MODULE_NAME', 'pay'); require_once '../../../global.php'; //检查权限 include_once JIEQI_ROOT_PATH . '/class/power.php'; $power_handler =& JieqiPowerHandler::getInstance('JieqiPowerHandler'); $power_handler->getSavedVars('pay'); jieqi_checkpower($jieqiPower['pay']['adminpaylog'], $jieqiUsersStatus, $jieqiUsersGroup, false, true); jieqi_loadlang('pay', JIEQI_MODULE_NAME); //处理手工确认和删除 include_once $jieqiModules['pay']['path'] . '/class/paylog.php'; $paylog_handler = JieqiPaylogHandler::getInstance('JieqiPaylogHandler'); if (!empty($_REQUEST['action']) && !empty($_REQUEST['id'])) { switch ($_REQUEST['action']) { case 'confirm': $tmplog = $paylog_handler->get($_REQUEST['id']); if (is_object($tmplog) && $tmplog->getVar('payflag') == 0) { $buyid = $tmplog->getVar('buyid'); $buyname = $tmplog->getVar('buyname'); $egoldtype = $tmplog->getVar('egoldtype'); $egold = $tmplog->getVar('egold'); include_once JIEQI_ROOT_PATH . '/class/users.php'; $users_handler =& JieqiUsersHandler::getInstance('JieqiUsersHandler');
* @category jieqicms * @package system * @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com) * @author $Author: juny $ * @version $Id: power.php 344 2009-06-23 03:06:07Z juny $ */ if (empty($_REQUEST['mod'])) { $_REQUEST['mod'] = 'system'; } define('JIEQI_MODULE_NAME', 'system'); require_once '../global.php'; //检查权限 include_once JIEQI_ROOT_PATH . '/class/power.php'; $power_handler =& JieqiPowerHandler::getInstance('JieqiPowerHandler'); $power_handler->getSavedVars($_REQUEST['mod']); jieqi_checkpower($jieqiPower[$_REQUEST['mod']]['adminpower'], $jieqiUsersStatus, $jieqiUsersGroup, false, true); //载入语言 jieqi_loadlang('power', JIEQI_MODULE_NAME); if (count($jieqiPower[$_REQUEST['mod']]) > 0) { if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'update') { foreach ($jieqiPower[$_REQUEST['mod']] as $k => $v) { if (!isset($_POST[$k])) { $_POST[$k] = ''; } if ($v['groups'] != $_POST[$k]) { $jieqiPower[$_REQUEST['mod']][$k]['groups'] = $_POST[$k]; $power_handler->db->query("UPDATE " . jieqi_dbprefix('system_power') . " SET pgroups='" . jieqi_dbslashes(serialize($_POST[$k])) . "' WHERE modname='" . jieqi_dbslashes($_REQUEST['mod']) . "' AND pname='" . jieqi_dbslashes($k) . "'"); } } jieqi_setconfigs('power', 'jieqiPower', $jieqiPower, $_REQUEST['mod']); //记录日志
$chapter_handler =& JieqiOchapterHandler::getInstance('JieqiOchapterHandler'); $newChapter = $chapter_handler->create(); $chaptercount = $obook->getVar('chapters'); if (empty($_POST['volumeid'])) { $_POST['volumeid'] = $chaptercount + 1; } //如果是插入章节,则原来章节的序号加一位 if ($_POST['volumeid'] <= $chaptercount) { $criteria = new CriteriaCompo(new Criteria('obookid', $_REQUEST['aid'])); $criteria->add(new Criteria('chapterorder', $_POST['volumeid'], '>=')); $chapter_handler->updatefields('chapterorder=chapterorder+1', $criteria); unset($criteria); } if (!empty($_POST['chaptercontent'])) { $chaptersize = strlen(str_replace(array(" ", " ", "\r", "\n"), '', $_POST['chaptercontent'])); if (trim($_POST['saleprice']) != '' && jieqi_checkpower($jieqiPower['obook']['customprice'], $jieqiUsersStatus, $jieqiUsersGroup, true)) { $_POST['saleprice'] = intval($_POST['saleprice']); } elseif (is_numeric($jieqiConfigs['obook']['wordsperegold']) && $jieqiConfigs['obook']['wordsperegold'] > 0) { $jieqiConfigs['obook']['wordsperegold'] = ceil($jieqiConfigs['obook']['wordsperegold']) * 2; if ($jieqiConfigs['obook']['priceround'] == 1) { $_POST['saleprice'] = floor($chaptersize / $jieqiConfigs['obook']['wordsperegold']); } elseif ($jieqiConfigs['obook']['priceround'] == 2) { $_POST['saleprice'] = ceil($chaptersize / $jieqiConfigs['obook']['wordsperegold']); } else { $_POST['saleprice'] = round($chaptersize / $jieqiConfigs['obook']['wordsperegold']); } } else { $_POST['saleprice'] = 0; } } else { $chaptersize = 0;
* 电子书本站推荐标志记录 * * 电子书本站推荐标志记录 * * 调用模板:无 * * @category jieqicms * @package obook * @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com) * @author $Author: juny $ * @version $Id: setgood.php 231 2008-11-27 08:46:26Z juny $ */ define('JIEQI_MODULE_NAME', 'obook'); require_once '../../../global.php'; jieqi_getconfigs(JIEQI_MODULE_NAME, 'power'); jieqi_checkpower($jieqiPower['obook']['manageallobook'], $jieqiUsersStatus, $jieqiUsersGroup, false, true); jieqi_loadlang('manage', JIEQI_MODULE_NAME); if (empty($_REQUEST['id'])) { jieqi_printfail($jieqiLang['obook']['obook_not_exists']); } include_once $jieqiModules['obook']['path'] . '/class/obook.php'; $obook_handler =& JieqiObookHandler::getInstance('JieqiObookHandler'); $obook = $obook_handler->get($_REQUEST['id']); if (!is_object($obook)) { jieqi_printfail($jieqiLang['obook']['obook_not_exists']); } if ($_REQUEST['action'] == 'no') { $obook->setVar('toptime', 0); } else { $obook->setVar('toptime', JIEQI_NOW_TIME); }
* 最近更新章节列表 * * 最近更新章节列表 * * 调用模板:/modules/article/templates/admin/chapterlist.html * * @category jieqicms * @package article * @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com) * @author $Author: juny $ * @version $Id: chapter.php 332 2009-02-23 09:15:08Z juny $ */ define('JIEQI_MODULE_NAME', 'article'); require_once '../../../global.php'; jieqi_getconfigs(JIEQI_MODULE_NAME, 'power'); jieqi_checkpower($jieqiPower['article']['viewuplog'], $jieqiUsersStatus, $jieqiUsersGroup, false, true); jieqi_loadlang('list', JIEQI_MODULE_NAME); jieqi_getconfigs(JIEQI_MODULE_NAME, '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']; include_once $jieqiModules['article']['path'] . '/class/chapter.php'; $chapter_handler =& JieqiChapterHandler::getInstance('JieqiChapterHandler'); include_once JIEQI_ROOT_PATH . '/admin/header.php'; $jieqiTpl->assign('article_static_url', $article_static_url); $jieqiTpl->assign('article_dynamic_url', $article_dynamic_url); //页码 if (empty($_REQUEST['page']) || !is_numeric($_REQUEST['page'])) { $_REQUEST['page'] = 1; } $criteria = new CriteriaCompo(); if (!empty($_REQUEST['keyword'])) {
* * 编辑采集规则 * * 调用模板:无 * * @category jieqicms * @package article * @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com) * @author $Author: juny $ * @version $Id: collectedit.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']['adminconfig'], $jieqiUsersStatus, $jieqiUsersGroup, false); jieqi_loadlang('collect', JIEQI_MODULE_NAME); jieqi_getconfigs(JIEQI_MODULE_NAME, 'collectsite'); jieqi_getconfigs(JIEQI_MODULE_NAME, '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 (empty($_REQUEST['config']) || !file_exists(JIEQI_ROOT_PATH . '/configs/article/site_' . $_REQUEST['config'] . '.php')) { jieqi_printfail($jieqiLang['article']['rule_not_exists']); } include_once JIEQI_ROOT_PATH . '/configs/article/site_' . $_REQUEST['config'] . '.php'; include_once $jieqiModules['article']['path'] . '/include/collectfunction.php'; if (!isset($_REQUEST['action'])) { $_REQUEST['action'] = 'show'; } switch ($_REQUEST['action']) { case 'edit':
* 作家申请信息列表 * * 作家申请信息列表 * * 调用模板:/modules/article/templates/admin/applylist.html * * @category jieqicms * @package article * @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com) * @author $Author: juny $ * @version $Id: applylist.php 326 2009-02-04 00:26:22Z juny $ */ define('JIEQI_MODULE_NAME', 'article'); require_once '../../../global.php'; jieqi_getconfigs(JIEQI_MODULE_NAME, 'power'); jieqi_checkpower($jieqiPower['article']['setwriter'], $jieqiUsersStatus, $jieqiUsersGroup, false, true); jieqi_loadlang('applywriter', JIEQI_MODULE_NAME); jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs'); include_once $jieqiModules['article']['path'] . '/class/applywriter.php'; $apply_handler =& JieqiApplywriterHandler::getInstance('JieqiApplywriterHandler'); //处理审核、删除 if (isset($_REQUEST['action']) && !empty($_REQUEST['id'])) { $apply = $apply_handler->get($_REQUEST['id']); if (!is_object($apply)) { jieqi_printfail($jieqiLang['article']['apply_not_exists']); } if (!is_array($jieqiArticleuplog)) { $jieqiArticleuplog = array('articleuptime' => 0, 'chapteruptime' => 0); } switch ($_REQUEST['action']) { case 'confirm':
* * µ÷ÓÃÄ£°å£ºÎÞ * * @category jieqicms * @package article * @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com) * @author $Author: juny $ * @version $Id: draftedit.php 300 2008-12-26 04:36:06Z juny $ */ define('JIEQI_MODULE_NAME', 'article'); require_once '../../global.php'; if (empty($_REQUEST['id'])) { jieqi_printfail(LANG_ERROR_PARAMETER); } jieqi_getconfigs(JIEQI_MODULE_NAME, 'power'); jieqi_checkpower($jieqiPower['article']['newdraft'], $jieqiUsersStatus, $jieqiUsersGroup, false); jieqi_loadlang('draft', JIEQI_MODULE_NAME); include_once $jieqiModules['article']['path'] . '/class/draft.php'; $draft_handler =& JieqiDraftHandler::getInstance('JieqiDraftHandler'); $draft = $draft_handler->get($_REQUEST['id']); if (!$draft) { jieqi_printfail($jieqiLang['article']['draft_not_exists']); } if ($draft->getVar('posterid') != $_SESSION['jieqiUserId']) { jieqi_printfail($jieqiLang['article']['noper_manage_draft']); } jieqi_getconfigs(JIEQI_MODULE_NAME, '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'] = 'edit';
* @category jieqicms * @package system * @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com) * @author $Author: juny $ * @version $Id: blockedit.php 344 2009-06-23 03:06:07Z juny $ */ if (empty($_GET['mod'])) { $_GET['mod'] = 'system'; } define('JIEQI_MODULE_NAME', $_GET['mod']); require_once '../global.php'; //检查权限 include_once JIEQI_ROOT_PATH . '/class/power.php'; $power_handler =& JieqiPowerHandler::getInstance('JieqiPowerHandler'); $power_handler->getSavedVars($_GET['mod']); jieqi_checkpower($jieqiPower[$_GET['mod']]['adminblock'], $jieqiUsersStatus, $jieqiUsersGroup, false, true); //载入语言 jieqi_loadlang('blocks', JIEQI_MODULE_NAME); //取得设置 if (empty($_REQUEST['id'])) { jieqi_printfail($jieqiLang['system']['block_not_exists']); } include_once JIEQI_ROOT_PATH . '/class/blocks.php'; $blocks_handler =& JieqiBlocksHandler::getInstance('JieqiBlocksHandler'); $block = $blocks_handler->get($_REQUEST['id']); if (!is_object($block)) { jieqi_printfail($jieqiLang['system']['block_not_exists']); } include_once JIEQI_ROOT_PATH . '/admin/header.php'; //区块名称 include_once JIEQI_ROOT_PATH . '/class/modules.php';
* 用户分类列表 * * 按用户组分类显示 * * 调用模板:/templates/userlist.html * * @category jieqicms * @package system * @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com) * @author $Author: juny $ * @version $Id: userlist.php 326 2009-02-04 00:26:22Z juny $ */ define('JIEQI_MODULE_NAME', 'system'); require_once 'global.php'; jieqi_getconfigs(JIEQI_MODULE_NAME, 'power'); jieqi_checkpower($jieqiPower['system']['viewuser'], $jieqiUsersStatus, $jieqiUsersGroup, false); //包含区块参数(定制) jieqi_getconfigs('system', 'memberblocks', 'jieqiBlocks'); //包含配置参数 jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs'); include_once JIEQI_ROOT_PATH . '/header.php'; //用户类别 if (empty($_REQUEST['group'])) { $_REQUEST['group'] = 0; } //页码 if (empty($_REQUEST['page']) || !is_numeric($_REQUEST['page'])) { $_REQUEST['page'] = 1; } include_once JIEQI_ROOT_PATH . '/class/users.php'; $users_handler =& JieqiUsersHandler::getInstance('JieqiUsersHandler');
* * 调用模板:/modules/article/templates/applywriter.html * * @category jieqicms * @package article * @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com) * @author $Author: juny $ * @version $Id: applywriter.php 326 2009-02-04 00:26:22Z juny $ */ define('JIEQI_MODULE_NAME', 'article'); require_once '../../global.php'; jieqi_checklogin(); jieqi_loadlang('applywriter', JIEQI_MODULE_NAME); jieqi_getconfigs(JIEQI_MODULE_NAME, 'power'); //发表文章权限 if (jieqi_checkpower($jieqiPower['article']['newarticle'], $jieqiUsersStatus, $jieqiUsersGroup, true)) { jieqi_printfail($jieqiLang['article']['has_been_writer']); } jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs'); if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'applywriter' || isset($_REQUEST['agree']) && $_REQUEST['agree'] == '1') { include_once $jieqiModules['article']['path'] . '/class/applywriter.php'; $apply_handler =& JieqiApplywriterHandler::getInstance('JieqiApplywriterHandler'); $newApply = $apply_handler->create(); $newApply->setVar('siteid', JIEQI_SITE_ID); $newApply->setVar('applytime', JIEQI_NOW_TIME); $newApply->setVar('applyuid', $_SESSION['jieqiUserId']); $newApply->setVar('applyname', $_SESSION['jieqiUserName']); $newApply->setVar('authtime', 0); $newApply->setVar('authuid', 0); $newApply->setVar('authname', ''); $newApply->setVar('applytitle', '');
* 设置文章的本站推荐标志 * * 设置文章的本站推荐标志 * * 调用模板:无 * * @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); }
/** * 本地用户编辑,预处理 * * @param array $params 参数数组 * 必须参数: $params['username'] - 用户名,$params['password'] - 密码 * @access public * @return int */ function jieqi_uedit_lprepare(&$params) { global $users_handler; global $jieqiPower; global $jieqiUsersStatus; global $jieqiUsersGroup; global $jieqiLang; global $jieqiConfigs; //载入参数设置 if (!isset($jieqiConfigs['system'])) { jieqi_getconfigs('system', 'configs'); } //载入语言包 if (!isset($jieqiLang['system'])) { jieqi_loadlang('users', 'system'); } if (!is_a($users_handler, 'JieqiUsersHandler')) { include_once JIEQI_ROOT_PATH . '/class/users.php'; $users_handler =& JieqiUsersHandler::getInstance('JieqiUsersHandler'); } $user = $users_handler->get($params['uid']); if (!is_object($user)) { $params['error'] = LANG_NO_USER; if ($params['return']) { return false; } else { jieqi_printfail($params['error']); } } else { $params['username'] = $user->getVar('uname', 'n'); } //管理员修改用户资料的等级 $tmpstr = $_SERVER['PHP_SELF'] ? basename($_SERVER['PHP_SELF']) : basename($_SERVER['SCRIPT_NAME']); if (empty($_SESSION['jieqiAdminLogin']) || strstr($tmpstr, 'useredit.php')) { $params['adminlevel'] = 0; } else { if (!isset($jieqiPower['system'])) { jieqi_getconfigs('system', 'power'); } if (jieqi_checkpower($jieqiPower['system']['deluser'], $jieqiUsersStatus, $jieqiUsersGroup, true, true)) { $params['adminlevel'] = 5; } elseif (jieqi_checkpower($jieqiPower['system']['adminvip'], $jieqiUsersStatus, $jieqiUsersGroup, true, true)) { $params['adminlevel'] = 4; } elseif (jieqi_checkpower($jieqiPower['system']['changegroup'], $jieqiUsersStatus, $jieqiUsersGroup, true, true)) { $params['adminlevel'] = 3; } elseif (jieqi_checkpower($jieqiPower['system']['adminuser'], $jieqiUsersStatus, $jieqiUsersGroup, true, true)) { $params['adminlevel'] = 2; } else { $params['adminlevel'] = 0; } } //判断登录用户是不是本人,session对应或者密码对应都行 if ($params['adminlevel'] == 0) { if ($params['uid'] == $_SESSION['jieqiUserId']) { $params['adminlevel'] = 1; } elseif (!empty($params['oldpass']) && ($user->getVar('pass', 'n') == $params['oldpass'] || $user->getVar('pass', 'n') == $users_handler->encryptPass($params['oldpass']))) { $params['adminlevel'] = 1; } } if ($params['adminlevel'] == 0) { $params['error'] = LANG_NO_PERMISSION; if ($params['return']) { return false; } else { jieqi_printfail($params['error']); } } $params['error'] = ''; //只允许本人修改 if ($params['adminlevel'] == 1) { //检查Email格式 if (isset($params['email'])) { $params['email'] = trim($params['email']); if (strlen($params['email']) == 0) { $params['error'] .= $jieqiLang['system']['need_email'] . '<br />'; } elseif (!preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+([\\.][a-z0-9-]+)+\$/i", $params['email'])) { $params['error'] .= $jieqiLang['system']['error_email_format'] . '<br />'; } //检查Email是否已注册 if ($params['email'] != $user->getVar('email', 'n')) { if ($users_handler->getCount(new Criteria('email', $params['email'], '=')) > 0) { $params['error'] .= $jieqiLang['system']['email_has_registered'] . '<br />'; } } } //修改昵称 $params['changenick'] = false; if (isset($params['nickname']) && $user->getVar('name', 'n') != $params['nickname']) { if ($params['nickname'] != '') { if ($users_handler->getByname($params['nickname'], 3) != false) { $params['error'] .= $jieqiLang['system']['user_name_exists'] . '<br />'; } } $params['changenick'] = true; } //修改密码 if (!empty($params['newpass'])) { $params['oldpass'] = trim($params['oldpass']); $params['newpass'] = trim($params['newpass']); $params['repass'] = trim($params['repass']); if ($params['newpass'] != $params['repass']) { $params['error'] .= $jieqiLang['system']['password_not_equal'] . '<br />'; } elseif (strlen($params['newpass']) == 0) { $params['error'] .= $jieqiLang['system']['need_pass_repass'] . '<br />'; } elseif ($user->getVar('pass', 'n') != $params['oldpass'] && $user->getVar('pass', 'n') != $users_handler->encryptPass($params['oldpass'])) { $params['error'] .= $jieqiLang['system']['error_old_pass'] . '<br />'; } } } if (!empty($params['error'])) { if ($params['return']) { return false; } else { jieqi_printfail($params['error']); } } else { return true; } }