Пример #1
0
 $chapterlink = '';
 if (strpos($jieqiCollect['urlchapter'], '<{chapterlink}>') !== false && !empty($jieqiCollect['chapterlink'])) {
     //章节链接
     $pregstr = jieqi_collectstoe($jieqiCollect['chapterlink']);
     if (!empty($pregstr)) {
         $matchvar = jieqi_cmatchone($pregstr, $source);
         if (!empty($matchvar)) {
             $chapterlink = trim(jieqi_textstr($matchvar));
         }
     }
 }
 if (!isset($jieqiConfigs['article'])) {
     jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs');
 }
 include_once JIEQI_ROOT_PATH . '/lib/text/texttypeset.php';
 $texttypeset = new TextTypeset();
 //增加章节
 //不直接进行生成页面和压缩包
 $old_makehtml = $jieqiConfigs['article']['makehtml'];
 $jieqiConfigs['article']['makehtml'] = 0;
 include_once $GLOBALS['jieqiModules']['article']['path'] . '/class/chapter.php';
 $chapter_handler =& JieqiChapterHandler::getInstance('JieqiChapterHandler');
 $size = $article->getVar('size');
 $lastchapter = $article->getVar('lastchapter', 'n');
 $lastchapterid = $article->getVar('lastchapterid', 'n');
 $lastvolume = $article->getVar('lastvolume', 'n');
 $lastvolumeid = $article->getVar('lastvolumeid', 'n');
 $lastchapterorder = $tp + 1;
 if (!empty($jieqiConfigs['article']['hidearticlewords'])) {
     $articlewordssplit = strlen($jieqiConfigs['article']['articlewordssplit']) == 0 ? ' ' : $jieqiConfigs['article']['articlewordssplit'];
     $filterary = explode($articlewordssplit, $jieqiConfigs['article']['hidearticlewords']);
Пример #2
0
     $chapter->setVar('posterid', 0);
     $chapter->setVar('poster', '');
 }
 $chapter->setVar('lastupdate', JIEQI_NOW_TIME);
 $chapter->setVar('chaptername', $_POST['chaptername']);
 if ($_REQUEST['chaptertype'] == 0) {
     //文字过滤
     if (!empty($jieqiConfigs['article']['hidearticlewords'])) {
         $articlewordssplit = strlen($jieqiConfigs['article']['articlewordssplit']) == 0 ? ' ' : $jieqiConfigs['article']['articlewordssplit'];
         $filterary = explode($articlewordssplit, $jieqiConfigs['article']['hidearticlewords']);
         $_POST['chaptercontent'] = str_replace($filterary, '', $_POST['chaptercontent']);
     }
     //内容排版
     if ($jieqiConfigs['article']['authtypeset'] == 2 || $jieqiConfigs['article']['authtypeset'] == 1 && $_POST['typeset'] == 1) {
         include_once JIEQI_ROOT_PATH . '/lib/text/texttypeset.php';
         $texttypeset = new TextTypeset();
         $_POST['chaptercontent'] = $texttypeset->doTypeset($_POST['chaptercontent']);
     }
     $chaptersize = strlen(str_replace(array(" ", " ", "\r", "\n"), '', $_POST['chaptercontent']));
     $beforesize = $chapter->getVar('size');
     $chapter->setVar('size', $chaptersize);
 } else {
     $_POST['chaptercontent'] = '';
 }
 if (!$chapter_handler->insert($chapter)) {
     jieqi_printfail($jieqiLang['article']['chapter_edit_failure']);
 } else {
     if ($_REQUEST['chaptertype'] == 0) {
         $article->setVar('size', $article->getVar('size') + $chaptersize - $beforesize);
         if ($chapter->getVar('chapterid') == $article->getVar('lastchapterid')) {
             $article->setVar('lastchapter', $_POST['chaptername']);
Пример #3
0
switch ($_REQUEST['action']) {
    case 'newdraft':
        $_POST['draftname'] = trim($_POST['draftname']);
        $errtext = '';
        //检查标题
        if (strlen($_POST['draftname']) == 0) {
            $errtext .= $jieqiLang['article']['need_draft_title'] . '<br />';
        }
        if (strlen($_POST['draftcontent']) == 0) {
            $errtext .= $jieqiLang['article']['need_draft_content'] . '<br />';
        }
        if (empty($errtext)) {
            //内容排版
            if ($jieqiConfigs['article']['authtypeset'] == 2 || $jieqiConfigs['article']['authtypeset'] == 1 && $_POST['typeset'] == 1) {
                include_once JIEQI_ROOT_PATH . '/lib/text/texttypeset.php';
                $texttypeset = new TextTypeset();
                $_POST['draftcontent'] = $texttypeset->doTypeset($_POST['draftcontent']);
            }
            //保存到草稿箱
            include_once $jieqiModules['article']['path'] . '/class/draft.php';
            $draft_handler =& JieqiDraftHandler::getInstance('JieqiDraftHandler');
            $newDraft = $draft_handler->create();
            $draftsize = strlen(str_replace(array(" ", " ", "\r", "\n"), '', $_POST['draftcontent']));
            include_once $jieqiModules['article']['path'] . '/class/article.php';
            $article_handler =& JieqiArticleHandler::getInstance('JieqiArticleHandler');
            $article = $article_handler->get($_POST['articleid']);
            $newDraft->setVar('articleid', $_POST['articleid']);
            if (is_object($article)) {
                $newDraft->setVar('articlename', $article->getVar('articlename', 'n'));
            } else {
                $newDraft->setVar('articlename', '');