vxIsLogin()) { URL::vxToRedirect(URL::vxGetLogin('/dashboard')); } if ($User->vxIsLogin()) { define('BABEL_LANG', $User->usr_lang); } else { include(BABEL_PREFIX . '/res/supported_languages.php'); if (isset($_SESSION['babel_lang'])) { if (in_array($_SESSION['babel_lang'], array_keys($_languages))) { define('BABEL_LANG', $_SESSION['babel_lang']); } else { define('BABEL_LANG', BABEL_LANG_DEFAULT); } } else { define('BABEL_LANG', BABEL_LANG_DEFAULT); } } $_friends = array(); $sql = "SELECT frd_fid FROM babel_friend WHERE frd_uid = {$User->usr_id}"; $rs = mysql_query($sql); while ($_f = mysql_fetch_array($rs)) { $_friends[] = $_f['frd_fid']; } $_all = $_friends; $_all[] = $User->usr_id; $all_sql = implode(',', $_all); ?> V2EX Dashboard '); } ?>
usr_nick . ' <' . $User->usr_email . '>'); echo(' | 修改个人信息与设置 | 登出'); ?>
V2EX Dashboard
Everything
主题和回复
短消息
朋友们的状态
朋友们在做的事情
我收藏的频道
更多应用
我的个人设置

Everything

Timeline of the latest topics and ING updates of mine and my friends.
发布新消息'); echo('  '); _v_ico_tango_16('actions/appointment-new'); echo(' 创建新事件'); echo('  '); _v_ico_tango_16('actions/view-refresh'); echo(' 刷新'); ?>
usr_id; if ($timeline_cached = $c->load($tag_cache)) { $_timeline = unserialize($timeline_cached); } else { /* Create a new empty array for timeline. */ $_timeline = array(); /* Get 30 new topics and convert them. */ $sql = "SELECT usr_id, usr_nick, usr_gender, usr_portrait, tpc_id, tpc_title, tpc_hits, tpc_posts, tpc_created, nod_id, nod_name, nod_title FROM babel_topic, babel_user, babel_node WHERE tpc_uid IN ({$all_sql}) AND tpc_uid = usr_id AND tpc_pid = nod_id ORDER BY tpc_created DESC LIMIT 30"; $rs = mysql_query($sql) or die ($sql . mysql_error()); while ($_topic = mysql_fetch_array($rs)) { $_timeline[$_topic['tpc_created']] = array(); $_timeline[$_topic['tpc_created']]['type'] = 'topic'; $_timeline[$_topic['tpc_created']]['link'] = '/topic/view/' . $_topic['tpc_id'] . '.html'; $_timeline[$_topic['tpc_created']]['weight'] = Dashboard::vxCalcWeightFromTopic($_topic['tpc_hits'], $_topic['tpc_posts']); $_timeline[$_topic['tpc_created']]['title'] = $_topic['tpc_title']; $_timeline[$_topic['tpc_created']]['usr_nick'] = $_topic['usr_nick']; $_timeline[$_topic['tpc_created']]['img_p'] = ($_topic['usr_portrait'] == '') ? '/img/p_' . $_topic['usr_gender'] . '_n.gif' : '/img/p/' . $_topic['usr_portrait'] . '_n.jpg'; $_timeline[$_topic['tpc_created']]['nod_name'] = $_topic['nod_name']; $_timeline[$_topic['tpc_created']]['nod_title'] = $_topic['nod_title']; } mysql_free_result($rs); /* Get 20 new ING updates and convert them. */ $sql = "SELECT usr_id, usr_nick, usr_gender, usr_portrait, ing_id, ing_doing, ing_created FROM babel_ing_update, babel_user WHERE usr_id = ing_uid AND ing_uid IN ({$all_sql}) ORDER BY ing_created DESC LIMIT 20"; $rs = mysql_query($sql); while ($_ing = mysql_fetch_array($rs)) { $_timeline[$_ing['ing_created']] = array(); $_timeline[$_ing['ing_created']]['type'] = 'ing'; $_timeline[$_ing['ing_created']]['link'] = '/ing-' . $_ing['ing_id'] . '.html'; $_timeline[$_ing['ing_created']]['weight'] = 12; $_timeline[$_ing['ing_created']]['title'] = $_ing['ing_doing']; $_timeline[$_ing['ing_created']]['usr_nick'] = $_ing['usr_nick']; $_timeline[$_ing['ing_created']]['img_p'] = ($_ing['usr_portrait'] == '') ? '/img/p_' . $_ing['usr_gender'] . '_n.gif' : '/img/p/' . $_ing['usr_portrait'] . '_n.jpg'; } /* Sort the timeline. */ krsort($_timeline); $c->save(serialize($_timeline), $tag_cache); } foreach ($_timeline as $time => $event) { echo('
'); switch ($event['type']) { case 'topic': echo('
  ' . make_plaintext($event['usr_nick']) . ' ... ' . make_descriptive_time($time) . '在 ' . make_plaintext($event['nod_title']) . ' 发表了新主题:
'); echo(''); break; case 'ing': echo('
  ' . make_plaintext($event['usr_nick']) . ' ... ' . make_descriptive_time($time) . '说:
'); echo(''); break; } echo('
'); } ?>
© 2007 V2EX
V2EX | Blog | Labs | Developers
V2EX Dashboard is a prototype design of future V2EX frontpage, it changes by time.