Added:
trunk/htdocs/img/welcome_001.png (contents, props changed)
Modified:
trunk/apache/htaccess/.htaccess
trunk/apache/rewrite.conf
trunk/htdocs/babel.php
trunk/htdocs/core/NodeCore.php
trunk/htdocs/core/StandaloneCore.php
trunk/htdocs/core/URLCore.php
trunk/htdocs/core/Utilities.php
trunk/htdocs/core/V2EXCore.php
trunk/htdocs/core/ValidatorCore.php
trunk/htdocs/img/powered.png
trunk/lang/de_de/lang.php
Log:
[I18N] Node editor.
Modified: trunk/apache/htaccess/.htaccess
==============================================================================
--- trunk/apache/htaccess/.htaccess (original)
+++ trunk/apache/htaccess/.htaccess Mon Sep 24 16:56:33 2007
@@ -148,6 +148,9 @@
RewriteRule ^board/view/([0-9]*)/([0-9]*).html$ /babel.php?m=board_view&board_id=$1&p=$2 [L]
RewriteRule ^board/view/([0-9]*).html$ /babel.php?m=board_view&board_id=$1 [L]
+RewriteRule ^node/edit/([0-9]*).vx$ /babel.php?m=node_edit&node_id=$1 [L]
+RewriteRule ^node/save/([0-9]*).vx$ /babel.php?m=node_save&node_id=$1 [L]
+
RewriteRule ^section/view/([0-9]*).html$ /babel.php?m=section_view§ion_id=$1 [L]
RewriteRule ^topic/top.html$ /babel.php?m=topic_top [L]
Modified: trunk/apache/rewrite.conf
==============================================================================
--- trunk/apache/rewrite.conf (original)
+++ trunk/apache/rewrite.conf Mon Sep 24 16:56:33 2007
@@ -160,6 +160,9 @@
RewriteRule ^/board/view/([0-9]*)/([0-9]*).html$ /babel.php?m=board_view&board_id=$1&p=$2 [L]
RewriteRule ^/board/view/([0-9]*).html$ /babel.php?m=board_view&board_id=$1 [L]
+RewriteRule ^/node/edit/([0-9]*).vx$ /babel.php?m=node_edit&node_id=$1 [L]
+RewriteRule ^/node/save/([0-9]*).vx$ /babel.php?m=node_save&node_id=$1 [L]
+
RewriteRule ^/section/view/([0-9]*).html$ /babel.php?m=section_view§ion_id=$1 [L]
RewriteRule ^/topic/top.html$ /babel.php?m=topic_top [L]
Modified: trunk/htdocs/babel.php
==============================================================================
--- trunk/htdocs/babel.php (original)
+++ trunk/htdocs/babel.php Mon Sep 24 16:56:33 2007
@@ -667,6 +667,74 @@
}
}
+ case 'node_edit':
+ if (isset($_GET['node_id'])) {
+ $node_id = abs(intval($_GET['node_id']));
+ } else {
+ $node_id = 0;
+ }
+ if ($p->User->vxIsLogin()) {
+ if ($p->User->usr_id == 1) {
+ $p->vxHead($msgSiteTitle = 'Node Editor');
+ $p->vxBodyStart();
+ $p->vxTop();
+ $p->vxContainer('node_edit', $node_id);
+ break;
+ } else {
+ $p->vxHomeBundle();
+ break;
+ }
+ } else {
+ if ($node_id != 0) {
+ $p->URL->vxToRedirect($p->URL->vxGetLogin($p->URL->vxGetNodeEdit($node_id)));
+ } else {
+ $p->URL->vxToRedirect($p->URL->vxGetLogin());
+ }
+ }
+ break;
+
+ case 'node_save':
+ if (isset($_GET['node_id'])) {
+ $node_id = abs(intval($_GET['node_id']));
+ } else {
+ $node_id = 0;
+ }
+ if ($p->User->vxIsLogin()) {
+ if ($p->User->usr_id == 1) {
+ if ($p->Validator->vxExistNode($node_id)) {
+ if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') {
+ $rt = $p->Validator->vxNodeEditCheck($node_id);
+ $p->vxHead($msgSiteTitle = 'Node Editor');
+ $p->vxBodyStart();
+ $p->vxTop();
+ $p->vxContainer('node_save', $rt);
+ } else {
+ $p->vxHead($msgSiteTitle = 'Node Editor');
+ $p->vxBodyStart();
+ $p->vxTop();
+ $p->vxContainer('node_edit', $node_id);
+ }
+ break;
+ } else {
+ $p->vxHead($msgSiteTitle = 'Node Not Found');
+ $p->vxBodyStart();
+ $p->vxTop();
+ $p->vxContainer('node_not_found');
+ break;
+ }
+ } else {
+ $p->vxHomeBundle();
+ break;
+ }
+ } else {
+ if ($node_id != 0) {
+ $p->URL->vxToRedirect($p->URL->vxGetLogin($p->URL->vxGetNodeEdit($node_id)));
+ } else {
+ $p->URL->vxToRedirect($p->URL->vxGetLogin());
+ }
+ }
+ break;
+
case 'who_fav_node':
$GOOGLE_AD_LEGAL = true;
if (isset($_GET['node_name'])) {
Modified: trunk/htdocs/core/NodeCore.php
==============================================================================
--- trunk/htdocs/core/NodeCore.php (original)
+++ trunk/htdocs/core/NodeCore.php Mon Sep 24 16:56:33 2007
@@ -21,29 +21,33 @@
/* S Node class */
class Node {
- var $db;
+ public $db;
- var $nod_id;
- var $nod_pid;
- var $nod_uid;
- var $nod_sid;
- var $nod_level;
- var $nod_name;
- var $nod_title;
- var $nod_description;
- var $nod_header;
- var $nod_footer;
- var $nod_topics;
- var $nod_favs;
- var $nod_created;
- var $nod_lastupdated;
+ public $nod_id;
+ public $nod_pid;
+ public $nod_uid;
+ public $nod_sid;
+ public $nod_level;
+ public $nod_name;
+ public $nod_title;
+ public $nod_title_en_us;
+ public $nod_title_de_de;
+ public $nod_title_zh_cn;
+ public $nod_title_i18n;
+ public $nod_description;
+ public $nod_header;
+ public $nod_footer;
+ public $nod_topics;
+ public $nod_favs;
+ public $nod_created;
+ public $nod_lastupdated;
- var $usr_id;
- var $usr_nick;
+ public $usr_id;
+ public $usr_nick;
public function __construct($node_id, $db) {
$this->db =& $db;
- $sql = "SELECT nod_id, nod_pid, nod_uid, nod_sid, nod_level, nod_name, nod_title, nod_description, nod_header, nod_footer, nod_topics, nod_favs, nod_created, nod_lastupdated, usr_id, usr_nick FROM babel_node, babel_user WHERE nod_uid = usr_id AND nod_id = {$node_id}";
+ $sql = "SELECT nod_id, nod_pid, nod_uid, nod_sid, nod_level, nod_name, nod_title, nod_title_en_us, nod_title_de_de, nod_title_zh_cn, nod_description, nod_header, nod_footer, nod_topics, nod_favs, nod_created, nod_lastupdated, usr_id, usr_nick FROM babel_node, babel_user WHERE nod_uid = usr_id AND nod_id = {$node_id}";
$rs = mysql_query($sql, $this->db);
$O = mysql_fetch_object($rs);
mysql_free_result($rs);
@@ -54,6 +58,28 @@
$this->nod_level = $O->nod_level;
$this->nod_name = $O->nod_name;
$this->nod_title = $O->nod_title;
+ $this->nod_title_en_us = $O->nod_title_en_us;
+ $this->nod_title_de_de = $O->nod_title_de_de;
+ $this->nod_title_zh_cn = $O->nod_title_zh_cn;
+ $this->nod_title_i18n = $O->nod_title;
+ switch (BABEL_LANG) {
+ default:
+ case 'en_us':
+ if ($this->nod_title_en_us != '') {
+ $this->nod_title_i18n = $this->nod_title_en_us;
+ }
+ break;
+ case 'zh_cn':
+ if ($this->nod_title_zh_cn != '') {
+ $this->nod_title_i18n = $this->nod_title_zh_cn;
+ }
+ break;
+ case 'de_de':
+ if ($this->nod_title_de_de != '') {
+ $this->nod_title_i18n = $this->nod_title_de_de;
+ }
+ break;
+ }
$this->nod_description = $O->nod_description;
$this->nod_header = $O->nod_header;
$this->nod_footer = $O->nod_footer;
@@ -70,10 +96,29 @@
}
public function vxGetNodeInfo($node_id) {
- $sql = "SELECT nod_id, nod_name, nod_title FROM babel_node WHERE nod_id = {$node_id}";
+ $sql = "SELECT nod_id, nod_name, nod_title, nod_title_en_us, nod_title_de_de, nod_title_zh_cn FROM babel_node WHERE nod_id = {$node_id}";
$rs = mysql_query($sql, $this->db);
$Node = mysql_fetch_object($rs);
mysql_free_result($rs);
+ $Node->nod_title_i18n = $Node->nod_title;
+ switch (BABEL_LANG) {
+ default:
+ case 'en_us':
+ if ($Node->nod_title_en_us != '') {
+ $Node->nod_title_i18n = $Node->nod_title_en_us;
+ }
+ break;
+ case 'zh_cn':
+ if ($Node->nod_title_zh_cn != '') {
+ $Node->nod_title_i18n = $Node->nod_title_zh_cn;
+ }
+ break;
+ case 'de_de':
+ if ($Node->nod_title_de_de != '') {
+ $Node->nod_title_i18n = $Node->nod_title_de_de;
+ }
+ break;
+ }
return $Node;
}
Modified: trunk/htdocs/core/StandaloneCore.php
==============================================================================
--- trunk/htdocs/core/StandaloneCore.php (original)
+++ trunk/htdocs/core/StandaloneCore.php Mon Sep 24 16:56:33 2007
@@ -1490,11 +1490,14 @@
if (!in_array($lang, array_keys($_languages))) {
$lang = BABEL_LANG_DEFAULT;
}
- if ($this->User->vxIsLogin()) {
- $sql = "UPDATE babel_user SET usr_lang = '{$lang}' WHERE usr_id = {$this->User->usr_id}";
- mysql_unbuffered_query($sql);
+ if ($_SESSION['babel_lang'] != $lang) {
+ if ($this->User->vxIsLogin()) {
+ $sql = "UPDATE babel_user SET usr_lang = '{$lang}' WHERE usr_id = {$this->User->usr_id}";
+ mysql_unbuffered_query($sql);
+ }
+ @$this->cs->remove('nav_' . md5(session_id()));
+ $_SESSION['babel_lang'] = $lang;
}
- $_SESSION['babel_lang'] = $lang;
}
if (isset($_SERVER['HTTP_REFERER'])) {
return header('Location: ' . $_SERVER['HTTP_REFERER']);
Modified: trunk/htdocs/core/URLCore.php
==============================================================================
--- trunk/htdocs/core/URLCore.php (original)
+++ trunk/htdocs/core/URLCore.php Mon Sep 24 16:56:33 2007
@@ -277,6 +277,16 @@
$url = '/user/inventory.vx';
return $url;
}
+
+ public static function vxGetNodeEdit($node_id) {
+ $url = '/node/edit/' . $node_id . '.vx';
+ return $url;
+ }
+
+ public static function vxGetNodeSave($node_id) {
+ $url = '/node/save/' . $node_id . '.vx';
+ return $url;
+ }
}
/* E URL class */
Modified: trunk/htdocs/core/Utilities.php
==============================================================================
--- trunk/htdocs/core/Utilities.php (original)
+++ trunk/htdocs/core/Utilities.php Mon Sep 24 16:56:33 2007
@@ -718,9 +718,9 @@
}
function rand_gray($color_start = 1, $color_end = 3) {
- $color = array(0 => '0', 1 => '3', 2 => '6', 3 => '9', 4 => 'C', 5 => 'F');
+ $color = array(0 => '0', 1 => '3', 2 => '6', 3 => '9', 4 => 'A', 5 => 'D');
$g = $color[rand($color_start, $color_end)];
- while (($o = '#' . $g . $g . $g) != '#FFF') {
+ while (($o = '#' . $g . $g . $g) != '#DDD') {
return $o;
}
}
Modified: trunk/htdocs/core/V2EXCore.php
==============================================================================
--- trunk/htdocs/core/V2EXCore.php (original)
+++ trunk/htdocs/core/V2EXCore.php Mon Sep 24 16:56:33 2007
@@ -656,25 +656,32 @@
echo('</ul>');
echo('</li>');
}
- if ($nav = $this->cs->get('nav')) {
+ $cache_nav_tag = 'nav_' . md5(session_id());
+ if ($nav = $this->cs->get($cache_nav_tag)) {
} else {
- $sql = "SELECT nod_id, nod_name, nod_title FROM babel_node WHERE nod_level = 1 ORDER BY nod_weight DESC";
+ $sql = "SELECT nod_id, nod_name, nod_title, nod_title_" . BABEL_LANG . " AS nod_title_i18n FROM babel_node WHERE nod_level = 1 ORDER BY nod_weight DESC";
$rs = mysql_query($sql);
$nav = '';
while ($Section = mysql_fetch_array($rs)) {
- $nav .= '<li class="top"><a href="/go/' . $Section['nod_name'] . '" class="top"> ' . make_plaintext($Section['nod_title']) . ' </a>';
- $sql = 'SELECT nod_id, nod_name, nod_title, count(tpc_id) AS nod_topics FROM babel_node, babel_topic WHERE tpc_pid = nod_id AND nod_sid = ' . $Section['nod_id'] . ' GROUP BY nod_id ORDER BY nod_topics DESC LIMIT 8';
+ if ($Section['nod_title_i18n'] == '') {
+ $Section['nod_title_i18n'] = $Section['nod_title'];
+ }
+ $nav .= '<li class="top"><a href="/go/' . $Section['nod_name'] . '" class="top"> ' . make_plaintext($Section['nod_title_i18n']) . ' </a>';
+ $sql = 'SELECT nod_id, nod_name, nod_title, nod_title_' . BABEL_LANG . ' AS nod_title_i18n, count(tpc_id) AS nod_topics FROM babel_node, babel_topic WHERE tpc_pid = nod_id AND nod_sid = ' . $Section['nod_id'] . ' GROUP BY nod_id ORDER BY nod_topics DESC LIMIT 8';
$rs_boards = mysql_query($sql);
$nav .= '<ul>';
while ($Node = mysql_fetch_array($rs_boards)) {
- $nav .= '<li><a href="/go/' . $Node['nod_name'] . '" class="nav"> ' . make_plaintext($Node['nod_title']) . '</a></li>';
+ if ($Node['nod_title_i18n'] == '') {
+ $Node['nod_title_i18n'] = $Node['nod_title'];
+ }
+ $nav .= '<li><a href="/go/' . $Node['nod_name'] . '" class="nav"> ' . make_plaintext($Node['nod_title_i18n']) . '</a></li>';
}
$nav .= '<li><div class="sep"> </div></li>';
- $nav .= '<li><a href="/topic/new/' . $Section['nod_id'] . '.vx" class="nav"> ' . $this->lang->create_new_topic_in(make_plaintext($Section['nod_title'])) . '</a></li>';
+ $nav .= '<li><a href="/topic/new/' . $Section['nod_id'] . '.vx" class="nav"> ' . $this->lang->create_new_topic() . '</a></li>';
$nav .= '</ul></li>';
$Section = null;
}
- $this->cs->save($nav, 'nav');
+ $this->cs->save($nav, $cache_nav_tag);
mysql_free_result($rs);
}
echo $nav;
@@ -1429,6 +1436,42 @@
$this->vxMenu($_menu_options);
$this->vxBoardView($options['board_id']);
break;
+
+ case 'node_not_found':
+ $_menu_options['modules']['friends'] = false;
+ $_menu_options['modules']['links'] = false;
+ $_menu_options['modules']['new_members'] = false;
+ $_menu_options['modules']['fav'] = false;
+ $_menu_options['modules']['logins'] = false;
+ $_menu_options['modules']['stats'] = false;
+ $this->vxSidebar();
+ $this->vxMenu($_menu_options);
+ $this->vxNodeNotFound();
+ break;
+
+ case 'node_edit':
+ $_menu_options['modules']['friends'] = false;
+ $_menu_options['modules']['links'] = false;
+ $_menu_options['modules']['new_members'] = false;
+ $_menu_options['modules']['fav'] = false;
+ $_menu_options['modules']['logins'] = false;
+ $_menu_options['modules']['stats'] = false;
+ $this->vxSidebar();
+ $this->vxMenu($_menu_options);
+ $this->vxNodeEdit($options);
+ break;
+
+ case 'node_save':
+ $_menu_options['modules']['friends'] = false;
+ $_menu_options['modules']['links'] = false;
+ $_menu_options['modules']['new_members'] = false;
+ $_menu_options['modules']['fav'] = false;
+ $_menu_options['modules']['logins'] = false;
+ $_menu_options['modules']['stats'] = false;
+ $this->vxSidebar();
+ $this->vxMenu($_menu_options);
+ $this->vxNodeSave($options);
+ break;
case 'who_fav_node':
$_menu_options['modules']['friends'] = false;
@@ -2179,6 +2222,12 @@
public function vxHome($style) {
$o = '<div id="main">';
+ $o .= '<div class="blank">';
+ $o .= '<img src="/img/welcome_001.png" />';
+ $o .= _vo_hr();
+ $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.';
+ $o .= '</span></div>';
+
if ($_SESSION['hits'] < 10) {
$o .= file_get_contents(BABEL_PREFIX . '/res/hot.html');
}
@@ -2376,40 +2425,6 @@
public function vxHomeLatestTabs() {
$o = '<script src="/js/babel_home_tabs.js" type="text/javascript"> </script>';
$o .= '<div align="left" class="blank">';
-
- $o .= '<div style="float: right;">';
- $o .= '<span class="tip_i"><small>V' . $this->ver . '</small></span>';
- $o .= '</div>';
-
- if ($this->User->vxIsLogin()) {
- $img_p = $this->User->usr_portrait ? CDN_IMG . 'p/' . $this->User->usr_portrait . '_n.jpg' : CDN_IMG . 'p_' . $this->User->usr_gender . '_n.gif';
-
- $o = $o . '<span class="text"><img src="' . $img_p . '" align="absmiddle" class="portrait" /> 欢迎,<strong>' . $this->User->usr_nick . '</strong>!';
-
- if ($url = $this->cs->get('fsu_' . $this->User->usr_id)) {
- $F = unserialize($url);
- $o .= (rand(0, 1) == 1) ? '<span class="tip">或许你会对来自朋友 [ <small><a href="/u/' . urlencode($F['usr_nick']) . '">' . $F['usr_nick'] . '</a></small> ] 的 [ <small><a href="http://' . $F['svp_url'] . '" target="_blank" re="nofollow external">http://' . $F['svp_url'] . '</a></small> ] 感兴趣吧?</span>' : '';
- } else {
- $sql = "SELECT usr_nick, svp_url FROM babel_user, babel_savepoint WHERE usr_id = svp_uid AND svp_uid IN (SELECT frd_fid FROM babel_friend WHERE frd_uid = {$this->User->usr_id}) ORDER BY rand() LIMIT 1";
- $rs = mysql_query($sql);
- if ($F = mysql_fetch_array($rs)) {
- mysql_free_result($rs);
- $this->cs->save(serialize($F), 'fsu_' . $this->User->usr_id);
- $o .= (rand(0, 1) == 1) ? '<span class="tip">或许你会对来自朋友 [ <small><a href="/u/' . urlencode($F['usr_nick']) . '">' . $F['usr_nick'] . '</a></small> ] 的 [ <small><a href="http://' . $F['svp_url'] . '" target="_blank" re="nofollow external">http://' . $F['svp_url'] . '</a></small> ] 感兴趣吧?</span>' : '';
- } else {
- mysql_free_result($rs);
- $sql = "SELECT COUNT(*) FROM babel_savepoint WHERE svp_uid = {$this->User->usr_id}";
- $this->User->svp_count = mysql_result(mysql_query($sql), 0, 0);
- if ($this->User->svp_count == 0) {
- $o .= '<span class="tip_i">还没有添加自己的网上据点?现在 [ <a href="/u/' . urlencode($this->User->usr_nick) . '#svp">添加一个</a> ] 吧,让更多人知道你的网站!</span>';
- }
- }
- }
-
- $o .= '</span>';
- } else {
- $o = $o . '<span class="text">欢迎来到 ' . Vocabulary::site_name . '!如果你已经注册,请<a href="/login.vx">登录</a>,如果还没有,' . Vocabulary::site_name . ' 欢迎你的<a href="/signup.html">加入</a> ...</span>';
- }
$o .= '<ul class="tabs">';
$o .= '<li class="normal" id="home_tab_latest" onclick="switchHomeTab(' . "'latest', '', ''" . ')">最新讨论</li>';
$sql = 'SELECT nod_id, nod_name, nod_title FROM babel_node WHERE nod_level = 1 ORDER BY nod_weight DESC';
@@ -3384,9 +3399,15 @@
$Node = new Node($section_id, $this->db);
_v_m_s();
echo('<div class="blank">');
-
_v_ico_map();
- echo(' <a href="/">' . Vocabulary::site_name . '</a> > ' . $Node->nod_title . '</div>');
+ echo(' <a href="/">' . Vocabulary::site_name . '</a> > ' . $Node->nod_title_i18n . '</div>');
+ if ($this->User->usr_id == 1) {
+ _v_b_l_s();
+ _v_ico_silk('wrench');
+ echo(' <span class="tip_i">ADMINISTRATIVE TOOLS | </span>');
+ echo(' <a href="/node/edit/' . $Node->nod_id . '.vx" class="regular"><strong>Edit</strong></a> ');
+ _v_d_e();
+ }
_v_b_l_s();
echo('<div style="float: right;">');
_v_btn_l($this->lang->new_topic(), '/topic/new/' . $Node->nod_id . '.vx');
@@ -4156,8 +4177,10 @@
_v_ico_map();
echo(' <a href="/">' . Vocabulary::site_name . '</a> > ' . $this->lang->register() . '</div>');
echo('<div class="blank" align="left">');
- echo('<span class="text_large"><img src="' . CDN_IMG . 'ico_id.gif" align="absmiddle" class="home" />' . Vocabulary::site_name . ' ' . $this->lang->register() . '</span>');
- _v_hr();
+ echo('<h1 class="silver">');
+ _v_ico_tango_22('emotes/face-grin');
+ echo(' ' . $this->lang->register());
+ echo('</h1>');
echo('<table cellpadding="5" cellspacing="0" border="0" class="form">');
echo('<form action="/user/create.vx" method="post" id="usrNew">');
echo('<tr><td width="200" align="right">' . $this->lang->email() . '</td><td width="200" align="left"><input tabindex="1" type="text" maxlength="100" class="sl" name="usr_email" /></td>');
@@ -4696,7 +4719,7 @@
if (BABEL_FEATURE_DRY) {
echo(' | <img src="' . CDN_UI . 'img/icons/silk/color_swatch.png" align="absmiddle" alt="ZEN" /> <a href="/dry/' . urlencode($O->usr_nick) . '" class="var" style="color: ' . rand_color() . ';">DRY</a>');
}
- echo(' | <img src="' . CDN_UI . 'img/icons/silk/comments.png" alt="Topics" align="absmiddle" /> <a href="/topic/archive/user/' . urlencode($O->usr_nick) . '" class="var" style="color: ' . rand_color() . ';">' . $O->usr_nick . ' 的所有主题</a> | <img src="' . CDN_UI . 'img/icons/silk/heart_add.png" align="absmiddle" /> <a href="/who/connect/' . urlencode($O->usr_nick) . '" class="var" style="color: ' . rand_color() . ';">谁把 ' . $O->usr_nick . ' 加为好友</a> | <img src="' . CDN_UI . 'img/icons/silk/feed.png" align="absmiddle" alt="RSS" /> <a href="/feed/user/' . urlencode($O->usr_nick) . '" class="var" style="color: ' . rand_color() . '">RSS 种子输出</a></span></tr>');
+ echo(' | <img src="' . CDN_UI . 'img/icons/silk/comments.png" alt="Topics" align="absmiddle" /> <a href="/topic/archive/user/' . urlencode($O->usr_nick) . '" class="var" style="color: ' . rand_color() . ';">Topics</a> | <img src="' . CDN_UI . 'img/icons/silk/heart_add.png" align="absmiddle" /> <a href="/who/connect/' . urlencode($O->usr_nick) . '" class="var" style="color: ' . rand_color() . ';">Connections</a> | <img src="' . CDN_UI . 'img/icons/silk/feed.png" align="absmiddle" alt="RSS" /> <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) {
@@ -6350,7 +6373,6 @@
public function vxBoardView($board_id) {
global $GOOGLE_AD_LEGAL;
-
$Node = new Node($board_id, $this->db);
$Section = $Node->vxGetNodeInfo($Node->nod_sid);
if ($this->User->vxIsLogin()) {
@@ -6368,8 +6390,15 @@
echo('<div id="main">');
echo('<div class="blank">');
_v_ico_map();
- echo(' <a href="/">' . Vocabulary::site_name . '</a> > <a href="/go/' . $Section->nod_name . '" target="_self">' . $Section->nod_title . '</a> > ' . $Node->nod_title);
+ echo(' <a href="/">' . Vocabulary::site_name . '</a> > <a href="/go/' . $Section->nod_name . '" target="_self">' . $Section->nod_title_i18n . '</a> > ' . $Node->nod_title_i18n);
echo('</div>');
+ if ($this->User->usr_id == 1) {
+ _v_b_l_s();
+ _v_ico_silk('wrench');
+ echo(' <span class="tip_i">ADMINISTRATIVE TOOLS | </span>');
+ echo(' <a href="/node/edit/' . $Node->nod_id . '.vx" class="regular"><strong>Edit</strong></a> ');
+ _v_d_e();
+ }
echo('<div class="blank" align="left">');
echo('<span class="text_large">');
if ($Fav > 0) {
@@ -6377,7 +6406,7 @@
} else {
$nod_ico = 'board';
}
- echo('<img src="/img/ico_' . $nod_ico . '.gif" align="absmiddle" class="home" />' . $Node->nod_title);
+ echo('<img src="/img/ico_' . $nod_ico . '.gif" align="absmiddle" class="home" />' . $Node->nod_title_i18n);
/* S: add to favorite */
if ($this->User->vxIsLogin()) {
if ($Fav > 0) {
@@ -6658,6 +6687,131 @@
/* E module: Board View block */
+ /* S module: Node Not Found block */
+
+ public function vxNodeNotFound() {
+ _v_m_s();
+ _v_b_l_s();
+ _v_ico_map();
+ echo(' <a href="/" rel="home">' . Vocabulary::site_name . '</a> > Node Not Found');
+ _v_d_e();
+ _v_b_l_s();
+ echo('<h1 class="silver">');
+ _v_ico_tango_22('actions/process-stop');
+ echo(' Node Not Found');
+ echo('</h1>');
+ echo('<blockquote>');
+ echo('The requested node was not found.');
+ echo('</blockquote>');
+ _v_d_e();
+ _v_d_e();
+ }
+
+ /* E module: Node Not Found block */
+
+ /* S module: Node Edit block */
+
+ public function vxNodeEdit($node_id) {
+ if (!$this->Validator->vxExistNode($node_id)) {
+ $this->vxNodeNotFound();
+ } else {
+ $Node = new Node($node_id, $this->db);
+ _v_m_s();
+ _v_b_l_s();
+ _v_ico_map();
+ if ($Node->nod_level > 1) {
+ $Section = $Node->vxGetNodeInfo($Node->nod_sid);
+ echo(' <a href="/" rel="home">' . Vocabulary::site_name . '</a> > <a href="/go/' . $Section->nod_name . '">' . $Section->nod_title_i18n . '</a> > <a href="/go/' . $Node->nod_name . '">' . make_plaintext($Node->nod_title_i18n) . '</a> > Edit');
+ } else {
+ echo(' <a href="/" rel="home">' . Vocabulary::site_name . '</a> > <a href="/go/' . $Node->nod_name . '">' . make_plaintext($Node->nod_title_i18n) . '</a> > Edit');
+ }
+ _v_d_e();
+ _v_b_l_s();
+ echo('<h1 class="silver">');
+ _v_ico_tango_22('categories/preferences-system');
+ echo(' Node Settings');
+ echo('</h1>');
+ echo('<table cellpadding="5" cellspacing="0" border="0" class="form">');
+ echo('<form action="/node/save/' . $Node->nod_id . '.vx" method="post" id="form_node_edit">');
+ echo('<tr><td width="100" align="right">Name</td><td width="400" align="left"><input onfocus="brightBox(this);" onblur="dimBox(this);" type="text" class="sll" name="nod_name" value="' . make_single_return($Node->nod_name, 0) . '" /></td></tr>');
+ echo('<tr><td width="100" align="right">' . $this->lang->title() . '</td><td width="400" align="left"><input onfocus="brightBox(this);" onblur="dimBox(this);" type="text" class="sll" name="nod_title" value="' . make_single_return($Node->nod_title, 0) . '" /></td></tr>');
+ echo('<tr><td width="100" align="right">' . $this->lang->title() . ' <small>(en_us)</small></td><td width="400" align="left"><input onfocus="brightBox(this);" onblur="dimBox(this);" type="text" class="sll" name="nod_title_en_us" value="' . make_single_return($Node->nod_title_en_us, 0) . '" /></td></tr>');
+ echo('<tr><td width="100" align="right">' . $this->lang->title() . ' <small>(de_de)</small></td><td width="400" align="left"><input onfocus="brightBox(this);" onblur="dimBox(this);" type="text" class="sll" name="nod_title_de_de" value="' . make_single_return($Node->nod_title_de_de, 0) . '" /></td></tr>');
+ echo('<tr><td width="100" align="right">' . $this->lang->title() . ' <small>(zh_cn)</small></td><td width="400" align="left"><input onfocus="brightBox(this);" onblur="dimBox(this);" type="text" class="sll" name="nod_title_zh_cn" value="' . make_single_return($Node->nod_title_zh_cn, 0) . '" /></td></tr>');
+ echo('<tr><td width="100" align="right" valign="top">' . $this->lang->description() . '</td><td width="400" align="left"><textarea onfocus="brightBox(this);" onblur="dimBox(this);" rows="5" class="ml" name="nod_description">' . make_multi_return($Node->nod_description, 0) . '</textarea></td></tr>');
+ echo('<tr><td width="100" align="right" valign="top">' . 'Header' . '</td><td width="400" align="left"><textarea onfocus="brightBox(this);" onblur="dimBox(this);" rows="5" class="ml" name="nod_header">' . make_multi_return($Node->nod_header, 0) . '</textarea></td></tr>');
+ echo('<tr><td width="100" align="right" valign="top">' . 'Footer' . '</td><td width="400" align="left"><textarea onfocus="brightBox(this);" onblur="dimBox(this);" rows="5" class="ml" name="nod_footer">' . make_multi_return($Node->nod_footer, 0) . '</textarea></td></tr>');
+ echo('<td width="500" colspan="3" valign="middle" align="right">');
+ _v_btn_f($this->lang->modify(), 'form_node_edit');
+ echo('</td></tr>');
+ echo('</form>');
+ echo('</table>');
+ _v_hr();
+ echo('<span class="tip"><img src="/img/pico_left.gif" align="absmiddle" /> <a href="/go/' . $Node->nod_name . '">' . $this->lang->return_to_discussion_board() . ' / ' . $Node->nod_title . '</a></span>');
+ _v_d_e();
+ _v_d_e();
+ }
+ }
+
+ /* E module: Node Edit block */
+
+ /* S module: Node Save block */
+
+ public function vxNodeSave($rt) {
+ $node_id = $rt['node_id'];
+ $Node = new Node($node_id, $this->db);
+ _v_m_s();
+ _v_b_l_s();
+ _v_ico_map();
+ if ($Node->nod_level > 1) {
+ $Section = $Node->vxGetNodeInfo($Node->nod_sid);
+ echo(' <a href="/" rel="home">' . Vocabulary::site_name . '</a> > <a href="/go/' . $Section->nod_name . '">' . $Section->nod_title_i18n . '</a> > <a href="/go/' . $Node->nod_name . '">' . make_plaintext($Node->nod_title_i18n) . '</a> > Edit');
+ } else {
+ echo(' <a href="/" rel="home">' . Vocabulary::site_name . '</a> > <a href="/go/' . $Node->nod_name . '">' . make_plaintext($Node->nod_title_i18n) . '</a> > Edit');
+ }
+ _v_d_e();
+ _v_b_l_s();
+ echo('<h1 class="silver">');
+ _v_ico_tango_22('categories/preferences-system');
+ echo(' Node Settings');
+ echo('</h1>');
+ echo('<div class="notify">');
+ if ($rt['errors'] > 0) {
+ } else {
+ $nod_name_sql = mysql_real_escape_string($rt['nod_name_value']);
+ $nod_title_sql = mysql_real_escape_string($rt['nod_title_value']);
+ $nod_title_en_us_sql = mysql_real_escape_string($rt['nod_title_en_us_value']);
+ $nod_title_de_de_sql = mysql_real_escape_string($rt['nod_title_de_de_value']);
+ $nod_title_zh_cn_sql = mysql_real_escape_string($rt['nod_title_zh_cn_value']);
+ $sql = "UPDATE babel_node SET nod_name = '{$nod_name_sql}', nod_title = '{$nod_title_sql}', nod_title_en_us = '{$nod_title_en_us_sql}', nod_title_de_de = '{$nod_title_de_de_sql}', nod_title_zh_cn = '{$nod_title_zh_cn_sql}' WHERE nod_id = {$Node->nod_id} LIMIT 1";
+ mysql_query($sql);
+ _v_ico_silk('tick');
+ echo(' Changes has been saved.');
+ }
+ echo('</div>');
+ echo('<table cellpadding="5" cellspacing="0" border="0" class="form">');
+ echo('<form action="/node/save/' . $Node->nod_id . '.vx" method="post" id="form_node_edit">');
+ echo('<tr><td width="100" align="right">Name</td><td width="400" align="left"><input onfocus="brightBox(this);" onblur="dimBox(this);" type="text" class="sll" name="nod_name" value="' . make_single_return($rt['nod_name_value'], 0) . '" /></td></tr>');
+ echo('<tr><td width="100" align="right">' . $this->lang->title() . '</td><td width="400" align="left"><input onfocus="brightBox(this);" onblur="dimBox(this);" type="text" class="sll" name="nod_title" value="' . make_single_return($rt['nod_title_value'], 0) . '" /></td></tr>');
+ echo('<tr><td width="100" align="right">' . $this->lang->title() . ' <small>(en_us)</small></td><td width="400" align="left"><input onfocus="brightBox(this);" onblur="dimBox(this);" type="text" class="sll" name="nod_title_en_us" value="' . make_single_return($rt['nod_title_en_us_value'], 0) . '" /></td></tr>');
+ echo('<tr><td width="100" align="right">' . $this->lang->title() . ' <small>(de_de)</small></td><td width="400" align="left"><input onfocus="brightBox(this);" onblur="dimBox(this);" type="text" class="sll" name="nod_title_de_de" value="' . make_single_return($rt['nod_title_de_de_value'], 0) . '" /></td></tr>');
+ echo('<tr><td width="100" align="right">' . $this->lang->title() . ' <small>(zh_cn)</small></td><td width="400" align="left"><input onfocus="brightBox(this);" onblur="dimBox(this);" type="text" class="sll" name="nod_title_zh_cn" value="' . make_single_return($rt['nod_title_zh_cn_value'], 0) . '" /></td></tr>');
+ echo('<tr><td width="100" align="right" valign="top">' . $this->lang->description() . '</td><td width="400" align="left"><textarea onfocus="brightBox(this);" onblur="dimBox(this);" rows="5" class="ml" name="nod_description">' . make_multi_return($Node->nod_description, 0) . '</textarea></td></tr>');
+ echo('<tr><td width="100" align="right" valign="top">' . 'Header' . '</td><td width="400" align="left"><textarea onfocus="brightBox(this);" onblur="dimBox(this);" rows="5" class="ml" name="nod_header">' . make_multi_return($Node->nod_header, 0) . '</textarea></td></tr>');
+ echo('<tr><td width="100" align="right" valign="top">' . 'Footer' . '</td><td width="400" align="left"><textarea onfocus="brightBox(this);" onblur="dimBox(this);" rows="5" class="ml" name="nod_footer">' . make_multi_return($Node->nod_footer, 0) . '</textarea></td></tr>');
+ echo('<td width="500" colspan="3" valign="middle" align="right">');
+ _v_btn_f($this->lang->modify(), 'form_node_edit');
+ echo('</td></tr>');
+ echo('</form>');
+ echo('</table>');
+ _v_hr();
+ echo('<span class="tip"><img src="/img/pico_left.gif" align="absmiddle" /> <a href="/go/' . $Node->nod_name . '">' . $this->lang->return_to_discussion_board() . ' / ' . $Node->nod_title . '</a></span>');
+ _v_d_e();
+ _v_d_e();
+ }
+
+ /* E module: Node Save block */
+
/* S module: Who Fav Node block */
public function vxWhoFavNode($node_id, $node_level) {
@@ -7843,10 +7997,11 @@
echo('<div class="blank" align="left">');
_v_ico_map();
echo(' <a href="/">' . Vocabulary::site_name . '</a> > <a href="/section/view/' . $Section->nod_id . '.html">' . $Section->nod_title . '</a> > <a href="/board/view/' . $Node->nod_id . '.html">' . $Node->nod_title . '</a> > ' . $this->lang->new_topic() . '</div>');
- echo('<div class="blank" align="left"><span class="text_large">');
- _v_ico_tango_32('actions/document-new', 'absmiddle', 'home');
- echo($this->lang->new_topic() . '</span>');
- _v_hr();
+ echo('<div class="blank" align="left">');
+ echo('<h1 class="silver">');
+ _v_ico_tango_22('actions/document-new');
+ echo(' ' . $this->lang->new_topic());
+ echo('</h1>');
echo('<table cellpadding="5" cellspacing="0" border="0" class="form">');
echo('<form action="/topic/create/' . $Node->nod_id . '.vx" method="post" id="form_topic_create">');
echo('<tr><td width="100" align="right">' . $this->lang->title() . '</td><td width="400" align="left"><input onfocus="brightBox(this);" onblur="dimBox(this);" type="text" class="sll" name="tpc_title" /></td></tr>');
@@ -8188,14 +8343,13 @@
echo('<div id="main">');
echo('<div class="blank">');
_v_ico_map();
- echo(' <a href="/" rel="home">' . Vocabulary::site_name . '</a> > <a href="/go/' . $Section->nod_name . '" target="_self">' . $Section->nod_title . '</a> > ');
+ echo(' <a href="/" rel="home">' . Vocabulary::site_name . '</a> > <a href="/go/' . $Section->nod_name . '" target="_self">' . $Section->nod_title_i18n . '</a> > ');
if (isset($_SESSION['babel_page_node_' . $Node->nod_id])) {
- echo('<a href="/board/view/' . $Node->nod_id . '/' . $_SESSION['babel_page_node_' . $Node->nod_id] . '.html">' . make_plaintext($Node->nod_title) . '</a>');
+ echo('<a href="/board/view/' . $Node->nod_id . '/' . $_SESSION['babel_page_node_' . $Node->nod_id] . '.html">' . make_plaintext($Node->nod_title_i18n) . '</a>');
} else {
- echo('<a href="/go/' . $Node->nod_name . '" rel="tag">' . make_plaintext($Node->nod_title) . '</a>');
+ echo('<a href="/go/' . $Node->nod_name . '" rel="tag">' . make_plaintext($Node->nod_title_i18n) . '</a>');
}
echo(' > ' . make_plaintext($Topic->tpc_title) . '</div>');
-
echo('<div class="blank"><table cellpadding="0" cellspacing="0" border="0">');
echo('<tr><td valign="top" align="center"><a name="imgPortrait"></a>');
if ($Topic->usr_portrait == '') {
Modified: trunk/htdocs/core/ValidatorCore.php
==============================================================================
--- trunk/htdocs/core/ValidatorCore.php (original)
+++ trunk/htdocs/core/ValidatorCore.php Mon Sep 24 16:56:33 2007
@@ -3245,6 +3245,115 @@
/* E module: Blog Comment Insert logic */
+ /* S module: Node Edit Check logic */
+
+ public function vxNodeEditCheck($node_id) {
+ $rt = array();
+
+ $rt['node_id'] = $node_id;
+
+ $rt['errors'] = 0;
+
+ /* Check: nod_name */
+ $rt['nod_name_value'] = '';
+ $rt['nod_name_maxlength'] = 40;
+ $rt['nod_name_error'] = 0;
+ $rt['nod_name_error_msg'] = array(1 => 'Node name cannot be empty.', 2 => 'New node name is too long.', 3 => 'Node name cannot be duplicated.', 4 => 'New node name contains illegal characters.');
+
+ if (isset($_POST['nod_name'])) {
+ $rt['nod_name_value'] = strtolower(fetch_single($_POST['nod_name']));
+ if ($rt['nod_name_value'] != '') {
+ if (strlen($rt['nod_name_value']) > $rt['nod_name_maxlength']) {
+ $rt['errors']++;
+ $rt['nod_name_error'] = 2;
+ } else {
+
+ }
+ } else {
+ $rt['errors']++;
+ $rt['nod_name_error'] = 1;
+ }
+ } else {
+ $rt['errors']++;
+ $rt['nod_name_error'] = 1;
+ }
+
+ /* Check: nod_title */
+ $rt['nod_title_value'] = '';
+ $rt['nod_title_maxlength'] = 50;
+ $rt['nod_title_error'] = 0;
+ $rt['nod_title_error_msg'] = array(1 => 'General title cannot be empty.', 2 => 'New title is too long.');
+
+ if (isset($_POST['nod_title'])) {
+ $rt['nod_title_value'] = fetch_single($_POST['nod_title']);
+ if ($rt['nod_title_value'] != '') {
+ if (strlen($rt['nod_title_value']) > $rt['nod_title_maxlength']) {
+ $rt['errors']++;
+ $rt['nod_title_error'] = 2;
+ }
+ } else {
+ $rt['errors']++;
+ $rt['nod_title_error'] = 1;
+ }
+ } else {
+ $rt['errors']++;
+ $rt['nod_title_error'] = 1;
+ }
+
+ /* Check: nod_title_en_us */
+ $rt['nod_title_en_us_value'] = '';
+ $rt['nod_title_en_us_error'] = 0;
+ $rt['nod_title_en_us_error_msg'] = array(2 => 'New title of en-US is too long.');
+
+ if (isset($_POST['nod_title_en_us'])) {
+ $rt['nod_title_en_us_value'] = fetch_single($_POST['nod_title_en_us']);
+ if ($rt['nod_title_en_us_value'] != '') {
+ if (strlen($rt['nod_title_en_us_value']) > $rt['nod_title_maxlength']) {
+ $rt['errors']++;
+ $rt['nod_title_en_us_error'] = 2;
+ }
+ }
+ }
+
+ /* Check: nod_title_de_de */
+ $rt['nod_title_de_de_value'] = '';
+ $rt['nod_title_de_de_error'] = 0;
+ $rt['nod_title_de_de_error_msg'] = array(2 => 'New title of de-DE is too long.');
+
+ if (isset($_POST['nod_title_de_de'])) {
+ $rt['nod_title_de_de_value'] = fetch_single($_POST['nod_title_de_de']);
+ if ($rt['nod_title_de_de_value'] != '') {
+ if (strlen($rt['nod_title_de_de_value']) > $rt['nod_title_maxlength']) {
+ $rt['errors']++;
+ $rt['nod_title_de_de_error'] = 2;
+ }
+ }
+ }
+
+ /* Check: nod_title_zh_cn */
+ $rt['nod_title_zh_cn_value'] = '';
+ $rt['nod_title_zh_cn_error'] = 0;
+ $rt['nod_title_zh_cn_error_msg'] = array(2 => 'New title of zh-CN is too long.');
+
+ if (isset($_POST['nod_title_zh_cn'])) {
+ $rt['nod_title_zh_cn_value'] = fetch_single($_POST['nod_title_zh_cn']);
+ if ($rt['nod_title_zh_cn_value'] != '') {
+ if (strlen($rt['nod_title_zh_cn_value']) > $rt['nod_title_maxlength']) {
+ $rt['errors']++;
+ $rt['nod_title_zh_cn_error'] = 2;
+ }
+ }
+ }
+
+ /* Check: nod_description */
+ /* Check: nod_header */
+ /* Check: nod_footer */
+
+ return $rt;
+ }
+
+ /* E module: Node Edit Check logic */
+
/* S module: Send Money Check logic */
public function vxSendMoneyCheck() {
Modified: trunk/htdocs/img/powered.png
==============================================================================
Binary files. No diff available.
Added: trunk/htdocs/img/welcome_001.png
==============================================================================
Binary file. No diff available.
Modified: trunk/lang/de_de/lang.php
==============================================================================
--- trunk/lang/de_de/lang.php (original)
+++ trunk/lang/de_de/lang.php Mon Sep 24 16:56:33 2007
@@ -579,7 +579,7 @@
}
public function board_stats_favs($count, $name) {
- return '<small><a href="/who/fav/node/' . $name . '" class="regular"><strong>' . $count . '</strong></a> mal favorisiert/small>';
+ return '<small><a href="/who/fav/node/' . $name . '" class="regular"><strong>' . $count . '</strong></a> mal favorisiert</small>';
}
public function board_stats_favs_zero() {