Example #1
0
            }
        }
        if (!empty($article['dateline'])) {
            $article['dateline'] = dgmdate($article['dateline']);
        }
        if (!empty($attachs)) {
            $article['attachs'] = get_upload_content($attachs);
        }
        $article_tags = article_parse_tags($article['tag']);
        $tag_names = article_tagnames();
    }
}
require_once libfile('function/upload');
$swfconfig = getuploadconfig($_G['uid'], 0, false);
require_once libfile('function/spacecp');
$albums = getalbums($_G['uid']);
include_once template("portal/portalcp_article");
function portalcp_get_summary($message)
{
    $message = preg_replace(array("/\\[attach\\].*?\\[\\/attach\\]/", "/\\&[a-z]+\\;/i", "/\\<script.*?\\<\\/script\\>/"), '', $message);
    $message = preg_replace("/\\[.*?\\]/", '', $message);
    $message = getstr(strip_tags($message), 200);
    return $message;
}
function portalcp_get_postmessage($post, $getauthorall = '')
{
    global $_G;
    $forum = C::t('forum_forum')->fetch($post['fid']);
    require_once libfile('function/discuzcode');
    $language = lang('forum/misc');
    if ($forum['type'] == 'sub' && $forum['status'] == 3) {
Example #2
0
        $_POST['hot'] = intval($_POST['hot']);
        updatetable('blog', array('hot' => $_POST['hot']), array('blogid' => $blog['blogid']));
        if ($_POST['hot'] > 0) {
            include_once S_ROOT . './source/function_feed.php';
            feed_publish($blog['blogid'], 'blogid');
        } else {
            updatetable('feed', array('hot' => $_POST['hot']), array('id' => $blog['blogid'], 'idtype' => 'blogid'));
        }
        showmessage('do_success', "space.php?uid={$blog['uid']}&do=blog&id={$blog['blogid']}", 0);
    }
} else {
    //添加编辑
    //获取个人分类
    $classarr = $blog['uid'] ? getclassarr($blog['uid']) : getclassarr($_SGLOBAL['supe_uid']);
    //获取相册
    $albums = getalbums($_SGLOBAL['supe_uid']);
    $tags = empty($blog['tag']) ? array() : unserialize($blog['tag']);
    $blog['tag'] = implode(' ', $tags);
    $blog['target_names'] = '';
    $friendarr = array($blog['friend'] => ' selected');
    $passwordstyle = $selectgroupstyle = 'display:none';
    if ($blog['friend'] == 4) {
        $passwordstyle = '';
    } elseif ($blog['friend'] == 2) {
        $selectgroupstyle = '';
        if ($blog['target_ids']) {
            $names = array();
            $query = $_SGLOBAL['db']->query("SELECT username FROM " . tname('space') . " WHERE uid IN ({$blog['target_ids']})");
            while ($value = $_SGLOBAL['db']->fetch_array($query)) {
                $names[] = $value['username'];
            }
Example #3
0
            $start = ($page - 1) * $perpage;
        }
        $bbcode =& bbcode::instance();
        $query = C::t('home_pic')->fetch_all_by_albumid($albumid, $start, $perpage, $picid, 0, 1, $albumid > 0 ? 0 : $_G['uid']);
        foreach ($query as $value) {
            if ($picid) {
                $value['checked'] = ' checked';
            }
            $value['title'] = $bbcode->html2bbcode($value['title']);
            $value['pic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']);
            $value['bigpic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote'], 0);
            $list[] = $value;
        }
    }
    $multi = multi($count, $perpage, $page, "home.php?mod=spacecp&ac=album&op=editpic&albumid={$albumid}");
    $albumlist = getalbums($album['uid']);
} elseif ($_GET['op'] == 'setpic') {
    album_update_pic($albumid, $picid);
    showmessage('do_success', dreferer(), array('picid' => $picid), array('showmsg' => true, 'closetime' => true));
} elseif ($_GET['op'] == 'edittitle') {
    $picid = empty($_GET['picid']) ? 0 : intval($_GET['picid']);
    $pic = C::t('home_pic')->fetch($picid);
    if (!checkperm('managealbum') && $pic['uid'] != $_G['uid']) {
        $pic = array();
    }
} elseif ($_GET['op'] == 'edithot') {
    if (!checkperm('managealbum')) {
        showmessage('no_privilege_edithot_album');
    }
    if (!($pic = C::t('home_pic')->fetch($picid))) {
        showmessage('image_does_not_exist');