Beispiel #1
0
     }
     $view->display('index.tpl');
     break;
 case 'view':
     $id = intval(trim($_GET['id']));
     if (!($logs_list = $content->load('logs_list'))) {
         $show = new Show();
         $logs_list = $show->getById($id);
         $reply_list = $show->getReply($id);
         $logs_list[0]['content'] = format_ubb($logs_list[0]['content']);
         $related = $show->getRelated($logs_list[0]['tags']);
         for ($i = 0; $i < count($related); $i++) {
             $related[$i][lastmodify] = make_descriptive_time($related[$i][lastmodify]);
         }
         for ($i = 0; $i < count($reply_list); $i++) {
             $reply_list[$i][create] = make_descriptive_time($reply_list[$i][create]);
         }
         //print_r($related);
         $view->assign('logs', $logs_list);
         $view->assign('reply', $reply_list);
         $view->assign('count_of_reply', count($reply_list));
         $view->assign('pid', $id);
         $view->assign('related', $related);
         $view->assign('relatedColor', rand_color(true));
         $content->save($logs_list, 'logs_list');
     } else {
         $view->assign('logs', $logs_list);
     }
     //print_r($logs_list);
     $view->assign(array('tags_name' => $logs_list[0][tags], 'topic_name' => $logs_list[0][title], 'topic_id' => $logs_list[0][id]));
     $view->display('view.tpl');
 public function vxView()
 {
     if ($this->User->vxIsLogin()) {
         if (isset($_GET['message_id'])) {
             $message_id = intval($_GET['message_id']);
             if ($this->Validator->vxExistMessage($message_id)) {
                 $Message = new Message($message_id, $this->db);
                 $mode = '';
                 if ($Message->msg_sid == $this->User->usr_id) {
                     if ($Message->msg_draft == 1) {
                         $mode = 'draft';
                     } else {
                         $mode = 'sent';
                     }
                 } else {
                     if ($Message->msg_rid == $this->User->usr_id) {
                         $mode = 'inbox';
                     } else {
                         $mode = 'mismatch';
                     }
                 }
                 if ($mode == 'mismatch') {
                     $this->vxHome();
                 } else {
                     switch ($mode) {
                         case 'inbox':
                             $Sender = $this->User->vxGetUserInfo($Message->msg_sid);
                             $this->vxHead($msgSiteTitle = '收件箱');
                             $this->vxBodyStart();
                             $this->vxToolbar();
                             echo '<div id="main">';
                             echo '<div id="msg"><span class="text">';
                             echo '<table cellpadding="0" cellspacing="0" border="0" class="msg">';
                             echo '<tr>';
                             echo '<td width="150" height="20">来自于 - ' . make_plaintext($Sender->usr_nick) . '</td><td width="220" height="20" align="right">接收时间 - ' . make_descriptive_time($Message->msg_sent) . '</td>';
                             echo '</tr>';
                             echo '<tr>';
                             echo '<td height="20" colspan="2" align="right"><small class="tip">';
                             if ($Message->msg_opened == 0) {
                                 $t = time();
                                 $sql = "UPDATE babel_message SET msg_hits = msg_hits + 1, msg_opened = {$t}, msg_lastaccessed = {$t} WHERE msg_id = {$Message->msg_id}";
                                 mysql_query($sql, $this->db);
                                 echo '这是你第 1 次打开这条消息!';
                             } else {
                                 $t = time();
                                 $sql = "UPDATE babel_message SET msg_hits = msg_hits + 1, msg_lastaccessed = {$t} WHERE msg_id = {$Message->msg_id} LIMIT 1";
                                 mysql_query($sql, $this->db);
                                 echo '这是你第 ' . ($Message->msg_hits + 1) . ' 次打开这条消息';
                             }
                             echo '</small></td>';
                             echo '</tr>';
                             echo '</table>';
                             echo $Message->msg_body;
                             echo '</span>';
                             echo '</div>';
                             if (isset($_SERVER['HTTP_REFERER'])) {
                                 if (trim($_SERVER['HTTP_REFERER']) != '') {
                                     $url_return = $_SERVER['HTTP_REFERER'];
                                 } else {
                                     $url_return = '/message/inbox.vx';
                                 }
                             } else {
                                 $url_return = '/message/inbox.vx';
                             }
                             echo '<div id="tool">';
                             echo '<a href="' . $url_return . '" class="tool">&lt; 返回</a>';
                             echo '<a href="#;" onclick="if (confirm(' . "'删除之后将无法恢复,你确认吗?'" . ')) { location.href=' . "'/message/remove/{$Message->msg_id}.vx'; }" . '" class="tool">X 删除</a>';
                             echo '<a href="/message/compose/' . $Message->msg_sid . '.vx" class="tool">回复 &gt;</a>';
                             echo '</div>';
                             echo '</div>';
                             $this->vxBottom();
                             $this->vxBodyEnd();
                             $Sender = null;
                             break;
                         case 'sent':
                             $Receiver = $this->User->vxGetUserInfo($Message->msg_rid);
                             $this->vxHead($msgSiteTitle = '已发送');
                             $this->vxBodyStart();
                             $this->vxToolbar();
                             echo '<div id="main">';
                             echo '<div id="msg"><span class="text">';
                             echo '<table cellpadding="0" cellspacing="0" border="0" class="msg">';
                             echo '<tr>';
                             echo '<td width="150" height="20">发送到 - ' . make_plaintext($Receiver->usr_nick) . '</td><td width="220" height="20" align="right">发送时间 - ' . make_descriptive_time($Message->msg_sent) . '</td>';
                             echo '</tr>';
                             echo '<tr>';
                             echo '<td height="20" colspan="2" align="right"><small class="tip">';
                             if ($Message->msg_opened == 0) {
                                 echo '对方尚未打开这条短消息';
                             } else {
                                 echo '对方在 ' . make_descriptive_time($Message->msg_lastaccessed) . '打开过这条短消息,共看过 ' . $Message->msg_hits . ' 次';
                             }
                             echo '</small></td>';
                             echo '</tr>';
                             echo '</table>';
                             echo $Message->msg_body;
                             echo '</span>';
                             echo '</div>';
                             if (isset($_SERVER['HTTP_REFERER'])) {
                                 $url_return = $_SERVER['HTTP_REFERER'];
                             } else {
                                 $url_return = '/message/sent.vx';
                             }
                             echo '<div id="tool">';
                             echo '<a href="' . $url_return . '" class="tool">&lt; 返回</a>';
                             echo '<a href="#;" onclick="if (confirm(' . "'删除之后将无法恢复,你确认吗?'" . ')) { location.href=' . "'/message/remove/{$Message->msg_id}.vx'; }" . '" class="tool">X 删除</a>';
                             echo '</div>';
                             echo '</div>';
                             $this->vxBottom();
                             $this->vxBodyEnd();
                             $Receiver = null;
                             break;
                         default:
                             $this->vxHome();
                             break;
                     }
                 }
             } else {
                 $this->vxHome();
             }
         } else {
             $this->vxHome();
         }
     } else {
         $this->vxDenied();
     }
 }
 public function vxLogin()
 {
     $rt = $this->Validator->vxLoginCheck();
     if (strtoupper($_SERVER['REQUEST_METHOD']) == 'GET') {
         $this->vxHeader(Vocabulary::action_login);
         $this->vxBodyStart();
         $this->vxH1();
         echo '<div class="content"><small><a href="/' . $_SESSION['babel_page_home_mobile'] . '">' . Vocabulary::site_name . '</a> &gt; ' . Vocabulary::action_login . '</small></div>';
         echo '<div class="form">';
         echo '<form action="/babel_mobile.php?m=login" method="post">';
         echo '用户: <input type="text" name="usr" class="textbox" /><br />';
         echo '密码: <input type="password" name="usr_password" class="textbox" /><br />';
         echo '<input type="submit" value="登 录" class="go" />';
         if (strlen($rt['return']) > 0) {
             echo '<input type="hidden" name="return" value="' . make_single_return($rt['return']) . '" />';
         }
         echo '</form>';
         echo '</div>';
         $this->vxBottom();
         $this->vxBodyEnd();
         $this->vxHTMLEnd();
     } else {
         if ($rt['target'] == 'ok') {
             $this->User = new User($rt['usr_email_value'], sha1($rt['usr_password_value']), $this->db);
             $this->User->vxUpdateLogin();
             /* start the session now */
             $this->User->vxSessionStart();
             if ($this->User->vxIsLogin()) {
                 if (isset($rt['return'])) {
                     if (mb_strlen($rt['return'], 'UTF-8') > 0) {
                         $this->URL->vxToRedirect($rt['return']);
                     }
                 }
             }
         }
         $this->vxHeader(Vocabulary::action_login);
         $this->vxBodyStart();
         $this->vxH1();
         switch ($rt['target']) {
             default:
             case 'welcome':
                 if (isset($_GET['r'])) {
                     if (get_magic_quotes_gpc()) {
                         $rt['return'] = make_single_safe(stripslashes($_GET['r']));
                     } else {
                         $rt['return'] = make_single_safe($_GET['r']);
                     }
                 } else {
                     $rt['return'] = '';
                 }
                 echo '<div class="content"><small><a href="/' . $_SESSION['babel_page_home_mobile'] . '">' . Vocabulary::site_name . '</a> &gt; ' . Vocabulary::action_login . '</small></div>';
                 echo '<div class="form">';
                 echo '<form action="/babel_mobile.php?m=login" method="post">';
                 echo '用户: <input type="text" name="usr" class="textbox" /><br />';
                 echo '密码: <input type="password" name="usr_password" class="textbox" /><br />';
                 echo '<input type="submit" value="登 录" class="go" />';
                 if (strlen($rt['return']) > 0) {
                     echo '<input type="hidden" name="return" value="' . make_single_return($rt['return']) . '" />';
                 }
                 echo '</form>';
                 echo '</div>';
                 break;
             case 'ok':
                 echo '<div class="content"><small>';
                 echo '<a href="/u/' . urlencode($this->User->usr_nick) . '">' . make_plaintext($this->User->usr_nick) . '</a> - ';
                 echo '<a href="/babel_mobile.php?m=logout">登出</a>';
                 echo '</small></div>';
                 echo '<div class="content">欢迎回到 <a href="/' . $_SESSION['babel_page_home_mobile'] . '">' . Vocabulary::site_name . '</a>,你上次登录时间是在 ' . make_descriptive_time($this->User->usr_lastlogin) . '。</div>';
                 break;
             case 'error':
                 echo '<div class="content"><small><a href="/' . $_SESSION['babel_page_home_mobile'] . '">' . Vocabulary::site_name . '</a> &gt; ' . Vocabulary::action_login . '</small></div>';
                 echo '<div class="form">';
                 echo '<form action="/babel_mobile.php?m=login" method="post"><small class="error">密码或者用户名错误</small><br />';
                 echo '用户: <input type="text" name="usr" class="textbox" /><br />';
                 echo '密码: <input type="password" name="usr_password" class="textbox" /><br />';
                 echo '<input type="submit" value="登 录" class="go" />';
                 if (strlen($rt['return']) > 0) {
                     echo '<input type="hidden" name="return" value="' . make_single_return($rt['return']) . '" />';
                 }
                 echo '</form>';
                 echo '</div>';
                 break;
         }
         $this->vxBottom();
         $this->vxBodyEnd();
         $this->vxHTMLEnd();
     }
 }
Beispiel #4
0
 public function online_details($onl_created, $onl_lastmoved)
 {
     return '于 ' . make_descriptive_time($onl_created) . '进入 ' . Vocabulary::site_name . ',最后活动时间是在 ' . make_descriptive_time($onl_lastmoved);
 }
Beispiel #5
0
 public function vxIngPersonal($User)
 {
     /* start: how many pages */
     $sql = "SELECT COUNT(*) FROM babel_ing_update WHERE ing_uid = {$User->usr_id}";
     $count_total = mysql_result(mysql_query($sql), 0, 0);
     $size = BABEL_ING_PAGE;
     if ($count_total > BABEL_ING_PAGE) {
         if (isset($_GET['p'])) {
             $p = intval($_GET['p']);
             if ($p < 1) {
                 $p = 1;
             }
         } else {
             $p = 1;
         }
         $pages = $count_total % BABEL_ING_PAGE == 0 ? intval($count_total / BABEL_ING_PAGE) : floor($count_total / BABEL_ING_PAGE) + 1;
         if ($p > $pages) {
             $p = $pages;
         }
         $start = ($p - 1) * BABEL_ING_PAGE;
     } else {
         $pages = 1;
         $start = 0;
         $p = 1;
     }
     /* end: how many pages */
     if ($User->usr_id == $this->User->usr_id) {
         $flag_self = true;
     } else {
         $flag_self = false;
     }
     _v_ing_style_personal();
     _v_m_s();
     _v_b_l_s();
     _v_ico_map();
     echo ' <a href="/">' . Vocabulary::site_name . '</a> &gt <a href="/u/' . $User->usr_nick_url . '">' . $User->usr_nick_plain . '</a> &gt ING <span class="tip_i"><small>alpha</small></span>';
     _v_d_e();
     /* S: data here!!! */
     include BABEL_PREFIX . '/res/ing_sources.php';
     $t = time() - 86400;
     $sql = "SELECT ing_id, ing_uid, ing_doing, ing_doing, ing_source, ing_created, usr_id, usr_nick, usr_gender, usr_portrait FROM babel_ing_update, babel_user WHERE usr_id = ing_uid AND ing_uid = {$User->usr_id} ORDER BY ing_created DESC LIMIT {$start}, {$size}";
     $rs_updates = mysql_query($sql);
     $count = mysql_num_rows($rs_updates);
     if ($count == 0) {
         if ($flag_self) {
             $hack_height = 'height: 350px; ';
         } else {
             $hack_height = 'height: 240px; ';
         }
     } else {
         if ($count < 5) {
             $hack_height = 'height: 360px; ';
         } else {
             $hack_height = '';
         }
     }
     /* E: data here!!! */
     echo '<div class="blank" align="left" style="' . $hack_height . '">';
     echo '<div style="float: right; padding: 3px 10px 3px 10px; font-size: 10px; background-color: #F0F0F0; -moz-border-radius: 5px; color: #999;">';
     echo $User->usr_nick_plain . ' | <a href="/ing/' . $User->usr_nick_url . '/friends">With Friends</a> | <a href="/ing">Everyone</a>';
     /*if ($this->User->vxIsLogin()) {
     			echo('&nbsp;&nbsp;<a href="/fav/ing">' . _vo_ico_silk('heart') . '</a>');
     		}*/
     echo '&nbsp;&nbsp;<a href="/feed/ing/' . $User->usr_nick_url . '">' . _vo_ico_silk('feed') . '</a>';
     echo '</div>';
     echo '<span class="text_large">';
     _v_ico_silk('hourglass');
     echo ' ING</span>';
     if ($flag_self) {
         _v_hr();
         echo '<div align="center">';
         echo '<form action="/recv/ing.vx" id="ing_personal" method="POST" onsubmit="return checkIngForm();">';
         echo '<div style="background-image: url(' . "'/img/bg_ing.gif'" . '); padding-top: 3px; width: 320px; height: 35px;"><input onkeyup="checkIngType(' . "'doing', 'ing_status'" . ');" type="text" class="sll" id="doing" name="doing" maxlength="131" /></div> ';
         _v_btn_f($this->lang->update(), 'ing_personal');
         echo '<div id="ing_status" style="padding-top: 10px;"><span class="tip_i"><small>131 characters remaining</small></span></div>';
         echo '<input type="hidden" name="return" value="/ing/' . urlencode($this->User->usr_nick) . '" />';
         echo '</form>';
         echo '</div>';
     } else {
     }
     _v_hr();
     /* S: right user badge */
     echo '<div style="min-width: 170px; max-width: 180px; padding: 5px 0px 5px 0px; background-color: #FFF; float: right;"><img src="' . $User->img_p_s . '" align="left" style="margin-right: 10px;" class="portrait" /> <span class="tip_i">all about</span><h1 class="ititle" style="margin-bottom: 5px; display: block;"><a href="/u/' . $User->usr_nick_url . '">' . $User->usr_nick_plain . '</a></h1>';
     $sql = "SELECT ing_doing, ing_created FROM babel_ing_update WHERE ing_uid = {$User->usr_id} ORDER BY ing_created DESC LIMIT 1";
     $rs = mysql_query($sql);
     if ($_up = mysql_fetch_array($rs)) {
         _v_hr();
         echo '<span class="tip_i"><small>Currently:</small></span>';
         echo '<blockquote style="padding: 5px 5px 5px 20px; margin: 0px; border: none;">' . format_ubb($_up['ing_doing']) . '</blockquote>';
         echo '<div align="right"><small class="fade">Updated ' . make_desc_time($_up['ing_created']) . ' ago</small></div>';
     } else {
         _v_hr();
         echo '<span class="tip_i"><small>Currently:</small></span>';
         echo '<blockquote style="padding: 5px 5px 5px 20px; margin: 0px; border: none;">(void)</blockquote>';
     }
     mysql_free_result($rs);
     if ($User->usr_brief_plain != '') {
         _v_hr();
         echo '<span class="tip_i">' . $User->usr_brief_plain . '</span>';
     }
     _v_hr();
     if ($stats = $this->cl->load('babel_ing_stats_brief_' . $User->usr_id)) {
     } else {
         $stats = '';
         $stats .= '<span class="tip"><small>';
         $stats .= '&#187; <a href="/ing/' . $User->usr_nick_url . '" class="regular">' . $count_total . '</a> updates<br /><br />';
         $sql = 'SELECT COUNT(*) FROM babel_friend WHERE frd_uid = ' . $User->usr_id;
         $count_friends = mysql_result(mysql_query($sql), 0, 0);
         $stats .= '&#187; <a href="/u/' . $User->usr_nick_url . '#friends" class="regular">' . $count_friends . '</a> friends<br /><br />';
         $sql = 'SELECT COUNT(*) FROM babel_friend WHERE frd_fid = ' . $User->usr_id;
         $count_fans = mysql_result(mysql_query($sql), 0, 0);
         $stats .= '&#187; <a href="/who/connect/' . $User->usr_nick_url . '" class="regular">' . $count_fans . '</a> fans';
         $stats .= '</small></span>';
         $this->cl->save($stats, 'babel_ing_stats_brief_' . $User->usr_id);
     }
     echo $stats;
     _v_d_e();
     /* E: right user badge */
     echo '<div>';
     make_pages($pages, $p, '/ing/' . $User->usr_nick_url . '/page/', '');
     $i = 0;
     while ($_up = mysql_fetch_array($rs_updates)) {
         $i++;
         $css_class = $i % 2 == 0 ? 'even' : 'odd';
         $img_p = $_up['usr_portrait'] ? CDN_IMG . 'p/' . $_up['usr_portrait'] . '_s.jpg' : CDN_IMG . 'p_' . $_up['usr_gender'] . '_s.gif';
         echo '<div style="width: 61.8%; min-width: 200px; max-width: 800px;" class="entry_' . $css_class . '">';
         //echo('<img src="' . $img_p . '" align="absmiddle" alt="' . make_single_return($_up['usr_nick']) . '" class="portrait" /> ');
         //echo('<a href="/u/' . urlencode($_up['usr_nick']) . '" class="t">' . make_plaintext($_up['usr_nick']) . '</a> ');
         echo format_ubb(trim($_up['ing_doing'])) . ' <span class="tip_i">' . make_descriptive_time($_up['ing_created']) . '</span> <span class="tip"><small>from ' . $_sources[$_up['ing_source']] . '</small></span> ';
         if ($flag_self) {
             echo '<a href="/erase/ing/' . $_up['ing_id'] . '.vx"><img src="/img/ing_trash.gif" align="absmiddle" alt="del" border="0" /></a>';
         }
         /*
         			if ($this->User->vxIsLogin()) {
         				echo(' <a href="/fav/ing/' . $_up['ing_id'] . '.vx"><img src="/img/ing_fav.gif" align="absmiddle" alt="fav" border="0" /></a>');
         			}*/
         _v_d_e();
     }
     mysql_free_result($rs_updates);
     make_pages($pages, $p, '/ing/' . $User->usr_nick_url . '/page/', '');
     if ($i > 0) {
         _v_hr();
         echo '<span class="tip_i">';
         _v_ico_silk('feed');
         echo ' <a href="/feed/ing/' . $User->usr_nick_url . '">RSS / ' . $User->usr_nick_plain . ' 的最新状态</a>';
         echo ' | ';
         _v_ico_silk('html');
         echo ' <a href="#;" onclick="openOJSIngPersonal(' . "'{$this->User->usr_nick_url}'" . ')">JavaScript 输出到你的网站</a>';
         echo ' | ';
         _v_ico_silk('computer');
         echo ' <a href="http://code.google.com/p/ingc" target="_blank">通过 INGC 来更新 <img src="/img/ext.png" align="absmiddle" border="0" /></a>';
         echo '</span>';
     }
     _v_d_e();
     if ($i == 0) {
         _v_ico_silk('exclamation');
         echo ' <a href="/u/' . $User->usr_nick_url . '">' . $User->usr_nick_plain . '</a> 目前还没有任何更新 ...';
     }
     if ($flag_self) {
         echo '<img src="/img/spacer.gif" onload="getObj(' . "'doing'" . ').focus();" style="display: none;" />';
     }
     _v_d_e();
     Widget::vxIngAbout();
     _v_d_e();
 }
 public function vxJSONHomeTabSection()
 {
     if (!isset($_GET['section_id'])) {
         $this->vxJSONHomeTabLatest();
     } else {
         $section_id = intval($_GET['section_id']);
         $_data = new stdClass();
         $Node = new Node($section_id, $this->db);
         if ($Node->nod_id != 0) {
             $_data->node = new stdClass();
             $_data->node->nod_id = $Node->nod_id;
             $_data->node->nod_name = $Node->nod_name;
             $_data->node->nod_title = $Node->nod_title;
             $_data->node->nod_title_plain = make_plaintext($Node->nod_title);
         }
         $Node = null;
         $sql = 'SELECT nod_id, nod_name, nod_title, nod_topics FROM babel_node WHERE nod_sid = ' . $section_id . ' ORDER BY nod_topics DESC LIMIT 8';
         $rs = mysql_query($sql, $this->db);
         if (mysql_num_rows($rs) > 0) {
             $_SESSION['babel_home_tab'] = 'section:' . $_data->node->nod_id . ':' . $_data->node->nod_name;
         } else {
             $_SESSION['babel_home_tab'] = 'latest';
         }
         $_data->boards = array();
         $i = 0;
         while ($Node = mysql_fetch_object($rs)) {
             $i++;
             $_data->boards[$i] = new stdClass();
             $_data->boards[$i]->nod_id = $Node->nod_id;
             $_data->boards[$i]->nod_name = $Node->nod_name;
             $_data->boards[$i]->nod_title = $Node->nod_title;
             $_data->boards[$i]->nod_title_plain = make_plaintext($Node->nod_title);
             $_data->boards[$i]->nod_topics = $Node->nod_topics;
             $_data->boards[$i]->color = rand_color();
             $Node = null;
         }
         mysql_free_result($rs);
         $sql = 'SELECT usr_id, usr_nick, usr_gender, usr_portrait, tpc_id, tpc_title, tpc_posts, tpc_created, tpc_lasttouched, nod_id, nod_title, nod_name FROM babel_user, babel_topic, babel_node WHERE tpc_uid = usr_id AND tpc_pid = nod_id AND nod_sid = ' . $section_id . ' AND tpc_flag IN (0, 2) AND tpc_pid NOT IN ' . BABEL_NODES_POINTLESS . ' ORDER BY tpc_lasttouched DESC LIMIT 20';
         $rs = mysql_query($sql, $this->db);
         $_data->topics = array();
         $i = 0;
         while ($Topic = mysql_fetch_object($rs)) {
             $i++;
             $_data->topics[$i] = new stdClass();
             $_data->topics[$i]->usr_id = $Topic->usr_id;
             $_data->topics[$i]->usr_nick = $Topic->usr_nick;
             $_data->topics[$i]->usr_nick_plain = make_plaintext($Topic->usr_nick);
             $_data->topics[$i]->usr_gender = $Topic->usr_gender;
             $_data->topics[$i]->usr_portrait = $Topic->usr_portrait;
             $_data->topics[$i]->usr_portrait_img = $Topic->usr_portrait ? CDN_IMG . 'p/' . $Topic->usr_portrait . '_n.jpg' : CDN_IMG . 'p_' . $Topic->usr_gender . '_n.gif';
             $_data->topics[$i]->tpc_id = $Topic->tpc_id;
             $_data->topics[$i]->tpc_title = $Topic->tpc_title;
             $_data->topics[$i]->tpc_title_plain = make_plaintext($Topic->tpc_title);
             $_data->topics[$i]->tpc_posts = $Topic->tpc_posts;
             $_data->topics[$i]->tpc_created = $Topic->tpc_created;
             $_data->topics[$i]->tpc_created_relative = make_descriptive_time($Topic->tpc_created);
             $_data->topics[$i]->tpc_lasttouched = $Topic->tpc_lasttouched;
             $_data->topics[$i]->tpc_lasttouched_relative = make_descriptive_time($Topic->tpc_lasttouched);
             $_data->topics[$i]->nod_id = $Topic->nod_id;
             $_data->topics[$i]->nod_title = $Topic->nod_title;
             $_data->topics[$i]->nod_title_plain = make_plaintext($Topic->nod_title);
             $_data->topics[$i]->nod_name = $Topic->nod_name;
             if ($Topic->tpc_posts > 5) {
                 $_data->topics[$i]->color = rand_color();
             } else {
                 $_data->topics[$i]->color = rand_gray(2, 4);
             }
             $Topic = null;
         }
         mysql_free_result($rs);
         header('Content-type: text/plain; charset=utf-8');
         header('Cache-control: no-cache, must-revalidate');
         if (function_exists('json_encode')) {
             $encoded = json_encode($_data);
         } else {
             $encoded = Zend_Json::encode($_data);
         }
         echo $encoded;
     }
 }
Beispiel #7
0
 public function vxFeedIngPersonal($User)
 {
     $this->s->assign('site_url', 'http://' . BABEL_DNS_NAME . '/ing/' . $User->usr_nick_url);
     $sql = "SELECT ing_id, ing_doing, ing_source, ing_created FROM babel_ing_update WHERE ing_uid = {$User->usr_id} ORDER BY ing_created DESC LIMIT 10";
     $rs = mysql_query($sql);
     $Updates = array();
     $i = 0;
     while ($Update = mysql_fetch_object($rs)) {
         $i++;
         $Updates[$i] = $Update;
         $Updates[$i]->ing_doing_title = htmlspecialchars(make_plaintext(format_ubb($Updates[$i]->ing_doing, false)), ENT_NOQUOTES);
         $Updates[$i]->ing_doing = htmlspecialchars('<img src="' . $User->img_p_n . '" align="left" style="background-color: #FFF; padding: 2px; margin: 0px 5px 5px 0px; border: 1px solid #CCC;" />&nbsp;' . format_ubb($Updates[$i]->ing_doing), ENT_NOQUOTES) . ' - ' . make_descriptive_time($Update->ing_created);
         $Updates[$i]->ing_pubdate = date('r', $Updates[$i]->ing_created);
         $Updates[$i]->entry_link = 'http://' . BABEL_DNS_NAME . '/ing-' . $Update->ing_id . '.html';
     }
     $this->s->assign('user', $User);
     $this->s->assign('feed_title', $User->usr_nick_plain . " 在做什么");
     $this->s->assign('feed_description', $User->usr_nick_plain . ' 的最新活动');
     $this->s->assign('feed_category', $User->usr_nick_plain);
     $this->s->assign('a_updates', $Updates);
     $this->s->display('feed/rss2_ing_personal.smarty');
 }
        $_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 '<div class="object">';
    switch ($event['type']) {
        case 'topic':
            echo '<div class="head"><img src="' . $event['img_p'] . '" align="absmiddle" border="0" />&nbsp;&nbsp;<a href="/u/' . urlencode($event['usr_nick']) . '" class="var" style="color: ' . rand_color() . '; font-weight: bold;">' . make_plaintext($event['usr_nick']) . '</a><span class="tip"> ... ' . make_descriptive_time($time) . '在 <a href="/go/' . urlencode($event['nod_name']) . '" class="var" style="color: ' . rand_color() . '; font-weight: bold;">' . make_plaintext($event['nod_title']) . '</a> 发表了新主题:</span></div>';
            echo '<div class="body"><a href="' . $event['link'] . '" style="font-size: ' . $event['weight'] . 'px">' . make_plaintext($event['title']) . '</a></div>';
            break;
        case 'ing':
            echo '<div class="head"><img src="' . $event['img_p'] . '" align="absmiddle" border="0" />&nbsp;&nbsp;<a href="/u/' . urlencode($event['usr_nick']) . '" class="var" style="color: ' . rand_color() . '; font-weight: bold;">' . make_plaintext($event['usr_nick']) . '</a><span class="tip"> ... ' . make_descriptive_time($time) . '说:</span></div>';
            echo '<div class="body"><a href="' . $event['link'] . '" style="font-size: ' . $event['weight'] . 'px">' . format_ubb($event['title']) . '</a></div>';
            break;
    }
    echo '</div>';
}
?>
	</div>
</div>
</div>
<div id="bottom">
	<div id="bottom_inside">
		&copy; 2007 V2EX<br />
		<a href="http://www.v2ex.com/" class="white">V2EX</a> | <a href="http://www.livid.cn/" class="white">Blog</a> | <a href="http://labs.v2ex.com/" class="white">Labs</a> | <a href="http://code.google.com/" class="white">Developers</a><br />
		<small>V2EX Dashboard is a prototype design of future V2EX frontpage, it changes by time.</small>
	</div>
Beispiel #9
0
 $tag = strval(trim($_GET['tag']));
 $tag = urldecode($tag);
 $view->assign('tags_name', $tag);
 if (!($tags_list = $content->load('tags_list'))) {
     $show = new Show();
     if (ROOT) {
         $tags_list = $show->getByTags($tag, true);
     } else {
         $tags_list = $show->getByTags($tag);
     }
     for ($i = 0; $i < count($tags_list); $i++) {
         $id = $tags_list[$i][id];
         $reply = $show->getTopReply($id);
         $tags_list[$i][content] = format_ubb($tags_list[$i][content]);
         $tags_list[$i][reply_user] = $reply[reply_user];
         $tags_list[$i][reply_create] = make_descriptive_time($reply[reply_create]);
         $tags_list[$i][reply_content] = $reply[reply_content];
         $tags_list[$i][reply_desc] = $reply[reply_desc];
         //print_r($reply);
     }
     $view->assign('tags', $tags_list);
     $content->save($tags_list, 'tags_list');
 } else {
     $view->assign('tags', $tags_list);
 }
 /* Flickr cache */
 require_once 'models/Flickr.class.php';
 if (!($flickr = $cache->load('flickr'))) {
     $flickr = Flickr::output("schema/Flickr.xml");
     $view->assign('flickr', $flickr);
     $cache->save($flickr, 'flickr');
Beispiel #10
0
 public function online_details($onl_created, $onl_lastmoved)
 {
     return 'angemeldet seit ' . make_descriptive_time($onl_created) . ', zuletzt bewegt um ' . make_descriptive_time($onl_lastmoved);
 }
Beispiel #11
0
 public function online_details($onl_created, $onl_lastmoved)
 {
     return 'signed in at ' . make_descriptive_time($onl_created) . ', last moved at ' . make_descriptive_time($onl_lastmoved);
 }