Ejemplo n.º 1
0
} elseif ($action == 'del') {
    define('AJAX', 1);
    S::gp(array('ids', 'column_id'));
    /*
    if(!checkEditPurview($windid,$column_id)) {
    	Showmsg('您没有权限删除帖子');
    }
    */
    if (strpos($ids, ',')) {
        $ids = explode(',', $ids);
    }
    $articleDB = C::loadDB('article');
    $list = $articleDB->getArticlesByIds(is_array($ids) ? $ids : array($ids));
    if (empty($list)) {
        Showmsg('data_error');
    }
    foreach ($list as $key => $value) {
        if (!checkEditPurview($windid, $value['column_id'])) {
            Showmsg('您没有权限删除帖子');
        }
    }
    if (!$articleService->deleteArticlesToRecycle($ids)) {
        echo 'error';
        ajax_footer();
    }
    echo 'success';
    ajax_footer();
}
require_once M_P . 'require/header.php';
require cmsTemplate::printEot('list');
footer();
Ejemplo n.º 2
0
} elseif ($action == 'deletepage') {
    S::gp(array('id', 'page'));
    $articleModule = $articleService->getArticleModule($id);
    if (!checkEditPurview($windid, $articleModule->columnId) && $articleModule->user != $windid) {
        Showmsg('你没有权限编辑本栏目的文章');
    }
    $articleModule->deletePage($page);
    $articleModule->showError();
    $result = $articleService->updateArticle($articleModule);
    if ($result) {
        refreshto("{$basename}q=post&action=edit&id={$id}&page=1", 'operate_success', 2);
    } else {
        Showmsg('删除分页失败');
    }
}
require cmsTemplate::printEot('post');
footer();
function initFileTypeInfo($db_uploadfiletype)
{
    $uploadfiletype = $db_uploadfiletype ? unserialize($db_uploadfiletype) : array();
    $attachAllow = pwJsonEncode($uploadfiletype);
    $imageAllow = pwJsonEncode(getAllowKeysFromArray($uploadfiletype, array('jpg', 'jpeg', 'gif', 'png', 'bmp')));
    return array($attachAllow, $imageAllow);
}
function initAttach($attachs)
{
    $attach = '';
    if ($attachs) {
        foreach ($attachs as $key => $value) {
            $attach .= "'{$key}' : ['{$value['name']}', '{$value['size']}', '{$value['attachurl']}', '{$value['type']}', '0', '0', '', '{$value['descrip']}'],";
        }
Ejemplo n.º 3
0
if (checkReplyPurview()) {
    // 编辑器
    $uploadfiletype = $db_uploadfiletype ? unserialize($db_uploadfiletype) : array();
    $attachAllow = pwJsonEncode($uploadfiletype);
    $imageAllow = pwJsonEncode(getAllowKeysFromArray($uploadfiletype, array('jpg', 'jpeg', 'gif', 'png', 'bmp')));
}
// 评论列表
$reply_perpage = 10;
!$replypage && ($replypage = 1);
$cmscomment = C::loadClass('cmscommentservice');
$replyCount = $cmscomment->getCommentsCountByArticleId($id);
$cmsReplyList = $cmscomment->getCommentsByArticleId($id, $replypage, $reply_perpage);
$replynumofpage = ceil($replyCount / $reply_perpage);
$replyPages = numofpage($replyCount, 1, $replynumofpage, "pw_ajax.php?action=cmsreply&type=listcomment&id={$id}&", 10, 'getCommentList');
require_once M_P . 'require/header.php';
require cmsTemplate::printEot('view');
footer();
function cookContent($articleModule, $page)
{
    global $db_windpost;
    $content = $articleModule->getPageContent($page);
    $articleModule->showError();
    //$content = showface($content);
    $content = str_replace(array(" "), ' ', $content);
    $content = str_replace(array("\n", "\r\n"), '<br />', trim($content, "\r\n \n \r"));
    if ($articleModule->ifAttach && is_array($articleModule->attach)) {
        $aids = attachment($articleModule->content);
    }
    $endAttachs = array();
    foreach ($articleModule->attach as $at) {
        if (in_array($at['attach_id'], $aids)) {