function processCollectionData($collection, $tf = array(), $orderby = '') { if (count($collection) <= 0) { return array(); } require_once libfile('function/discuzcode'); foreach ($collection as $ctid => &$curvalue) { $curvalue['updated'] = $curvalue['lastupdate'] > $tf[$ctid]['lastvisit'] ? 1 : 0; $curvalue['tflastvisit'] = $tf[$ctid]['lastvisit']; $curvalue['lastupdate'] = dgmdate($curvalue['lastupdate']); $curvalue['dateline'] = dgmdate($curvalue['dateline']); $curvalue['lastposttime'] = dgmdate($curvalue['lastposttime']); $curvalue['avgrate'] = number_format($curvalue['rate'], 1); $curvalue['star'] = imgdisplayrate($curvalue['rate']); $curvalue['lastposterhtml'] = rawurlencode($curvalue['lastposter']); $curvalue['shortdesc'] = cutstr(strip_tags(discuzcode($curvalue['desc'])), 50); $curvalue['arraykeyword'] = parse_keyword($curvalue['keyword'], false, false); if ($curvalue['arraykeyword']) { foreach ($curvalue['arraykeyword'] as $kid => $s_keyword) { $curvalue['urlkeyword'][$kid] = rawurlencode($s_keyword); } } if ($orderby == 'commentnum') { $curvalue['displaynum'] = $curvalue['commentnum']; } elseif ($orderby == 'follownum') { $curvalue['displaynum'] = $curvalue['follownum']; } else { $curvalue['displaynum'] = $curvalue['threadnum']; } } return $collection; }
$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); } if (!$op || $op == 'related') { $isteamworkers = in_array($_G['uid'], array_keys($collectionteamworker)); $cloud_apps = (array) unserialize($_G['setting']['cloud_apps']); $search_status = $cloud_apps['search']['status'] == 'normal' ? TRUE : FALSE; if (!$op && $op != 'related') {
} if (!$_G['collection']['ctid'] || !checkcollectionperm($_G['collection'], $_G['uid'])) { showmessage('collection_permission_deny'); } if (!submitcheck('collectionsubmit')) { include template('forum/collection_add'); } else { if (!$_GET['title']) { showmessage('collection_edit_checkentire'); } if ($_GET['formhash'] != FORMHASH) { showmessage('undefined_action', NULL); } $newCollectionTitle = censor(dhtmlspecialchars($_GET['title'])); $newCollectionTitle = cutstr($newCollectionTitle, 30, ''); $newcollection = array('name' => $newCollectionTitle, 'desc' => dhtmlspecialchars(cutstr(censor($_GET['desc']), $desclimit, '')), 'keyword' => parse_keyword($_GET['keyword'], true)); C::t('forum_collection')->update($ctid, $newcollection); if ($_GET['title'] != $_G['collection']['name']) { C::t('forum_collectionteamworker')->update_by_ctid($ctid, $_GET['title']); } showmessage('collection_edit_succ', 'forum.php?mod=collection&action=view&ctid=' . $ctid); } } elseif ($op == 'remove') { if ($_GET['formhash'] != FORMHASH) { showmessage('undefined_action', NULL); } if ($_G['collection'] && checkcollectionperm($_G['collection'], $_G['uid'])) { require_once libfile('function/delete'); deletecollection($_G['collection']['ctid']); showmessage('collection_delete_succ', 'forum.php?mod=collection&op=my'); } else {