1 頁 (共 1 頁)

[分享] 全討論區立即導向不等待

發表於 : 2009-06-20 17:23
matuser
●主機作業系統:Linux
●您的上網方式:3G
●您安裝的程式:Apache + php + MySql
●您的 phpBB 版本:phpBB 3.0.4
●您的 domain (網域名稱) : http://www.matuser.net
●您的 phpBB 連結網址: http://www.matuser.net/phpBB3/

其實心靈老師已經有分享過,不過美中不足每個動作(登入,登出,發文,刪文 .... )都要更正一次
延續看著官網的討論,網友GurlzLubme發表終極修改方案
只是我對照自己的code似乎不太一樣,所以貼上來讓大家參考,也提供給有這方面需求的朋友
(因為不是正式外掛,所以貼這裡,勿怪)

Open:
includes/functions.php
Find:

代碼: 選擇全部

* Meta refresh assignment
* Adds META template variable with meta http tag.
*
* @param int $time Time in seconds for meta refresh tag
* @param string $url URL to redirect to. The url will go through redirect() first before the template variable is assigned
* @param bool $disable_cd_check If true, meta_refresh() will redirect to an external domain. If false, the redirect point to the boards url if it does not match the current domain. Default is false.
*/
function meta_refresh($time, $url, $disable_cd_check = false)
{
	global $template;

	$url = redirect($url, true, $disable_cd_check);
	$url = str_replace('&', '&', $url);
Replace with:

代碼: 選擇全部

* Meta refresh assignment
* Adds META template variable with meta http tag.
*
* @param int $time Time in seconds for meta refresh tag
* @param string $url URL to redirect to. The url will go through redirect() first before the template variable is assigned
* @param bool $disable_cd_check If true, meta_refresh() will redirect to an external domain. If false, the redirect point to the boards url if it does not match the current domain. Default is false.
*/
function meta_refresh($time, $url, $disable_cd_check = false)
{
	global $template;

	$url = redirect($url, false, $disable_cd_check);
	$url = str_replace('&', '&', $url);
* 其實就是 $url = redirect($url, false, $disable_cd_check); 的true 改成 false 就可以囉 :-D

Re: [分享] 全討論區立即導向不等待

發表於 : 2009-06-21 08:26
yehrussell
請問這是發文時候,不用等待修正時間嗎?
謝謝

Re: [分享] 全討論區立即導向不等待

發表於 : 2009-06-22 18:39
philipchiu
matuser 寫:●主機作業系統:Linux
●您的上網方式:3G
●您安裝的程式:Apache + php + MySql
●您的 phpBB 版本:phpBB 3.0.4
●您的 domain (網域名稱) : http://www.matuser.net
●您的 phpBB 連結網址: http://www.matuser.net/phpBB3/

其實心靈老師已經有分享過,不過美中不足每個動作(登入,登出,發文,刪文 .... )都要更正一次
延續看著官網的討論,網友GurlzLubme發表終極修改方案
只是我對照自己的code似乎不太一樣,所以貼上來讓大家參考,也提供給有這方面需求的朋友
(因為不是正式外掛,所以貼這裡,勿怪)

Open:
includes/functions.php
Find:

代碼: 選擇全部

* Meta refresh assignment
* Adds META template variable with meta http tag.
*
* @param int $time Time in seconds for meta refresh tag
* @param string $url URL to redirect to. The url will go through redirect() first before the template variable is assigned
* @param bool $disable_cd_check If true, meta_refresh() will redirect to an external domain. If false, the redirect point to the boards url if it does not match the current domain. Default is false.
*/
function meta_refresh($time, $url, $disable_cd_check = false)
{
	global $template;

	$url = redirect($url, true, $disable_cd_check);
	$url = str_replace('&', '&', $url);
Replace with:

代碼: 選擇全部

* Meta refresh assignment
* Adds META template variable with meta http tag.
*
* @param int $time Time in seconds for meta refresh tag
* @param string $url URL to redirect to. The url will go through redirect() first before the template variable is assigned
* @param bool $disable_cd_check If true, meta_refresh() will redirect to an external domain. If false, the redirect point to the boards url if it does not match the current domain. Default is false.
*/
function meta_refresh($time, $url, $disable_cd_check = false)
{
	global $template;

	$url = redirect($url, false, $disable_cd_check);
	$url = str_replace('&', '&', $url);
* 其實就是 $url = redirect($url, false, $disable_cd_check); 的true 改成 false 就可以囉 :-D
我的沒有這行
找到以下這行把false改為true後效果明顯改善,但不清楚這樣改會否有後遺症; function redirect($url, $return = false, $disable_cd_check = true) //false

Re: [分享] 全討論區立即導向不等待

發表於 : 2009-06-25 02:35
matuser
yehrussell 寫:請問這是發文時候,不用等待修正時間嗎?
謝謝
發文按"送出"以後,不用再等待幾秒或是按連結才能看到自己的發文
philipchiu 寫:我的沒有這行
找到以下這行把false改為true後效果明顯改善,但不清楚這樣改會否有後遺症; function redirect($url, $return = false, $disable_cd_check = true) //false
我不懂PHP語法,不過redirect的字面意思應該是重新導向沒錯 ;-)
我想,唯一缺點就是發文節奏會變得比較直覺吧

Re: [分享] 全討論區立即導向不等待

發表於 : 2009-06-25 07:01
心靈捕手
matuser 寫:
yehrussell 寫:請問這是發文時候,不用等待修正時間嗎?
謝謝
發文按"送出"以後,不用再等待幾秒或是按連結才能看到自己的發文
philipchiu 寫:我的沒有這行
找到以下這行把false改為true後效果明顯改善,但不清楚這樣改會否有後遺症; function redirect($url, $return = false, $disable_cd_check = true) //false
我不懂PHP語法,不過redirect的字面意思應該是重新導向沒錯 ;-)
我想,唯一缺點就是發文節奏會變得比較直覺吧
依個人經驗:
有時候發文 (或重新編輯) 完後, 不見得需要回到 "檢視您送出的內容" 頁面,
而是希望回到 "最近流覽的版面" 或其他連結.

因為這樣, 才能真正加速處理版面文章.

Re: [分享] 全討論區立即導向不等待

發表於 : 2009-06-25 09:33
philipchiu
心靈捕手 寫:
matuser 寫:
yehrussell 寫:請問這是發文時候,不用等待修正時間嗎?
謝謝
發文按"送出"以後,不用再等待幾秒或是按連結才能看到自己的發文
philipchiu 寫:我的沒有這行
找到以下這行把false改為true後效果明顯改善,但不清楚這樣改會否有後遺症; function redirect($url, $return = false, $disable_cd_check = true) //false
我不懂PHP語法,不過redirect的字面意思應該是重新導向沒錯 ;-)
我想,唯一缺點就是發文節奏會變得比較直覺吧
依個人經驗:
有時候發文 (或重新編輯) 完後, 不見得需要回到 "檢視您送出的內容" 頁面,
而是希望回到 "最近流覽的版面" 或其他連結.

因為這樣, 才能真正加速處理版面文章.
依前輩說;我修改的位置是正確的囉 :$

Re: [分享] 全討論區立即導向不等待

發表於 : 2009-06-25 11:32
心靈捕手
philipchiu 寫:依前輩說;我修改的位置是正確的囉 :$
抱歉! 我並不清楚您的修改是對或不對.
我的意思是: 有些 "等待" 是有其意義的.

Re: [分享] 全討論區立即導向不等待

發表於 : 2009-07-17 19:51
SCR
此修改的確有 Bug .
當你改完後,試著按下"檢視誰在線上"看看,論壇馬上就出現差不多死當的模樣.

Re: [分享] 全討論區立即導向不等待

發表於 : 2009-07-17 21:14
philipchiu
我的沒問題

Re: [分享] 全討論區立即導向不等待

發表於 : 2009-07-17 23:17
SCR
philipchiu 寫:我的沒問題
你的不是沒有問題,而是你所修改的方法跟原發文者的修改法不同.所以不會出現我所說的問題.
況且....................我剛到你的論壇去做測試.發現你的修改法也根本沒啥作用!!無法實踐立即導向功能.