$theurl = "userapp.php?view=we"; $f_index = 'dateline'; $_GET['view'] = 'we'; $_G['home_tpl_hidden_time'] = 1; } } $icon = empty($_GET['icon']) ? '' : trim($_GET['icon']); $multi = ''; $feed_list = $appfeed_list = $hiddenfeed_list = $filter_list = $hiddenfeed_num = $icon_num = array(); $count = $filtercount = 0; $query = C::t('home_feed')->fetch_all_by_search(1, $uids, $icon, '', '', '', '', '', $start, $perpage, $f_index); foreach ($query as $value) { $feed_list[$value['icon']][] = $value; $count++; } $multi = simplepage($count, $perpage, $page, $theurl); require_once libfile('function/feed'); $list = $filter_list = array(); foreach ($feed_list as $key => $values) { $nowcount = 0; foreach ($values as $value) { $value = mkfeed($value); $nowcount++; if ($nowcount > 5 && empty($icon)) { break; } $list[$key][] = $value; } } getuserapp(); $my_userapp = array();
$authorid = $_G['uid']; foreach (C::t('forum_thread')->fetch_all_by_fid_authorid_displayorder($mygroupfid, $authorid, $displayorder, $lastpost, $start, $perpage) as $thread) { $groupthreadlist[$thread['tid']]['fid'] = $thread['fid']; $groupthreadlist[$thread['tid']]['subject'] = $thread['subject']; $groupthreadlist[$thread['tid']]['groupname'] = $mygrouplist[$thread['fid']]['name']; $groupthreadlist[$thread['tid']]['views'] = $thread['views']; $groupthreadlist[$thread['tid']]['replies'] = $thread['replies']; $groupthreadlist[$thread['tid']]['lastposter'] = $thread['lastposter']; $groupthreadlist[$thread['tid']]['lastpost'] = dgmdate($thread['lastpost'], 'u'); $groupthreadlist[$thread['tid']]['folder'] = 'common'; if (empty($_G['cookie']['oldtopics']) || strpos($_G['cookie']['oldtopics'], 'D' . $thread['tid'] . 'D') === FALSE) { $groupthreadlist[$thread['tid']]['folder'] = 'new'; } } if ($view == 'mythread') { $multipage = simplepage(count($groupthreadlist), $perpage, $page, 'group.php?mod=my&view=' . $view . $typeurl); } } } } elseif ($view == 'manager' || $view == 'join') { $perpage = 40; $start = ($page - 1) * $perpage; $ismanager = $view == 'manager' ? 1 : 2; $num = mygrouplist($_G['uid'], 'lastupdate', array('f.name', 'ff.icon'), 0, 0, $ismanager, 1); $multipage = multi($num, $perpage, $page, 'group.php?mod=my&view=' . $view); $grouplist = mygrouplist($_G['uid'], 'lastupdate', array('f.name', 'ff.icon'), $perpage, $start, $ismanager); } $frienduidarray = $friendgrouplist = $randgroupdata = $randgrouplist = $randgroup = array(); loadcache('groupindex'); $randgroupdata = $_G['cache']['groupindex']['randgroupdata']; if ($randgroupdata) {
function get_my_threads($viewtype, $fid = 0, $filter = '', $searchkey = '', $start = 0, $perpage = 20, $theurl = '') { global $_G; $fid = $fid ? intval($fid) : null; loadcache('forums'); $dglue = '='; if ($viewtype == 'thread') { $authorid = $_G['uid']; $dglue = '='; if ($filter == 'recyclebin') { $displayorder = -1; } elseif ($filter == 'aduit') { $displayorder = -2; } elseif ($filter == 'ignored') { $displayorder = -3; } elseif ($filter == 'save') { $displayorder = -4; } elseif ($filter == 'close') { $closed = 1; } elseif ($filter == 'common') { $closed = 0; $displayorder = 0; $dglue = '>='; } $gids = $fids = $forums = array(); foreach (C::t('forum_thread')->fetch_all_by_authorid_displayorder($authorid, $displayorder, $dglue, $closed, $searchkey, $start, $perpage, null, $fid) as $tid => $value) { if (!isset($_G['cache']['forums'][$value['fid']])) { $gids[$value['fid']] = $value['fid']; } else { $forumnames[$value['fid']] = array('fid' => $value['fid'], 'name' => $_G['cache']['forums'][$value['fid']]['name']); } $list[$value['tid']] = guide_procthread($value); } if (!empty($gids)) { $gforumnames = C::t('forum_forum')->fetch_all_name_by_fid($gids); foreach ($gforumnames as $fid => $val) { $forumnames[$fid] = $val; } } $listcount = count($list); } elseif ($viewtype == 'postcomment') { require_once libfile('function/post'); $pids = $tids = array(); $postcommentarr = C::t('forum_postcomment')->fetch_all_by_authorid($_G['uid'], $start, $perpage); foreach ($postcommentarr as $value) { $pids[] = $value['pid']; $tids[] = $value['tid']; } $pids = C::t('forum_post')->fetch_all(0, $pids); $tids = C::t('forum_thread')->fetch_all($tids); $list = $fids = array(); foreach ($postcommentarr as $value) { $value['authorid'] = $pids[$value['pid']]['authorid']; $value['fid'] = $pids[$value['pid']]['fid']; $value['invisible'] = $pids[$value['pid']]['invisible']; $value['dateline'] = $pids[$value['pid']]['dateline']; $value['message'] = $pids[$value['pid']]['message']; $value['special'] = $tids[$value['tid']]['special']; $value['status'] = $tids[$value['tid']]['status']; $value['subject'] = $tids[$value['tid']]['subject']; $value['digest'] = $tids[$value['tid']]['digest']; $value['attachment'] = $tids[$value['tid']]['attachment']; $value['replies'] = $tids[$value['tid']]['replies']; $value['views'] = $tids[$value['tid']]['views']; $value['lastposter'] = $tids[$value['tid']]['lastposter']; $value['lastpost'] = $tids[$value['tid']]['lastpost']; $value['icon'] = $tids[$value['tid']]['icon']; $value['tid'] = $pids[$value['pid']]['tid']; $fids[] = $value['fid']; $value['comment'] = messagecutstr($value['comment'], 100); $list[] = guide_procthread($value); } unset($pids, $tids, $postcommentarr); if ($fids) { $fids = array_unique($fids); $forumnames = C::t('forum_forum')->fetch_all_name_by_fid($gids); } $listcount = count($list); } else { $invisible = null; if ($filter == 'recyclebin') { $invisible = -5; } elseif ($filter == 'aduit') { $invisible = -2; } elseif ($filter == 'save' || $filter == 'ignored') { $invisible = -3; $displayorder = -4; } elseif ($filter == 'close') { $closed = 1; } elseif ($filter == 'common') { $invisible = 0; $displayorder = 0; $dglue = '>='; $closed = 0; } require_once libfile('function/post'); $posts = C::t('forum_post')->fetch_all_by_authorid(0, $_G['uid'], true, 'DESC', $start, $perpage, null, $invisible, $fid, $followfid); $listcount = count($posts); foreach ($posts as $pid => $post) { $tids[$post['tid']][] = $pid; $post['message'] = !getstatus($post['status'], 2) || $post['authorid'] == $_G['uid'] ? messagecutstr($post['message'], 100) : ''; $posts[$pid] = $post; } if (!empty($tids)) { $threads = C::t('forum_thread')->fetch_all_by_tid_displayorder(array_keys($tids), $displayorder, $dglue, array(), $closed); foreach ($threads as $tid => $thread) { if (!isset($_G['cache']['forums'][$thread['fid']])) { $gids[$thread['fid']] = $thread['fid']; } else { $forumnames[$thread[fid]] = array('fid' => $thread['fid'], 'name' => $_G['cache']['forums'][$thread[fid]]['name']); } $threads[$tid] = guide_procthread($thread); } if (!empty($gids)) { $groupforums = C::t('forum_forum')->fetch_all_name_by_fid($gids); foreach ($groupforums as $fid => $val) { $forumnames[$fid] = $val; } } $list = array(); foreach ($tids as $key => $val) { $list[$key] = $threads[$key]; } unset($threads); } } $multi = simplepage($listcount, $perpage, $_G['page'], $theurl); return array('forumnames' => $forumnames, 'threadcount' => $listcount, 'threadlist' => $list, 'multi' => $multi, 'tids' => $tids, 'posts' => $posts); }
} } } foreach ($list as $key => $val) { if (!$forums[$val['fid']] || $val['closed'] > 1) { unset($list[$key]); $hiddennum++; } } if ($_G['gp_view'] == 'all') { $_G['cache']['space_thread'][$alltype] = array('dateline' => $_G['timestamp'], 'hiddennum' => $hiddennum, 'forums' => $forums, 'data' => $list); save_syscache('space_thread', $_G['cache']['space_thread']); } } if ($_G['gp_view'] != 'all') { $multi = simplepage(count($list) + $hiddennum, $perpage, $page, $theurl); } } dsetcookie('home_diymode', $diymode); if ($_G['uid']) { $_G['gp_view'] = !$_G['gp_view'] ? 'we' : $_G['gp_view']; $navtitle = lang('core', 'title_' . $_G['gp_view'] . '_thread'); } else { $navtitle = lang('core', 'title_thread'); } if ($space['username']) { $navtitle = lang('space', 'sb_thread', array('who' => $space['username'])); } $metakeywords = $navtitle; $metadescription = $navtitle; include_once template("diy:home/space_thread");
} $mythreadsql = $view == 'mythread' ? " AND authorid='{$_G['uid']}'" : ''; if (!empty($attentiongroupfid) && !empty($mygroupfid)) { $mygroupfid = array_diff($mygroupfid, explode(',', $attentiongroupfid)); } if ($mygroupfid) { $query = DB::query("SELECT fid, tid, subject, lastpost, lastposter, views, replies FROM " . DB::table('forum_thread') . " WHERE fid IN (" . dimplode($mygroupfid) . ") AND displayorder>='0' {$mythreadsql} ORDER BY lastpost DESC LIMIT {$start}, {$perpage}"); while ($thread = DB::fetch($query)) { $groupthreadlist[$thread['tid']]['fid'] = $thread['fid']; $groupthreadlist[$thread['tid']]['subject'] = $thread['subject']; $groupthreadlist[$thread['tid']]['groupname'] = $mygrouplist[$thread['fid']]['name']; $groupthreadlist[$thread['tid']]['views'] = $thread['views']; $groupthreadlist[$thread['tid']]['replies'] = $thread['replies']; $groupthreadlist[$thread['tid']]['lastposter'] = $thread['lastposter']; $groupthreadlist[$thread['tid']]['lastpost'] = dgmdate($thread['lastpost'], 'u'); $groupthreadlist[$thread['tid']]['folder'] = 'common'; if (empty($_G['cookie']['oldtopics']) || strpos($_G['cookie']['oldtopics'], 'D' . $thread['tid'] . 'D') === FALSE) { $groupthreadlist[$thread['tid']]['folder'] = 'new'; } } $multipage = simplepage(count($groupthreadlist), $perpage, $page, 'home.php?mod=space&do=group&view=' . $view . $typeurl); } } } elseif ($view == 'manager' || $view == 'join') { $perpage = 40; $ismanager = $view == 'manager' ? 1 : 2; $num = mygrouplist($_G['uid'], 'lastupdate', array('f.name', 'ff.icon'), 0, 0, $ismanager, 1); $multipage = multi($num, $perpage, $page, 'home.php?mod=space&do=group&view=' . $view); $grouplist = mygrouplist($_G['uid'], 'lastupdate', array('f.name', 'ff.icon'), $perpage, $start, $ismanager); } include_once template("diy:home/space_group");