/** * 用户接口,注册预处理 * * @param array $params 参数数组 * 必须参数: $params['username'] - 用户名,$params['password'] - 密码,$params['email'] - 邮箱 * @access public * @return int */ function jieqi_uregister_iprepare(&$params) { global $jieqiLang; if (!isset($jieqiLang['system'])) { jieqi_loadlang('users', 'system'); } $params['uc_uid'] = uc_user_register($params['username'], $params['password'], $params['email']); /* -1 用户名不合法, -2 包含要允许注册的词语, -3 用户名已经存在, -4 Email 格式有误, -5 Email 不允许注册, -6 该 Email 已经被注册 */ if ($params['uc_uid'] > 0) { return true; } else { switch ($params['uc_uid']) { case -1: $params['error'] = $jieqiLang['system']['error_user_format']; break; case -2: $params['error'] = $jieqiLang['system']['error_user_format']; break; case -3: $params['error'] = $jieqiLang['system']['error_user_format']; break; case -4: $params['error'] = $jieqiLang['system']['error_email_format']; break; case -5: $params['error'] = $jieqiLang['system']['email_has_registered']; break; case -6: $params['error'] = $jieqiLang['system']['email_has_registered']; break; default: $params['error'] = $jieqiLang['system']['register_failure']; break; } if ($params['return']) { return false; } else { jieqi_printfail($params['error']); } } }
//关键字长度 if (!empty($jieqiConfigs['obook']['minsearchlen']) && strlen($_REQUEST['searchkey']) < intval($jieqiConfigs['obook']['minsearchlen'])) { jieqi_printfail(sprintf($jieqiLang['obook']['search_minsize_limit'], $jieqiConfigs['obook']['minsearchlen'])); } //检查时间,是否允许搜索 if (!empty($jieqiConfigs['obook']['minsearchtime']) && empty($_REQUEST['page'])) { $jieqi_visit_time = jieqi_strtosary($_COOKIE['jieqiVisitTime']); if (!empty($_SESSION['jieqiObooksearchTime'])) { $logtime = $_SESSION['jieqiObooksearchTime']; } elseif (!empty($jieqi_visit_time['jieqiObooksearchTime'])) { $logtime = $jieqi_visit_time['jieqiObooksearchTime']; } else { $logtime = 0; } if ($logtime > 0 && JIEQI_NOW_TIME - $logtime < intval($jieqiConfigs['obook']['minsearchtime'])) { jieqi_printfail(sprintf($jieqiLang['obook']['search_time_limit'], $jieqiConfigs['obook']['minsearchtime'])); } $_SESSION['jieqiObooksearchTime'] = JIEQI_NOW_TIME; $jieqi_visit_time['jieqiObooksearchTime'] = JIEQI_NOW_TIME; setcookie("jieqiVisitTime", jieqi_sarytostr($jieqi_visit_time), JIEQI_NOW_TIME + 3600, '/', JIEQI_COOKIE_DOMAIN, 0); } $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']; //搜索字段 if (!isset($_REQUEST['searchtype']) || $_REQUEST['searchtype'] != 'author') { $_REQUEST['searchtype'] = 'obookname'; } //页码 if (empty($_REQUEST['page']) || !is_numeric($_REQUEST['page'])) { $_REQUEST['page'] = 1; }
* @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); } $article_handler->insert($article); if ($_REQUEST['action'] == 'no') { jieqi_msgwin(LANG_DO_SUCCESS, $jieqiLang['article']['article_notgood_success']); } else { jieqi_msgwin(LANG_DO_SUCCESS, $jieqiLang['article']['article_setgood_success']); }
$errtext .= $jieqiLang['system']['system_userlink_ultitle'] . '<br />'; } if (strlen($_POST['ulurl']) == 0) { $errtext .= $jieqiLang['system']['system_userlink_ulurl'] . '<br />'; } if (empty($errtext)) { $newUserlink =& $userlink_handler->create(); $newUserlink->setVar('ultitle', $_POST['ultitle']); $newUserlink->setVar('ulurl', $_POST['ulurl']); $newUserlink->setVar('ulinfo', $_POST['ulinfo']); $newUserlink->setVar('userid', $_SESSION['jieqiUserId']); $newUserlink->setVar('username', $_SESSION['jieqiUserName']); $newUserlink->setVar('addtime', JIEQI_NOW_TIME); $userlink_handler->insert($newUserlink); } else { jieqi_printfail($errtext); } break; case 'delete': if (!empty($_REQUEST['ulid'])) { $sql = "DELETE FROM " . jieqi_dbprefix('system_userlink') . " WHERE userid=" . intval($_SESSION['jieqiUserId']) . " AND ulid=" . intval($_REQUEST['ulid']); $userlink_handler->db->query($sql); } break; case 'top': if (!empty($_REQUEST['ulid'])) { $sql = "UPDATE " . jieqi_dbprefix('system_userlink') . " SET toptime=" . intval(JIEQI_NOW_TIME) . " WHERE userid=" . intval($_SESSION['jieqiUserId']) . " AND ulid=" . intval($_REQUEST['ulid']); $userlink_handler->db->query($sql); } break; case 'untop':
$jieqiTpl->assign('egold', $_REQUEST['egold']); $jieqiTpl->assign('egoldname', JIEQI_EGOLD_NAME); $jieqiTpl->assign('money', sprintf('%0.2f', $money / 100)); $jieqiTpl->assign('merchant_id', $merchant_id); $jieqiTpl->assign('orderid', $orderid); $jieqiTpl->assign('paytype', $_REQUEST['paytype']); //$jieqiPayset[JIEQI_PAY_TYPE]['paytype'] $jieqiTpl->assign('amount', $amount); $jieqiTpl->assign('attach', $attach); $jieqiTpl->assign('currency', $currency); $jieqiTpl->assign('merchant_url', $merchant_url); $jieqiTpl->assign('notify_url', $jieqiPayset[JIEQI_PAY_TYPE]['paynotify']); $jieqiTpl->assign('commodity_info', $commodity_info); $jieqiTpl->assign('pname', $pname); $jieqiTpl->assign('pemail', $pemail); $jieqiTpl->assign('merchant_param', $merchant_param); $jieqiTpl->assign('isSupportDES', $isSupportDES); $jieqiTpl->assign('pid_15173account', $pid_15173account); $jieqiTpl->assign('mac', $mac); if (is_array($jieqiPayset[JIEQI_PAY_TYPE]['addvars'])) { foreach ($jieqiPayset[JIEQI_PAY_TYPE]['addvars'] as $k => $v) { $jieqiTpl->assign($k, $v); } } $jieqiTpl->setCaching(0); $jieqiTset['jieqi_contents_template'] = $jieqiModules['pay']['path'] . '/templates/15173.html'; include_once JIEQI_ROOT_PATH . '/footer.php'; } } else { jieqi_printfail($jieqiLang['pay']['need_buy_type']); }
jieqi_loadlang('share', JIEQI_MODULE_NAME); jieqi_getconfigs(JIEQI_MODULE_NAME, 'publisher'); jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs'); if (!isset($_REQUEST['action'])) { $_REQUEST['action'] = ''; } if ($_REQUEST['action'] == 'login' && isset($_REQUEST['publishid'])) { $_REQUEST['publishid'] = intval($_REQUEST['publishid']); if (isset($jieqiPublisher[$_REQUEST['publishid']]) && $jieqiPublisher[$_REQUEST['publishid']]['password'] == $_REQUEST['password'] && !empty($_REQUEST['password'])) { $_SESSION['jieqiPublishid'] = $_REQUEST['publishid']; if (empty($_REQUEST['jumpurl'])) { $_REQUEST['jumpurl'] = $jieqiModules['obook']['url'] . '/share/sharestat.php'; } jieqi_jumppage($_REQUEST['jumpurl'], LANG_DO_SUCCESS, $jieqiLang['obook']['share_login_success']); } else { jieqi_printfail($jieqiLang['obook']['share_login_error']); } } else { include_once JIEQI_ROOT_PATH . '/admin/header.php'; $publishrows = array(); foreach ($jieqiPublisher as $k => $v) { $publishrows[] = array('id' => $k, 'name' => $v['name']); } $jieqiTpl->assign_by_ref('publishrows', $publishrows); if (!empty($_REQUEST['jumpurl'])) { $jieqiTpl->assign('url_login', $jieqiModules['obook']['url'] . '/share/sharelogin.php?do=submit&jumpurl=' . urlencode($_REQUEST['jumpurl'])); } else { $jieqiTpl->assign('url_login', $jieqiModules['obook']['url'] . '/share/sharelogin.php?do=submit'); } $jieqiTpl->setCaching(0); $jieqiTset['jieqi_contents_template'] = $jieqiModules['obook']['path'] . '/templates/share/sharelogin.html';
include_once JIEQI_ROOT_PATH . '/lib/xml/xmlarray.php'; $xmlarray = new XMLArray(); if ($_REQUEST['vsize'] <= 1) { $packrows[1] = $xmlarray->xml2array(jieqi_readfile($packxml)); } else { $packrows = $xmlarray->xml2array(jieqi_readfile($packxml)); } } $jieqiTpl->assign_by_ref('packrows', $packrows); $jieqiTset['jieqi_contents_template'] = $jieqiModules['article']['path'] . '/templates/packumd.html'; break; case 'txtchapter': default: $jieqiTpl->assign('type', 'txtchapter'); $jieqiConfigs['article']['maketxt'] = intval($jieqiConfigs['article']['maketxt']); if (empty($jieqiConfigs['article']['maketxt'])) { jieqi_printfail($jieqiLang['article']['down_file_notopen']); } $packsize = array(); $jieqiTpl->assign_by_ref('packsize', $packsize); $jieqiTpl->assign('vsize', 0); foreach ($opf_chapters as $k => $v) { $path = jieqi_uploadpath($jieqiConfigs['article']['txtdir'], 'article') . jieqi_getsubdir($_REQUEST['id']) . '/' . $_REQUEST['id'] . '/' . $v['chapterid'] . $jieqi_file_postfix['txt']; $opf_chapters[$k]['maketime'] = intval(@filemtime($path)); $opf_chapters[$k]['filesize'] = intval(@filesize($path)); } $jieqiTpl->assign_by_ref('packrows', $opf_chapters); $jieqiTset['jieqi_contents_template'] = $jieqiModules['article']['path'] . '/templates/packtxtchapter.html'; break; } include_once JIEQI_ROOT_PATH . '/footer.php';
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']); }
$newApply->setVar('applyflag', 0); $apply_handler->insert($newApply); //jieqi_msgwin(LANG_DO_SUCCESS, $jieqiLang['article']['apply_submit_success']); include_once JIEQI_ROOT_PATH . '/header.php'; $jieqiTpl->setCaching(0); $jieqiTpl->assign('jieqi_contents', jieqi_msgbox(LANG_DO_SUCCESS, $jieqiLang['article']['apply_submit_success'])); include_once JIEQI_ROOT_PATH . '/footer.php'; } else { //不需要审核 include_once JIEQI_ROOT_PATH . '/class/groups.php'; jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs'); $key = array_search($jieqiConfigs['article']['writergroup'], $jieqiGroups); if ($key == false) { jieqi_printfail($jieqiLang['article']['no_writer_group']); } elseif ($key == JIEQI_GROUP_ADMIN) { jieqi_printfail($jieqiLang['article']['no_writer_admin']); } else { include_once JIEQI_ROOT_PATH . '/class/users.php'; $users_handler =& JieqiUsersHandler::getInstance('JieqiUsersHandler'); $jieqiUsers = $users_handler->get($_SESSION['jieqiUserId']); $jieqiUsers->setVar('groupid', $key); $_SESSION['jieqiUserGroup'] = $jieqiUsers->getVar('groupid'); $users_handler->insert($jieqiUsers); //自动申请通过 $newApply->setVar('applyflag', 1); $apply_handler->insert($newApply); jieqi_jumppage($jieqiModules['article']['url'] . '/myarticle.php', LANG_DO_SUCCESS, sprintf($jieqiLang['article']['apply_writer_success'], $jieqiConfigs['article']['writergroup'])); } } } else { //显示申请条例
//检查权限 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'; $modules_handler =& JieqiModulesHandler::getInstance('JieqiModulesHandler'); $criteria = new CriteriaCompo(new Criteria('publish', 1, '=')); $criteria->setSort('weight'); $criteria->setOrder('ASC'); $modules_handler->queryObjects($criteria); unset($criteria); $modules = array(); while ($v = $modules_handler->getObject()) { $modules[$v->getVar('name', 'n')] = $v->getVar('caption', 'n'); } $modules['system'] = LANG_MODULE_SYSTEM;
$buyinfo->setVar('siteid', JIEQI_SITE_ID); $buyinfo->setVar('osaleid', $osale->getVar('osaleid', 'n')); $buyinfo->setVar('buytime', JIEQI_NOW_TIME); $buyinfo->setVar('userid', $users->getVar('uid', 'n')); $buyinfo->setVar('username', $users->getVar('uname', 'n')); $buyinfo->setVar('obookid', $v['obookid']); $buyinfo->setVar('ochapterid', $v['ochapterid']); $buyinfo->setVar('obookname', $v['obookname']); $buyinfo->setVar('chaptername', $v['chaptername']); $buyinfo->setVar('lastread', 0); $buyinfo->setVar('readnum', 0); $buyinfo->setVar('state', 0); $buyinfo->setVar('flag', 0); $ret = $buyinfo_handler->insert($buyinfo); if (!$ret) { jieqi_printfail($jieqiLang['obook']['add_buyinfo_failure']); } //改变章节销售状态 $lastsale = $v['lastsale']; $lastdate = date('Y-m-d', $lastsale); $nowdate = date('Y-m-d', JIEQI_NOW_TIME); $nowweek = date('w', JIEQI_NOW_TIME); $addnum = 1; $sql = ''; if ($nowdate == $lastdate) { $sql .= 'daysale=daysale+' . $addnum . ', weeksale=weeksale+' . $addnum . ', monthsale=monthsale+' . $addnum; } else { $sql .= 'daysale=' . $addnum; if ($nowweek == 1) { $sql .= ', weeksale=' . $addnum; } else {
} } else { jieqi_msgwin(LANG_NOTICE, sprintf($jieqiLang['article']['ovote_need_score'], $maxvote, $jieqiConfigs['article']['ovotescore'], jieqi_addurlvars(array('confirm' => 1)))); } } else { jieqi_printfail(sprintf($jieqiLang['article']['ovote_times_limit'], $maxvote)); } } 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']); } if (is_numeric($jieqiConfigs['article']['voteminsize']) && intval($jieqiConfigs['article']['voteminsize']) > $article->getVar('size')) { jieqi_printfail(sprintf($jieqiLang['article']['ovote_min_articlesize'], $jieqiConfigs['article']['voteminsize'])); } //增加投票值(每日、每周、每月、合计) $lastdate = date('Y-m-d', $article->getVar('lastovote', 'n')); $nowdate = date('Y-m-d', JIEQI_NOW_TIME); $criteria = new CriteriaCompo(new Criteria('articleid', $_REQUEST['id'])); if (substr($nowdate, 0, 7) == substr($lastdate, 0, 7)) { $monthovote = $article->getVar('monthovote', 'n') + $addnum; $article_handler->updatefields(array('lastovote' => JIEQI_NOW_TIME, 'monthovote' => $monthvote), $criteria); } else { $oldovote = $article->getVar('monthovote', 'n'); $monthovote = $addnum; $article_handler->updatefields(array('lastovote' => JIEQI_NOW_TIME, 'monthovote' => $monthvote, 'oldovote' => $oldovote), $criteria); } //记录已经投票标志 if (isset($userset['ovotedate']) && $userset['ovotedate'] == $today) {
if (in_array($v, $alltables)) { if ($_POST['action'] == 'optimize') { $db_query->execute("OPTIMIZE TABLE " . $v); $doaction = $jieqiLang['system']['optimize_table_action']; echo "<br>OPTIMIZE TABLE " . $v; } else { $db_query->execute("REPAIR TABLE " . $v); $doaction = $jieqiLang['system']['repair_table_action']; echo "<br>REPAIR TABLE " . $v; } } } if (!empty($doaction)) { jieqi_jumppage(JIEQI_URL . '/admin/dboptimize.php', LANG_DO_SUCCESS, sprintf($jieqiLang['system']['optrep_table_success'], $doaction)); } else { jieqi_printfail(sprintf($jieqiLang['system']['optrep_table_success'], $doaction)); } } else { $sql = "SHOW TABLE STATUS LIKE '" . JIEQI_DB_PREFIX . "%'"; $res = $db_query->execute($sql); $tablerows = array(); $k = 0; $totaltable = 0; //表数 $totalsize = 0; //数据长度 $totalrows = 0; //记录数 $totalindex = 0; //索引程度 $totalfree = 0;
/** * 产生一个错误 * * @param string $message 错误信息 * @param int $mode 错误类型 * @access public * @return void */ function raiseError($message = 'unknown error!', $mode = JIEQI_ERROR_DIE) { switch ($mode) { case JIEQI_ERROR_DIE: jieqi_printfail($message); //$this->errors[$mode][] = $message; break; case JIEQI_ERROR_RETURN: case JIEQI_ERROR_PRINT: $this->errors[$mode][] = $message; break; default: $this->errors[JIEQI_ERROR_RETURN][] = $message; break; } }
$newChapter->setVar('freesale', 0); $newChapter->setVar('bespsale', 0); $newChapter->setVar('totalsale', 0); $newChapter->setVar('daysale', 0); $newChapter->setVar('weeksale', 0); $newChapter->setVar('monthsale', 0); $newChapter->setVar('allsale', 0); $newChapter->setVar('lastsale', 0); $newChapter->setVar('canvip', 0); $newChapter->setVar('canfree', 0); $newChapter->setVar('canbesp', 0); $newChapter->setVar('state', 0); $newChapter->setVar('flag', 0); $newChapter->setVar('display', 0); if (!$chapter_handler->insert($newChapter)) { jieqi_printfail($jieqiLang['obook']['add_chapter_failure']); } else { if ($chaptertype != 2) { //增加或插入章节,最新卷可能也会变化 //暂时默认插入的章节就是本卷最后章节,否则最新章节可能不是插入的章节 $criteria = new CriteriaCompo(new Criteria('obookid', $_REQUEST['aid'])); $criteria->add(new Criteria('chapterorder', $_POST['volumeid'], '<')); $criteria->add(new Criteria('chaptertype', 1, '=')); $criteria->setSort('chapterorder'); $criteria->setOrder('DESC'); $criteria->setLimit(1); $chapter_handler->queryObjects($criteria); $tmpchapter = $chapter_handler->getObject(); if (is_object($tmpchapter)) { $lastvolume = $tmpchapter->getVar('chaptername', 'n'); $lastvolumeid = $tmpchapter->getVar('ochapterid', 'n');
switch ($_REQUEST['retcode']) { case 1: jieqi_msgwin(LANG_DO_SUCCESS, sprintf($jieqiLang['pay']['buy_egold_success'], jieqi_htmlstr($_REQUEST['buyname']), JIEQI_EGOLD_NAME, jieqi_htmlstr($_REQUEST['egold']))); break; case -1002: jieqi_printfail($jieqiLang['pay']['errmsg_card_password']); break; case -1003: jieqi_printfail($jieqiLang['pay']['errmsg_card_used']); break; case -2004: jieqi_printfail($jieqiLang['pay']['errmsg_card_cant']); break; case -1: jieqi_printfail($jieqiLang['pay']['errmsg_syatem']); break; case -101: jieqi_printfail($jieqiLang['pay']['errmsg_customer']); break; case -102: jieqi_printfail($jieqiLang['pay']['errmsg_checkcode']); break; case -103: jieqi_printfail($jieqiLang['pay']['errmsg_no_paylog']); break; case -104: jieqi_printfail($jieqiLang['pay']['errmsg_save_paylog']); break; default: jieqi_printfail($jieqiLang['pay']['errmsg_unknow']); }
$colary = array('repeat' => 2, 'referer' => $jieqiCollect['referer'], 'proxy_host' => $jieqiCollect['proxy_host'], 'proxy_port' => $jieqiCollect['proxy_port'], 'proxy_user' => $jieqiCollect['proxy_user'], 'proxy_pass' => $jieqiCollect['proxy_pass']); if (!empty($jieqiCollect['pagecharset'])) { $colary['charset'] = $jieqiCollect['pagecharset']; } //echo time().'<br>'.$url.'<br>';print_r($_SESSION);exit; $source = jieqi_urlcontents($url, $colary); if (empty($source)) { jieqi_printfail(sprintf($jieqiLang['article']['collect_url_failure'], $url, $url)); } //获取文章序号 $pregstr = jieqi_collectstoe($jieqiCollect['listcollect'][$_REQUEST['collectname']]['articleid']); if (!empty($pregstr)) { $matchvar = jieqi_cmatchall($pregstr, $source); } if (empty($matchvar)) { jieqi_printfail($jieqiLang['article']['parse_articleid_failure']); } if (is_array($matchvar)) { $aidsary = $matchvar; } else { $aidsary = array(); } //下一页参数 $nextpageid = ''; if ($jieqiCollect['listcollect'][$_REQUEST['collectname']]['nextpageid'] == '++') { $nextpageid = intval($startpageid) + 1; } else { $pregstr = jieqi_collectstoe($jieqiCollect['listcollect'][$_REQUEST['collectname']]['nextpageid']); if (!empty($pregstr)) { $matchvar = jieqi_cmatchone($pregstr, $source); }
if (!$article) { jieqi_printfail($jieqiLang['article']['article_not_exists']); } //检查权限 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 || $article->getVar('posterid') == $tmpvar || $article->getVar('agentid') == $tmpvar)) { $canedit = true; } } if (!$canedit) { jieqi_printfail($jieqiLang['article']['noper_manage_article']); } //包含区块参数 jieqi_getconfigs('article', 'authorblocks', 'jieqiBlocks'); jieqi_getconfigs(JIEQI_MODULE_NAME, 'sort'); jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs'); include_once JIEQI_ROOT_PATH . '/header.php'; $article_static_url = empty($jieqiConfigs['article']['staticurl']) ? $jieqiModules['article']['url'] : $jieqiConfigs['article']['staticurl']; $article_dynamic_url = empty($jieqiConfigs['article']['dynamicurl']) ? $jieqiModules['article']['url'] : $jieqiConfigs['article']['dynamicurl']; $jieqiTpl->assign('article_static_url', $article_static_url); $jieqiTpl->assign('article_dynamic_url', $article_dynamic_url); //采集 $setting = unserialize($article->getVar('setting', 'n')); $url_collect = $article_static_url . '/admin/collect.php?toid=' . $article->getVar('articleid', 'n'); if (is_numeric($setting['fromarticle'])) { $url_collect .= '&fromid=' . $setting['fromarticle'];
} 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']; $honorid = jieqi_gethonorid($_SESSION['jieqiUserScore'], $jieqiHonors); if ($honorid && isset($jieqiRight['system']['maxmessages']['honors'][$honorid]) && is_numeric($jieqiRight['system']['maxmessages']['honors'][$honorid])) { $maxmessage = intval($jieqiRight['system']['maxmessages']['honors'][$honorid]); } //根据头衔设置的消息数 include_once JIEQI_ROOT_PATH . '/class/message.php'; $message_handler = JieqiMessageHandler::getInstance('JieqiMessageHandler'); $sql = "SELECT COUNT(*) AS msgnum FROM " . jieqi_dbprefix('system_message') . " WHERE (fromid=" . $_SESSION['jieqiUserId'] . " AND fromdel=0) OR (toid=" . $_SESSION['jieqiUserId'] . " AND todel=0)";
$article = $article_handler->get($_REQUEST['articleid']); if (!$article) { jieqi_printfail($jieqiLang['article']['article_not_exists']); } //检查权限 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 || $article->getVar('agentid') == $tmpvar)) { $canedit = true; } } if (!$canedit) { jieqi_printfail($jieqiLang['article']['noper_delete_chapters']); } //执行删除 $cids = ''; foreach ($_REQUEST['chapterid'] as $cid) { $cid = intval($cid); if ($cid) { if ($cids != '') { $cids .= ', '; } $cids .= $cid; } } if ($cids != '') { include_once $jieqiModules['article']['path'] . '/include/operatefunction.php'; $criteria = new CriteriaCompo();
* @category jieqicms * @package article * @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com) * @author $Author: juny $ * @version $Id: applyinfo.php 326 2009-02-04 00:26:22Z juny $ */ define('JIEQI_MODULE_NAME', 'article'); require_once '../../../global.php'; if (empty($_REQUEST['id'])) { jieqi_printfail(LANG_ERROR_PARAMETER); } jieqi_loadlang('applywriter', JIEQI_MODULE_NAME); include_once $jieqiModules['article']['path'] . '/class/applywriter.php'; $apply_handler =& JieqiApplywriterHandler::getInstance('JieqiApplywriterHandler'); $applywriter = $apply_handler->get($_REQUEST['id']); if (!is_object($applywriter)) { jieqi_printfail($jieqiLang['article']['applywriter_not_exists']); } //jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs'); //包含页头处理 include_once JIEQI_ROOT_PATH . '/header.php'; $jieqiTpl->setCaching(0); $jieqiTpl->assign('applyid', $applywriter->getVar('applyid')); $jieqiTpl->assign('applytime', date(JIEQI_DATE_FORMAT . ' ' . JIEQI_TIME_FORMAT, $applywriter->getVar('applytime'))); $jieqiTpl->assign('applyuid', $applywriter->getVar('applyuid')); $jieqiTpl->assign('applyname', $applywriter->getVar('applyname')); $jieqiTpl->assign('applytitle', $applywriter->getVar('applytitle')); $jieqiTpl->assign('applytext', $applywriter->getVar('applytext')); $jieqiTpl->assign('applysize', $applywriter->getVar('applysize')); $jieqiTset['jieqi_contents_template'] = $jieqiModules['article']['path'] . '/templates/admin/applyinfo.html'; include_once JIEQI_ROOT_PATH . '/footer.php';
$buyname = $paylog->getVar('buyname'); $buyid = $paylog->getVar('buyid'); $payflag = $paylog->getVar('payflag'); $egold = $paylog->getVar('egold'); if ($payflag == 0) { include_once JIEQI_ROOT_PATH . '/class/users.php'; $users_handler =& JieqiUsersHandler::getInstance('JieqiUsersHandler'); $ret = $users_handler->income($buyid, $egold, $jieqiPayset[JIEQI_PAY_TYPE]['paysilver'], $jieqiPayset[JIEQI_PAY_TYPE]['payscore'][$egold]); if ($ret) { $note = sprintf($jieqiLang['pay']['add_egold_success'], $buyname, JIEQI_EGOLD_NAME, $egold); } else { $note = sprintf($jieqiLang['pay']['add_egold_failure'], $buyid, $buyname, JIEQI_EGOLD_NAME, $egold); } $paylog->setVar('rettime', JIEQI_NOW_TIME); $paylog->setVar('money', $money); $paylog->setVar('note', $note); $paylog->setVar('payflag', 1); if (!$paylog_handler->insert($paylog)) { jieqi_printfail($jieqiLang['pay']['save_paylog_failure']); } else { jieqi_msgwin(LANG_DO_SUCCESS, sprintf($jieqiLang['pay']['buy_egold_success'], $buyname, JIEQI_EGOLD_NAME, $egold)); } } else { jieqi_printfail($jieqiLang['pay']['already_add_egold']); } } else { jieqi_printfail($jieqiLang['pay']['no_buy_record']); } } else { jieqi_printfail(sprintf($jieqiLang['pay']['pay_failure_message'], jieqi_htmlstr($msg))); }
echo $out_var; exit; } $tmpvar = explode(' ', microtime()); $jieqiTpl->assign('jieqi_exetime', round($tmpvar[1] + $tmpvar[0] - JIEQI_START_TIME, 6)); $jieqiTpl->setCaching(0); $pagecontent =& $jieqiTpl->fetch($jieqiTset['jieqi_page_template']); if (empty($_REQUEST['refresh'])) { echo $pagecontent; if (JIEQI_ENABLE_CACHE && JIEQI_CHAR_SET == JIEQI_SYSTEM_CHARSET) { jieqi_writefile(JIEQI_ROOT_PATH . '/' . $_REQUEST['target'], $pagecontent); } } else { if (JIEQI_ENABLE_CACHE && JIEQI_CHAR_SET == JIEQI_SYSTEM_CHARSET) { $ret = jieqi_writefile(JIEQI_ROOT_PATH . '/' . $_REQUEST['target'], $pagecontent); //if($ret) jieqi_jumppage(JIEQI_URL.'/'.$_REQUEST['target'], LANG_DO_SUCCESS, $jieqiLang['system']['make_sindex_success']); if ($ret) { jieqi_msgwin(LANG_DO_SUCCESS, sprintf($jieqiLang['system']['make_static_success'], JIEQI_URL . '/' . $_REQUEST['target'])); } else { jieqi_printfail(sprintf($jieqiLang['system']['make_static_failure'], $_REQUEST['target'])); } } else { if (!JIEQI_ENABLE_CACHE) { jieqi_printfail($jieqiLang['system']['sindex_need_cache']); } else { jieqi_printfail(sprintf($jieqiLang['system']['sindex_need_charset'], JIEQI_CHAR_SET)); } } } //结束数据库连接 jieqi_freeresource();
} else { $score = 0; } if ($_REQUEST['egold'] > 0) { $uservip = 1; } else { $uservip = 0; $now_egold = intval($user->getVar('egold')); $now_esilver = intval($user->getVar('esilver')); if ($usesliver == 1 && $now_esilver + $_REQUEST['egold'] < 0 || $usesliver == 0 && $now_egold + $_REQUEST['egold'] < 0) { jieqi_printfail($jieqiLang['pay']['change_egold_notenough']); } } $ret = $users_handler->income($uid, $_REQUEST['egold'], $usesliver, $score, $uservip); if (!$ret) { jieqi_printfail(sprintf($jieqiLang['pay']['change_egold_failure'], $uname)); } include_once $jieqiModules['pay']['path'] . '/class/paylog.php'; $paylog_handler = JieqiPaylogHandler::getInstance('JieqiPaylogHandler'); $paylog = $paylog_handler->create(); $paylog->setVar('siteid', JIEQI_SITE_ID); $paylog->setVar('buytime', JIEQI_NOW_TIME); $paylog->setVar('rettime', JIEQI_NOW_TIME); $paylog->setVar('buyid', $uid); $paylog->setVar('buyname', $uname_n); $paylog->setVar('buyinfo', ''); $paylog->setVar('moneytype', 0); $paylog->setVar('money', $money); $paylog->setVar('egoldtype', $usesliver); $paylog->setVar('egold', $_REQUEST['egold']); $paylog->setVar('paytype', 'manual');
* * 配置模块名称、路径,访问的url等 * * 调用模板:/templates/admin/managemodules.html * * @category jieqicms * @package system * @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com) * @author $Author: juny $ * @version $Id: managemodules.php 332 2009-02-23 09:15:08Z juny $ */ define('JIEQI_MODULE_NAME', 'system'); require_once '../global.php'; jieqi_checklogin(); if ($jieqiUsersStatus != JIEQI_GROUP_ADMIN) { jieqi_printfail(LANG_NEED_ADMIN); } //jieqi_getconfigs(JIEQI_MODULE_NAME, 'modules','jieqiModules'); //系统已经载入 jieqi_loadlang('modules', JIEQI_MODULE_NAME); if (!empty($_REQUEST['dosubmit'])) { foreach ($_REQUEST['jieqiModules'] as $k => $v) { $jieqiModules[$k] = $v; } $jieqiModules = $_REQUEST['jieqiModules']; //jieqi_setconfigs('modules','jieqiModules',$jieqiModules, JIEQI_MODULE_NAME); jieqi_save_modconfig($jieqiModules); jieqi_jumppage(JIEQI_URL . '/admin/managemodules.php', LANG_DO_SUCCESS, $jieqiLang['system']['modules_config_saved']); } include_once JIEQI_ROOT_PATH . '/admin/header.php'; if (!isset($jieqiModules)) { $jieqiModules = array();
/** * 根据数据库类型创建一个类 * * @param string $dbtype 数据库类型 * @param string $dbhost 数据库服务器地址 * @param string $dbuser 数据库用户名 * @param string $dbpass 数据库密码 * @param string $dbname 数据库名 * @param bool $getnew 其否强制创建新实例,默认否 * @access public * @return object 返回数据库实例 */ function &getInstance($dbtype = '', $dbhost = '', $dbuser = '', $dbpass = '', $dbname = '', $getnew = false) { $instance =& JieqiDatabase::retInstance(); if (empty($dbtype)) { $dbtype = JIEQI_DB_TYPE; } if (empty($dbhost)) { $dbhost = JIEQI_DB_HOST; } if (empty($dbuser)) { $dbuser = JIEQI_DB_USER; } if (empty($dbpass)) { $dbpass = JIEQI_DB_PASS; } if (empty($dbname)) { $dbname = JIEQI_DB_NAME; } $inskey = md5($dbtype . ',' . $dbhost . ',' . $dbuser . ',' . $dbpass . ',' . $dbname); $getnew = $dbtype == JIEQI_DB_TYPE && $dbhost == JIEQI_DB_HOST && $dbuser == JIEQI_DB_USER && $dbpass == JIEQI_DB_PASS && $dbname == JIEQI_DB_NAME ? false : true; if (!isset($instance[$inskey]) || $getnew) { switch ($dbtype) { case 'mysql': require_once 'mysql/db.php'; if ($getnew) { $db = new JieqiMySQLDatabase(); } else { $instance[$inskey] = new JieqiMySQLDatabase(); } break; case 'sqlite': require_once 'sqlite/db.php'; if ($getnew) { $db = new JieqiSQLiteDatabase(); } else { $instance[$inskey] = new JieqiSQLiteDatabase(); } break; default: jieqi_printfail('The database type (' . $dbtype . ') is not exists!'); return false; } if ($getnew) { if (!$db->connect($dbhost, $dbuser, $dbpass, $dbname)) { jieqi_printfail('Can not connect to database!<br /><br />error: ' . $db->error()); return false; } else { return $db; } } else { if (!$instance[$inskey]->connect($dbhost, $dbuser, $dbpass, $dbname)) { jieqi_printfail('Can not connect to database!<br /><br />error: ' . $instance[$inskey]->error()); return false; } } } if (!defined('JIEQI_DB_CONNECTED')) { @define('JIEQI_DB_CONNECTED', true); } return $instance[$inskey]; }
* 阅读书架中的文章 * * 点击书架中文章后记录阅读标志,并跳转到阅读页面 * * 调用模板:无 * * @category jieqicms * @package article * @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com) * @author $Author: juny $ * @version $Id: readbookcase.php 332 2009-02-23 09:15:08Z juny $ */ define('JIEQI_MODULE_NAME', 'article'); require_once '../../global.php'; if (empty($_REQUEST['aid']) && empty($_REQUEST['oid'])) { jieqi_printfail(LANG_ERROR_PARAMETER); } $_REQUEST['aid'] = intval($_REQUEST['aid']); //更新书架的最后访问 if (!empty($_REQUEST['bid'])) { include_once $jieqiModules['article']['path'] . '/class/bookcase.php'; $bookcase_handler =& JieqiBookcaseHandler::getInstance('JieqiBookcaseHandler'); $bookcase_handler->db->query('UPDATE ' . jieqi_dbprefix('article_bookcase') . ' SET lastvisit=' . JIEQI_NOW_TIME . ' WHERE caseid=' . $_REQUEST['bid']); } 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['oid'])) { if (!empty($_REQUEST['ocid'])) { $gourl = '/reader.php?aid=' . $_REQUEST['oid'] . '&cid=' . $_REQUEST['ocid']; } else {
} echo sprintf($jieqiLang['article']['repack_next_html'], JIEQI_CHAR_SET, $showinfo, $url, $url); } elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == 'packwithtime') { if (!empty($_REQUEST['flagary'])) { $_REQUEST['flagary'] = unserialize(urldecode($_REQUEST['flagary'])); } else { $_REQUEST['flagary'] = $_REQUEST['packflag']; } if (!is_array($_REQUEST['flagary']) || count($_REQUEST['flagary']) < 1) { jieqi_printfail($jieqiLang['article']['need_repack_option']); } $starttime = trim($_REQUEST['starttime']); $stoptime = trim($_REQUEST['stoptime']); $startlimit = trim($_REQUEST['startlimit']); if (empty($starttime)) { jieqi_printfail($jieqiLang['article']['need_time_format']); } if (!is_numeric($starttime)) { $starttime = mktime((int) substr($starttime, 11, 2), (int) substr($starttime, 14, 2), (int) substr($starttime, 17, 2), (int) substr($starttime, 5, 2), (int) substr($starttime, 8, 2), (int) substr($starttime, 0, 5)); } if (empty($stoptime)) { $stoptime = JIEQI_NOW_TIME; } if (!is_numeric($stoptime)) { $stoptime = mktime((int) substr($stoptime, 11, 2), (int) substr($stoptime, 14, 2), (int) substr($stoptime, 17, 2), (int) substr($stoptime, 5, 2), (int) substr($stoptime, 8, 2), (int) substr($stoptime, 0, 5)); } include_once $jieqiModules['article']['path'] . '/class/article.php'; $article_handler =& JieqiArticleHandler::getInstance('JieqiArticleHandler'); if (empty($startlimit)) { $startlimit = 0; }
if (count($payary) > 0) { $money = 0; $egold = 0; $pids = ''; foreach ($payary as $v) { $money += $v['money']; $egold += $v['egold']; if (!empty($pids)) { $pids .= ', '; } $pids .= $v['payid']; } $buyname = $_SESSION['jieqiUserName']; $buyid = $_SESSION['jieqiUserId']; include_once JIEQI_ROOT_PATH . '/class/users.php'; $users_handler =& JieqiUsersHandler::getInstance('JieqiUsersHandler'); if (isset($jieqiPayset[JIEQI_PAY_TYPE]['scorerate'])) { $addscore = ceil($egold * $jieqiPayset[JIEQI_PAY_TYPE]['scorerate']); } else { $addscore = 0; } $ret = $users_handler->income($buyid, $egold, $jieqiPayset[JIEQI_PAY_TYPE]['paysilver'], $addscore); $sql = "UPDATE " . jieqi_dbprefix('pay_paylog') . " SET buyid='" . intval($buyid) . "', buyname='" . jieqi_dbslashes($buyname) . "', rettime='" . intval(JIEQI_NOW_TIME) . "', payflag='1' WHERE payid IN (" . $pids . ')'; $ret = $paylog_handler->db->query($sql); if (!$ret) { jieqi_printfail($jieqiLang['pay']['save_paylog_failure']); } jieqi_msgwin(LANG_DO_SUCCESS, sprintf($jieqiLang['pay']['call_cinfirm_success'], jieqi_htmlstr($buyname), sprintf('%0.2f', $money / 100), $egold, JIEQI_EGOLD_NAME)); } else { jieqi_printfail($jieqiLang['pay']['no_buy_record']); }
* @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); } $obook_handler->insert($obook); if ($_REQUEST['action'] == 'no') { jieqi_msgwin(LANG_DO_SUCCESS, $jieqiLang['obook']['obook_notgood_success']); } else { jieqi_msgwin(LANG_DO_SUCCESS, $jieqiLang['obook']['obook_setgood_success']); }