if (jieqi_checkpower($jieqiPower['article']['needcheck'], $jieqiUsersStatus, $jieqiUsersGroup, true)) { $newArticle->setVar('display', 0); } else { $newArticle->setVar('display', 1); //待审文章 } if (!$article_handler->insert($newArticle)) { jieqi_printfail($jieqiLang['article']['article_add_failure']); } else { $id = $newArticle->getVar('articleid'); include_once $jieqiModules['article']['path'] . '/class/package.php'; $package = new JieqiPackage($id); $package->initPackage(array('id' => $newArticle->getVar('articleid', 'n'), 'title' => $newArticle->getVar('articlename', 'n'), 'creatorid' => $newArticle->getVar('authorid', 'n'), 'creator' => $newArticle->getVar('author', 'n'), 'subject' => $newArticle->getVar('keywords', 'n'), 'description' => $newArticle->getVar('intro', 'n'), 'publisher' => JIEQI_SITE_NAME, 'contributorid' => $newArticle->getVar('posterid', 'n'), 'contributor' => $newArticle->getVar('poster', 'n'), 'sortid' => $newArticle->getVar('sortid', 'n'), 'typeid' => $newArticle->getVar('typeid', 'n'), 'articletype' => $newArticle->getVar('articletype', 'n'), 'permission' => $newArticle->getVar('permission', 'n'), 'firstflag' => $newArticle->getVar('firstflag', 'n'), 'fullflag' => $newArticle->getVar('fullflag', 'n'), 'imgflag' => $newArticle->getVar('imgflag', 'n'), 'power' => $newArticle->getVar('power', 'n'), 'display' => $newArticle->getVar('display', 'n'))); //保存小图 if (!empty($_FILES['articlespic']['name'])) { jieqi_copyfile($_FILES['articlespic']['tmp_name'], $package->getDir('imagedir') . '/' . $id . 's' . $simage_postfix, 0777, true); } //保存大图 if (!empty($_FILES['articlelpic']['name'])) { jieqi_copyfile($_FILES['articlelpic']['tmp_name'], $package->getDir('imagedir') . '/' . $id . 'l' . $limage_postfix, 0777, true); } //增加发文积分 if (!empty($jieqiConfigs['article']['scorearticle'])) { $users_handler->changeScore($_SESSION['jieqiUserId'], $jieqiConfigs['article']['scorearticle'], true); } //更新最新入库 if ($newArticle->getVar('display') == 0) { jieqi_getcachevars('article', 'articleuplog'); if (!is_array($jieqiArticleuplog)) { $jieqiArticleuplog = array('articleuptime' => 0, 'chapteruptime' => 0); }
@session_write_close(); } header("Content-type: text/plain"); header("Accept-Ranges: bytes"); if ($_REQUEST['fname'] == 'id') { header("Content-Disposition: attachment; filename=" . $_REQUEST['id'] . ".txt"); } else { header("Content-Disposition: attachment; filename=" . jieqi_htmlstr($package->metas['dc:Title']) . ".txt"); } $br = "\r\n"; if (!empty($jieqiConfigs['article']['txtarticlehead'])) { echo $jieqiConfigs['article']['txtarticlehead'] . $br . $br; } echo '《' . $package->metas['dc:Title'] . '》' . $br; $volume = ''; $txtdir = $package->getDir('txtdir', true, false); foreach ($package->chapters as $k => $chapter) { if ($chapter['content-type'] == 'volume') { $volume = $chapter['id']; } else { echo $br . $br . $volume . ' ' . $chapter['id'] . $br . $br; //echo jieqi_readfile($txtdir.'/'.$chapter['href']); @readfile($txtdir . '/' . $chapter['href']); ob_flush(); flush(); } } if (!empty($jieqiConfigs['article']['txtarticlefoot'])) { echo $jieqiConfigs['article']['txtarticlefoot']; } } else {
$article->setVar($v, intval($_POST[$v])); } } } if (!$article_handler->insert($article)) { jieqi_printfail($jieqiLang['article']['article_edit_failure']); } else { $id = $article->getVar('articleid'); include_once $jieqiModules['article']['path'] . '/class/package.php'; $package = new JieqiPackage($id); $package->editPackage(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'))); //删除老封面 if ($old_imgflag != $imgflag) { $tmpvar = $old_imgflag >> 2 & 7; if (isset($imgtary[$tmpvar])) { if (is_file($package->getDir('imagedir') . '/' . $id . 's' . $imgtary[$tmpvar])) { jieqi_delfile($package->getDir('imagedir') . '/' . $id . 's' . $imgtary[$tmpvar]); } } $tmpvar = $old_imgflag >> 5; if (isset($imgtary[$tmpvar])) { if (is_file($package->getDir('imagedir') . '/' . $id . 'l' . $imgtary[$tmpvar])) { jieqi_delfile($package->getDir('imagedir') . '/' . $id . 'l' . $imgtary[$tmpvar]); } } } //保存小图 if (!empty($_FILES['articlespic']['name'])) { jieqi_copyfile($_FILES['articlespic']['tmp_name'], $package->getDir('imagedir') . '/' . $id . 's' . $simage_postfix, 0777, true); } //保存大图