1 頁 (共 1 頁)

[問題]Recent Topics

發表於 : 2003-07-19 13:01
ruka_zh
問題外掛:Recent Topics(Third Version)
來源連結phpBBHacks
參考連結[外掛] Recent Topics 檢視近日發表的文章
使用版本:1.0.3 (phpBB 2.0.4 or lower)
網站位置:LAN內測試主機
phpBB版本:phpBB 2.0.4
加裝外掛狀況:無,純安裝後。
狀況描述
1.檢視日期功能失效, 無法隨著點選 '最後 24 小時'、'今天'、'昨天'、'上週'、'最後 [ ]天內' 標籤檢視各別限定期限內文章, 永遠只能列出 '最後 24 小時' 的文章(且頁面提示也是顯示 "顯示中: 最後 24 小時"), 但網址列確會改變搜尋關鍵字(例如 : 點 '上週' -> ./phpbb2/recent.php?selorder=lweek, 點 '今天' -> ./phpbb2/recent.php?selorder=today ...etc)

2.訪客直接於頁面 檢視近日發表的文章 連結進入會出現此錯誤..

代碼: 選擇全部

Could not obtain main information

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax near ') AND p.post_id = t.topic_last_post_id AND UNIX_TIMESTAMP(NOW()) - p.post_time <' at line 7

SELECT from_unixtime(p.post_time, '%d.%m.%y %H:%i:%s') as topic_time, f.forum_name as forum_name, f.forum_id as forum_id, u.username as username, u2.username as username2, u2.user_id as user_id2, p.poster_id as poster_id, p.post_username as post_username, p.post_id as post_id, t.*, p.post_time as post_time FROM phpbb_topics t, phpbb_posts p LEFT OUTER JOIN phpbb_forums f on p.forum_id = f.forum_id LEFT OUTER JOIN phpbb_users u on p.poster_id = u.user_id LEFT OUTER JOIN phpbb_users u2 on u2.user_id = t.topic_poster WHERE t.topic_id IN () AND p.post_id = t.topic_last_post_id AND UNIX_TIMESTAMP(NOW()) - p.post_time < 86400 ORDER BY p.post_time desc LIMIT 0, 50

Line : 110
File : /usr/home/ruka/www/204/recent.php
補充
唯提出此狀況, 想了解是否有朋友碰到同樣問題.

發表於 : 2003-10-26 10:31
asukacc
我是在 recent.php 加入兩行解決
上週,昨天等... 功能就可以使用\r

#
#-----[尋找]
#
if (!isset($selorder)) $selorder = "las24";

#
#-----[之前加入]
#
$selorder = $HTTP_GET_VARS["selorder"];
$nodays = $HTTP_GET_VARS["nodays"];

發表於 : 2004-02-29 22:16
NICO
請問一下!!你們裝的時候在右邊文章主題部分的地方!!
在開始於 後面應該是顯示時間的!!
但是我的並不會顯示!!請問在安裝的時候有需要改什麼嗎??

代碼: 選擇全部

增加積分、金幣和銀行功能 
開始於  (這裡不見了)

發表於 : 2004-02-29 22:21
NICO

代碼: 選擇全部

	$length		- length of topic title
	$special_forums	- if only special forums should be displayed (0 = no; 1 = yes)
			  Note: the recent hack uses an auth check to display forums only
				to users who are authorized to see/enter them (you can
				activate the option if you want to display only special
				forums)
	$forums		- IDs of the forums that should be displayed (separate them with
			  a comma); e.g. /viewforum.php?f=2 (2 is the ID)
順便問一下這段話是什麼意思!!
小弟的英文真的是破到可以了

發表於 : 2004-03-01 00:29
NICO
多謝 soupjvc 大大提供的方法!!
可以將該篇文章的發表時間顯示
做法如下!!
打開 recent.php

代碼: 選擇全部

找到\r
'FIRST_TIME' => sprintf($lang['Started'], $first_time),
'FIRST_AUTHOR' => sprintf($lang['By'], $first_author),
修改為\r
'FIRST_TIME' => sprintf($lang['Started'] . ' ' . $first_time),
'FIRST_AUTHOR' => sprintf($lang['By'] . ' ' . $first_author),
完成 搞定!!

發表於 : 2004-03-01 00:37
NICO
然後讓裡面的字型大小跟你風格設定一樣的方法!!
templates/XXXX/recent_body.tpl

代碼: 選擇全部

找到\r
{recent.FIRST_TIME}{recent.FIRST_AUTHOR}
修改為\r
<span class="gensmall">{recent.FIRST_TIME}{recent.FIRST_AUTHOR}</span>

修改後整行應該是\r
<font size="-6">{recent.GOTO_PAGE}<br /><span class="gensmall">{recent.FIRST_TIME}{recent.FIRST_AUTHOR}</span></font></td>
這個樣子

發表於 : 2004-03-01 00:44
NICO
不過我又發現了一個問題!!
就是裡面的 昨天 那個選項 搜尋出來的都是空的
明明論壇昨天有人發言
但是用昨天搜尋的時候都是空的!!

發表於 : 2004-03-01 01:58
soupjvc
我剛剛看了一下
昨天明明可以的
原來是程式碼的判斷裡面的問題
他是用\r

(現在的時間 年 月 日) - (張貼的 年 月 日) = -1
來判斷!!
所以在跨月的時候便出問題了

而今天,兩個相減是0,所以不會出錯

發表於 : 2004-03-01 02:46
NICO
喔 那可能是我3月1日搜尋的!!
晚上在試試看!!

發表於 : 2004-03-01 06:26
soupjvc
//基本上我是先判斷月份是否相同,如果月份不同代表可能會造成跨月(跨年)的
判斷失誤! 不同的時候就先換成秒(年-月-日 00:00:00),用AND來判斷正好界
於一天之內 比起修改成為陣列應該簡單許多 快暈倒了.....有錯誤的地方請
包含 記得要先備分喔!!

#打開 recent.php


代碼: 選擇全部

#------------[FIND]--------------------------------------------

$yesterdaysql = $part1."FROM_UNIXTIME(unix_timestamp(NOW()),'%Y%m%d') - FROM_UNIXTIME(p.post_time,'%Y%m%d') = 1".$part2;

代碼: 選擇全部

#------------[REPLACE]------------------------------------------

if("FROM_UNIXTIME(unix_timestamp(NOW()),'%m') - FROM_UNIXTIME(p.post_time,'%m') != 0")
{
	$yesterdaysql = $part1."UNIX_TIMESTAMP(CURDATE()+0) - p.post_time < 86400 AND UNIX_TIMESTAMP(CURDATE()+0) - p.post_time > 0".$part2;
}else{
	$yesterdaysql = $part1."FROM_UNIXTIME(unix_timestamp(NOW()),'%Y%m%d') - FROM_UNIXTIME(p.post_time,'%Y%m%d') = 1".$part2;
}


代碼: 選擇全部

#------------[FIND]--------------------------------------------

else if ( $selorder == 'yestr' )

{

        $where = "WHERE $where_part1 AND FROM_UNIXTIME(unix_timestamp(NOW()),'%Y%m%d') - FROM_UNIXTIME(p.post_time,'%Y%m%d') = 1";

        $l_selorder = $lang['yday'];

}

代碼: 選擇全部

------------[REPLACE]---------------------------------------------------

else if ( $selorder == 'yestr' )

{
	if("FROM_UNIXTIME(unix_timestamp(NOW()),'%m') - FROM_UNIXTIME(p.post_time,'%m') != 0")
	{
		$where = "WHERE $where_part1 AND UNIX_TIMESTAMP(CURDATE()+0) - p.post_time < 86400 AND UNIX_TIMESTAMP(CURDATE()+0) - p.post_time > 0";
	}else{
		$where = "WHERE $where_part1 AND FROM_UNIXTIME(unix_timestamp(NOW()),'%Y%m%d') - FROM_UNIXTIME(p.post_time,'%Y%m%d') = 1";

        $l_selorder = $lang['yday'];
	}        

}



存檔並關閉

發表於 : 2004-04-10 17:50
gonow1234
我的日期不能中文化呀??怎麼辦呀??
我已經在lang_main上加上了中文了...還不能呀....中英文中的都變了做中文
on Fri Apr 09, 2004 9:19 pm
還是這樣

發表於 : 2004-04-19 18:12
soupjvc
不好意思
請問一下你是甚版本\r
或者有論壇可以看看....

不然這應該只是lan_main的問題