コード例 #1
0
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
$oplist = array('comment', 'followers', 'related');
if (!in_array($op, $oplist)) {
    $op = '';
}
$fromoplist = array('my', 'all');
$fromop = !in_array($_GET['fromop'], $fromoplist) ? '' : $_GET['fromop'];
$fromtid = dintval($_GET['fromtid']);
$tids = $fids = array();
if (!$_G['collection']['ctid']) {
    showmessage('collection_permission_deny');
}
$navtitle = $_G['collection']['name'] . ' - ' . lang('core', 'title_collection');
$permission = checkcollectionperm($_G['collection'], $_G['uid']);
$avgrate = number_format($_G['collection']['rate'], 1);
$start = ($page - 1) * $tpp;
$collectionfollowdata = C::t('forum_collectionfollow')->fetch_by_ctid_uid($ctid, $_G['uid']);
$collectionteamworker = C::t('forum_collectionteamworker')->fetch_all_by_ctid($_G['collection']['ctid']);
$_G['collection']['arraykeyword'] = parse_keyword($_G['collection']['keyword'], false, false);
if ($_G['collection']['arraykeyword']) {
    foreach ($_G['collection']['arraykeyword'] as $kid => $s_keyword) {
        $metakeywords .= ($metakeywords ? ',' : '') . $s_keyword;
        $_G['collection']['urlkeyword'][$kid] = rawurlencode($s_keyword);
    }
}
$metadescription = $_G['collection']['name'];
if ($_G['collection']['ratenum']) {
    $star = imgdisplayrate($avgrate);
}
コード例 #2
0
        $newcomment['rate'] = $_GET['ratescore'];
    } else {
        $_GET['ratescore'] = 0;
    }
    C::t('forum_collectioncomment')->insert($newcomment);
    C::t('forum_collection')->update_by_ctid($_G['collection']['ctid'], 0, 0, 1, 0, $_GET['ratescore'], $_G['collection']['ratenum']);
    if ($_G['collection']['uid'] != $_G['uid']) {
        notification_add($_G['collection']['uid'], "system", 'collection_becommented', array('from_id' => $_G['collection']['ctid'], 'from_idtype' => 'collectioncomment', 'ctid' => $_G['collection']['ctid'], 'collectionname' => $_G['collection']['name']), 1);
    }
    C::t('common_member_status')->update($_G['uid'], array('lastpost' => TIMESTAMP), 'UNBUFFERED');
    showmessage('collection_comment_succ', $tid ? 'forum.php?mod=viewthread&tid=' . $tid : dreferer());
} elseif ($op == 'del') {
    if (!submitcheck('formhash')) {
        showmessage('undefined_action', NULL);
    } else {
        if (!$_G['collection']['ctid'] || !checkcollectionperm($_G['collection'], $_G['uid']) || count($_GET['delcomment']) == 0) {
            showmessage('undefined_action', NULL);
        }
        $delrows = C::t('forum_collectioncomment')->delete_by_cid_ctid($_GET['delcomment'], $_G['collection']['ctid']);
        C::t('forum_collection')->update_by_ctid($_G['collection']['ctid'], 0, 0, -$delrows);
        showmessage('collection_comment_remove_succ', 'forum.php?mod=collection&action=view&op=comment&ctid=' . $ctid);
    }
} elseif ($op == 'pop') {
    $collectionthread = C::t('forum_collectionthread')->fetch_by_ctid_tid($ctid, $tid);
    if (!$collectionthread['ctid']) {
        showmessage('collection_permission_deny');
    }
    $thread = C::t('forum_thread')->fetch($tid);
    include template('forum/collection_commentpop');
} elseif ($op == 'recommend') {
    if (!$_G['collection']['ctid']) {
コード例 #3
0
    $decthread = C::t('forum_collectionthread')->delete_by_ctid_tid($ctid, $_GET['delthread']);
    $lastpost = null;
    if (in_array($_G['collection']['lastpost'], $_GET['delthread']) && $_G['collection']['threadnum'] - $decthread > 0) {
        $collection_thread = C::t('forum_collectionthread')->fetch_by_ctid_dateline($ctid);
        if ($collection_thread) {
            $thread = C::t('forum_thread')->fetch($collection_thread['tid']);
            $lastpost = array('lastpost' => $thread['tid'], 'lastsubject' => $thread['subject'], 'lastposttime' => $thread['dateline'], 'lastposter' => $thread['authorid']);
        }
    }
    C::t('forum_collection')->update_by_ctid($ctid, -$decthread, 0, 0, 0, 0, 0, $lastpost);
    showmessage('collection_remove_thread', 'forum.php?mod=collection&action=view&ctid=' . $ctid);
} elseif ($op == 'invite') {
    if (!$ctid) {
        showmessage('undefined_action', NULL);
    }
    if (!$_G['collection']['ctid'] || !checkcollectionperm($_G['collection'], $_G['uid'])) {
        showmessage('collection_permission_deny');
    }
    $collectionteamworker = C::t('forum_collectionteamworker')->fetch_all_by_ctid($ctid);
    $submitworkers = count($_GET['users']);
    if (count($collectionteamworker) + $submitworkers >= $maxteamworkers) {
        showmessage('collection_teamworkers_exceed');
    }
    require_once libfile('function/friend');
    if ($_GET['username'] && !$_GET['users']) {
        $_GET['users'][] = $_GET['username'];
    }
    if (!$_GET['users']) {
        if ($_POST['formhash']) {
            showmessage('collection_teamworkers_noselect', NULL);
        }