[project-babel commit] r316 - in trunk: apache htdocs htdocs/core htdocs/img impl impl/iphone impl/mail impl/mail/mac.6....

3 views
Skip to first unread message

codesite...@google.com

unread,
Jan 14, 2008, 7:26:18 PM1/14/08
to v2ex-...@googlegroups.com
Author: v2ex.livid
Date: Mon Jan 14 16:25:31 2008
New Revision: 316

Added:
trunk/htdocs/core/LividUtil.php (contents, props changed)
trunk/htdocs/core/iPhoneCore.php (contents, props changed)
trunk/htdocs/img/bg_space.jpg (contents, props changed)
trunk/htdocs/img/m6_logo.png (contents, props changed)
trunk/impl/
trunk/impl/iphone/
trunk/impl/mail/
trunk/impl/mail/mac.6.cn/
trunk/impl/mail/mac.6.cn/signup.php
trunk/impl/mail/v2ex.com/
trunk/impl/mail/v2ex.com/signup.php
Removed:
trunk/htdocs/babel_iphone.php
Modified:
trunk/apache/babel.conf
trunk/apache/rewrite.conf
trunk/htdocs/babel.php
trunk/htdocs/babel_ing.php
trunk/htdocs/core/AirmailCore.php
trunk/htdocs/core/MobileCore.php
trunk/htdocs/core/Settings.example.php
trunk/htdocs/core/Shortcuts.php
trunk/htdocs/core/StandaloneCore.php
trunk/htdocs/core/UserCore.php
trunk/htdocs/core/Utilities.php
trunk/htdocs/core/V2EXCore.php
trunk/htdocs/core/ValidatorCore.php

Log:
[Portability] Critical update

Modified: trunk/apache/babel.conf
==============================================================================
--- trunk/apache/babel.conf (original)
+++ trunk/apache/babel.conf Mon Jan 14 16:25:31 2008
@@ -6,6 +6,7 @@
RewriteEngine On

Include /www/babel/apache/rewrite.conf
+ Include /www/babel/apache/rewrite_iphone.conf

DocumentRoot /www/babel/htdocs/
<Directory />

Modified: trunk/apache/rewrite.conf
==============================================================================
--- trunk/apache/rewrite.conf (original)
+++ trunk/apache/rewrite.conf Mon Jan 14 16:25:31 2008
@@ -38,6 +38,9 @@
RewriteRule ^/me$ /babel.php?m=user_home&do=me [L]
RewriteRule ^/u/(.+)$ /babel.php?m=user_home&user_nick=$1 [L]

+RewriteRule ^/f/([^/?&]+)$ /babel_mobile.php?m=friend&user_nick=$1 [L]
+RewriteRule ^/f/([^/?&]+)/([0-9]+)$
/babel_mobile.php?m=friend&user_nick=$1&p=$2 [L]
+
RewriteRule ^/pix/(.+)$ /babel.php?m=pix&user_nick=$1 [L]

RewriteRule ^/dry/new.vx$ /babel.php?m=dry_new [L]

Modified: trunk/htdocs/babel.php
==============================================================================
--- trunk/htdocs/babel.php (original)
+++ trunk/htdocs/babel.php Mon Jan 14 16:25:31 2008
@@ -1851,17 +1851,12 @@
case 'ing_personal':
$public = false;
if (isset($_GET['u'])) {
- $u = make_single_safe($_GET['u']);
+ $u = fetch_single($_GET['u']);
} else {
$u = false;
$public = true;
}
if ($u) {
- if (get_magic_quotes_gpc()) {
- $u = mysql_real_escape_string(stripslashes($u));
- } else {
- $u = mysql_real_escape_string($u);
- }
$User = $p->User->vxGetUserInfoByNick($u);
if (!$User) {
$public = true;
@@ -1884,17 +1879,12 @@
case 'ing_friends':
$public = false;
if (isset($_GET['u'])) {
- $u = make_single_safe($_GET['u']);
+ $u = fetch_single($_GET['u']);
} else {
$u = false;
$public = true;
}
if ($u) {
- if (get_magic_quotes_gpc()) {
- $u = mysql_real_escape_string(stripslashes($u));
- } else {
- $u = mysql_real_escape_string($u);
- }
$User = $p->User->vxGetUserInfoByNick($u);
if (!$User) {
$public = true;
@@ -1998,21 +1988,12 @@
case 'add':
$hot = false;
if (isset($_GET['u'])) {
- $u = make_single_safe($_GET['u']);
+ $u = fetch_single($_GET['u']);
} else {
$u = false;
$hot = true;
}
if ($u) {
- if (function_exists('get_magic_quotes_gpc')) {
- if (get_magic_quotes_gpc()) {
- $u = mysql_real_escape_string(stripslashes($u));
- } else {
- $u = mysql_real_escape_string($u);
- }
- } else {
- $u = mysql_real_escape_string($u);
- }
if (strtolower($u) == 'own') {
if ($p->User->vxIsLogin()) {
$User = $p->User->vxGetUserInfoByNick($p->User->usr_nick);

Modified: trunk/htdocs/babel_ing.php
==============================================================================
--- trunk/htdocs/babel_ing.php (original)
+++ trunk/htdocs/babel_ing.php Mon Jan 14 16:25:31 2008
@@ -51,11 +51,11 @@

case 'personal':
if (isset($_GET['u'])) { // u: usr_nick
- $u = make_single_safe($_GET['u']);
+ $u = fetch_single($_GET['u']);
if ($u == '') {
$p->vxPublic();
} else {
- $User = $p->User->vxGetUserInfoByNick();
+ $User = $p->User->vxGetUserInfoByNick($u);
}
}
$p->vxPersonal();

Modified: trunk/htdocs/core/AirmailCore.php
==============================================================================
--- trunk/htdocs/core/AirmailCore.php (original)
+++ trunk/htdocs/core/AirmailCore.php Mon Jan 14 16:25:31 2008
@@ -78,14 +78,24 @@
$this->headers['to'] = $receiver;

$this->params = array();
- $this->params["sendmail_path"] = '/usr/sbin/sendmail';
+ switch (BABEL_AM_SENDER) {
+ case 'sendmail':
+ $this->params["sendmail_path"] = '/usr/sbin/sendmail';
+ break;
+
+ case 'smtp':
+ $this->params["host"] = '127.0.0.1';
+ $this->params["port"] = '25';
+ break;
+ }
+
}

public function __destruct() {
}

public function vxSend() {
- $m =& Mail::factory('sendmail', $this->params);
+ $m =& Mail::factory(BABEL_AM_SENDER, $this->params);
$m->send($this->headers['to'], $this->headers, $this->body);
}
}

Added: trunk/htdocs/core/LividUtil.php
==============================================================================
--- (empty file)
+++ trunk/htdocs/core/LividUtil.php Mon Jan 14 16:25:31 2008
@@ -0,0 +1 @@
+link /www/footbig/src/core/EX/LividUtil.php
\ No newline at end of file

Modified: trunk/htdocs/core/MobileCore.php
==============================================================================
--- trunk/htdocs/core/MobileCore.php (original)
+++ trunk/htdocs/core/MobileCore.php Mon Jan 14 16:25:31 2008
@@ -57,6 +57,7 @@
require_once('core/ChannelCore.php');
require_once('core/URLCore.php');
require_once('core/ValidatorCore.php');
+ require_once('core/LividUtil.php');
} else {
die('<strong>Project Babel</strong><br /><br />Made by V2EX |
software for internet');
}
@@ -84,10 +85,27 @@
}
$this->URL = new URL();
$this->User = new User('', '', $this->db);
+ if (!isset($GLOBALS['SET_LANG'])) {
+ if ($this->User->vxIsLogin()) {
+ define('BABEL_LANG', $this->User->usr_lang);
+ } else {
+ include(BABEL_PREFIX . '/res/supported_languages.php');
+ if (isset($_SESSION['babel_lang'])) {
+ if (in_array($_SESSION['babel_lang'], array_keys($_languages))) {
+ define('BABEL_LANG', $_SESSION['babel_lang']);
+ } else {
+ define('BABEL_LANG', BABEL_LANG_DEFAULT);
+ }
+ } else {
+ define('BABEL_LANG', BABEL_LANG_DEFAULT);
+ }
+ }
+ $GLOBALS['SET_LANG'] = true;
+ }
$this->Validator = new Validator($this->db, $this->User);

if (!isset($_SESSION['babel_ua'])) {
- $_SESSION['babel_ua'] = $this->Validator->vxGetUserAgent();
+ $_SESSION['babel_ua'] = LividUtil::parseUserAgent();
}

global $CACHE_LITE_OPTIONS_SHORT;
@@ -109,9 +127,9 @@
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="/logout.vx">登出</a>');
+ echo('<a href="/babel_mobile.php?m=logout">登出</a>');
} else {
- echo('<a href="/login.vx">登录</a>');
+ echo('<a href="/babel_mobile.php?m=login">登录</a>');
}
echo('</small></div>');
echo('<div class="content">');
@@ -181,7 +199,7 @@
$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="/login.vx" method="post">');
+ 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" />');
@@ -224,7 +242,7 @@
}
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="/login.vx" method="post">');
+ 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" />');
@@ -237,14 +255,14 @@
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="/logout.vx">登出</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="/login.vx" method="post"><small
class="error">密码或者用户名错误</small><br />');
+ 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" />');
@@ -267,7 +285,7 @@
$this->vxBodyStart();
$this->vxH1();
echo('<div class="content"><small><a href="/' .
$_SESSION['babel_page_home_mobile'] . '">' .
Vocabulary::site_name . '</a> &gt; ' . Vocabulary::action_logout . '</small></div>');
- echo('<div class="content">你已经从 ' .
Vocabulary::site_name . ' 完全登出。<br /><br />感谢你访问
' . Vocabulary::site_name . ',没有任何的个人信息留在你当
前使用的设备上。<br /><br /><a href="/login.vx">重新登录</a></div>');
+ echo('<div class="content">你已经从 ' .
Vocabulary::site_name . ' 完全登出。<br /><br />感谢你访问
' . Vocabulary::site_name . ',没有任何的个人信息留在你当
前使用的设备上。<br /><br /><a
href="/babel_mobile.php?m=login">重新登录</a></div>');
$this->vxBottom();
$this->vxBodyEnd();
$this->vxHTMLEnd();
@@ -289,9 +307,9 @@
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="/logout.vx">登出</a>');
+ echo('<a href="/babel_mobile.php?m=logout">登出</a>');
} else {
- echo('<a href="/login.vx">登录</a>');
+ echo('<a href="/babel_mobile.php?m=login">登录</a>');
}
echo('</small></div>');
echo('<div class="content"><small><a href="/' .
$_SESSION['babel_page_home_mobile'] . '">' .
Vocabulary::site_name . '</a> &gt; ' .
make_plaintext($Section->nod_title) . ' &gt; ' . make_plaintext($Board->nod_title) . '</small></div>');
@@ -443,9 +461,9 @@
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="/logout.vx">登出</a>');
+ echo('<a href="/babel_mobile.php?m=logout">登出</a>');
} else {
- echo('<a href="/login.vx">登录</a>');
+ echo('<a href="/babel_mobile.php?m=login">登录</a>');
}
echo('</small></div>');
echo('<div class="content"><small><a href="/">V2EX</a> &gt; ' . $_u->usr_nick . '</small></div>');
@@ -537,9 +555,9 @@
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="/logout.vx">登出</a>');
+ echo('<a href="/babel_mobile.php?m=logout">登出</a>');
} else {
- echo('<a href="/login.vx">登录</a>');
+ echo('<a href="/babel_mobile.php?m=login">登录</a>');
}
echo('</small></div>');
echo('<div class="content">用户不存在</div>');
@@ -574,9 +592,9 @@
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="/logout.vx">登出</a>');
+ echo('<a href="/babel_mobile.php?m=logout">登出</a>');
} else {
- echo('<a href="/login.vx">登录</a>');
+ echo('<a href="/babel_mobile.php?m=login">登录</a>');
}
echo('</small></div>');
if ($_u) {
@@ -669,9 +687,9 @@
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="/logout.vx">登出</a>');
+ echo('<a href="/babel_mobile.php?m=logout">登出</a>');
} else {
- echo('<a href="/login.vx">登录</a>');
+ echo('<a href="/babel_mobile.php?m=login">登录</a>');
}
echo('</small></div>');
echo('<div class="content"><small><a href="/">' .
Vocabulary::site_name . '</a> &gt; ING</small></div>');

Modified: trunk/htdocs/core/Settings.example.php
==============================================================================
--- trunk/htdocs/core/Settings.example.php (original)
+++ trunk/htdocs/core/Settings.example.php Mon Jan 14 16:25:31 2008
@@ -51,6 +51,7 @@

define('BABEL_DEBUG', true);

+define('BABEL_AM_SENDER', 'smtp');
define('BABEL_AM_FROM', '"Project Babel" <nor...@yourdomain.tld>');
define('BABEL_AM_SUPPORT', 'sup...@yourdomain.tld');

define('BABEL_AM_SIGNATURE', "\n\n\n_______________________________________________\n\nProject Babel");

Modified: trunk/htdocs/core/Shortcuts.php
==============================================================================
--- trunk/htdocs/core/Shortcuts.php (original)
+++ trunk/htdocs/core/Shortcuts.php Mon Jan 14 16:25:31 2008
@@ -79,11 +79,29 @@
}

function _v_ico_map() {
- echo('<img src="' . CDN_UI . 'img/icons/silk/map.png"
align="absmiddle" alt="You are here" class="map" />');
+ switch (BABEL_DNS_DOMAIN) {
+ case 'v2ex.com':
+ default:
+ echo('<img src="' . CDN_UI . 'img/icons/silk/map.png"
align="absmiddle" alt="' . Vocabulary::SITE_NAME . '" class="map" />');
+ break;
+
+ case 'mac.6.cn':
+ echo('<img src="/img/m6_icon.gif" align="absmiddle" alt="You are
here" class="map" />');
+ break;
+ }
}

function _vo_ico_map() {
- return '<img src="' . CDN_UI . 'img/icons/silk/map.png"
align="absmiddle" alt="You are here" class="map" />';
+ switch (BABEL_DNS_DOMAIN) {
+ case 'v2ex.com':
+ default:
+ return '<img src="' . CDN_UI . 'img/icons/silk/map.png"
align="absmiddle" alt="' . Vocabulary::SITE_NAME . '" class="map" />';
+ break;
+
+ case 'mac.6.cn':
+ return '<img src="/img/m6_icon.gif" align="absmiddle" alt="M6"
class="map" />';
+ break;
+ }
}

function _v_ico_silk($icon, $align = 'absmiddle') {

Modified: trunk/htdocs/core/StandaloneCore.php
==============================================================================
--- trunk/htdocs/core/StandaloneCore.php (original)
+++ trunk/htdocs/core/StandaloneCore.php Mon Jan 14 16:25:31 2008
@@ -63,6 +63,7 @@
require('core/ValidatorCore.php');
require('core/WeblogCore.php');
require('core/EntryCore.php');
+ require('core/LividUtil.php');
} else {
die('<strong>Project Babel</strong><br /><br />Made by V2EX |
software for internet');
}
@@ -91,7 +92,7 @@
define('BABEL_LANG', $this->User->usr_lang);
$this->Validator = new Validator($this->db, $this->User);
if (!isset($_SESSION['babel_ua'])) {
- $_SESSION['babel_ua'] = $this->Validator->vxGetUserAgent();
+ $_SESSION['babel_ua'] = LividUtil::parseUserAgent();
}
$this->URL = new URL();
global $CACHE_LITE_OPTIONS_SHORT;

Modified: trunk/htdocs/core/UserCore.php
==============================================================================
--- trunk/htdocs/core/UserCore.php (original)
+++ trunk/htdocs/core/UserCore.php Mon Jan 14 16:25:31 2008
@@ -255,8 +255,13 @@
}

public function vxSessionStart() {
- setcookie('babel_usr_email', $this->usr_email, time() +
2678400, '/', BABEL_DNS_DOMAIN);
- setcookie('babel_usr_password',
$this->bf->encrypt($this->usr_password), time() + 2678400, '/', BABEL_DNS_DOMAIN);
+ if (BABEL_DEBUG) {
+ setcookie('babel_usr_email', $this->usr_email, time() + 2678400, '/');
+ setcookie('babel_usr_password',
$this->bf->encrypt($this->usr_password), time() + 2678400, '/');
+ } else {
+ setcookie('babel_usr_email', $this->usr_email, time() +
2678400, '/', BABEL_DNS_DOMAIN);
+ setcookie('babel_usr_password',
$this->bf->encrypt($this->usr_password), time() + 2678400, '/', BABEL_DNS_DOMAIN);
+ }
$_SESSION['babel_usr_email'] = $this->usr_email;
$_SESSION['babel_usr_password'] = $this->usr_password;
}
@@ -348,7 +353,8 @@
*
*/

- public function vxGetUserInfoByNick($user_nick) { //
mysql_real_escape_string() or other treatment is expected for $user_nick
+ 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)) {

Modified: trunk/htdocs/core/Utilities.php
==============================================================================
--- trunk/htdocs/core/Utilities.php (original)
+++ trunk/htdocs/core/Utilities.php Mon Jan 14 16:25:31 2008
@@ -327,8 +327,10 @@

function fetch_single($input) { // $input must be an element in GPC
$output = trim($input);
- if (get_magic_quotes_gpc()) {
- $output = stripslashes($output);
+ if (function_exists('get_magic_quotes_gpc')) {
+ if (get_magic_quotes_gpc()) {
+ $output = stripslashes($output);
+ }
}
$output = str_ireplace(chr(10), '', $output);
$output = str_ireplace(chr(13), '', $output);

Modified: trunk/htdocs/core/V2EXCore.php
==============================================================================
--- trunk/htdocs/core/V2EXCore.php (original)
+++ trunk/htdocs/core/V2EXCore.php Mon Jan 14 16:25:31 2008
@@ -84,6 +84,7 @@

/* new world cores */
require_once('core/SimpleStorageCore.php');
+ require_once('core/LividUtil.php');
} else {
die('<strong>Project Babel</strong><br /><br />Made by <a
href="http://labs.v2ex.com/">V2EX</a> | software for internet');
}
@@ -186,6 +187,7 @@
define('BABEL_LANG', BABEL_LANG_DEFAULT);
}
}
+ $GLOBALS['SET_LANG'] = true;
require_once(BABEL_PREFIX . '/lang/' . BABEL_LANG . '/lang.php');
$this->lang = new lang();
if ($this->User->vxIsLogin()) {
@@ -200,7 +202,7 @@
}
$this->Validator = new Validator($this->db, $this->User);
if (!isset($_SESSION['babel_ua'])) {
- $_SESSION['babel_ua'] = $this->Validator->vxGetUserAgent();
+ $_SESSION['babel_ua'] = LividUtil::parseUserAgent();
}
$sql = 'DELETE FROM babel_online WHERE onl_lastmoved < ' . (time() - BABEL_USR_ONLINE_DURATION);
mysql_query($sql, $this->db);
@@ -469,19 +471,19 @@
public function vxLink($feedURL = BABEL_FEED_URL) {
echo('<link href="/favicon.ico" rel="shortcut icon" />');
echo('<link rel="stylesheet" type="text/css" href="/css/themes/' .
BABEL_THEME . '/css_babel.css?' . date('YnjG', time()) . '" />');
- // $_SESSION['babel_ua'] = $this->Validator->vxGetUserAgent();
+ $_SESSION['babel_ua'] = LividUtil::parseUserAgent();
if ($_SESSION['babel_ua']['FF3_DETECTED']) {
echo('<style type="text/css">body, html { background: #000
url("/img/bg_city.jpg") no-repeat 50% 0; }</style>');
}
echo('<link rel="stylesheet" type="text/css" href="/css/themes/' .
BABEL_THEME . '/css_extra.css?' . date('YnjG', time()) . '" />');
echo('<link rel="stylesheet" type="text/css" href="/css/themes/' .
BABEL_THEME . '/css_zen.css" />');
- //echo('<link rel="stylesheet" type="text/css"
href="/css/lightbox.css" media="screen" />');
+ echo('<link rel="stylesheet" type="text/css"
href="/css/lightbox.css" media="screen" />');
echo('<link rel="alternate" type="application/rss+xml" title="' .
Vocabulary::site_name . ' RSS" href="' . $feedURL . '" />');
echo('<script type="text/javascript" src="/js/babel.js"></script>');
echo('<script type="text/javascript" src="/js/babel_zen.js"></script>');
- //echo('<script type="text/javascript" src="' . CDN_UI . 'js/prototype.js"></script>');
- //echo('<script type="text/javascript" src="' . CDN_UI . 'js/scriptaculous.js?load=effects"></script>');
- //echo('<script type="text/javascript" src="' . CDN_UI . 'js/lightbox.js"></script>');
+ echo('<script type="text/javascript" src="' . CDN_UI . 'js/prototype.js"></script>');
+ echo('<script type="text/javascript" src="' . CDN_UI . 'js/scriptaculous.js?load=effects"></script>');
+ echo('<script type="text/javascript" src="' . CDN_UI . 'js/lightbox.js"></script>');
}

/* E module: link and script tags */
@@ -529,9 +531,18 @@
}

/* nav menu start: */
- echo('<div id="top_banner" align="left">');
-
- $img_logo = 'v2ex_logo_uranium.png';
+ switch (BABEL_DNS_DOMAIN) {
+ case 'v2ex.com':
+ default:
+ echo('<div id="top_banner" align="left">');
+ $img_logo = 'v2ex_logo_uranium.png';
+ break;
+
+ case 'mac.6.cn':
+ echo('<div id="top_banner" align="left" style="background-image:
url(\'/img/bg_space.jpg\'); border-bottom: 1px solid #777;">');
+ $img_logo = 'm6_logo.png';
+ break;
+ }

if ($this->User->usr_id != 0) {
if ($usr_share = $this->cs->get('babel_user_share_' .
$this->User->usr_id)) {
@@ -2247,28 +2258,30 @@

public function vxHome($style) {
$o = '<div id="main">';
- if (!$this->User->vxIsLogin()) {
- $o .= '<div class="blank">';
- switch (BABEL_LANG) {
- case 'en_us':
- default:
- $o .= '<img src="/img/splash/0709/en_us.png" />';
- break;
- case 'zh_cn':
- $o .= '<img src="/img/splash/0709/zh_cn.png" />';
- break;
- }
- $o .= _vo_hr();
- switch (BABEL_LANG) {
- case 'en_us':
- default:
- $o .= '<span class="tip_i"><a href="/login"
class="regular"><strong>Sign In</strong></a> if you\'re already
registered or <a href="/signup.html" class="regular"><strong>Create
Your Free Account</strong></a> now.';
- break;
- case 'zh_cn':
- $o .= '<span class="tip_i">如果你已经有账户,那么请
<a href="/login" class="regular"><strong>登入</strong></a> 或者现
在就 <a href="/signup.html" class="regular"><strong>注册一个新账
户</strong></a>';
- break;
+ if (BABEL_DNS_DOMAIN == 'v2ex.com') {
+ if (!$this->User->vxIsLogin()) {
+ $o .= '<div class="blank">';
+ switch (BABEL_LANG) {
+ case 'en_us':
+ default:
+ $o .= '<img src="/img/splash/0709/en_us.png" />';
+ break;
+ case 'zh_cn':
+ $o .= '<img src="/img/splash/0709/zh_cn.png" />';
+ break;
+ }
+ $o .= _vo_hr();
+ switch (BABEL_LANG) {
+ case 'en_us':
+ default:
+ $o .= '<span class="tip_i"><a href="/login"
class="regular"><strong>Sign In</strong></a> if you\'re already
registered or <a href="/signup.html" class="regular"><strong>Create
Your Free Account</strong></a> now.';
+ break;
+ case 'zh_cn':
+ $o .= '<span class="tip_i">如果你已经有账户,那么请
<a href="/login" class="regular"><strong>登入</strong></a> 或者现
在就 <a href="/signup.html" class="regular"><strong>注册一个新账
户</strong></a>';
+ break;
+ }
+ $o .= '</span></div>';
}
- $o .= '</span></div>';
}
if ($_SESSION['hits'] < 10) {
$o .= file_get_contents(BABEL_PREFIX . '/res/hot.html');
@@ -5269,13 +5282,10 @@
echo(' ' . $this->lang->register_agreement() . '</div>');
} else {
$mail = array();
- $mail['subject'] = "{$this->User->usr_nick} 你好,欢迎来到
" . Vocabulary::site_name;
- $mail['body'] = "{$this->User->usr_nick},你好!\n\n" .
Vocabulary::site_name . " 欢迎你的到来,你或许会对 " .
Vocabulary::site_name . " 这个名字感到好奇吧?\n\n" .
Vocabulary::site_name . " 是两个短句的缩写,way too extreme 和
way to explore,前者关于一种生活的态度,后者关于我们
每天都会产生然后又失去的好奇心。So is V2EX,希望你
喜欢。\n\n目前看来,V2EX 是一个普普通通不足为奇的社
区(或者说论坛),不过,我们正在修建一个有着透明
玻璃的怪物博物馆,不久的将来,每天都会有各种怪物
可以玩,也是相当开心的事情吧。\n\nEnjoy!" . BABEL_AM_SIGNATURE;
-
+ include(BABEL_PREFIX . '/impl/mail/' . BABEL_DNS_DOMAIN . '/signup.php');
$am = new Airmail($this->User->usr_email, $mail['subject'],
$mail['body'], $this->db);
$am->vxSend();
$am = null;
-
echo('<div class="blank" align="left"><span class="text_large"><img
src="/img/ico_smile.gif" align="absmiddle" class="home" />' .
$this->User->usr_nick . ',恭喜你!注册成功</span>');
echo('<table cellpadding="5" cellspacing="0" border="0"
class="form"><tr><td width="200" align="right" valign="top">' .
$this->lang->email() . '</td><td align="left">' .
$this->User->usr_email . '</td></tr><tr><td width="200" align="right"
valign="top">' . $this->lang->user_id() . '</td><td align="left">' .
$this->User->usr_nick . '</td></tr><tr><td width="200" align="right"
valign="top">' . $this->lang->password() . '</td><td align="left"><div class="important">');
$max = rand(1, 6) * 4;
@@ -11011,7 +11021,7 @@
_v_hr();
_v_btn_f('创建', 'dry_new');
_v_hr();
- echo('<div class="notify">你可以将新项目的查看权限设置
为公开或者私密,如果设置为公开,请确保你的内容和
V2EX 的 <a href="/community_guidelines.vx" class="t">社区指导原
则</a> 相符</div>');
+ echo('<div class="notify">你可以将新项目的查看权限设置
为公开或者私密,如果设置为公开,请确保你的内容和
' . Vocabulary::SITE_NAME . ' 的 <a href="/community_guidelines.vx"
class="t">社区指导原则</a> 相符</div>');
echo('</form>');
_v_d_e();
_v_b_l_s();
@@ -11073,7 +11083,7 @@
_v_hr();
_v_btn_f('创建', 'dry_new');
_v_hr();
- echo('<div class="notify">你可以将新项目的查看权限设置
为公开或者私密,如果设置为公开,请确保你的内容和
V2EX 的 <a href="/community_guidelines.vx" class="t">社区指导原
则</a> 相符</div>');
+ echo('<div class="notify">你可以将新项目的查看权限设置
为公开或者私密,如果设置为公开,请确保你的内容和
' . Vocabulary::SITE_NAME . ' 的 <a href="/community_guidelines.vx"
class="t">社区指导原则</a> 相符</div>');
echo('</form>');
_v_d_e();
_v_b_l_s();
@@ -13084,7 +13094,7 @@
_v_d_e();
_v_b_l_s(); // Introduction
_v_ico_silk('information');
- echo(' 你可以在 V2EX Shop 买到各种有用的在线应用程序
和资料,一切都在持续更新中。');
+ echo(' 你可以在 ' . Vocabulary::SITE_NAME . ' Shop 买到各种
有用的在线应用程序和资料,一切都在持续更新中。');
_v_d_e();
_v_b_l_s(); // Shop
echo('<span class="text_large">Buy</span>');
@@ -13120,7 +13130,7 @@
_v_d_e();
_v_b_l_s(); // Information for Developers
_v_ico_silk('cog');
- echo(' 如果你熟悉程序开发,希望开发能够被放到
V2EX Shop 中进行出售的物品,请参考 Project Babel 的
SimpleStorage 实现。');
+ echo(' 如果你熟悉程序开发,希望开发能够被放到 ' .
Vocabulary::SITE_NAME . ' Shop 中进行出售的物品,请参考
Project Babel 的 SimpleStorage 实现。');
_v_d_e();
_v_d_e();
}

Modified: trunk/htdocs/core/ValidatorCore.php
==============================================================================
--- trunk/htdocs/core/ValidatorCore.php (original)
+++ trunk/htdocs/core/ValidatorCore.php Mon Jan 14 16:25:31 2008
@@ -539,324 +539,7 @@
}

/* E module: URL Classified logic */
-
- /* S module: User Agent Check logic */
-
- public function vxGetUserAgent($ua = '') {
- if ($ua == '') {
- if (isset($_SERVER['HTTP_USER_AGENT'])) {
- $ua = $_SERVER['HTTP_USER_AGENT'];
- } else {
- if (isset($_SERVER['HTTP_VIA'])) {
- if (preg_match('/(infoX)|(Nokia WAP Gateway)|(WAP)/i',
$_SERVER['HTTP_VIA'], $z)) {
- $o['ua'] = $_SERVER['HTTP_VIA'];
- $o['name'] = 'WAP Gateway';
- $o['platform'] = 'Handheld';
- $o['version'] = '0';
- $o['DEVICE_LEVEL'] = 2;
- return $o;
- }
- }
- }
- }
-
- $o = array();
-
- $o['ua'] = $ua;
- $o['platform'] = '';
- $o['name'] = '';
- $o['version'] = '';
- $o['PSP_DETECTED'] = 0;
- $o['MSIE_DETECTED'] = 0;
- $o['GECKO_DETECTED'] = 0;
- $o['FF3_DETECTED'] = 0;
- $o['KHTML_DETECTED'] = 0;
- $o['OPERA_DETECTED'] = 0;
- $o['IPHONE_DETECTED'] = 0;
- $o['LEGACY_ENCODING'] = 0;
- /* DEVICE_LEVEL
- 0 => bot
- 1 => plaintext
- 2 => handheld (limited display and processor)
- 3 => pc (full capable)
- 4 => fetcher (just file access)
- 5 => tv (various features supported)
- */
- $o['DEVICE_LEVEL'] = 0;
-
- /* PSP Internet Browser
- * Example: Mozilla/4.0 (PSP (PlayStation Portable); 2.00) */
- if (preg_match('/Mozilla\/4\.0 \(PSP \(PlayStation Portable\);
([2-9]?\.[0-9]*)\)/', $ua, $z)) {
- $o['platform'] = 'PSP';
- $o['name'] = 'PSP Internet Browser';
- $o['version'] = $z[1];
- $o['PSP_DETECTED'] = 1;
- $o['DEVICE_LEVEL'] = 2;
- return $o;
- }
-
- /* PalmOne Blazer */
- if (preg_match('/Blazer\/([1-9]+\.[0-9a-zA-Z]*)/', $ua, $z) &&
preg_match('/Palm/', $ua)) {
- $o['platform'] = 'PalmOS';
- $o['name'] = 'Blazer';
- $o['version'] = $z[1];
- $o['DEVICE_LEVEL'] = 2;
- return $o;
- }
-
- /* Xiino
- * Example: Xiino/3.4E [en] (v.5.4.8; 153x130; c16/d) */
- if (preg_match('/Xiino\/([0-9a-zA-Z\.]*)/', $ua, $z)) {
- $o['platform'] = 'PalmOS';
- $o['name'] = 'Xiino';
- $o['version'] = $z[1];
- $o['LEGACY_ENCODING'] = 1;
- $o['DEVICE_LEVEL'] = 2;
- return $o;
- }
-
- /* Nokia 9300 Opera
- * Example: Nokia9300/5.50 Series80/2.0 Profile/MIDP-2.0
Configuration/CLDC-1.1 */
- if (preg_match('/Nokia9300\/([0-9]+)\.([0-9]+)
Series80\/([0-9]+)\.([0-9]+) Profile\/MIDP-([0-9]+)\.([0-9]+)
Configuration\/CLDC-([0-9]+)\.([0-9]+)/', $ua, $z)) {
- $o['platform'] = 'Nokia9300';
- $o['name'] = 'Opera';
- $o['version'] = '6.0';
- $o['DEVICE_LEVEL'] = 2;
- $o['OPERA_DETECTED'] = 1;
- return $o;
- }
-
- /* PocketLink
- * Example: Mozilla/5.0 (compatible; PalmOS) PLink 2.56c */
- if (preg_match('/Mozilla\/5\.0 \(compatible; PalmOS\) PLink
([0-9a-zA-Z\.]*)/', $ua, $z)) {
- $o['platform'] = 'PalmOS';
- $o['name'] = 'PocketLink';
- $o['version'] = $z[1];
- $o['LEGACY_ENCODING'] = 1;
- $o['DEVICE_LEVEL'] = 2;
- return $o;
- }
-
- /* Opera (Identify as Opera)
- * Example: Opera/8.5 (Macintosh; PPC Mac OS X; U; zh-cn)
- * Example: Opera/8.50 (Windows NT 5.0; U; en) */
- if (preg_match('/Opera\/([0-9]+\.[0-9]+) \(([a-zA-Z0-9\.\- ]*);
([a-zA-Z0-9\.\- ]*); ([a-zA-Z0-9\.\-\; ]*)\)/', $ua, $z)) {
- if (preg_match('/(Linux|Mac OS X)/', $ua, $y)) {
- $o['platform'] = $y[1];
- } else {
- $o['platform'] = $z[2];
- }
- $o['name'] = 'Opera';
- $o['version'] = $z[1];
- $o['DEVICE_LEVEL'] = 3;
- $o['OPERA_DETECTED'] = 1;
- return $o;
- }
-
- /* Opera (Identify as MSIE 6.0)
- * Example: Mozilla/4.0 (compatible; MSIE 6.0; X11; Linux i686; en)
Opera 8.5
- * Example: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; en)
Opera 8.50 */
- if (preg_match('/Mozilla\/4\.0 \(compatible; MSIE ([0-9\.]*);
([a-zA-Z0-9\-\.;_ ]*); ([a-zA-Z0-9\-\.;_ ]*)\) Opera ([0-9\.]*)/', $ua,
$z)) {
- if (preg_match('/(Linux|Mac OS X)/', $z[2], $y)) {
- $o['platform'] = $y[1];
- } else {
- $o['platform'] = $z[2];
- }
- $o['name'] = 'Opera';
- $o['version'] = $z[4];
- $o['DEVICE_LEVEL'] = 3;
- $o['OPERA_DETECTED'] = 1;
- return $o;
- }
-
- /* Opera (Identify as Mozilla/5.0)
- * Example: Mozilla/5.0 (X11; Linux i686; U; en) Opera 8.5
- * Example: Mozilla/5.0 (Windows NT 5.0; U; en) Opera 8.50 */
- if (preg_match('/Mozilla\/5\.0 \(([a-zA-Z0-9\-\. ]*);
([a-zA-Z0-9\-\. ]*); ([a-zA-Z0-9\-\.; ]*)\) Opera ([0-9\.]*)/', $ua,
$z)) {
- if (preg_match('/Windows ([a-zA-Z0-9\.\- ]*)/', $z[1], $y)) {
- $o['platform'] = $y[0];
- } else {
- if (preg_match('/(Linux|Mac OS X)/', $z[2], $y)) {
- $o['platform'] = $y[1];
- } else {
- $o['platform'] = $z[2];
- }
- }
- $o['name'] = 'Opera';
- $o['version'] = $z[4];
- $o['DEVICE_LEVEL'] = 3;
- $o['OPERA_DETECTED'] = 1;
- return $o;
- }
-
- /* Apple iPhone
- * Example: Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en)
AppleWebKit/420+(KHTML, like Gecko) Version/3.0 Mobile/1C25
Safari/419.3 */
- if (preg_match('/Mozilla\/5\.0 \(iPhone; U; CPU like Mac OS X;
([a-z\-]+)\) AppleWebKit\/([a-z0-9]+)\+ \(KHTML, like Gecko\)
Version\/3.0 Mobile\/([a-zA-Z0-9]+) Safari\/([0-9]+\.[0-9]+)/', $ua,
$z)) {
- $o['platform'] = 'Mac OS X';
- $o['name'] = 'Safari';
- $o['version'] = $z[2];
- $o['DEVICE_LEVEL'] = 3;
- $o['KHTML_DETECTED'] = 1;
- $o['IPHONE_DETECTED'] = 1;
- return $o;
- }
-
- /* Apple Safari 2.x
- * Example: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; zh-cn)
AppleWebKit/412.7 (KHTML, like Gecko) Safari/412.5 */
- if (preg_match('/Mozilla\/5\.0 \(Macintosh; U;([a-zA-Z0-9\s]+);
[a-z\-]+\) AppleWebKit\/([0-9]+\.[0-9]+) \(KHTML, like Gecko\)
Safari\/([0-9]+\.[0-9]+)/', $ua, $z)) {
- $o['platform'] = 'Mac OS X';
- $o['name'] = 'Safari';
- $o['version'] = $z[2];
- $o['DEVICE_LEVEL'] = 3;
- $o['KHTML_DETECTED'] = 1;
- return $o;
- }
-
- /* Apple Safari 3.x on Mac OS X
- * Example: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en)
AppleWebKit/522.10.1 (KHTML, like Gecko) Version/3.0 Safari/522.11 */
- if (preg_match('/Mozilla\/5\.0 \(Macintosh; U;([a-zA-Z0-9\s]+);
[a-z\-]+\) AppleWebKit\/([0-9]+\.[0-9]+\.[0-9]+) \(KHTML, like Gecko\)
Version\/([0-9]+\.[0-9]+) Safari\/([0-9]+\.[0-9]+)/', $ua, $z)) {
- $o['platform'] = 'Mac OS X';
- $o['name'] = 'Safari';
- $o['version'] = $z[3];
- $o['DEVICE_LEVEL'] = 3;
- $o['KHTML_DETECTED'] = 1;
- return $o;
- }
-
- /* Apple Safari 3.x on Windows
- * Example: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh)
AppleWebKit/522.11.3 (KHTML, like Gecko) Version/3.0 Safari/522.11.3 */
- if (preg_match('/Mozilla\/5\.0 \(Windows; U;([a-zA-Z0-9\.\s]+);
[a-z\-]+\) AppleWebKit\/([0-9]+\.[0-9]+\.[0-9]+) \(KHTML, like Gecko\)
Version\/([0-9]+\.[0-9]+) Safari\/([0-9]+\.[0-9]+)/', $ua, $z)) {
- $o['platform'] = 'Windows';
- $o['name'] = 'Safari';
- $o['version'] = $z[3];
- $o['DEVICE_LEVEL'] = 3;
- $o['KHTML_DETECTED'] = 1;
- return $o;
- }
-
- /* Apple WebKit
- * Example: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en)
AppleWebKit/420+ (KHTML, like Gecko) Safari/417.9.2 */
- if (preg_match('/Mozilla\/5\.0 \(Macintosh; U;([a-zA-Z0-9\s]+);
[a-z\-]+\) AppleWebKit\/([0-9\+\.]+) \(KHTML, like Gecko\)
Safari\/([0-9]+\.[0-9]+)/', $ua, $z)) {
- $o['platform'] = 'Mac OS X';
- $o['name'] = 'WebKit';
- $o['version'] = $z[2];
- $o['DEVICE_LEVEL'] = 3;
- $o['KHTML_DETECTED'] = 1;
- return $o;
- }
-
- /* Shiira (WebKit based)
- * Example: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en)
AppleWebKit/419 (KHTML, like Gecko) Shiira/2.0 b2 Safari/125 */
- if (preg_match('/Mozilla\/5\.0 \(Macintosh; U;([a-zA-Z0-9\s]+);
[a-z\-]+\) AppleWebKit\/([0-9\+\.]+) \(KHTML, like Gecko\)
Shiira\/([0-9]+\.[0-9]+) ([b0-9]+) Safari\/([0-9]+)/', $ua, $z)) {
- $o['platform'] = 'Mac OS X';
- $o['name'] = 'Shiira';
- if (isset($z[5])) {
- $o['version'] = $z[3] . ' ' . $z[4];
- } else {
- $o['version'] = $z[3];
- }
- $o['DEVICE_LEVEL'] = 3;
- $o['KHTML_DETECTED'] = 1;
- return $o;
- }
-
- /* KDE Konqueror
- * Example: Mozilla/5.0 (compatible; Konqueror/3.4; Linux)
KHTML/3.4.2 (like Gecko) (Debian package 4:3.4.2-4) */
- if (preg_match('/Mozilla\/5\.0 \(compatible; Konqueror\/([0-9\.]*);
([a-zA-Z]*)\) KHTML\/([0-9\.]*)/', $ua, $z)) {
- $o['platform'] = $z[2];
- $o['name'] = 'Konqueror';
- $o['version'] = $z[1];
- $o['DEVICE_LEVEL'] = 3;
- $o['KHTML_DETECTED'] = 1;
- return $o;
- }
-
- /* iCab
- * Example: Mozilla/5.0 (compatible; iCab 3.0.1; Macintosh; U; PPC
Mac OS X)*/
- if (preg_match('/Mozilla\/5\.0 \(compatible; iCab ([0-9\.]+);
Macintosh; U; PPC Mac OS X\)/', $ua, $z)) {
- $o['platform'] = 'Macintosh';
- $o['name'] = 'iCab';
- $o['version'] = $z[1];
- $o['DEVICE_LEVEL'] = 3;
- return $o;
- }
-
- /* Microsoft Internet Explorer
- * Example: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50215) */
- if (preg_match('/Mozilla\/4\.0 \([a-z]+; MSIE ([0-9]+\.[0-9]+);
([a-zA-Z0-9\.\- ]+)/', $ua, $z)) {
- $o['platform'] = $z[2];
- $o['name'] = 'Internet Explorer';
- $o['version'] = $z[1];
- $o['DEVICE_LEVEL'] = 3;
- $o['MSIE_DETECTED'] = 1;
- return $o;
- }
-
- /* Chimera
- * Example: Chimera/2.0alpha */
- if (preg_match('/^Chimera\/([0-9a-zA-Z\.]*)/', $ua, $z)) {
- $o['platform'] = 'Unix';
- $o['name'] = 'Chimera';
- $o['version'] = $z[1];
- $o['DEVICE_LEVEL'] = 3;
- return $o;
- }

- /* Mozilla Camino | Firefox | Firebird | Thunderbird | SeaMonkey |
Sunbird | Epiphany
- * Camino Example: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O;
en-US; rv:1.8b4) Gecko/20050914 Camino/1.0a1
- * Firefox Example: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O;
en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4
- * Firefox Example: Mozilla/5.0 (X11; U; Linux i686; en-US;
rv:1.7.12) Gecko/20050922 Firefox/1.0.7 (Debian package 1.0.7-1) */
- if (preg_match('/Mozilla\/5\.0 \(([a-zA-Z0-9]+); U; ([0-9a-zA-Z\.\-
]+); [a-zA-Z\- ]*; rv:([0-9a-z\.]+)\) Gecko\/([0-9]+) (Camino|Firefox|
Firebird|GranParadiso|Minefield|SeaMonkey|Thunderbird|Sunbird|
Epiphany)\/([0-9]+\.[0-9a-zA-Z\.]*)/', $ua, $z)) {
- if ($z[1] == 'Windows' | preg_match('/X11/', $z[1])) {
- $o['platform'] = $z[2];
- if (preg_match('/(Linux)/', $o['platform'], $y)) {
- $o['platform'] = $y[1];
- }
- } else {
- $o['platform'] = $z[1];
- }
- $o['name'] = $z[5];
- $o['version'] = $z[6];
- $o['DEVICE_LEVEL'] = 3;
- $o['GECKO_DETECTED'] = 1;
- if ($o['name'] == 'Firefox' || $o['name'] == 'Minefield') {
- if (preg_match('/^3\.0/', $o['version'])) {
- $o['FF3_DETECTED'] = 1;
- }
- }
- return $o;
- }
-
- /* Mozilla Suite
- * Example: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US;
rv:1.7.12) Gecko/20050915 */
- if (preg_match('/Mozilla\/5\.0 \(([a-zA-Z0-9]+); U; ([0-9a-zA-Z\.\-
]*); [a-zA-Z\- ]*; rv:([0-9a-z\.]+)\) Gecko\/([0-9]+)/', $ua, $z)) {
- if ($z[1] == 'Windows' | preg_match('/X11/', $z[1])) {
- $o['platform'] = $z[2];
- if (preg_match('/(Linux)/', $o['platform'], $y)) {
- $o['platform'] = $y[1];
- }
- } else {
- $o['platform'] = $z[1];
- }
- $o['name'] = 'Mozilla';
- $o['version'] = $z[3];
- $o['DEVICE_LEVEL'] = 3;
- $o['GECKO_DETECTED'] = 1;
- return $o;
- }
-
- /* Unknown Vendor Unknown Browser */
- if ($o['name'] == '') {
- $o['platform'] = 'Unknown Platform';
- $o['name'] = 'Unknown Browser';
- $o['version'] = 'Unknown Version';
- $o['DEVICE_LEVEL'] = 0;
- return $o;
- }
- }
-
- /* E module: User Agent Check logic */
-
/* S module: User Create Check logic */

public function vxUserCreateCheck() {
@@ -887,7 +570,7 @@
/* usr_nick_error:
0 => no error
1 => empty
- 2 => overflow (20 mbs)
+ 2 => overflow (12 mbs)
3 => invalid characters
4 => conflict
999 => unspecific */
@@ -1009,7 +692,7 @@
$rt['usr_nick_error'] = 1;
$rt['errors']++;
} else {
- if (mb_strlen($rt['usr_nick_value']) > 20) {
+ if (mb_strlen($rt['usr_nick_value'], 'UTF-8') > 12) {
$rt['usr_nick_error'] = 2;
$rt['errors']++;
} else {
@@ -1279,7 +962,7 @@
/* usr_nick_error:
0 => no error
1 => empty
- 2 => overflow (20 mbs)
+ 2 => overflow (12 mbs)
3 => invalid characters
4 => conflict
999 => unspecific */
@@ -1410,7 +1093,7 @@
$rt['usr_nick_error'] = 1;
$rt['errors']++;
} else {
- if (mb_strlen($rt['usr_nick_value'], 'UTF-8') > 20) {
+ if (mb_strlen($rt['usr_nick_value'], 'UTF-8') > 12) {
$rt['usr_nick_error'] = 2;
$rt['errors']++;
} else {

Added: trunk/htdocs/core/iPhoneCore.php
==============================================================================
--- (empty file)
+++ trunk/htdocs/core/iPhoneCore.php Mon Jan 14 16:25:31 2008
@@ -0,0 +1,37 @@
+<?php
+/* Project Babel
+ *
+ * Author: Livid Liu <v2ex....@mac.com>
+ * File: /htdocs/core/iPhoneCore.php
+ * Usage: iPhone Core Class
+ * Format: 1 tab indent(4 spaces), LF, UTF-8, no-BOM
+ *
+ * Subversion Keywords:
+ *
+ * $Id$
+ * $Date$
+ * $Revision$
+ * $Author$
+ * $URL$
+ *
+ * Copyright (C) 2006 Livid Liu <v2ex....@mac.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+class iPhoneCore {
+
+}
+?>
\ No newline at end of file

Added: trunk/htdocs/img/bg_space.jpg
==============================================================================
Binary file. No diff available.

Added: trunk/htdocs/img/m6_logo.png
==============================================================================
Binary file. No diff available.

Added: trunk/impl/mail/mac.6.cn/signup.php
==============================================================================
--- (empty file)
+++ trunk/impl/mail/mac.6.cn/signup.php Mon Jan 14 16:25:31 2008
@@ -0,0 +1,4 @@
+<?php
+$mail['subject'] = "{$this->User->usr_nick} 你好,欢迎来到 " . Vocabulary::site_name;
+$mail['body'] = "{$this->User->usr_nick},你好!\n\n" .
Vocabulary::site_name . " 欢迎你的到来,这是一个关于 Mac
的分享和交流的地方,希望你喜欢!\n\nEnjoy!" . BABEL_AM_SIGNATURE;
+?>
\ No newline at end of file

Added: trunk/impl/mail/v2ex.com/signup.php
==============================================================================
--- (empty file)
+++ trunk/impl/mail/v2ex.com/signup.php Mon Jan 14 16:25:31 2008
@@ -0,0 +1,4 @@
+<?php
+$mail['subject'] = "{$this->User->usr_nick} 你好,欢迎来到 " . Vocabulary::site_name;
+$mail['body'] = "{$this->User->usr_nick},你好!\n\n" .
Vocabulary::site_name . " 欢迎你的到来,你或许会对 " .
Vocabulary::site_name . " 这个名字感到好奇吧?\n\n" .
Vocabulary::site_name . " 是两个短句的缩写,way too extreme 和
way to explore,前者关于一种生活的态度,后者关于我们
每天都会产生然后又失去的好奇心。So is V2EX,希望你
喜欢。\n\n目前看来,V2EX 是一个普普通通不足为奇的社
区(或者说论坛),不过,我们正在修建一个有着透明
玻璃的怪物博物馆,不久的将来,每天都会有各种怪物
可以玩,也是相当开心的事情吧。\n\nEnjoy!" . BABEL_AM_SIGNATURE;
+?>
\ No newline at end of file

codesite...@google.com

unread,
Jan 14, 2008, 7:26:18 PM1/14/08
to v2ex-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages