Beispiel #1
0
                C::t('portal_article_title')->update($aids, array('catid' => $catid));
                showmessage('article_move_success', dreferer("portal.php?mod=portalcp&ac=category&catid={$catid}"));
            } else {
                showmessage('article_move_select_cat', dreferer());
            }
        }
    }
} elseif ($op == 'verify') {
    if ($aid) {
        check_articleperm($article['catid'], $aid, $article);
    } else {
        showmessage('article_not_exist', dreferer());
    }
} elseif ($op == 'pushplus') {
    if ($aid) {
        check_articleperm($article['catid'], $aid, $article);
    } else {
        showmessage('no_article_specified_for_pushplus', dreferer());
    }
    $pids = (array) $_POST['topiclist'];
    $tid = intval($_GET['tid']);
    $pushedids = array();
    $pushcount = $pushedcount = 0;
    if (!empty($pids)) {
        foreach (C::t('portal_article_content')->fetch_all($aid) as $value) {
            $pushedids[] = intval($value['id']);
            $pushedcount++;
        }
        $pids = array_diff($pids, $pushedids);
    }
    $pushcount = count($pids);
/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: portalcp_related.php 12343 2010-07-05 08:56:47Z shanzongjun $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
$op = in_array($_GET['op'], array('manual', 'search', 'add', 'get')) ? $_GET['op'] : '';
$aid = intval($_G['gp_aid']);
$catid = intval($_G['gp_catid']);
if ($aid) {
    check_articleperm($catid, $aid);
} else {
    check_articleperm($catid);
}
$wherearr = $articlelist = $relatedarr = array();
if ($op == 'manual') {
    $manualid = intval($_GET['manualid']);
    $ra = array();
    if ($manualid) {
        $query = DB::query("SELECT * FROM " . DB::table('portal_article_title') . " WHERE aid='{$manualid}'");
        $ra = DB::fetch($query);
    }
} elseif ($op == 'get') {
    $id = trim($_GET['id']);
    $getidarr = explode(',', $id);
    $getidarr = array_map('intval', $getidarr);
    $getidarr = array_unique($getidarr);
    $getidarr = array_filter($getidarr);
}
$operation = $_GET['op'] ? $_GET['op'] : '';
$upload = new discuz_upload();
$downremotefile = false;
$aid = intval(getgpc('aid'));
$catid = intval(getgpc('catid'));
if ($aid) {
    $article = C::t('portal_article_title')->fetch($aid);
    if (!$article) {
        portal_upload_error(lang('portalcp', 'article_noexist'));
    }
    if (check_articleperm($catid, $aid, $article, false, true) !== true) {
        portal_upload_error(lang('portalcp', 'article_noallowed'));
    }
} else {
    if (($return = check_articleperm($catid, $aid, null, false, true)) !== true) {
        portal_upload_error(lang('portalcp', $return));
    }
}
if ($operation == 'downremotefile') {
    $arrayimageurl = $temp = $imagereplace = array();
    $string = $_GET['content'];
    $downremotefile = true;
    preg_match_all("/\\<img.+src=('|\"|)?(.*)(\\1)([\\s].*)?\\>/ismUe", $string, $temp, PREG_SET_ORDER);
    if (is_array($temp) && !empty($temp)) {
        foreach ($temp as $tempvalue) {
            $tempvalue[2] = str_replace('\\"', '', $tempvalue[2]);
            if (strlen($tempvalue[2])) {
                $arrayimageurl[] = $tempvalue[2];
            }
        }
Beispiel #4
0
} elseif ($_GET['operation'] == 'portal') {
    $aid = intval($_POST['aid']);
    $catid = intval($_POST['catid']);
    $msg = '';
    $errorcode = 0;
    require_once libfile('function/portalcp');
    if ($aid) {
        $article = C::t('portal_article_title')->fetch($aid);
        if (!$article) {
            $errorcode = 1;
        }
        if (check_articleperm($catid, $aid, $article, false, true) !== true) {
            $errorcode = 2;
        }
    } else {
        if (check_articleperm($catid, $aid, null, false, true) !== true) {
            $errorcode = 3;
        }
    }
    $upload = new discuz_upload();
    $_FILES["Filedata"]['name'] = addslashes(diconv(urldecode($_FILES["Filedata"]['name']), 'UTF-8'));
    $upload->init($_FILES['Filedata'], 'portal');
    $attach = $upload->attach;
    if (!$upload->error()) {
        $upload->save();
    }
    if ($upload->error()) {
        $errorcode = 4;
    }
    if (!$errorcode) {
        if ($attach['isimage'] && empty($_G['setting']['portalarticleimgthumbclosed'])) {
Beispiel #5
0
        $query = DB::query('SELECT id FROM ' . DB::table('portal_article_content') . " WHERE aid='{$aid}' AND id IN (" . dimplode($pids) . ")");
        while ($value = DB::fetch($query)) {
            $pushedids[] = intval($value['id']);
            $pushedcount++;
        }
        $pids = array_diff($pids, $pushedids);
    }
    $pushcount = count($pids);
    if (empty($pids)) {
        showmessage($pushedids ? 'all_posts_pushed_already' : 'no_posts_for_pushplus');
    }
} else {
    if ($aid) {
        $catid = intval($article['catid']);
    }
    check_articleperm($catid, $aid, $article);
    $page = empty($_GET['page']) ? 1 : intval($_GET['page']);
    if ($page < 1) {
        $page = 1;
    }
    $start = $page - 1;
    $pageselect = '';
    $category = $_G['cache']['portalcategory'];
    $cate = $category[$catid];
    if ($article) {
        if ($op == 'addpage') {
            $article_content = array();
        } else {
            $query = DB::query("SELECT * FROM " . DB::table('portal_article_content') . " WHERE aid='{$aid}' ORDER BY pageorder LIMIT {$start},1");
            $article_content = DB::fetch($query);
        }