示例#1
0
 public function __construct($entry_id)
 {
     $sql = "SELECT bge_id, bge_pid, bge_uid, bge_title, bge_body, bge_comments, bge_comment_permission, bge_trackbacks, bge_tags, bge_status, bge_mode, bge_revisions, bge_hash, bge_created, bge_lastupdated, bge_published FROM babel_weblog_entry WHERE bge_id = {$entry_id}";
     $rs = mysql_query($sql);
     if (mysql_num_rows($rs) == 1) {
         $this->entry = true;
         $_entry = mysql_fetch_array($rs);
         $this->bge_id = intval($_entry['bge_id']);
         $this->bge_pid = intval($_entry['bge_pid']);
         $this->bge_uid = intval($_entry['bge_uid']);
         $this->bge_title = $_entry['bge_title'];
         $this->bge_title_plain = make_plaintext($_entry['bge_title']);
         $this->bge_body = $_entry['bge_body'];
         $this->bge_comments = intval($_entry['bge_comments']);
         $this->bge_comment_permission = intval($_entry['bge_comment_permission']);
         $this->bge_trackbacks = intval($_entry['bge_trackbacks']);
         $this->bge_tags = $_entry['bge_tags'];
         $this->bge_status = intval($_entry['bge_status']);
         $this->bge_mode = intval($_entry['bge_mode']);
         $this->bge_revisions = intval($_entry['bge_revisions']);
         $this->bge_hash = $_entry['bge_hash'];
         $this->bge_created = intval($_entry['bge_created']);
         $this->bge_lastupdated = intval($_entry['bge_lastupdated']);
         $this->bge_published = intval($_entry['bge_published']);
     } else {
         $this->entry = false;
     }
 }
示例#2
0
 public function __construct($project_id, $db)
 {
     $this->db =& $db;
     $sql = "SELECT zpr_id, zpr_uid, zpr_private, zpr_title, zpr_progress, zpr_type, zpr_tasks, zpr_notes, zpr_dbs, zpr_created, zpr_lasttouched, zpr_lastupdated, zpr_completed, usr_id, usr_nick, usr_geo, usr_gender, usr_portrait FROM babel_zen_project, babel_user WHERE zpr_uid = usr_id AND zpr_id = {$project_id}";
     $rs = mysql_query($sql, $this->db);
     if ($_p = mysql_fetch_array($rs)) {
         $this->zpr_id = $_p['zpr_id'];
         $this->zpr_uid = $_p['zpr_uid'];
         $this->zpr_private = $_p['zpr_private'];
         $this->zpr_title = $_p['zpr_title'];
         $this->zpr_title_plain = make_plaintext($_p['zpr_title']);
         $this->zpr_progress = $_p['zpr_progress'];
         $this->zpr_type = $_p['zpr_type'];
         $this->zpr_type_grid = 'zen2_grid_' . $_p['zpr_type'] . '_s';
         $this->zpr_tasks = $_p['zpr_tasks'];
         $this->zpr_notes = $_p['zpr_notes'];
         $this->zpr_dbs = $_p['zpr_dbs'];
         $this->zpr_created = $_p['zpr_created'];
         $this->zpr_lastupdated = $_p['zpr_lastupdated'];
         $this->zpr_lasttouched = $_p['zpr_lasttouched'];
         $this->zpr_completed = $_p['zpr_completed'];
         $this->usr_id = $_p['usr_id'];
         $this->usr_nick = $_p['usr_nick'];
         $this->usr_nick_plain = make_plaintext($_p['usr_nick']);
         $this->usr_geo = $_p['usr_geo'];
         $this->usr_gender = $_p['usr_gender'];
         $this->usr_portrait = $_p['usr_portrait'];
         unset($_p);
     } else {
         $this->zpr_id = 0;
         $this->zpr_uid = 0;
         $this->zpr_private = 1;
         $this->zpr_title = '';
         $this->zpr_title_plain = '';
         $this->zpr_progress = 0;
         $this->zpr_type = 0;
         $this->zpr_type_grid = 0;
         $this->zpr_tasks = 0;
         $this->zpr_notes = 0;
         $this->zpr_dbs = 0;
         $this->zpr_created = 0;
         $this->zpr_lastupdated = 0;
         $this->zpr_lasttouched = 0;
         $this->zpr_completed = 0;
         $this->usr_id = 0;
         $this->usr_nick = '';
         $this->usr_nick_plain = '';
         $this->usr_geo = 'earth';
         $this->usr_gender = 9;
         $this->usr_portrait = '';
     }
 }
示例#3
0
 public function browse_node($name, $title)
 {
     return 'Pretražite <a href="' . urlencode($name) . '" class="regular">' . make_plaintext($title) . '</a>';
 }
 public function vxSent()
 {
     if ($this->User->vxIsLogin()) {
         $this->vxHead($msgSiteTitle = '已发送');
         $this->vxBodyStart();
         $this->vxToolbar();
         $p = array();
         $p['base'] = '/message/sent/';
         $p['ext'] = '.vx';
         $sql = "SELECT COUNT(msg_id) FROM babel_message WHERE msg_sid = {$this->User->usr_id} AND msg_draft = 0 AND msg_sdeleted = 0";
         $rs = mysql_query($sql, $this->db);
         $p['items'] = mysql_result($rs, 0, 0);
         mysql_free_result($rs);
         if ($p['items'] > 0) {
             $p['size'] = BABEL_MSG_PAGE;
             $p['span'] = BABEL_PG_SPAN - 2;
             if ($p['items'] % $p['size'] == 0) {
                 $p['total'] = $p['items'] / $p['size'];
             } else {
                 $p['total'] = floor($p['items'] / $p['size']) + 1;
             }
             if (isset($_GET['p'])) {
                 $p['cur'] = intval($_GET['p']);
             } else {
                 $p['cur'] = 1;
             }
             if ($p['cur'] < 1) {
                 $p['cur'] = 1;
             }
             if ($p['cur'] > $p['total']) {
                 $p['cur'] = $p['total'];
             }
             if ($p['cur'] - $p['span'] >= 1) {
                 $p['start'] = $p['cur'] - $p['span'];
             } else {
                 $p['start'] = 1;
             }
             if ($p['cur'] + $p['span'] <= $p['total']) {
                 $p['end'] = $p['cur'] + $p['span'];
             } else {
                 $p['end'] = $p['total'];
             }
             $_SESSION['babel_page_message'] = $p['cur'];
             $p['sql'] = ($p['cur'] - 1) * $p['size'];
             $sql = "SELECT msg_id, msg_body, msg_created, msg_opened, usr_nick FROM babel_message, babel_user WHERE msg_sid = {$this->User->usr_id} AND msg_draft = 0 AND msg_sdeleted = 0 AND msg_rid = usr_id ORDER BY msg_created DESC LIMIT " . $p['sql'] . "," . BABEL_MSG_PAGE;
             $rs = mysql_query($sql, $this->db);
             echo '<div id="main">';
             echo '<div id="tool">';
             if ($p['total'] > 1) {
                 $this->vxDrawPages($p, ' sent');
             } else {
                 echo '<span class="tip">已发送短消息 ' . $p['items'] . ' 条</span>';
             }
             echo '</div>';
             echo '<div id="msg"><span class="text"><table cellpadding="0" cellspacing="0" border="0" class="items">';
             while ($Message = mysql_fetch_object($rs)) {
                 echo '<tr>';
                 echo '<td width="100" height="20" class="recv" align="right">' . make_plaintext($Message->usr_nick) . '&nbsp;</td><td width="190" height="20">&nbsp;<a href="/message/view/' . $Message->msg_id . '.vx">';
                 $msg_excerpt = mb_substr($Message->msg_body, 0, 12, 'UTF-8');
                 if ($Message->msg_opened == 0) {
                     echo '<strong>' . $msg_excerpt . '</strong>';
                 } else {
                     echo $msg_excerpt;
                 }
                 if (mb_strlen($Message->msg_body, 'UTF-8') > mb_strlen($msg_excerpt, 'UTF-8')) {
                     echo '...';
                 }
                 echo '</a></td><td width="90" height="20">';
                 echo '<small>' . make_desc_time($Message->msg_created) . '</small>';
                 if ($Message->msg_opened == 0) {
                     echo ' *';
                 }
                 echo '</td>';
                 echo '</tr>';
             }
             echo '</table></span></div>';
             echo '</div>';
         } else {
             echo '<div id="main"><div id="msg"><span class="text">你还没有向任何人发送过短消息,<a href="/message/compose.vx">现在写一条?</a></span></div></div>';
         }
         $this->vxBottom();
         $this->vxBodyEnd();
     } else {
         $this->vxDenied();
     }
 }
    _v_ico_silk('comments');
    echo ' ' . $Entry->bge_comments . ' responses to <strong>' . $Entry->bge_title_plain . '</strong>';
    echo '</div>';
    $sql = "SELECT bec_id, bec_nick, bec_body, bec_url, bec_created FROM babel_weblog_entry_comment WHERE bec_eid = {$entry_id} AND bec_status = 1 ORDER BY bec_created ASC";
    $rs = mysql_query($sql);
    while ($_comment = mysql_fetch_array($rs)) {
        echo '<div class="comment">';
        echo nl2br($_comment['bec_body']);
        echo '<div class="author">By ';
        if ($_comment['bec_url'] != '') {
            if (strtolower(substr($_comment['bec_url'], 0, 7)) != 'http://') {
                $_comment['bec_url'] = 'http://' . $_comment['bec_url'];
            }
            echo '<a href="' . $_comment['bec_url'] . '" target="_blank" rel="nofollow external">' . make_plaintext($_comment['bec_nick']) . '</a>';
        } else {
            echo make_plaintext($_comment['bec_nick']);
        }
        echo ' at ' . date('r', $_comment['bec_created']) . '</div>';
        echo '</div>';
    }
    mysql_free_result($rs);
}
if ($Entry->entry) {
    if ($flag_permit) {
        if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') {
            if ($rt['errors'] > 0) {
                echo '<div class="notify">';
                _v_ico_silk('exclamation');
                echo ' Please check the comment you just submitted.';
                echo '</div>';
                echo '<div class="form">';
示例#6
0
 public function vxGetUserInfoByNick($user_nick)
 {
     $user_nick = mysql_real_escape_string($user_nick);
     $sql = "SELECT usr_id, usr_gender, usr_nick, usr_brief, usr_email, usr_portrait, usr_hits, usr_created, usr_lastlogin FROM babel_user WHERE usr_nick = '{$user_nick}'";
     $rs = mysql_query($sql, $this->db);
     if ($User = mysql_fetch_object($rs)) {
         mysql_free_result($rs);
         $User->usr_nick_url = urlencode($User->usr_nick);
         $User->usr_nick_plain = make_plaintext($User->usr_nick);
         $User->usr_brief_plain = make_plaintext($User->usr_brief);
         $User->img_p = $User->usr_portrait ? CDN_IMG . 'p/' . $User->usr_portrait . '.jpg' : CDN_IMG . 'p_' . $User->usr_gender . '.gif';
         $User->img_p_s = $User->usr_portrait ? CDN_IMG . 'p/' . $User->usr_portrait . '_s.jpg' : CDN_IMG . 'p_' . $User->usr_gender . '_s.gif';
         $User->img_p_n = $User->usr_portrait ? CDN_IMG . 'p/' . $User->usr_portrait . '_n.jpg' : CDN_IMG . 'p_' . $User->usr_gender . '_n.gif';
         return $User;
     } else {
         mysql_free_result($rs);
         return false;
     }
 }
示例#7
0
 public function vxFriend()
 {
     if (isset($_GET['user_nick'])) {
         $user_nick = make_single_safe($_GET['user_nick']);
         if (get_magic_quotes_gpc()) {
             $user_nick = stripslashes($user_nick);
         }
         $user_id = $this->Validator->vxExistUserNick($user_nick);
         if ($user_id) {
             $_u = $this->User->vxGetUserInfo($user_id);
         } else {
             $_u = false;
         }
     } else {
         $_u = false;
     }
     if ($_u) {
         $this->vxHeader(make_plaintext($_u->usr_nick) . ' 的朋友');
     } else {
         $this->vxHeader('用户不存在');
     }
     $this->vxBodyStart();
     $this->vxH1();
     echo '<div class="content"><small>';
     if ($this->User->vxIsLogin()) {
         echo '<a href="/u/' . urlencode($this->User->usr_nick) . '">' . $this->User->usr_nick . '</a> - ';
         echo '<a href="/babel_mobile.php?m=logout">登出</a>';
     } else {
         echo '<a href="/babel_mobile.php?m=login">登录</a>';
     }
     echo '</small></div>';
     if ($_u) {
         $sql = "SELECT COUNT(frd_id) FROM babel_friend WHERE frd_uid = {$_u->usr_id}";
         $rs = mysql_query($sql);
         $_total = mysql_result($rs, 0, 0);
         mysql_free_result($rs);
         $_per = 10;
         if ($_total % $_per == 0) {
             $_pages = $_total / $_per;
         } else {
             $_pages = floor($_total / $_per) + 1;
         }
         if (isset($_GET['p'])) {
             $_p = intval($_GET['p']);
             if ($_p < 1) {
                 $_p = 1;
             }
             if ($_p > $_pages) {
                 $_p = $_pages;
             }
         } else {
             $_p = 1;
         }
         if ($_p == 1) {
             $_p_first = true;
         } else {
             $_p_first = false;
         }
         if ($_p == $_pages) {
             $_p_last = true;
         } else {
             $_p_last = false;
         }
         $_SESSION['babel_page_user_friend_mobile'] = $_p;
         $_p_start = ($_p - 1) * $_per;
         echo '<div class="content"><small><a href="/">V2EX</a> &gt; <a href="/u/' . urlencode($_u->usr_nick) . '">' . $_u->usr_nick . '</a> &gt; ' . $_total . ' 个朋友</small></div>';
         echo '<div class="content"><small><a href="/u/' . $_u->usr_nick . '" target="_blank">' . $_u->usr_nick . '</a> 共有 ' . $_total . ' 个朋友</small></div>';
         if ($o = $this->cl->get('babel_user_friend_mobile_' . $_u->usr_id . '_' . $_p)) {
             echo $o;
         } else {
             $_o = '';
             $sql = "SELECT usr_id, usr_gender, usr_nick, usr_portrait, usr_hits, frd_created FROM babel_user, babel_friend WHERE usr_id = frd_fid AND frd_uid = {$_u->usr_id} ORDER BY frd_created ASC LIMIT {$_p_start}, {$_per}";
             $rs = mysql_query($sql, $this->db);
             while ($Friend = mysql_fetch_array($rs)) {
                 if ($Friend['usr_portrait'] == '') {
                     $Friend['usr_portrait_img'] = '/img/p_' . $Friend['usr_gender'] . '_n.gif';
                 } else {
                     $Friend['usr_portrait_img'] = '/img/p/' . $Friend['usr_portrait'] . '_n.' . BABEL_PORTRAIT_EXT;
                 }
                 $_o .= '<div class="content"><small>';
                 $sql = "SELECT tpc_id, tpc_title, tpc_lasttouched FROM babel_topic WHERE tpc_uid = {$Friend['usr_id']} ORDER BY tpc_created DESC LIMIT 1";
                 $rs_topic = mysql_query($sql, $this->db);
                 if ($Topic = mysql_fetch_object($rs_topic)) {
                     $_o .= '<img src="' . $Friend['usr_portrait_img'] . '" align="absmiddle" class="p" /> <a href="/u/' . $Friend['usr_nick'] . '">' . $Friend['usr_nick'] . '</a> - <a href="/t/' . $Topic->tpc_id . '">' . make_plaintext($Topic->tpc_title) . '</a> - ' . make_desc_time($Topic->tpc_lasttouched) . ' ago</small>';
                 } else {
                     $_o .= '<img src="' . $Friend['usr_portrait_img'] . '" align="absmiddle" class="p" /> <a href="/u/' . $Friend['usr_nick'] . '">' . $Friend['usr_nick'] . '</a></small>';
                 }
                 unset($Topic);
                 mysql_free_result($rs_topic);
                 $_o .= '</div>';
             }
             mysql_free_result($rs);
             echo $_o;
             $this->cl->save($_o, 'babel_user_friend_mobile_' . $_u->usr_id . '_' . $_p);
         }
         if ($_pages > 1) {
             echo '<div class="content"><small>';
             if (!$_p_last) {
                 echo '&nbsp;&nbsp;<a href="/f/' . urlencode($_u->usr_nick) . '/' . ($_p + 1) . '">下一页</a>';
             }
             if (!$_p_first) {
                 echo '&nbsp;&nbsp;<a href="/f/' . urlencode($_u->usr_nick) . '/' . ($_p - 1) . '">上一页</a>';
             }
             echo '&nbsp;-&nbsp;' . $_p . '/' . $_pages;
             echo '</small></div>';
         }
     } else {
         echo '<div class="content">用户不存在</div>';
     }
     $this->vxBottom();
     $this->vxBodyEnd();
     $this->vxHTMLEnd();
 }
    $ing_id = intval($_GET['ing_id']);
} else {
    $ing_id = false;
    $_ing = false;
}
if ($ing_id) {
    $db = mysql_pconnect(BABEL_DB_HOSTNAME . ':' . BABEL_DB_PORT, BABEL_DB_USERNAME, BABEL_DB_PASSWORD);
    mysql_select_db(BABEL_DB_SCHEMATA, $db);
    mysql_query("SET NAMES utf8");
    mysql_query("SET CHARACTER SET utf8");
    mysql_query("SET COLLATION_CONNECTION='utf8_general_ci'");
    $sql = "SELECT usr_id, usr_nick, usr_gender, usr_portrait, ing_id, ing_doing, ing_source, ing_created FROM babel_user, babel_ing_update WHERE ing_uid = usr_id AND ing_id = {$ing_id} LIMIT 1";
    $rs = mysql_query($sql);
    if (mysql_num_rows($rs) == 1) {
        $_ing = mysql_fetch_array($rs);
        $_ing['usr_nick_plain'] = make_plaintext($_ing['usr_nick']);
        $_ing['usr_nick_url'] = urlencode($_ing['usr_nick']);
        $_ing['img_p'] = $_ing['usr_portrait'] ? CDN_P . 'p/' . $_ing['usr_portrait'] . '_n.jpg' : CDN_P . 'p_' . $_ing['usr_gender'] . '_n.gif';
        mysql_free_result($rs);
    } else {
        mysql_free_result($rs);
        $_ing = false;
    }
}
header('Content-Type: text/html; charset=UTF-8');
header('Etag: ' . sha1($ing_id));
?>
<html>
<head>
	<meta http-equiv="Content-type" content="text/html;charset=utf-8" />
	<meta name="Author" content="<?php 
示例#9
0
 public function vxDrawAlsoFav($c, $i18n_label)
 {
     $board_id = $this->nod_id;
     if ($o = $c->load('babel_node_fav_also_' . $board_id)) {
     } else {
         $sql = "SELECT fav_uid FROM babel_favorite WHERE fav_res = {$board_id} AND fav_type = 1";
         $rs = mysql_query($sql);
         $_users = array();
         while ($_user = mysql_fetch_array($rs)) {
             $_users[] = $_user['fav_uid'];
         }
         mysql_free_result($rs);
         $_nodes = array();
         $o = '';
         if (count($_users) > 0) {
             foreach ($_users as $usr_id) {
                 $sql = "SELECT fav_res FROM babel_favorite WHERE fav_uid = {$usr_id} AND fav_type = 1";
                 $rs = mysql_query($sql);
                 if (mysql_num_rows($rs) > 0) {
                     while ($_node = mysql_fetch_array($rs)) {
                         if (array_key_exists(intval($_node['fav_res']), $_nodes)) {
                             $_nodes[$_node['fav_res']]++;
                         } else {
                             $_nodes[$_node['fav_res']] = 1;
                         }
                     }
                 }
                 mysql_free_result($rs);
             }
         }
         if (count($_nodes) > 0) {
             arsort($_nodes);
             $_nodes_keys = array_keys($_nodes);
             $sql = "SELECT nod_id, nod_title, nod_name FROM babel_node WHERE nod_id IN (" . implode(',', $_nodes_keys) . ")";
             $rs = mysql_query($sql);
             if (mysql_num_rows($rs) > 0) {
                 while ($_node = mysql_fetch_array($rs)) {
                     $_nodes_names[$_node['nod_id']] = $_node['nod_name'];
                     $_nodes_titles[$_node['nod_id']] = $_node['nod_title'];
                 }
                 $o .= _vo_hr();
                 $o .= '<span class="tip_i">' . _vo_ico_silk('star') . ' ' . $i18n_label . ' ... </span> ';
                 $i = 0;
                 if (count($_nodes_keys) > 7) {
                     $max = 8;
                 } else {
                     $max = count($_nodes_keys);
                 }
                 while ($i < $max) {
                     $css_color = rand_color();
                     $o .= '<a href="/go/' . $_nodes_names[$_nodes_keys[$i]] . '" class="var" style="color: ' . $css_color . '">' . make_plaintext($_nodes_titles[$_nodes_keys[$i]]) . '</a> <small>(' . $_nodes[$_nodes_keys[$i]] . ')</small> ';
                     $i++;
                 }
             } else {
                 $o = '';
             }
             mysql_free_result($rs);
         } else {
             $o = '';
         }
         $c->save($o, 'babel_node_fav_also_' . $board_id);
     }
     echo $o;
 }
示例#10
0
 private function vxHomeSectionRemix($node_id, $node_level = 1, $items = 3)
 {
     if ($node_level < 2) {
         $sql = "SELECT nod_id FROM babel_node WHERE nod_sid = {$node_id}";
         $rs = mysql_query($sql, $this->db);
         $board_count = mysql_num_rows($rs);
         $board_ids = '';
         $i = 0;
         while ($Board = mysql_fetch_object($rs)) {
             $i++;
             if ($i == $board_count) {
                 $board_ids = $board_ids . $Board->nod_id;
             } else {
                 $board_ids = $board_ids . $Board->nod_id . ', ';
             }
         }
         mysql_free_result($rs);
         $items = rand($items - 1, $items * 2);
         $sql = "SELECT usr_id, usr_nick, usr_gender, usr_portrait, nod_id, nod_name, nod_title, tpc_id, tpc_title, tpc_description, tpc_content, tpc_hits, tpc_posts, tpc_created, tpc_lasttouched FROM babel_topic, babel_user, babel_node WHERE nod_id = tpc_pid AND usr_id = tpc_uid AND tpc_posts > 1 AND tpc_hits > 10 AND tpc_pid IN ({$board_ids}) AND tpc_flag IN (0) ORDER BY tpc_lasttouched DESC LIMIT {$items}";
     } else {
         $board_ids = $node_id;
         $items = 15;
         $sql = "SELECT usr_id, usr_nick, usr_gender, usr_portrait, nod_id, nod_name, nod_title, tpc_id, tpc_title, tpc_description, tpc_content, tpc_hits, tpc_posts, tpc_created, tpc_lasttouched FROM babel_topic, babel_user, babel_node WHERE nod_id = tpc_pid AND usr_id = tpc_uid AND tpc_pid IN ({$board_ids}) AND tpc_flag IN (0) ORDER BY tpc_lasttouched DESC LIMIT {$items}";
     }
     $rs = mysql_query($sql, $this->db);
     $i = 0;
     $o = '';
     while ($Topic = mysql_fetch_object($rs)) {
         $i++;
         $css_color = rand_color();
         $o = $o . '<dl class="home_topic">';
         $img_p = $Topic->usr_portrait ? CDN_IMG . 'p/' . $Topic->usr_portrait . '_n.jpg' : CDN_IMG . 'p_' . $Topic->usr_gender . '_n.gif';
         $o .= '<h1 class="silver">&nbsp;';
         $o .= '<a href="/u/' . urlencode($Topic->usr_nick) . '" class="var"><img src="' . $img_p . '" align="absmiddle" class="portrait" border="0" /></a>&nbsp;';
         $o .= '<a href="/topic/view/' . $Topic->tpc_id . '.html" class="regular">';
         $o .= make_plaintext($Topic->tpc_title);
         $o .= '</a></h1><dd>';
         $url = 'http://' . BABEL_DNS_NAME . '/topic/view/' . $Topic->tpc_id . '.html';
         if (preg_match('/\\[media/i', $Topic->tpc_content)) {
             $o .= 'This topic contains multimedia content, please <a href="/topic/view/' . $Topic->tpc_id . '.html" class="regular">click here</a> to continue ...';
         } else {
             $o .= make_excerpt_home($Topic);
         }
         if ($node_level < 2) {
             $o .= '<span class="tip_i" style="display: block; clear: left; margin-top: 10px; padding-top: 5px; padding-bottom: 5px; border-top: 1px solid #E0E0E0; font-size: 12px; font-size: 12px;">... <a href="/topic/view/' . $Topic->tpc_id . '.html#reply" class="regular">' . $this->lang->posts($Topic->tpc_posts) . '</a> | <a href="/topic/view/' . $Topic->tpc_id . '.html#replyForm" class="regular">' . $this->lang->join_discussion() . '</a> | ' . $this->lang->browse_node($Topic->nod_name, $Topic->nod_title) . ' | <a href="/u/' . urlencode($Topic->usr_nick) . '" class="regular">' . $Topic->usr_nick . '</a>';
         } else {
             $o .= '<span class="tip_i" style="display: block; clear: left; margin-top: 10px; padding-top: 5px; padding-bottom: 5px; border-top: 1px solid #E0E0E0; font-size: 12px; font-size: 12px;">... <a href="/topic/view/' . $Topic->tpc_id . '.html#reply" class="regular">' . $this->lang->posts($Topic->tpc_posts) . '</a> | <a href="/topic/view/' . $Topic->tpc_id . '.html#replyForm" class="regular">' . $this->lang->join_discussion() . '</a> | <a href="/u/' . urlencode($Topic->usr_nick) . '" class="regular">' . $Topic->usr_nick . '</a>';
         }
         $o .= ' | ';
         $title = urlencode($Topic->tpc_title);
         $o .= '<a href="http://del.icio.us/post?url=' . $url . '&title=' . $title . '" class="var" target="_blank"><img src="/img/prom/delicious.png" border="0" align="absmiddle" alt="Add to del.icio.us" /></a> | ';
         $o .= '<a href="http://reddit.com/submit?url=' . $url . '&title=' . $title . '" class="var" target="_blank"><img src="/img/prom/reddit.png" border="0" align="absmiddle" alt="Add to reddit" /></a> | ';
         $o .= '<a href="http://technorati.com/cosmos/search.html?url=' . $url . '" class="var" target="_blank"><img src="/img/prom/technorati.png" border="0" align="absmiddle" alt="Search in Technorati" /></a> | ';
         $o .= '<a href="http://ma.gnolia.com/bookmarklet/add?url=' . $url . '&title=' . $title . '" class="var" target="_blank"><img src="/img/prom/magnoliacom.png" border="0" align="absmiddle" alt="Add to Ma.gonolia" /></a> | ';
         $o .= '<a href="http://blogmarks.net/my/new.php?mini=1&truc=3&title=' . $title . '&url=' . $url . '" class="var" target="_blank"><img src="/img/prom/blogmarks.png" border="0" align="absmiddle" alt="Add to BlogMarks" /></a> | ';
         $o .= '<a href="http://www.furl.net/storeIt.jsp?t=' . $title . '&u=' . $url . '" class="var" target="_blank"><img src="/img/prom/furl.png" border="0" align="absmiddle" alt="Add to LookSmart FURL" /></a> | ';
         $o .= '<a href="http://www.spurl.net/spurl.php?v=3&title=' . $title . '&url=' . $url . '&blocked=" class="var" target="_blank"><img src="/img/prom/spurl.png" border="0" align="absmiddle" alt="Add to Spurl" /></a> | ';
         $o .= '<a href="http://simpy.com/simpy/LinkAdd.do?title=' . $title . '&href=' . $url . '&note=&_doneURI=http%3A%2F%2Fwww.simpy.com%2F&v=6&src=bookmarklet" class="var" target="_blank"><img src="/img/prom/simpy.png" border="0" align="absmiddle" alt="Add to simpy" /></a> | ';
         $o .= '<a href="http://tailrank.com/share/?title=' . $title . '&link_href=' . $url . '&text=" class="var" target="_blank"><img src="/img/prom/tailrank.png" border="0" align="absmiddle" alt="Add to Tailrank" /></a>';
         $o .= '</span></dd></dl>';
     }
     mysql_free_result($rs);
     return $o;
 }
示例#11
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');
 }
示例#12
0
 public function vxLoadProjectsDone()
 {
     $user_id = 0;
     if (isset($_GET['user_id'])) {
         $user_id = intval($_GET['user_id']);
         if (!$this->Validator->vxExistUser($user_id)) {
             $user_id = 0;
         }
     } else {
         if ($this->User->usr_id != 0) {
             $user_id = $this->User->usr_id;
         }
     }
     if ($user_id == 0) {
         echo $this->r_failed;
     } else {
         $sql = "SELECT zpr_id, zpr_uid, zpr_title, zpr_private, zpr_type, zpr_tasks, zpr_notes, zpr_dbs, zpr_created FROM babel_zen_project WHERE zpr_progress = 1 AND zpr_uid = {$user_id} ORDER BY zpr_completed DESC";
         $rs = mysql_query($sql);
         $i = 0;
         $tasks = 0;
         $notes = 0;
         $dbs = 0;
         $o = '';
         while ($_p = mysql_fetch_array($rs)) {
             $i++;
             $tasks += $_p['zpr_tasks'];
             $notes += $_p['zpr_notes'];
             $dbs += $_p['zpr_dbs'];
             $_p['zpr_type_grid'] = 'zen2_grid_' . $_p['zpr_type'] . '_s';
             $o .= '<div class="zen2_project"><div class="' . $_p['zpr_type_grid'] . '"></div><div class="zen2_project_toolbar"><span class="tip_i"><small>' . Zen::vxIconTask($_p['zpr_tasks']) . ' / ' . Zen::vxIconNote($_p['zpr_notes']) . ' / ' . Zen::vxIconDB($_p['zpr_dbs']) . ' &nbsp;</small></span>';
             if ($_p['zpr_uid'] == $this->User->usr_id) {
                 $o .= Zen::vxUndoneButton($_p['zpr_id']);
                 $o .= Zen::vxDeleteButton($_p['zpr_id'], 'done');
             }
             $o .= '</div><div class="zen2_project_main">&nbsp; <a href="/project/view/' . $_p['zpr_id'] . '.html">' . make_plaintext($_p['zpr_title']) . '</a><span class="tip_i">&nbsp;...&nbsp;<small>created ' . make_desc_time($_p['zpr_created']) . ' ago</small></span></div></div>';
             unset($_p);
         }
         mysql_free_result($rs);
         $o .= '<div class="conclude">' . $i . ' 个完成了的项目 - ' . $tasks . ' 项任务 - ' . $notes . ' 则笔记 - ' . $dbs . ' 个数据库</div>';
         return $o;
     }
 }
        $_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>
示例#14
0
 public static function vxDestroy($user_id, $weblog_id)
 {
     $Weblog = new Weblog($weblog_id);
     /* 1: Unlink all files */
     $usr_dir = BABEL_WEBLOG_PREFIX . '/' . BABEL_WEBLOG_WWWROOT . '/' . $Weblog->blg_name;
     if (file_exists($usr_dir)) {
         foreach (glob($usr_dir . '/*.html') as $filename) {
             unlink($filename);
         }
         foreach (glob($usr_dir . '/*.css') as $filename) {
             unlink($filename);
         }
         foreach (glob($usr_dir . '/*.rss') as $filename) {
             unlink($filename);
         }
         rmdir($usr_dir);
     }
     /* 2: If it has portraits */
     if ($Weblog->blg_portrait != '') {
         unlink(BABEL_PREFIX . '/htdocs/img/b/' . $Weblog->blg_portrait . '.' . BABEL_PORTRAIT_EXT);
         unlink(BABEL_PREFIX . '/htdocs/img/b/' . $Weblog->blg_portrait . '_s.' . BABEL_PORTRAIT_EXT);
         unlink(BABEL_PREFIX . '/htdocs/img/b/' . $Weblog->blg_portrait . '_n.' . BABEL_PORTRAIT_EXT);
         mysql_unbuffered_query("DELETE FROM babel_weblog_portrait WHERE bgp_filename = '{$Weblog->blg_portrait}'");
         mysql_unbuffered_query("DELETE FROM babel_weblog_portrait WHERE bgp_filename = '{$Weblog->blg_portrait}_s'");
         mysql_unbuffered_query("DELETE FROM babel_weblog_portrait WHERE bgp_filename = '{$Weblog->blg_portrait}_n'");
     }
     /* 3: Clean all database records */
     mysql_unbuffered_query("DELETE FROM babel_weblog_entry_comment WHERE bec_eid IN (SELECT bge_id FROM babel_weblog_entry WHERE bge_pid = {$weblog_id})");
     // comments
     mysql_unbuffered_query("DELETE FROM babel_weblog_entry_tag WHERE bet_eid IN (SELECT bge_id FROM babel_weblog_entry WHERE bge_pid = {$weblog_id})");
     // tags
     mysql_unbuffered_query("DELETE FROM babel_weblog_entry WHERE bge_pid = {$weblog_id}");
     // entries
     mysql_unbuffered_query("DELETE FROM babel_weblog WHERE blg_id = {$weblog_id}");
     // weblog
     $_SESSION['babel_message_weblog'] = '博客网站 <strong>' . make_plaintext($Weblog->blg_title) . '</strong> 已经彻底关闭,全部相关数据清除完毕';
 }
示例#15
0
         $p->vxContainer('bank_transfer');
         break;
     } else {
         $p->URL->vxToRedirect($p->URL->vxGetLogin($p->URL->vxGetBankTransfer()));
         break;
     }
 case 'bank_transfer_confirm':
     if ($p->User->vxIsLogin()) {
         if ($p->User->usr_money >= 1800) {
             $rt = $p->Validator->vxSendMoneyCheck();
             if ($rt['errors'] == 0 && $rt['confirm'] == 1) {
                 $p->User->vxPay($p->User->usr_id, -$rt['amount_value'], 500, $p->User->usr_id . ':' . make_plaintext($rt['who_object']->usr_nick));
                 if ($rt['fee_value'] > 0) {
                     $p->User->vxPay($p->User->usr_id, -$rt['fee_value'], 502, '');
                 }
                 $p->User->vxPay($rt['who_object']->usr_id, $rt['amount_value'], 501, $p->User->usr_id . ':' . make_plaintext($p->User->usr_nick));
                 $mail = array();
                 $mail['subject'] = '收到来自 ' . $p->User->usr_nick . ' 的新汇款';
                 $mail['body'] = $rt['who_object']->usr_nick . ",你好!\n\n你在北京时间 " . date('Y-n-j G:i:s', time()) . " 收到了一笔来自 " . $p->User->usr_nick . " 的汇款,因此我们发送此邮件给你。\n\n-----------------------------------------------\n数额:" . $rt['amount_value'] . " 铜币\n-----------------------------------------------\n\n你可以点击下面的地址查看你目前在 " . Vocabulary::site_name . " 的经济状况。\n\nhttp://" . BABEL_DNS_NAME . $p->URL->vxGetExpenseView() . "\n\n备注:铜币是 " . Vocabulary::site_name . " 的虚拟货币单位。" . BABEL_AM_SIGNATURE;
                 $receiver = $rt['who_object']->usr_email;
                 $am = new Airmail($receiver, $mail['subject'], $mail['body'], $p->db);
                 $am->vxSend();
                 $am = null;
                 if (BABEL_DEBUG) {
                     if (isset($_SESSION['babel_debug_log'])) {
                         $_SESSION['babel_debug_log'][time() . '.' . rand(111, 999)] = 'babel - mail sent to: ' . $receiver;
                     } else {
                         $_SESSION['babel_debug_log'] = array();
                         $_SESSION['babel_debug_log'][time() . '.' . rand(111, 999)] = 'babel - mail sent to: ' . $receiver;
                     }
                 }
示例#16
0
 public function browse_node($name, $title)
 {
     return '포럼 <a href="/go/' . urlencode($name) . '" class="regular">' . make_plaintext($title) . '</a> 보기';
 }
示例#17
0
 public function vxBlogThemeSave()
 {
     $return = $_SERVER['HTTP_REFERER'];
     if ($this->User->vxIsLogin()) {
         if (isset($_GET['weblog_id'])) {
             $weblog_id = intval($_GET['weblog_id']);
             $sql = "SELECT blg_id, blg_uid, blg_title, blg_theme FROM babel_weblog WHERE blg_id = {$weblog_id}";
             $rs = mysql_query($sql);
             if ($_weblog = mysql_fetch_array($rs)) {
                 mysql_free_result($rs);
                 if ($_weblog['blg_uid'] == $this->User->usr_id) {
                     if (isset($_POST['blg_theme'])) {
                         $blg_theme = fetch_single($_POST['blg_theme']);
                         require BABEL_PREFIX . '/res/weblog_themes.php';
                         if (in_array($blg_theme, $_weblog_themes)) {
                             if ($_weblog['blg_theme'] != $blg_theme) {
                                 $sql = "UPDATE babel_weblog SET blg_theme = '{$blg_theme}', blg_dirty = 1 WHERE blg_id = {$weblog_id} LIMIT 1";
                                 mysql_unbuffered_query($sql);
                                 $_SESSION['babel_message_weblog'] = '博客网站 ' . make_plaintext($_weblog['blg_title']) . ' 已更换为使用 ' . $blg_theme . ' 主题,现在请重新构建以使用新主题';
                             }
                             return URL::vxToRedirect(URL::vxGetBlogList($_weblog['blg_id']));
                         } else {
                             $_SESSION['babel_message_weblog'] = '所指定的博客网站主题并不存在';
                             return URL::vxToRedirect(URL::vxGetBlogList($_weblog['blg_id']));
                         }
                     } else {
                         return URL::vxToRedirect(URL::vxGetBlogList($_weblog['blg_id']));
                     }
                 } else {
                     return js_alert('你没有权力对这个博客网站进行操作', '/blog/admin.vx');
                 }
             } else {
                 mysql_free_result($rs);
                 return js_alert('指定的博客网站没有找到', '/blog/admin.vx');
             }
         } else {
             return js_alert('指定的博客网站没有找到', '/blog/admin.vx');
         }
     } else {
         return js_alert('你还没有登录,请登录之后再进行操作', URL::vxGetLogin(URL::vxGetBlogAdmin));
     }
 }