count(); } $orderby = (in_array($_GET['order'], $orderbyarr)) ? $_GET['order'] : 'dateline'; $collectiondata = processCollectionData(C::t('forum_collection')->fetch_all('', $orderby, 'DESC', $start, $cpp, $searchtitle), array(), $orderby); $htmlsearchtitle = dhtmlspecialchars($searchtitle); $multipage = multi($count, $cpp, $page, 'forum.php?mod=collection&order='.$orderby.'&op='.$op.(($htmlsearchtitle) ? '&kw='.$htmlsearchtitle : '')); include template('forum/collection_all'); } elseif ($op == 'my') { $mycollection = C::t('forum_collection')->fetch_all_by_uid($_G['uid']); $myctid = array_keys($mycollection); $teamworker = C::t('forum_collectionteamworker')->fetch_all_by_uid($_G['uid']); $twctid = array_keys($teamworker); $follow = C::t('forum_collectionfollow')->fetch_all_by_uid($_G['uid']); if(empty($follow)) { $follow = array(); } $followctid = array_keys($follow); if(!$myctid) { $myctid = array(); } if(!$twctid) { $twctid = array(); } if(!$followctid) { $followctid = array(); } $ctidlist = array_merge($myctid, $twctid, $followctid); if(count($ctidlist) > 0) { $tfcollection = $mycollection + $teamworker + $follow; $collectiondata = C::t('forum_collection')->fetch_all($ctidlist, 'dateline', 'DESC'); $collectiondata = processCollectionData($collectiondata, $tfcollection); } include template('forum/collection_mycollection'); } else { if(!$tid) { $collectiondata = array(); loadcache('collection'); if(TIMESTAMP - $_G['cache']['collection']['dateline'] > 300) { $collection = getHotCollection(500, false); $collectioncache = array('dateline' => TIMESTAMP, 'data' => $collection); savecache('collection', $collectioncache); } else { $collection = &$_G['cache']['collection']['data']; } $count = count($collection); for($i = $start; $i < $start+$cpp; $i++) { if(!$collection[$i]) { continue; } $collectiondata[] = $collection[$i]; } unset($collection); $collectiondata = processCollectionData($collectiondata); } else { $tidrelate = C::t('forum_collectionrelated')->fetch($tid); $ctids = explode("\t", $tidrelate['collection'], -1); $count = count($ctids); $collectiondata = C::t('forum_collection')->fetch_all($ctids, 'follownum', 'DESC', $start, $cpp); $collectiondata = processCollectionData($collectiondata); } $multipage = multi($count, $cpp, $page, 'forum.php?mod=collection'.($tid ? '&tid='.$tid : '')); include template('forum/collection_index'); } ?>