[parasy commit] r50 - in trunk/upload: . forumdata/geo forumdata/geo/earth/china/taiwan forumdata/geo/earth/china...

1 view
Skip to first unread message

codesite...@google.com

unread,
Apr 30, 2008, 11:29:55 AM4/30/08
to project...@googlegroups.com
Author: Saiccc
Date: Wed Apr 30 08:28:54 2008
New Revision: 50

Added:
trunk/upload/forumdata/geo/earth/china/taiwan/
trunk/upload/forumdata/geo/earth/china/taiwan/chiayi/
trunk/upload/forumdata/geo/earth/china/taiwan/chiayi/data.xml
trunk/upload/forumdata/geo/earth/china/taiwan/data.xml
trunk/upload/forumdata/geo/earth/china/taiwan/hsinchu/
trunk/upload/forumdata/geo/earth/china/taiwan/hsinchu/data.xml
trunk/upload/forumdata/geo/earth/china/taiwan/kaohsiung/
trunk/upload/forumdata/geo/earth/china/taiwan/kaohsiung/data.xml
trunk/upload/forumdata/geo/earth/china/taiwan/keelung/
trunk/upload/forumdata/geo/earth/china/taiwan/keelung/data.xml
trunk/upload/forumdata/geo/earth/china/taiwan/taichung/
trunk/upload/forumdata/geo/earth/china/taiwan/taichung/data.xml
trunk/upload/forumdata/geo/earth/china/taiwan/tainan/
trunk/upload/forumdata/geo/earth/china/taiwan/tainan/data.xml
trunk/upload/forumdata/geo/earth/china/taiwan/taipei/
trunk/upload/forumdata/geo/earth/china/taiwan/taipei/data.xml
Removed:
trunk/upload/forumdata/geo/earth/taiwan/
Modified:
trunk/upload/.htaccess
trunk/upload/forumdata/geo/map.xml
trunk/upload/parasy/ParasyCore.php
trunk/upload/parasy/ParasyInit.php
trunk/upload/parasy_geo.php
trunk/upload/plugins/parasy/now.inc.php
trunk/upload/viewthread.php

Log:
Geo System Updated

Modified: trunk/upload/.htaccess
==============================================================================
--- trunk/upload/.htaccess (original)
+++ trunk/upload/.htaccess Wed Apr 30 08:28:54 2008
@@ -38,10 +38,17 @@
RewriteRule ^set/been/(.+)$ parasy_geo.php?action=set_been&geo=$1 [L]
RewriteRule ^revert/going/(.+)$ parasy_geo.php?action=revert_going&geo=$1 [L]
RewriteRule ^revert/been/(.+)$ parasy_geo.php?action=revert_been&geo=$1 [L]
+RewriteRule ^clean/geo/cache.nnm$ parasy_geo.php?action=clean_cache [L]

+RewriteRule ^my/favs/(forum|thread)$ parasy_my.php?item=favorites&type=$1 [L]
+RewriteRule ^my$ parasy_my.php [L]
RewriteRule ^my-favorites-(.+).html$ my.php?item=favorites&type=$1 [L]
-RewriteRule ^my-(.+)-fid-([0-9]+)\.html$ my.php?item=$1&srchfid=$2 [L]
-RewriteRule ^my-(.+)\.html$ my.php?item=$1 [L]
+RewriteRule ^my-(.+)-fid-([0-9]+)\.html$ parasy_my.php?item=$1&srchfid=$2 [L]
+RewriteRule ^my/(.+)/fid/([0-9]+)/page/([0-9]+)$ parasy_my.php?item=$1&srchfid=$2&page=$3 [L]
+RewriteRule ^my/(.+)/fid/([0-9]+)$ parasy_my.php?item=$1&srchfid=$2 [L]
+RewriteRule ^my/(.+)/page/([0-9]+)$ parasy_my.php?item=$1&page=$2 [L]
+RewriteRule ^my/(.+)$ parasy_my.php?item=$1 [L]
+RewriteRule ^remove/my/favs/(forum|thread).nnm$ parasy_my.php?item=favorites&type=$1 [L]

RewriteRule ^newthread-([0-9]+)-([0-9]+)\.html$ post.php?action=newthread&fid=$1&extra=page%3D$2 [L]
RewriteRule ^reply-([0-9]+)-([0-9]+)-([0-9]+)\.html$ post.php?action=reply&fid=$1&tid=$2&extra=page%3D$3 [L]
@@ -86,7 +93,6 @@
RewriteRule ^login-m.nnm$ logging.php?action=login&app=mobile [L]
RewriteRule ^login-now.nnm$ logging.php?action=login&app=now_mobile [L]
RewriteRule ^signup.nnm$ register.php [L]
-RewriteRule ^digest.nnm$ digest.php [L]
RewriteRule ^logout-([^\/]+).nnm$ logging.php?action=logout&formhash=$1 [L]
RewriteRule ^logout-now-([^\/]+).nnm$ logging.php?action=logout&app=now_mobile&formhash=$1 [L]

@@ -160,10 +166,10 @@
RewriteRule ^session/stats.nnm$ parasy.php?action=session [L]
RewriteRule ^new_features.html$ parasy.php?action=about [L]
RewriteRule ^about$ parasy.php?action=about [L]
-RewriteRule ^topic-latest.html$ parasy.php?action=topic_latest [L]
-RewriteRule ^topic-answered.html$ parasy.php?action=topic_answered [L]
RewriteRule ^topic/latest.html$ parasy.php?action=topic_latest [L]
RewriteRule ^topic/answered.html$ parasy.php?action=topic_answered [L]
+RewriteRule ^digest/([0-9]+)\.html$ parasy.php?action=digest&authorid=$1 [L]
+RewriteRule ^digest.nnm$ parasy.php?action=digest [L]

RewriteRule ^m$ parasy.php?action=mobile_home [L]
RewriteRule ^m/$ parasy.php?action=mobile_home [L]

Added: trunk/upload/forumdata/geo/earth/china/taiwan/chiayi/data.xml
==============================================================================
--- (empty file)
+++ trunk/upload/forumdata/geo/earth/china/taiwan/chiayi/data.xml Wed Apr 30 08:28:54 2008
@@ -0,0 +1,10 @@
+<data>
+ <name>
+ <cn>嘉義</cn>
+ <en>Chiayi</en>
+ </name>
+ <description>
+ <cn></cn>
+ <via></via>
+ </description>
+</data>

Added: trunk/upload/forumdata/geo/earth/china/taiwan/data.xml
==============================================================================
--- (empty file)
+++ trunk/upload/forumdata/geo/earth/china/taiwan/data.xml Wed Apr 30 08:28:54 2008
@@ -0,0 +1,10 @@
+<data>
+ <name>
+ <cn>臺灣</cn>
+ <en>Taiwan</en>
+ </name>
+ <description>
+ <cn></cn>
+ <via></via>
+ </description>
+</data>

Added: trunk/upload/forumdata/geo/earth/china/taiwan/hsinchu/data.xml
==============================================================================
--- (empty file)
+++ trunk/upload/forumdata/geo/earth/china/taiwan/hsinchu/data.xml Wed Apr 30 08:28:54 2008
@@ -0,0 +1,10 @@
+<data>
+ <name>
+ <cn>新竹</cn>
+ <en>Hsinchu</en>
+ </name>
+ <description>
+ <cn></cn>
+ <via></via>
+ </description>
+</data>

Added: trunk/upload/forumdata/geo/earth/china/taiwan/kaohsiung/data.xml
==============================================================================
--- (empty file)
+++ trunk/upload/forumdata/geo/earth/china/taiwan/kaohsiung/data.xml Wed Apr 30 08:28:54 2008
@@ -0,0 +1,10 @@
+<data>
+ <name>
+ <cn>高雄</cn>
+ <en>Kaohsiung</en>
+ </name>
+ <description>
+ <cn></cn>
+ <via></via>
+ </description>
+</data>

Added: trunk/upload/forumdata/geo/earth/china/taiwan/keelung/data.xml
==============================================================================
--- (empty file)
+++ trunk/upload/forumdata/geo/earth/china/taiwan/keelung/data.xml Wed Apr 30 08:28:54 2008
@@ -0,0 +1,10 @@
+<data>
+ <name>
+ <cn>基隆</cn>
+ <en>Keelung</en>
+ </name>
+ <description>
+ <cn></cn>
+ <via></via>
+ </description>
+</data>

Added: trunk/upload/forumdata/geo/earth/china/taiwan/taichung/data.xml
==============================================================================
--- (empty file)
+++ trunk/upload/forumdata/geo/earth/china/taiwan/taichung/data.xml Wed Apr 30 08:28:54 2008
@@ -0,0 +1,10 @@
+<data>
+ <name>
+ <cn>臺中</cn>
+ <en>Taichung</en>
+ </name>
+ <description>
+ <cn></cn>
+ <via></via>
+ </description>
+</data>

Added: trunk/upload/forumdata/geo/earth/china/taiwan/tainan/data.xml
==============================================================================
--- (empty file)
+++ trunk/upload/forumdata/geo/earth/china/taiwan/tainan/data.xml Wed Apr 30 08:28:54 2008
@@ -0,0 +1,10 @@
+<data>
+ <name>
+ <cn>臺南</cn>
+ <en>Tainan</en>
+ </name>
+ <description>
+ <cn></cn>
+ <via></via>
+ </description>
+</data>

Added: trunk/upload/forumdata/geo/earth/china/taiwan/taipei/data.xml
==============================================================================
--- (empty file)
+++ trunk/upload/forumdata/geo/earth/china/taiwan/taipei/data.xml Wed Apr 30 08:28:54 2008
@@ -0,0 +1,10 @@
+<data>
+ <name>
+ <cn>臺北</cn>
+ <en>Taipei</en>
+ </name>
+ <description>
+ <cn></cn>
+ <via></via>
+ </description>
+</data>

Modified: trunk/upload/forumdata/geo/map.xml
==============================================================================
--- trunk/upload/forumdata/geo/map.xml (original)
+++ trunk/upload/forumdata/geo/map.xml Wed Apr 30 08:28:54 2008
@@ -576,42 +576,42 @@
<location>
<geo>taiwan</geo>
<cn>臺灣</cn>
- <at>/earth/</at>
+ <at>/earth/china/</at>
</location>
<location>
<geo>taipei</geo>
<cn>臺北</cn>
- <at>/earth/taiwan/</at>
+ <at>/earth/china/taiwan/</at>
</location>
<location>
<geo>tainan</geo>
<cn>臺南</cn>
- <at>/earth/taiwan/</at>
+ <at>/earth/china/taiwan/</at>
</location>
<location>
<geo>taichung</geo>
<cn>臺中</cn>
- <at>/earth/taiwan/</at>
+ <at>/earth/china/taiwan/</at>
</location>
<location>
<geo>keelung</geo>
<cn>基隆</cn>
- <at>/earth/taiwan/</at>
+ <at>/earth/china/taiwan/</at>
</location>
<location>
<geo>chiayi</geo>
<cn>嘉義</cn>
- <at>/earth/taiwan/</at>
+ <at>/earth/china/taiwan/</at>
</location>
<location>
<geo>hsinchu</geo>
<cn>新竹</cn>
- <at>/earth/taiwan/</at>
+ <at>/earth/china/taiwan/</at>
</location>
<location>
<geo>kaohsiung</geo>
<cn>高雄</cn>
- <at>/earth/taiwan/</at>
+ <at>/earth/china/taiwan/</at>
</location>
<!-- end: countries in /earth/ -->
<!-- start: provinces in /earth/china/ @china -->

Modified: trunk/upload/parasy/ParasyCore.php
==============================================================================
--- trunk/upload/parasy/ParasyCore.php (original)
+++ trunk/upload/parasy/ParasyCore.php Wed Apr 30 08:28:54 2008
@@ -840,4 +840,21 @@
$ver = '.'.filemtime($_SERVER['DOCUMENT_ROOT'].$url).'.';
return str_replace('.', $ver, $path['basename']);
}
+
+function clean_cache_dir($cache_dir) {
+ global $filesnum,$adminid;
+ if ($adminid == '1') {
+ $d = dir($cache_dir);
+ $filesnum = 0;
+ while($entry=$d->read()) {
+ if (is_dir($cache_dir.$entry)){
+ continue;
+ } else {
+ unlink($cache_dir.$entry);
+ $filesnum++;
+ }
+ }
+ $d->close();
+ }
+}
?>

Modified: trunk/upload/parasy/ParasyInit.php
==============================================================================
--- trunk/upload/parasy/ParasyInit.php (original)
+++ trunk/upload/parasy/ParasyInit.php Wed Apr 30 08:28:54 2008
@@ -62,10 +62,9 @@
}

/* Parasy || Geo Initialization */
-if(PARASY_FEATURE_GEO && ($discuz_uid || $discuz_user)) {
- $Geo = new Geo($geo_user, $Geo->map);
- $Geo->geo->name->cn = iconv('utf-8', 'gbk', $Geo->geo->name->cn);
- $portal = $Geo->geo->name->cn;
+if(PARASY_FEATURE_GEO) {
+ $Geo['user'] = new Geo($geo_user);
+ $portal = iconv('utf-8', 'gbk', $Geo['user']->map['name'][$geo_user]);
}

/* Parasy || Cache Files */

Modified: trunk/upload/parasy_geo.php
==============================================================================
--- trunk/upload/parasy_geo.php (original)
+++ trunk/upload/parasy_geo.php Wed Apr 30 08:28:54 2008
@@ -16,6 +16,9 @@
switch ($action) {
case 'geo_home':
$Geo = new Geo($geo, $Geo->map);
+ if (!$Geo->nmIsExist($geo)) {
+ $geo = 'earth';
+ }
$geo_md5 = md5($geo);
$geos_all_children = $Geo->nmGetRecursiveChildrenArray('', true);
$geos_all_children_sql = implode(',', $geos_all_children);
@@ -103,9 +106,9 @@
echo('<td width="60%" align="left" valign="top" style="border-right: 1px solid #EEE; border-top: 1px solid #EEE; border-bottom: 1px solid #EEE;">');
echo('<div class="geo_home_bar_top"><img src="'.IMGDIR.'/award_star_gold_2.png" align="absmiddle" /> ͬ�������»�Ծ����<span class="tip_i"> ... <img src="'.IMGDIR.'/pico_feed.gif" align="absmiddle" alt="RSS" /> <a href="/feed/geo/' . $Geo->geo->geo . '">RSS �������</a></span></div>');
echo('<div class="geo_home_content">');
- @include(DISCUZ_ROOT.'./forumdata/'.GEO_LATEST_DIR.'/geo_latest_'.$geo.'.php');
- if((@!include('forumdata/'.GEO_LATEST_DIR.'/geo_latest_'.$geo.'.php')) || $latest_expiration < time()) {
- $geo_topic = geo_latest_update($geo);
+ @include(DISCUZ_ROOT.'./forumdata/'.GEO_LATEST_DIR.'/geo_latest_'.$Geo->geo->geo.'.php');
+ if((@!include('forumdata/'.GEO_LATEST_DIR.'/geo_latest_'.$Geo->geo->geo.'.php')) || $latest_expiration < time()) {
+ $geo_topic = geo_latest_update($Geo->geo->geo);
} else {
$geo_topic = $latest;
}
@@ -123,9 +126,9 @@
echo('<td width="40%" align="left" valign="top" style="border-top: 1px solid #EEE; border-bottom: 1px solid #EEE;">');
echo('<div class="geo_home_bar_top"><img src="'.IMGDIR.'/award_star_gold_1.png" align="absmiddle" /> ����ͬ������������</div>');
echo('<div class="geo_home_content">');
- @include(DISCUZ_ROOT.'./forumdata/'.GEO_HOT_DIR.'/geo_hot_'.$geo.'.php');
- if((@!include('forumdata/'.GEO_HOT_DIR.'/geo_hot_'.$geo.'.php')) || $hot_expiration < time()) {
- $geo_hot = geo_hot_update($geo);
+ @include(DISCUZ_ROOT.'./forumdata/'.GEO_HOT_DIR.'/geo_hot_'.$Geo->geo->geo.'.php');
+ if((@!include('forumdata/'.GEO_HOT_DIR.'/geo_hot_'.$Geo->geo->geo.'.php')) || $hot_expiration < time()) {
+ $geo_hot = geo_hot_update($Geo->geo->geo);
} else {
$geo_hot = $hot;
}
@@ -147,9 +150,9 @@
echo('<span class="tip_i">coming soon ... <small><a href="#/who/settle/' . $Geo->geo->geo . '" class="o">more</a> &gt;</small></span></div>');
echo('</div>');
echo('<hr class="board" />');
- @include(DISCUZ_ROOT.'./forumdata/'.GEO_NOW_DIR.'/geo_now_'.$geo.'.php');
- if((@!include('forumdata/'.GEO_NOW_DIR.'/geo_now_'.$geo.'.php')) || $now_expiration < time()) {
- $geo_now = geo_now_update($geo);
+ @include(DISCUZ_ROOT.'./forumdata/'.GEO_NOW_DIR.'/geo_now_'.$Geo->geo->geo.'.php');
+ if((@!include('forumdata/'.GEO_NOW_DIR.'/geo_now_'.$Geo->geo->geo.'.php')) || $now_expiration < time()) {
+ $geo_now = geo_now_update($Geo->geo->geo);
} else {
$geo_now = $now;
}
@@ -169,15 +172,15 @@
echo('</tr>');
echo('</table>');
/* Start: geos_children */
- @include(DISCUZ_ROOT.'./forumdata/'.GEO_CHILDREN_DIR.'/geo_children_'.$geo.'.php');
- if((@!include('forumdata/'.GEO_CHILDREN_DIR.'/geo_children_'.$geo.'.php'))) {
- $geos_children = $Geo->nmGetChildrenArray($geo);
+ @include(DISCUZ_ROOT.'./forumdata/'.GEO_CHILDREN_DIR.'/geo_children_'.$Geo->geo->geo.'.php');
+ if((@!include('forumdata/'.GEO_CHILDREN_DIR.'/geo_children_'.$Geo->geo->geo.'.php'))) {
+ $geos_children = $Geo->nmGetChildrenArray($Geo->geo->geo);
foreach ($geos_children as $g => $g_name) {
$data['geos_children'][$g]=$g_name;
}
if(!empty($geos_children)){
$data['children_expiration'] = 3600 + time();
- nmwritetocache('geo_children_'.$geo, '', nmgetcachevars($data),'', GEO_CHILDREN_DIR);
+ nmwritetocache('geo_children_'.$Geo->geo->geo, '', nmgetcachevars($data),'', GEO_CHILDREN_DIR);
}
}
if (count($geos_children) > 0) {
@@ -206,15 +209,15 @@
}
/* End: array geos_children */
/* Start: array geos_parallel */
- @include(DISCUZ_ROOT.'./forumdata/'.GEO_PARALLEL_DIR.'/geo_parallel_'.$geo.'.php');
- if((@!include('forumdata/'.GEO_PARALLEL_DIR.'/geo_parallel_'.$geo.'.php'))) {
- $geos_parallel = $Geo->nmGetParallelArray($geo);
+ @include(DISCUZ_ROOT.'./forumdata/'.GEO_PARALLEL_DIR.'/geo_parallel_'.$Geo->geo->geo.'.php');
+ if((@!include('forumdata/'.GEO_PARALLEL_DIR.'/geo_parallel_'.$Geo->geo->geo.'.php'))) {
+ $geos_parallel = $Geo->nmGetParallelArray($Geo->geo->geo);
foreach ($geos_parallel as $g => $g_name) {
$data['geos_parallel'][$g]=$g_name;
}
if(!empty($geos_parallel)){
$data['parallel_expiration'] = 3600 + time();
- nmwritetocache('geo_parallel_'.$geo, '', nmgetcachevars($data),'',GEO_PARALLEL_DIR);
+ nmwritetocache('geo_parallel_'.$Geo->geo->geo, '', nmgetcachevars($data),'',GEO_PARALLEL_DIR);
}
}
if (count($geos_parallel) > 0) {
@@ -263,6 +266,10 @@
}
}
echo('</div>');
+ if ($adminid==1) {
+ echo('<hr class="board" />');
+ echo('<div><small><a href="'.$bbsdir.'/clean/geo/cache.nnm">Clean Cache</a></small></div>');
+ }
include template('footer');
break;

@@ -314,15 +321,15 @@
echo(' <a href="'.$bbsdir.'/user/settle/' . $geo . '" class="var"><img src="'.IMGDIR.'/geo_set.gif" align="absmiddle" border="0" /></a>');
}
echo('<hr class="board" />');
- @include(DISCUZ_ROOT.'./forumdata/'.GEO_CHILDREN_DIR.'/geo_children_'.$geo.'.php');
- if((@!include('forumdata/'.GEO_CHILDREN_DIR.'/geo_children_'.$geo.'.php'))) {
- $geos_children = $Geo->nmGetChildrenArray($geo);
+ @include(DISCUZ_ROOT.'./forumdata/'.GEO_CHILDREN_DIR.'/geo_children_'.$Geo->geo->geo.'.php');
+ if((@!include('forumdata/'.GEO_CHILDREN_DIR.'/geo_children_'.$Geo->geo->geo.'.php'))) {
+ $geos_children = $Geo->nmGetChildrenArray($Geo->geo->geo);
foreach ($geos_children as $g => $g_name) {
$data['geos_children'][$g]=$g_name;
}
if(!empty($geos_children)){
$data['children_expiration'] = 3600 + time();
- nmwritetocache('geo_children_'.$geo, '', nmgetcachevars($data),'', GEO_CHILDREN_DIR);
+ nmwritetocache('geo_children_'.$Geo->geo->geo, '', nmgetcachevars($data),'', GEO_CHILDREN_DIR);
}
}
if (count($geos_children) > 0) {
@@ -364,15 +371,15 @@

}

- @include(DISCUZ_ROOT.'./forumdata/'.GEO_PARALLEL_DIR.'/geo_parallel_'.$geo.'.php');
- if((@!include('forumdata/'.GEO_PARALLEL_DIR.'/geo_parallel_'.$geo.'.php'))) {
- $geos_parallel = $Geo->nmGetParallelArray($geo);
+ @include(DISCUZ_ROOT.'./forumdata/'.GEO_PARALLEL_DIR.'/geo_parallel_'.$Geo->geo->geo.'.php');
+ if((@!include('forumdata/'.GEO_PARALLEL_DIR.'/geo_parallel_'.$Geo->geo->geo.'.php'))) {
+ $geos_parallel = $Geo->nmGetParallelArray($Geo->geo->geo);
foreach ($geos_parallel as $g => $g_name) {
$data['geos_parallel'][$g]=$g_name;
}
if(!empty($geos_parallel)){
$data['parallel_expiration'] = 3600 + time();
- nmwritetocache('geo_parallel_'.$geo, '', nmgetcachevars($data),'',GEO_PARALLEL_DIR);
+ nmwritetocache('geo_parallel_'.$Geo->geo->geo, '', nmgetcachevars($data),'',GEO_PARALLEL_DIR);
}
}
if (count($geos_parallel) > 0) {
@@ -587,7 +594,20 @@
} else {
dheader("Location: {$boardurl}geo/{$geo}");
}
- }
+ }
+ break;
+
+ case 'clean_cache':
+ if ($discuz_uid) {
+ clean_cache_dir(DISCUZ_ROOT.'./forumdata/'.GEO_LATEST_DIR.'/');
+ clean_cache_dir(DISCUZ_ROOT.'./forumdata/'.GEO_HOT_DIR.'/');
+ clean_cache_dir(DISCUZ_ROOT.'./forumdata/'.GEO_NOW_DIR.'/');
+ clean_cache_dir(DISCUZ_ROOT.'./forumdata/'.GEO_CHILDREN_DIR.'/');
+ clean_cache_dir(DISCUZ_ROOT.'./forumdata/'.GEO_PARALLEL_DIR.'/');
+ showmessage('���򻺴�ɹ����', $bbsdir.'/geo/'.$geo_user);
+ } else {
+ dheader("Location: {$boardurl}");
+ }
break;

default:

Modified: trunk/upload/plugins/parasy/now.inc.php
==============================================================================
--- trunk/upload/plugins/parasy/now.inc.php (original)
+++ trunk/upload/plugins/parasy/now.inc.php Wed Apr 30 08:28:54 2008
@@ -1,9 +1,8 @@
<?php
/* Project Parasynthesis
* Author: Fujiwara Sai
-* Usage: Nowhere
+* Usage: Nowhere Core
*/
-
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
@@ -256,11 +255,11 @@
if ($action == "view") {
if (isset($_GET['now_id'])) {
$now_id = intval($_GET['now_id']);
- $query = $db->query("SELECT count(vid) AS num FROM {$tablepre}plugin_now WHERE vid = {$now_id} LIMIT 1");
+ $query = $db->query("SELECT count(vid) AS num FROM {$tablepre}plugin_now WHERE vid = '{$now_id}' LIMIT 1");
$rec = mysql_fetch_array($query);
$count = $rec['num'];
if ($count) {
- $query = $db->query("SELECT n.*,mf.avatar FROM {$tablepre}plugin_now n LEFT JOIN {$tablepre}memberfields mf ON mf.uid=n.authorid WHERE vid = {$now_id} LIMIT 1");
+ $query = $db->query("SELECT n.*,mf.avatar FROM {$tablepre}plugin_now n LEFT JOIN {$tablepre}memberfields mf ON mf.uid=n.authorid WHERE vid = '{$now_id}' LIMIT 1");
} else {
dheader("Location: {$boardurl}now");
}
@@ -458,10 +457,10 @@

if (isset($_GET['now_id'])) {
$now_id = intval($_GET['now_id']);
- $query = $db->query("SELECT vid, authorid FROM {$tablepre}plugin_now WHERE vid = {$now_id}");
+ $query = $db->query("SELECT vid, authorid FROM {$tablepre}plugin_now WHERE vid = '{$now_id}'");
$row = $db->fetch_array($query);
if ($discuz_uid == $row['authorid']) {
- $db->query("DELETE FROM {$tablepre}plugin_now WHERE vid = {$now_id} LIMIT 1");
+ $db->query("DELETE FROM {$tablepre}plugin_now WHERE vid = '{$now_id}' LIMIT 1");
require_once DISCUZ_ROOT.'./include/cache.func.php';
updatecache('nowhere');
@nowIMG($discuz_userss,$now_img_select);
@@ -480,7 +479,7 @@
if (isset($_GET['img_id'])) {
$img_id = intval($_GET['img_id']);
if ($discuz_uid) {
- $db->query("UPDATE {$tablepre}members SET now_img = '{$img_id}' WHERE uid ={$discuz_uid} LIMIT 1");
+ $db->query("UPDATE {$tablepre}members SET now_img = '{$img_id}' WHERE uid ='{$discuz_uid}' LIMIT 1");
@nowIMG($discuz_userss,$img_id);
} else {
dheader("Location: {$boardurl}oimg/now");
@@ -498,9 +497,13 @@
} else {
$dir_output = './images/nowimg/'.$user_nick.'.png';
if (file_exists($dir_output)) {
+ header("Expires:".gmdate("D, d M Y H:i:s", time()+15360000)."GMT");
+ header("Cache-Control: max-age=315360000");
header("Content-type: image/png");
readfile($dir_output);
} else {
+ header("Expires:".gmdate("D, d M Y H:i:s", time()+15360000)."GMT");
+ header("Cache-Control: max-age=315360000");
header("Content-type: image/png");
readfile('./images/now/noimg.png');
}

Modified: trunk/upload/viewthread.php
==============================================================================
--- trunk/upload/viewthread.php (original)
+++ trunk/upload/viewthread.php Wed Apr 30 08:28:54 2008
@@ -283,9 +283,9 @@
$post['v2bg'] = $v2bg = isset($v2bg) && $v2bg == 'light_odd' ? 'light_even' : 'light_odd';
if(PARASY_FEATURE_GEO) {
if ($charset == 'utf-8') {
- $post['geo_name'] = $Geo->map['name'][$post[usr_geo]];
+ $post['geo_name'] = $Geo['user']->map['name'][$post[usr_geo]];
} else {
- $post['geo_name'] = iconv('utf-8', $charset, $Geo->map['name'][$post[usr_geo]]);
+ $post['geo_name'] = iconv('utf-8', $charset, $Geo['user']->map['name'][$post[usr_geo]]);
}
}
/* Parasy || E:Add */

Reply all
Reply to author
Forward
0 new messages