Пример #1
0
@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);
    $i = 0;
    $articlesize = 0;
    while ($chapter = $chapter_handler->getObject($res)) {
        if ($chapter->getVar('chaptertype', 'n') == 1) {
            $contenttype = 'volume';
        } else {
            $contenttype = 'chapter';
        }
        $package->chapters[$i] = array('id' => $chapter->getVar('chaptername', 'n'), 'href' => $chapter->getVar('chapterid', 'n') . $jieqi_file_postfix['txt'], 'media-type' => 'text/html', 'content-type' => $contenttype);
Пример #2
0
     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']);
     } else {
         $maxattachnum = 0;
     }
     $jieqiTpl->assign('maxattachnum', $maxattachnum);
     $jieqiTpl->assign('attachtype', $jieqiConfigs['article']['attachtype']);
     $jieqiTpl->assign('maximagesize', $jieqiConfigs['article']['maximagesize']);
     $jieqiTpl->assign('maxfilesize', $jieqiConfigs['article']['maxfilesize']);
     $tmpvar = $chapter->getVar('attachment', 'n');
     $attachnum = 0;
     $attachrows = array();
     if (!empty($tmpvar)) {
Пример #3
0
<?php

/**
 * ÏÔʾ·Ö¾íÔĶÁ
 *
 * ÏÔʾ·Ö¾íÔĶÁ
 * 
 * µ÷ÓÃÄ£°å£ºÎÞ
 * 
 * @category   jieqicms
 * @package    article
 * @copyright  Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com)
 * @author     $Author: juny $
 * @version    $Id: showvolume.php 228 2008-11-27 06:44:31Z juny $
 */
define('JIEQI_MODULE_NAME', 'article');
require_once '../../global.php';
if (empty($_REQUEST['aid']) || empty($_REQUEST['vid'])) {
    jieqi_printfail(LANG_ERROR_PARAMETER);
}
include_once $jieqiModules['article']['path'] . '/class/package.php';
$package = new JieqiPackage($_REQUEST['aid']);
if ($package->loadOPF()) {
    $package->showVolume($_REQUEST['vid']);
} else {
    jieqi_loadlang('article', JIEQI_MODULE_NAME);
    jieqi_printfail($jieqiLang['article']['article_not_exists']);
}
Пример #4
0
function article_repack($id, $params = array(), $syn = 0)
{
    global $jieqiConfigs;
    global $jieqiModules;
    global $jieqi_file_postfix;
    if (!$syn) {
        $article_static_url = empty($jieqiConfigs['article']['staticurl']) ? $jieqiModules['article']['url'] : $jieqiConfigs['article']['staticurl'];
        $url = $article_static_url . '/makepack.php?key=' . urlencode(md5(JIEQI_DB_USER . JIEQI_DB_PASS . JIEQI_DB_NAME)) . '&id=' . intval($id);
        $url = trim($url);
        if (strtolower(substr($url, 0, 7)) != 'http://') {
            $url = 'http://' . $_SERVER['HTTP_HOST'] . $url;
        }
        foreach ($params as $k => $v) {
            if ($v) {
                $url .= '&packflag[]=' . urlencode($k);
            }
        }
        return jieqi_socket_url($url);
    } else {
        $article_handler =& JieqiArticleHandler::getInstance('JieqiArticleHandler');
        $article = $article_handler->get($id);
        if (!is_object($article)) {
            return false;
        } else {
            $package = new JieqiPackage($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', $id, '='));
            $criteria->setSort('chapterorder ASC, chapterid');
            $criteria->setOrder('ASC');
            $res = $chapter_handler->queryObjects($criteria);
            $i = 0;
            $articlesize = 0;
            while ($chapter = $chapter_handler->getObject($res)) {
                if ($chapter->getVar('chaptertype', 'n') == 1) {
                    $contenttype = 'volume';
                } else {
                    $contenttype = 'chapter';
                }
                $package->chapters[$i] = array('id' => $chapter->getVar('chaptername', 'n'), 'href' => $chapter->getVar('chapterid', 'n') . $jieqi_file_postfix['txt'], 'media-type' => 'text/html', 'content-type' => $contenttype);
                $i++;
                if ($chapter->getVar('chaptertype', 'n') == 0) {
                    $articlesize = $articlesize + intval($chapter->getVar('size', 'n'));
                }
                if ($chapter->getVar('chapterorder', 'n') != $i) {
                    $chapter->setVar('chapterorder', $i);
                    $chapter_handler->insert($chapter);
                }
            }
            //检查文章信息和统计的是否对应
            $changeflag = false;
            if ($article->getVar('chapters', 'n') != $i) {
                $article->setVar('chapters', $i);
                $changeflag = true;
            }
            if ($article->getVar('size', 'n') != $articlesize) {
                $article->setVar('size', $articlesize);
                $changeflag = true;
            }
            if ($changeflag) {
                $article_handler->insert($article);
            }
            //开始生成
            $package->isload = true;
            //生成opf
            if ($params['makeopf']) {
                $package->createOPF();
            }
            if ($params['makehtml']) {
                $chaptercount = count($package->chapters);
                for ($i = 1; $i <= $chaptercount; $i++) {
                    if ($package->chapters[$i - 1]['content-type'] == 'chapter') {
                        $package->makeHtml($i, false, false, true);
                    }
                }
                //生成html目录
                $package->makeIndex();
            }
            //生成zip
            if ($params['makezip']) {
                $package->makezip();
            }
            //生成全文阅读
            if ($params['makefull']) {
                $package->makefulltext();
            }
            //生成umd
            if ($params['makeumd']) {
                $package->makeumd();
            }
            //生成txt全文
            if ($params['maketxtfull']) {
                $package->maketxtfull();
            }
            //生成jar
            if ($params['makejar']) {
                $package->makejar();
            }
            return true;
        }
    }
}
Пример #5
0
}
//检查下载积分
jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs');
$jieqiConfigs['article']['scoretxtfulldown'] = intval($jieqiConfigs['article']['scoretxtfulldown']);
if (empty($jieqiConfigs['article']['scoretxtfulldown']) && !empty($jieqiConfigs['article']['scoretxtdown'])) {
    $jieqiConfigs['article']['scoretxtfulldown'] = intval($jieqiConfigs['article']['scoretxtdown']);
}
if ($jieqiConfigs['article']['scoretxtfulldown'] > 0) {
    jieqi_checklogin();
    jieqi_loadlang('down', JIEQI_MODULE_NAME);
    if ($_SESSION['jieqiUserScore'] < $jieqiConfigs['article']['scoretxtfulldown']) {
        jieqi_printfail(sprintf($jieqiLang['article']['low_txtdown_score'], $jieqiConfigs['article']['scoretxtfulldown']));
    }
}
include_once $jieqiModules['article']['path'] . '/class/package.php';
$package = new JieqiPackage($_REQUEST['id']);
if ($package->loadOPF()) {
    //先扣分再下载
    if ($jieqiConfigs['article']['scoretxtfulldown'] > 0) {
        include_once JIEQI_ROOT_PATH . '/class/users.php';
        $users_handler =& JieqiUsersHandler::getInstance('JieqiUsersHandler');
        $users_handler->changeScore($_SESSION['jieqiUserId'], $jieqiConfigs['article']['scoretxtfulldown'], false, false);
        @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");
    }
Пример #6
0
 //if($setting['fromsite']==$_REQUEST['siteid'] && $setting['fromarticle']==$_REQUEST['fromid'] && $jieqiCollect['autoclear']==1){
 //允许清空,并且不是标记完成的书
 if ($jieqiCollect['autoclear'] == 1 && $fromisfull == false) {
     echo sprintf($jieqiLang['article']['article_collect_clean'], jieqi_htmlstr($article->getVar('articlename')));
     //清除文章统计
     $oldchapters = $article->getVar('chapters');
     $article->setVar('lastchapter', '');
     $article->setVar('lastchapterid', 0);
     $article->setVar('lastvolume', '');
     $article->setVar('lastvolumeid', 0);
     $article->setVar('chapters', 0);
     $article->setVar('size', 0);
     $article_handler->insert($article);
     //删除文本、html及zip
     include_once $GLOBALS['jieqiModules']['article']['path'] . '/class/package.php';
     $package = new JieqiPackage($_REQUEST['toid']);
     $package->delete();
     $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')));
     unset($package);
     //删除章节
     $criteria = new CriteriaCompo(new Criteria('articleid', $_REQUEST['toid'], '='));
     $chapter_handler->delete($criteria);
     unset($criteria);
     $fp = 0;
     $tp = 0;
     $torows = array();
     $tonum = 0;
     $maxchapterorder = 0;
 } else {
     $fp = $fromnum;
     $tp = $fromnum;
Пример #7
0
 *
 * 显示章节目录或者一个章节内容
 * 
 * 调用模板:无
 * 
 * @category   jieqicms
 * @package    article
 * @copyright  Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.jieqi.com)
 * @author     $Author: juny $
 * @version    $Id: reader.php 339 2009-06-23 03:03:24Z juny $
 */
define('JIEQI_MODULE_NAME', 'article');
require_once '../../global.php';
if (empty($_REQUEST['aid'])) {
    jieqi_printfail(LANG_ERROR_PARAMETER);
}
include_once JIEQI_ROOT_PATH . '/header.php';
include_once $jieqiModules['article']['path'] . '/class/package.php';
$package = new JieqiPackage($_REQUEST['aid']);
if ($package->loadOPF()) {
    if (!empty($_REQUEST['cid'])) {
        if (!$package->showChapter($_REQUEST['cid'])) {
            $package->showIndex();
        }
    } else {
        $package->showIndex();
    }
} else {
    jieqi_loadlang('article', JIEQI_MODULE_NAME);
    jieqi_printfail($jieqiLang['article']['article_not_exists']);
}
Пример #8
0
     unset($criteria);
     $criteria = new CriteriaCompo(new Criteria('chapterid', $cid, '='));
     $chapter_handler->updatefields('chapterorder=' . $_REQUEST['toid'], $criteria);
     unset($criteria);
 } else {
     $criteria = new CriteriaCompo(new Criteria('articleid', $_REQUEST['aid'], '='));
     $criteria->add(new Criteria('chapterorder', $_REQUEST['fromid'], '<'));
     $criteria->add(new Criteria('chapterorder', $_REQUEST['toid'], '>'));
     $chapter_handler->updatefields('chapterorder=chapterorder+1', $criteria);
     unset($criteria);
     $criteria = new CriteriaCompo(new Criteria('chapterid', $cid, '='));
     $chapter_handler->updatefields('chapterorder=' . ($_REQUEST['toid'] + 1), $criteria);
     unset($criteria);
 }
 include_once $jieqiModules['article']['path'] . '/class/package.php';
 $package = new JieqiPackage($_REQUEST['aid']);
 $package->sortChapter($_REQUEST['fromid'], $_REQUEST['toid']);
 //检查最新卷和最新章节
 $criteria = new CriteriaCompo(new Criteria('articleid', $_REQUEST['aid'], '='));
 $criteria->setSort('chapterorder');
 $criteria->setOrder('DESC');
 $chapter_handler->queryObjects($criteria);
 $v = $chapter_handler->getObject();
 if ($v) {
     $nolastchapter = true;
     $nolastvolume = true;
     $lastchapter = '';
     $lastchapterid = 0;
     $lastvolume = '';
     $lastvolumeid = 0;
     do {
Пример #9
0
function jieqi_article_clean($aid, $usescore = false)
{
    global $jieqiModules;
    global $article_handler;
    global $chapter_handler;
    global $jieqiArticleuplog;
    global $jieqiConfigs;
    $article = $article_handler->get($aid);
    if (!is_object($article)) {
        return false;
    }
    //清除文章统计
    $criteria = new CriteriaCompo(new Criteria('articleid', $aid));
    $fields = array('lastchapter' => '', 'lastchapterid' => 0, 'lastvolume' => '', 'lastvolumeid' => 0, 'chapters' => 0, 'size' => 0);
    $article_handler->updatefields($fields, $criteria);
    //更新最新文章
    $jieqiArticleuplog['articleuptime'] = JIEQI_NOW_TIME;
    $jieqiArticleuplog['chapteruptime'] = JIEQI_NOW_TIME;
    jieqi_setcachevars('articleuplog', 'jieqiArticleuplog', $jieqiArticleuplog, 'article');
    //删除文本、html及zip
    $package = new JieqiPackage($aid);
    $package->delete();
    $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')));
    //删除章节
    //检查这篇文章章节发表人,扣积分用
    if ($usescore) {
        $posterary = array();
        if (!empty($jieqiConfigs['article']['scorechapter'])) {
            $criteria0 = new CriteriaCompo(new Criteria('articleid', $aid, '='));
            $chapter_handler->queryObjects($criteria0);
            while ($chapterobj = $chapter_handler->getObject()) {
                $posterid = intval($chapterobj->getVar('posterid'));
                if (isset($posterary[$posterid])) {
                    $posterary[$posterid] += $jieqiConfigs['article']['scorechapter'];
                } else {
                    $posterary[$posterid] = $jieqiConfigs['article']['scorechapter'];
                }
            }
            unset($criteria0);
        }
    }
    //真正删除章节
    $criteria = new CriteriaCompo(new Criteria('articleid', $aid, '='));
    $chapter_handler->delete($criteria);
    //删除附件
    include_once $jieqiModules['article']['path'] . '/class/articleattachs.php';
    $attachs_handler =& JieqiArticleattachsHandler::getInstance('JieqiArticleattachsHandler');
    $attachs_handler->delete($criteria);
    //减少文章和章节积分
    if ($usescore) {
        include_once JIEQI_ROOT_PATH . '/class/users.php';
        $users_handler =& JieqiUsersHandler::getInstance('JieqiUsersHandler');
        if (!empty($jieqiConfigs['article']['scorearticle'])) {
            $posterid = intval($article->getVar('posterid'));
            if (isset($posterary[$posterid])) {
                $posterary[$posterid] += $jieqiConfigs['article']['scorearticle'];
            } else {
                $posterary[$posterid] = $jieqiConfigs['article']['scorearticle'];
            }
        }
        foreach ($posterary as $pid => $pscore) {
            $users_handler->changeScore($pid, $pscore, false);
        }
    }
    return $article;
}
Пример #10
0
             $img = new ImageWater();
             $img->save_image_file = $tmp_attachfile;
             $img->codepage = JIEQI_SYSTEM_CHARSET;
             $img->wm_image_pos = $jieqiConfigs['article']['attachwater'];
             $img->wm_image_name = $water_image_file;
             $img->wm_image_transition = $jieqiConfigs['article']['attachwtrans'];
             $img->jpeg_quality = $jieqiConfigs['article']['attachwquality'];
             $img->create($tmp_attachfile);
             unset($img);
         }
         jieqi_copyfile($tmp_attachfile, $attach_save_path, 0777, true);
     }
 }
 //保存文章内容和生成html
 include_once $GLOBALS['jieqiModules']['article']['path'] . '/class/package.php';
 $package = new JieqiPackage($article->getVar('articleid', 'n'));
 if ($_POST['chaptertype'] == 2) {
     $package->addChapter($newChapter->getVar('chapterid'), $_POST['chaptername'], $_POST['chaptercontent'], 1, $volumeid);
 } else {
     $package->addChapter($newChapter->getVar('chapterid'), $_POST['chaptername'], $_POST['chaptercontent'], 0, $volumeid);
 }
 if ($from_draft) {
     $draft_handler->delete($_REQUEST['draftid']);
 }
 //增加章节积分
 jieqi_getconfigs(JIEQI_MODULE_NAME, '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'];
 if (!empty($jieqiConfigs['article']['scorechapter'])) {
     include_once JIEQI_ROOT_PATH . '/class/users.php';
     $users_handler =& JieqiUsersHandler::getInstance('JieqiUsersHandler');
Пример #11
0
    if (!is_array($jieqiArticleuplog)) {
        $jieqiArticleuplog = array('articleuptime' => 0, 'chapteruptime' => 0);
    }
    $jieqiArticleuplog['chapteruptime'] = JIEQI_NOW_TIME;
    jieqi_setcachevars('articleuplog', 'jieqiArticleuplog', $jieqiArticleuplog, 'article');
    //清空本文章缓存
    if (JIEQI_USE_CACHE) {
        if (!is_a($jieqiTpl, 'JieqiTpl')) {
            include_once JIEQI_ROOT_PATH . '/lib/template/template.php';
            $jieqiTpl =& JieqiTpl::getInstance();
        }
        $jieqiTpl->clear_cache($jieqiModules['article']['path'] . '/templates/articleinfo.html', $article->getVar('articleid', 'n'));
    }
}
include_once $jieqiModules['article']['path'] . '/class/package.php';
$package = new JieqiPackage($article->getVar('articleid'));
$package->delChapter($chapter->getVar('chapterorder'), $chapter->getVar('chapterid'));
//删除附件记录
include_once $jieqiModules['article']['path'] . '/class/articleattachs.php';
$attachs_handler =& JieqiArticleattachsHandler::getInstance('JieqiArticleattachsHandler');
$criteria = new CriteriaCompo(new Criteria('chapterid', $_REQUEST['id']));
$attachs_handler->delete($criteria);
//减少章节积分
include_once JIEQI_ROOT_PATH . '/class/users.php';
$users_handler =& JieqiUsersHandler::getInstance('JieqiUsersHandler');
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($jieqiConfigs['article']['scorechapter'])) {
    $users_handler->changeScore($chapter->getVar('posterid'), $jieqiConfigs['article']['scorechapter'], false);
}
Пример #12
0
         $imgflag = $imgflag | $tmpvar * 32;
     }
 }
 $newArticle->setVar('imgflag', $imgflag);
 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) {