public function vxUserHome($options)
    {
        $O =& $options['target'];
        if ($O->usr_id != $this->User->usr_id) {
            $this->User->vxAddHits($O->usr_id);
        }
        $img_p = $O->usr_portrait ? '/img/p/' . $O->usr_portrait . '.jpg' : '/img/p_' . $O->usr_gender . '.gif';
        $img_p_n = $O->usr_portrait ? '/img/p/' . $O->usr_portrait . '_n.jpg' : '/img/p_' . $O->usr_gender . '_n.gif';
        $sql = "SELECT onl_uri, onl_ip, onl_created, onl_lastmoved FROM babel_online WHERE onl_nick = '{$O->usr_nick}' ORDER BY onl_lastmoved DESC LIMIT 1";
        $rs = mysql_query($sql, $this->db);
        if ($Online = mysql_fetch_object($rs)) {
            $_flag_online = true;
            $_o = '<small class="lime">' . strtolower($this->lang->online_now()) . '</small> ... ' . $this->lang->online_details($Online->onl_created, $Online->onl_lastmoved);
            if ($this->User->usr_id == 1) {
                $_o .= ' ... <small>' . $Online->onl_ip . '</small>';
            }
        } else {
            $_flag_online = false;
            $_o = '<small class="na">' . strtolower($this->lang->disconnected()) . '</small>';
        }
        mysql_free_result($rs);
        echo '<div id="main">';
        echo '<div class="blank" align="left">';
        _v_ico_map();
        echo ' <a href="/">' . Vocabulary::site_name . '</a> ';
        if ($options['mode'] == 'random') {
            echo '&gt; 茫茫人海 ';
        }
        echo '&gt; ' . $O->usr_nick;
        if ($_flag_online) {
            echo ' <span class="tip_i">... <small class="lime">online now</small> @ <a href="' . $Online->onl_uri . '" class="t">' . $Online->onl_uri . '</a></span>';
        } else {
            echo ' <span class="tip_i">...</span> <small class="na">disconnected</small>';
        }
        echo '</div>';
        echo '<div class="blank">';
        if ($O->usr_skype != '') {
            echo '<div style="float: right;"><script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
<a href="skype:' . make_single_return($O->usr_skype) . '?call"><img src="http://mystatus.skype.com/smallclassic/' . urlencode($O->usr_skype) . '" style="border: none;" width="114" height="20" alt="' . make_single_return($O->usr_nick) . '\'s Skype" /></a></div>';
        }
        echo '<span class="text"><img src="' . $img_p_n . '" class="portrait" align="absmiddle" /> ' . $this->lang->member_num($O->usr_id) . ' ... ' . $_o . '</span>';
        if ($_SESSION['babel_ua']['GECKO_DETECTED'] || $_SESSION['babel_ua']['KHTML_DETECTED'] || $_SESSION['babel_ua']['OPERA_DETECTED']) {
            $hack_width = 'width="100%" ';
        } else {
            $hack_width = 'width="99%" ';
        }
        echo '<table ' . $hack_width . 'cellpadding="0" cellspacing="0" border="0" class="fav">';
        echo '<tr>';
        $_gender_categories = $this->lang->gender_categories();
        $txt = '<span class="tip_i">' . $_gender_categories[$O->usr_gender] . ' | ';
        if ($count_u = $this->cs->get('count_u_' . $O->usr_id)) {
            $count_u = unserialize($count_u);
        } else {
            $count_u = array();
            $sql = "SELECT count(tpc_id) AS tpc_count FROM babel_topic WHERE tpc_uid = {$O->usr_id}";
            $rs_count = mysql_query($sql, $this->db);
            $o_count = mysql_fetch_object($rs_count);
            mysql_free_result($rs_count);
            $count_u['tpc_count'] = $o_count->tpc_count;
            $o_count = null;
            $sql = "SELECT count(pst_id) AS pst_count FROM babel_post WHERE pst_uid = {$O->usr_id}";
            $rs_count = mysql_query($sql, $this->db);
            $o_count = mysql_fetch_object($rs_count);
            mysql_free_result($rs_count);
            $count_u['pst_count'] = $o_count->pst_count;
            $o_count = null;
            $this->cs->save(serialize($count_u), 'count_u_' . $O->usr_id);
        }
        $sql = "SELECT tpc_id, tpc_title, tpc_posts, tpc_created, nod_id, nod_title FROM babel_topic, babel_node WHERE tpc_pid = nod_id AND tpc_uid = {$O->usr_id} AND tpc_flag IN (0, 2) ORDER BY tpc_created DESC LIMIT 10";
        $rs_created = mysql_query($sql, $this->db);
        if ($_followed = $this->cs->get('babel_user_' . $O->usr_id . '_followed')) {
            $_followed = unserialize($_followed);
        } else {
            $sql = "SELECT DISTINCT pst_tid FROM babel_post WHERE pst_uid = {$O->usr_id} ORDER BY pst_created DESC LIMIT 10";
            $rs = mysql_query($sql, $this->db);
            if (mysql_num_rows($rs) > 0) {
                $_tids = array();
                while ($_a = mysql_fetch_array($rs)) {
                    $_tids[] = $_a['pst_tid'];
                }
                mysql_free_result($rs);
                $_tids = implode(',', $_tids);
                $sql = "SELECT pst_id FROM babel_post WHERE pst_tid IN ({$_tids})";
                $rs = mysql_query($sql, $this->db);
                $_pids = array();
                while ($_a = mysql_fetch_array($rs)) {
                    $_pids[] = $_a['pst_id'];
                }
                mysql_free_result($rs);
                $_pids = implode(',', $_pids);
                $sql = "SELECT tpc_id, tpc_title, tpc_posts, tpc_lasttouched, nod_id, nod_title, pst_id, pst_created FROM ((babel_topic JOIN babel_node ON tpc_pid = nod_id) JOIN babel_post ON pst_tid = tpc_id) WHERE tpc_flag IN (0, 2) AND pst_id IN ({$_pids}) AND pst_uid = {$O->usr_id} ORDER BY pst_created DESC";
                $rs = mysql_query($sql, $this->db);
                $_followed = array();
                $i = 0;
                $_tids = array();
                while ($_t = mysql_fetch_array($rs)) {
                    $i++;
                    if (!in_array(strval($_t['tpc_id']), $_tids)) {
                        $_tids[] = strval($_t['tpc_id']);
                        $_followed[$i] = array();
                        $_followed[$i]['tpc_id'] = $_t['tpc_id'];
                        $_followed[$i]['tpc_title'] = $_t['tpc_title'];
                        $_followed[$i]['tpc_title_plain'] = make_plaintext($_t['tpc_title']);
                        $_followed[$i]['tpc_posts'] = $_t['tpc_posts'];
                        $_followed[$i]['tpc_lasttouched'] = $_t['tpc_lasttouched'];
                        $_followed[$i]['nod_id'] = $_t['nod_id'];
                        $_followed[$i]['nod_title'] = $_t['nod_title'];
                        $_followed[$i]['nod_title_plain'] = make_plaintext($_t['nod_title']);
                        $_followed[$i]['pst_id'] = $_t['pst_id'];
                        $_followed[$i]['pst_created'] = $_t['pst_created'];
                    }
                    unset($_t);
                }
            } else {
                mysql_free_result($rs);
                $_followed = array();
            }
            $this->cs->save(serialize($_followed), 'babel_user_' . $O->usr_id . '_followed');
        }
        $txt .= 'Since ' . date('Y-n-j', $O->usr_created) . ' - Topics <a href="/topic/archive/user/' . urlencode($O->usr_nick) . '" class="regular">' . $count_u['tpc_count'] . '</a> - Replies ' . $count_u['pst_count'] . ' - <a href="/geo/' . $O->usr_geo . '" class="regular">' . $this->Geo->map['name'][$O->usr_geo] . '</a>';
        // $txt .= '在' . date(' Y 年 n 月', $O->usr_created) . '的时候来到 ' . Vocabulary::site_name . ',在过去创建了 <a href="/topic/archive/user/' . $O->usr_nick . '">' . $count_u['tpc_count'] . '</a> 个主题,发表了 ' . $count_u['pst_count'] . ' 篇回复。所在地为 [ <a href="/geo/' . $O->usr_geo . '" class="o">' . $this->Geo->map['name'][$O->usr_geo] . '</a> ]';
        if ($O->usr_religion_permission != 0 && $O->usr_religion != 'Unknown') {
            if ($this->User->vxIsLogin()) {
                if ($O->usr_religion_permission = 2) {
                    if ($this->User->usr_religion == $O->usr_religion) {
                        $txt .= ' - ' . $O->usr_religion;
                    }
                } else {
                    if ($this->User->usr_religion == $O->usr_religion) {
                        $txt .= ' - ' . $O->usr_religion;
                    }
                }
            } else {
                if ($O->usr_religion_permission != 2) {
                    if ($this->User->usr_religion == $O->usr_religion) {
                        $txt .= ' - ' . $O->usr_religion;
                    }
                }
            }
        }
        $txt .= '</span>';
        echo '<td width="95" align="left" valign="top"><img src="' . $img_p . '" class="portrait" alt="' . make_single_return($O->usr_nick) . '" /></td><td align="left" valign="top">';
        echo '<div style="float: right;">';
        //echo('<div class="v2ex_watch" style="border: 1px solid #90909F; -moz-border-radius: 3px; width: 120px; background-color: #FFF;"><div class="v2ex_watch_title" style="color: #FFF; background-color: #90909F; padding: 2px 4px 2px 4px; font-size: 9px; ">Who is watching Livid?</div><div class="v2ex_watch_buddies" style="padding: 3px 4px 3px 4px; font-size: 9px;"><img src="http://www.v2ex.com/img/p/1_n.jpg" /> <img src="http://www.v2ex.com/img/p/3_n.jpg" /></div></div>');
        echo '</div>';
        echo '<span class="text_large">' . $O->usr_nick . '</span>';
        echo '<span class="excerpt"><br /><br />' . $txt . '</span></td>';
        echo '</tr>';
        $sql = "SELECT ing_doing, ing_created FROM babel_ing_update WHERE ing_uid = {$O->usr_id} ORDER BY ing_created DESC LIMIT 1";
        $rs = mysql_query($sql);
        if (mysql_num_rows($rs) == 1) {
            $_up = mysql_fetch_array($rs);
            echo '<tr><td colspan="2">';
            echo '<span class="tip_i">';
            echo '<small>Currently via V2EX::ING';
            echo '</small></span> ';
            _v_ico_silk('bullet_go');
            echo ' <a href="/ing/' . urlencode($O->usr_nick) . '/friends">' . format_ubb(trim($_up['ing_doing'])) . '</a> <small class="fade">' . make_desc_time($_up['ing_created']) . ' ago</small>';
            echo '</td></tr>';
        }
        mysql_free_result($rs);
        if ($this->User->usr_id == $O->usr_id) {
            echo '<tr><td colspan="2" align="center" class="section_odd"><img src="/img/icons/silk/house.png" align="absmiddle" />&nbsp;你的 V2EX 主页地址&nbsp;&nbsp;&nbsp;<input type="text" class="sll" onclick="this.select()" value="http://' . BABEL_DNS_NAME . '/u/' . urlencode($O->usr_nick) . '" readonly="readonly" />&nbsp;&nbsp;&nbsp;<span class="tip_i">... ' . $this->lang->hits($O->usr_hits) . '</span></td></tr>';
        }
        if ($O->usr_brief != '') {
            echo '<tr><td colspan="2" align="center" class="section_even"><span class="text_large"><img src="/img/quote_left.gif" align="absmiddle" />&nbsp;' . make_plaintext($O->usr_brief) . '&nbsp;<img src="/img/quote_right.gif" align="absmiddle" /></span></td></tr>';
        }
        echo '<tr><td colspan="2" align="center" class="section_odd"><span class="tip_i"><img src="' . CDN_UI . 'img/icons/silk/hourglass.png" align="absmiddle" alt="ING" />&nbsp;<a href="/ing/' . urlencode($O->usr_nick) . '/friends" class="var" style="color: ' . rand_color() . ';">ING</a>&nbsp;&nbsp;|&nbsp;&nbsp;<img src="' . CDN_UI . 'img/icons/silk/clock.png" align="absmiddle" alt="ZEN" />&nbsp;<a href="/zen/' . urlencode($O->usr_nick) . '" class="var" style="color: ' . rand_color() . ';">ZEN</a>';
        if (BABEL_FEATURE_DRY) {
            echo '&nbsp;&nbsp;|&nbsp;&nbsp;<img src="' . CDN_UI . 'img/icons/silk/color_swatch.png" align="absmiddle" alt="ZEN" />&nbsp;<a href="/dry/' . urlencode($O->usr_nick) . '" class="var" style="color: ' . rand_color() . ';">DRY</a>';
        }
        echo '&nbsp;&nbsp;|&nbsp;&nbsp;<img src="' . CDN_UI . 'img/icons/silk/comments.png" alt="Topics" align="absmiddle" />&nbsp;<a href="/topic/archive/user/' . urlencode($O->usr_nick) . '" class="var" style="color: ' . rand_color() . ';">Topics</a>&nbsp;&nbsp;|&nbsp;&nbsp;<img src="' . CDN_UI . 'img/icons/silk/heart_add.png" align="absmiddle" />&nbsp;<a href="/who/connect/' . urlencode($O->usr_nick) . '" class="var" style="color: ' . rand_color() . ';">Connections</a>&nbsp;&nbsp;|&nbsp;&nbsp;<img src="' . CDN_UI . 'img/icons/silk/feed.png" align="absmiddle" alt="RSS" />&nbsp;<a href="/feed/user/' . urlencode($O->usr_nick) . '" class="var" style="color: ' . rand_color() . '">RSS</a></span></tr>';
        $sql = "SELECT ggg_geo FROM babel_geo_going WHERE ggg_uid = {$O->usr_id} ORDER BY ggg_created DESC";
        $rs = mysql_query($sql);
        if (mysql_num_rows($rs) > 0) {
            echo '<tr><td colspan="2" class="section_odd" align="center"><span class="tip"> ' . _vo_ico_silk('world_go') . ' ' . $O->usr_nick . ' 想去的地方';
            while ($_geo_going = mysql_fetch_array($rs)) {
                echo '&nbsp;&nbsp;<a href="/geo/' . $_geo_going['ggg_geo'] . '" class="var" style="font-size: ' . rand(12, 18) . 'px;color: ' . rand_color() . '">' . $this->Geo->map['name'][$_geo_going['ggg_geo']] . '</a>';
            }
            echo '</span></td></tr>';
        }
        mysql_free_result($rs);
        $sql = "SELECT gbn_geo FROM babel_geo_been WHERE gbn_uid = {$O->usr_id} ORDER BY gbn_created DESC";
        $rs = mysql_query($sql);
        if (mysql_num_rows($rs) > 0) {
            echo '<tr><td colspan="2" class="section_odd" align="center"><span class="tip"> ' . _vo_ico_silk('world_go') . ' ' . $O->usr_nick . ' 去过的地方';
            while ($_geo_been = mysql_fetch_array($rs)) {
                echo '&nbsp;&nbsp;<a href="/geo/' . $_geo_been['gbn_geo'] . '" class="var" style="font-size: ' . rand(12, 18) . 'px;color: ' . rand_color() . '">' . $this->Geo->map['name'][$_geo_been['gbn_geo']] . '</a>';
            }
            echo '</span></td></tr>';
        }
        mysql_free_result($rs);
        if (BABEL_FEATURE_USER_COMPONENTS) {
            echo '<tr><td colspan="2" align="left" class="section_odd"><span class="text_large">';
            _v_ico_tango_32('places/start-here');
            echo ' ' . $this->lang->one_s_savepoints($O->usr_nick) . ' <a name="svp" /></span></td></tr>';
            $msgs = array(0 => '新据点添加失败,你可以再试一次,或者是到 <a href="/go/babel">Developer Corner</a> 向我们报告错误', 1 => '新据点添加成功', 2 => '你刚才想添加的据点已经存在于你的列表中', 3 => '目前,每个人只能添加至多 ' . BABEL_SVP_LIMIT . ' 个据点,你可以试着删除掉一些过去添加的,我们正在扩展系统的能力以支持更多的据点', 4 => '要删除的据点不存在', 5 => '你不能删除别人的据点', 6 => '据点删除成功', 7 => '据点删除失败,你可以再试一次,或者是到 <a href="/go/babel">Developer Corner</a> 向我们报告错误', 9 => '不需要输入前面的 http:// 协议名称,直接添加网址就可以了,比如 www.livid.cn 这样的地址');
            if (isset($_GET['msg'])) {
                echo '<tr><td colspan="2" class="section_odd"><div class="notify">';
                $msg = intval($_GET['msg']);
                switch ($msg) {
                    case 0:
                        echo $msgs[0];
                        break;
                    case 1:
                        echo $msgs[1];
                        break;
                    case 2:
                        echo $msgs[2];
                        break;
                    case 3:
                        echo $msgs[3];
                        break;
                    case 4:
                        echo $msgs[4];
                        break;
                    case 5:
                        echo $msgs[5];
                        break;
                    case 6:
                        echo $msgs[6];
                        break;
                    case 7:
                        echo $msgs[7];
                        break;
                    default:
                        echo $msgs[9];
                        break;
                }
                echo '</div></td></tr>';
                $savepoints = array();
                $sql = "SELECT svp_id, svp_url, svp_rank FROM babel_savepoint WHERE svp_uid = {$O->usr_id} ORDER BY svp_url";
                $rs = mysql_query($sql, $this->db);
                while ($Savepoint = mysql_fetch_object($rs)) {
                    $savepoints[$Savepoint->svp_id] = $Savepoint;
                }
                mysql_free_result($rs);
                $this->cs->save(serialize($savepoints), 'babel_user_savepoints_' . $O->usr_nick);
            } else {
                if ($savepoints = $this->cs->get('babel_user_savepoints_' . $O->usr_nick)) {
                    $savepoints = unserialize($savepoints);
                } else {
                    $savepoints = array();
                    $sql = "SELECT svp_id, svp_url, svp_rank FROM babel_savepoint WHERE svp_uid = {$O->usr_id} ORDER BY svp_url";
                    $rs = mysql_query($sql, $this->db);
                    while ($Savepoint = mysql_fetch_object($rs)) {
                        $savepoints[$Savepoint->svp_id] = $Savepoint;
                    }
                    mysql_free_result($rs);
                    $this->cs->save(serialize($savepoints), 'babel_user_savepoints_' . $O->usr_nick);
                }
            }
            $i = 0;
            foreach ($savepoints as $svp_id => $S) {
                $i++;
                $css_color = rand_color();
                $css_class = $i % 2 ? 'section_even' : 'section_odd';
                $o = $this->Validator->vxGetURLHost($S->svp_url);
                echo '<tr><td colspan="2" align="left" class="' . $css_class . '"><span class="svp"><img src="' . CDN_UI . 'img/fico_' . $o['type'] . '.gif" align="absmiddle" />&nbsp;&nbsp;<a href="http://' . htmlspecialchars(strip_quotes($S->svp_url)) . '" target="_blank" rel="external nofollow" style="color: ' . $css_color . '" class="var">http://' . htmlspecialchars(strip_quotes($S->svp_url)) . '</a>&nbsp;&nbsp;</span>';
                if ($this->User->usr_id == $O->usr_id) {
                    echo '<span class="tip_i"> ... <a href="/savepoint/erase/' . $S->svp_id . '.vx" class="g">X</a></span>';
                }
                echo '</td></tr>';
            }
            if ($this->User->vxIsLogin() && $this->User->usr_id == $O->usr_id) {
                $i++;
                $css_class = $i % 2 ? 'section_even' : 'section_odd';
                echo '<form action="/recv/savepoint.vx" method="post"><tr><td colspan="2" align="left" class="' . $css_class . '">Add a new Savepoint Now&nbsp;&nbsp;<span class="tip_i">http://&nbsp;<input type="text" onmouseover="this.focus();" name="url" class="sll" />&nbsp;&nbsp;<input type="image" align="absmiddle" src="/img/silver/sbtn_add.gif" /></span><div class="notify" style="margin-top: 5px;">';
                echo $msgs[9];
                echo '</div></td></tr></form>';
            }
        }
        echo '<tr><td colspan="2" align="left" class="section_odd"><span class="text_large"><a name="friends"></a>';
        _v_ico_tango_32('emotes/face-grin');
        echo ' ' . $this->lang->one_s_friends($O->usr_nick) . '</span>';
        if (isset($_GET['do'])) {
            $do = strtolower(make_single_safe($_GET['do']));
            if (!in_array($do, array('add', 'remove'))) {
                $do = false;
            }
        } else {
            $do = false;
        }
        if ($this->User->usr_id != $O->usr_id && $this->User->vxIsLogin()) {
            if ($do) {
                if ($do == 'add') {
                    $sql = "SELECT frd_id, frd_uid, frd_fid FROM babel_friend WHERE frd_uid = {$this->User->usr_id} AND frd_fid = {$O->usr_id}";
                    $rs = mysql_query($sql);
                    if (mysql_num_rows($rs) == 0) {
                        mysql_free_result($rs);
                        $sql = "INSERT INTO babel_friend(frd_uid, frd_fid, frd_created, frd_lastupdated) VALUES({$this->User->usr_id}, {$O->usr_id}, " . time() . ", " . time() . ")";
                        mysql_query($sql);
                        $txt_friend = '<span class="tip_i">&nbsp;&nbsp;&nbsp;You have added this member as friend</span>';
                    } else {
                        mysql_free_result($rs);
                        $txt_friend = '<span class="tip">&nbsp;&nbsp;&nbsp;<a href="#;" onclick="location.href = \'/friend/remove/' . urlencode($O->usr_nick) . '\'" class="g">No Longer Friend</a></span>';
                    }
                }
                if ($do == 'remove') {
                    $sql = "SELECT frd_id, frd_uid, frd_fid FROM babel_friend WHERE frd_uid = {$this->User->usr_id} AND frd_fid = {$O->usr_id}";
                    $rs = mysql_query($sql);
                    if (mysql_num_rows($rs) == 1) {
                        mysql_free_result($rs);
                        $sql = "DELETE FROM babel_friend WHERE frd_uid = {$this->User->usr_id} AND frd_fid = {$O->usr_id}";
                        mysql_query($sql);
                        $txt_friend = '<span class="tip_i">&nbsp;&nbsp;&nbsp;You removed this member from your friends</span>';
                    } else {
                        mysql_free_result($rs);
                        $txt_friend = '<span class="tip">&nbsp;&nbsp;&nbsp;<a href="/friend/connect/' . $O->usr_nick . '" class="g">Add as Friend</a></span>';
                    }
                }
            } else {
                $sql = "SELECT frd_id, frd_uid, frd_fid FROM babel_friend WHERE frd_uid = {$this->User->usr_id} AND frd_fid = {$O->usr_id}";
                $rs = mysql_query($sql);
                if (mysql_num_rows($rs) == 1) {
                    $txt_friend = '<span class="tip">&nbsp;&nbsp;&nbsp;<a href="#;" onclick="location.href = \'/friend/remove/' . urlencode($O->usr_nick) . '\'" class="g">No Longer Friend</a></span>';
                } else {
                    $txt_friend = '<span class="tip">&nbsp;&nbsp;&nbsp;<a href="/friend/connect/' . $O->usr_nick . '" class="g">Add as Friend</a></span>';
                }
            }
        } else {
            $txt_friend = '&nbsp;&nbsp;';
        }
        if ($this->User->vxIsLogin() && $O->usr_id != $this->User->usr_id) {
            $txt_msg = '<span class="tip">&nbsp;&nbsp;<a href="#;" class="g" onclick="sendMessage(' . $O->usr_id . ');">Send Message</a></span>';
        } else {
            $txt_msg = '&nbsp;&nbsp;';
        }
        echo $txt_friend;
        echo $txt_msg;
        if ($this->User->vxIsLogin() && $this->User->usr_id == 1) {
            $sql = "SELECT usr_id, usr_password FROM babel_user WHERE usr_password = '******' AND usr_id = {$O->usr_id}";
            $_rs = mysql_query($sql);
            if ($_u = mysql_fetch_object($_rs)) {
                $txt_duid = '<span class="tip_i">&nbsp;&nbsp;This member was disabled</span>';
            } else {
                if ($O->usr_id != 1) {
                    $txt_duid = '<span class="tip">&nbsp;&nbsp;<a href="#;" onclick="if (confirm(' . "'Continue to disable this member?'" . ')) { location.href=' . "'/d/uid/{$O->usr_id}'; } else { return false; }" . '" class="g">Disable</a></span>';
                } else {
                    $txt_duid = '';
                }
            }
            $_rs = null;
            if ($O->usr_id != 1) {
                $txt_dtuid = '<span class="tip">&nbsp;&nbsp;<a href="#;" onclick="if (confirm(' . "'Continue to erase all topics from this member with 0 replies?'" . ')) { location.href=' . "'/dt/uid/{$O->usr_id}'; } else { return false; }" . '" class="g">Erase Zero</a></span>';
            } else {
                $txt_dtuid = '';
            }
            echo $txt_duid . $txt_dtuid;
        }
        echo '</td></tr>';
        echo '<tr><td colspan="2">';
        $edges = array();
        for ($i = 1; $i < 1000; $i++) {
            $edges[] = $i * 5 + 1;
        }
        $sql = "SELECT usr_id, usr_geo, usr_gender, usr_nick, usr_portrait, usr_hits, frd_created FROM babel_user, babel_friend WHERE usr_id = frd_fid AND frd_uid = {$O->usr_id} ORDER BY frd_created ASC";
        $sql_hash = md5($sql);
        if ($friends = $this->cs->get('babel_sql_' . $sql_hash)) {
            $friends = unserialize($friends);
        } else {
            $friends = array();
            $rs = mysql_query($sql, $this->db);
            while ($Friend = mysql_fetch_object($rs)) {
                $friends[$Friend->usr_id] = $Friend;
            }
            mysql_free_result($rs);
            $this->cs->save(serialize($friends), 'babel_sql_' . $sql_hash);
        }
        $i = 0;
        $s = 0;
        foreach ($friends as $usr_id => $Friend) {
            $i++;
            if (in_array($i, $edges)) {
                echo '<tr><td colspan="2">';
            }
            $img_p = $Friend->usr_portrait ? CDN_P . 'p/' . $Friend->usr_portrait . '.jpg' : CDN_P . 'p_' . $Friend->usr_gender . '.gif';
            echo '<a href="/u/' . urlencode($Friend->usr_nick) . '" class="friend"><img src="' . $img_p . '" class="portrait" /><br />' . $Friend->usr_nick;
            if ($Friend->usr_geo != 'earth') {
                echo '<div class="tip">' . $this->Geo->map['name'][$Friend->usr_geo] . '</div>';
            }
            echo '</a>';
            if ($i % 5 == 0) {
                echo '</td></tr>';
            }
        }
        if ($i % 5 != 0) {
            echo '</td></tr>';
        }
        echo '<tr><td colspan="2" align="left" class="section_odd"><span class="text_large">';
        _v_ico_tango_32('categories/applications-multimedia');
        echo ' ' . $this->lang->one_s_recent_topics($O->usr_nick) . '</span>';
        echo '<table cellpadding="0" cellspacing="0" border="0" class="fav" width="100%">';
        $i = 0;
        while ($Topic = mysql_fetch_object($rs_created)) {
            $i++;
            $css_color = rand_color();
            $css_td_class = $i % 2 ? 'section_even' : 'section_odd';
            $txt_fresh = $Topic->tpc_posts ? $this->lang->posts($Topic->tpc_posts) : strtolower($this->lang->no_reply_yet());
            echo '<tr><td align="left" class="' . $css_td_class . '">[ <a href="/board/view/' . $Topic->nod_id . '.html" class="var" style="color: ' . $css_color . '">' . $Topic->nod_title . '</a> ]&nbsp;<a href="/topic/view/' . $Topic->tpc_id . '.html">' . $Topic->tpc_title . '</a> <span class="tip_i">... ' . make_descriptive_time($Topic->tpc_created) . ' ... ' . $txt_fresh . '</span></td></tr>';
        }
        echo '</table>';
        echo '</td></tr>';
        echo '<tr><td colspan="2" align="left" class="section_odd"><span class="text_large">';
        _v_ico_tango_32('apps/internet-group-chat');
        echo ' ' . $this->lang->one_s_recent_discussions($O->usr_nick) . '</span>';
        echo '<table cellpadding="0" cellspacing="0" border="0" class="fav" width="100%">';
        $i = 0;
        foreach ($_followed as $_reply) {
            $i++;
            $css_color = rand_color();
            $css_td_class = $i % 2 ? 'section_odd' : 'section_even';
            $txt_fresh = $_reply['tpc_posts'] ? $this->lang->posts($_reply['tpc_posts']) : strtolower($this->lang->no_reply_yet());
            echo '<tr><td align="left" class="' . $css_td_class . '">[ <a href="/board/view/' . $_reply['nod_id'] . '.html" class="var" style="color: ' . $css_color . '">' . $_reply['nod_title_plain'] . '</a> ]&nbsp;<a href="/topic/view/' . $_reply['tpc_id'] . '.html">' . $_reply['tpc_title_plain'] . '</a> <span class="tip_i">... ' . make_descriptive_time($_reply['pst_created']) . ' ... ' . $txt_fresh . '</span></td></tr>';
        }
        echo '</table>';
        echo '</td></tr>';
        if (BABEL_FEATURE_USER_COMPONENTS && (BABEL_LANG == 'zh_cn' || BABEL_LANG == 'zh_tw')) {
            echo '<tr><td colspan="2" align="left" class="section_odd">';
            echo '<div style="float: right;"><span class="tip_i"><small>Kuso Only</small></span></div>';
            echo '<span class="text_large">';
            _v_ico_tango_32('emotes/face-devil-grin');
            echo ' ' . $O->usr_nick . ' 的成分分析</span>';
            echo '</td></tr>';
            if ($c = $this->cl->load('cc_' . $O->usr_id)) {
                $c = unserialize($c);
            } else {
                $f = new Fun();
                $c = $f->vxGetComponents($O->usr_nick);
                $f = null;
                $this->cl->save(serialize($c), 'cc_' . $O->usr_id);
            }
            echo '<tr><td colspan="2" align="left" class="section_odd">';
            echo '<ul class="items">';
            foreach ($c['c'] as $C) {
                echo '<li>' . $C . '</li>';
            }
            echo '</ul>';
            echo '</td></tr>';
            echo '<tr><td colspan="2" align="left" class="section_even" style="padding-left: 20px;">';
            echo '<span class="tip">' . $c['s'] . '</span>';
            echo '</td></tr>';
        }
        if (BABEL_FEATURE_USER_LASTFM && $O->usr_lastfm != '') {
            $tag_cache = 'babel_user_lastfm_' . $O->usr_id;
            if ($o_lastfm = $this->cs->get($tag_cache)) {
            } else {
                require_once 'Zend/Service/Audioscrobbler.php';
                $as = new Zend_Service_Audioscrobbler();
                $as->set('user', $O->usr_lastfm);
                $_top_artists = $as->userGetTopArtists();
                $_recent = $as->userGetRecentTracks();
                $o_lastfm = '';
                if (count($_top_artists->artist) > 0) {
                    $o_lastfm .= '<tr><td colspan="2" align="left" class="section_odd"><span class="text_large">';
                    $o_lastfm .= '<div style="float: right;"><span class="tip"><small><img src="/img/favicons/lastfm.png" align="absmiddle" /> <a href="http://www.last.fm/user/' . $O->usr_lastfm . '" target="_blank" class="var">Powered by Last.fm</a></small></span></div>';
                    $o_lastfm .= _vo_ico_tango_32('mimetypes/audio-x-generic', 'absmiddle');
                    $o_lastfm .= ' ' . $this->lang->one_s_most_favorite_artists($O->usr_nick);
                    $o_lastfm .= '</span>';
                    $o_lastfm .= '</td></tr>';
                    $edges = array();
                    for ($i = 1; $i < 1000; $i++) {
                        $edges[] = $i * 6 + 1;
                    }
                    $i = 0;
                    foreach ($_top_artists->artist as $artist) {
                        $i++;
                        if ($i == 1) {
                            $o_lastfm .= '<tr><td colspan="2">';
                        } else {
                            if (in_array($i, $edges)) {
                                $o_lastfm .= '<tr><td colspan="2">';
                            }
                        }
                        $o_lastfm .= '<a href="' . $artist->url . '" class="artist" target="_blank" title="' . $artist->name . '"><img src="' . $artist->thumbnail . '" border="0" alt="' . make_single_return($artist->name) . '" class="portrait" /><br /><small>' . $artist->name . '</small>';
                        $o_lastfm .= '<div class="tip">' . $artist->playcount . ' 次播放</div>';
                        $o_lastfm .= '</a> ';
                        if ($i % 6 == 0) {
                            $o_lastfm .= '</td></tr>';
                        }
                    }
                    if ($i % 6 != 0) {
                        $o_lastfm .= '</td></tr>';
                    }
                }
                if (count($_recent->track) > 0) {
                    define('TMP_GLOBAL_EIGHT_HOURS', 28800);
                    $o_lastfm .= '<tr><td colspan="2" align="left" class="section_odd"><span class="text_large">';
                    $o_lastfm .= '<div style="float: right;"><span class="tip"><small><img src="/img/favicons/lastfm.png" align="absmiddle" /> <a href="http://www.last.fm/user/' . $O->usr_lastfm . '" target="_blank" class="var">Powered by Last.fm</a></small></span></div>';
                    $o_lastfm .= _vo_ico_tango_32('actions/media-playback-start', 'absmiddle');
                    $o_lastfm .= ' ' . $this->lang->one_s_recent_listened_tracks($O->usr_nick);
                    $o_lastfm .= '</span>';
                    $i = 0;
                    $o_lastfm .= '<table cellpadding="0" cellspacing="0" border="0" class="fav" width="100%">';
                    foreach ($_recent->track as $track) {
                        $i++;
                        $css_class = $i % 2 == 0 ? 'even' : 'odd';
                        $css_color = rand_color();
                        $o_lastfm .= '<tr><td colspan="2" class="section_' . $css_class . '">[ <a href="http://www.last.fm/music/' . urlencode($track->artist) . '" target="_blank" class="var" style="color: ' . $css_color . '">' . make_plaintext($track->artist) . '</a> ]';
                        if (trim($track->album) != '') {
                            $o_lastfm .= ' <a href="http://www.last.fm/music/' . urlencode($track->artist) . '/' . urlencode($track->album) . '" target="_blank">' . make_plaintext($track->album) . '</a> -';
                        }
                        $o_lastfm .= ' <a href="' . $track->url . '" target="_blank">' . make_plaintext($track->name) . '</a><span class="tip_i"> ... ' . make_descriptive_time(strtotime($track->date) + TMP_GLOBAL_EIGHT_HOURS) . '</span></td></tr>';
                    }
                    $o_lastfm .= '</table>';
                    $o_lastfm .= '</td></tr>';
                }
                $this->cs->save($o_lastfm, $tag_cache);
            }
            echo $o_lastfm;
        }
        echo '<tr><td colspan="2" align="left" class="section_odd"><span class="tip"><img src="/img/icons/silk/user_go.png" align="absmiddle" /> ' . $this->lang->last_signed_in() . ' ' . date('Y-n-j G:i:s', $O->usr_lastlogin) . ' ... ' . $this->lang->logins($O->usr_logins) . '</span></td></tr>';
        if ($O->usr_lastlogin_ua != '' && $this->User->usr_id == 1) {
            echo '<tr><td colspan="2" align="left" class="section_odd"><span class="tip_i"><img src="/img/icons/silk/computer.png" align="absmiddle" /> <small>' . make_plaintext($O->usr_lastlogin_ua) . '</small></span></td></tr>';
        }
        echo '</table>';
        echo '</div>';
        echo '</div>';
    }