[推薦] (必裝) session force

phpBB 大部分皆是由竹貓星球提供資料!
頭像
yehrussell
忍辱、精進、靜慮、般若波羅密
忍辱、精進、靜慮、般若波羅密
主題中的帖子: 2
文章: 1133
註冊時間: 2006-01-20 , 10:19
個人狀態: 非常忙碌中!
性別: 公仔

[推薦] (必裝) session force

未閱讀文章 yehrussell »

[推薦] (必裝) session force

http://www.phpbb-tw.net/phpbb/viewtopic.php?t=33421

剛被官方認可的 mod, 初時還不知是什麼, 但現在也 get 到了....

以前進入了一個討論區 (如這個版面) 後,

"正在瀏覽此區的會員: 沒有" <- 或至少看不到自己的名字

要 load 多一次才有自己的名字,

裝了那 mod 後 (那 mod 只改幾句), 再在 viewforum.php 把這句

代碼: 選擇全部

$userdata = session_pagestart($user_ip, $forum_id); 
改成

代碼: 選擇全部

$userdata = session_pagestart($user_ip, $forum_id, 1); 

之後一入討論區就會見到自己的名字了.... (像一個 bug fix 多於一個 mod 啊....)



官方網的標題 & 下載地方 :

http://www.phpbb.com/phpBB/viewtopic.php?t=265369



剛才作者回了帖... 提到如果想在所有頁上也用到這功能... 就把 session.php

代碼: 選擇全部

            if (($current_time - $userdata['session_time'] > 60) or $session_force) 



砍掉.... 即是你裝 mod 時做到這句就不是 replace 而是刪除...

代碼: 選擇全部

 if ( $current_time - $userdata['session_time'] > 60 ) 


(未更改前的句子)
頭像
yehrussell
忍辱、精進、靜慮、般若波羅密
忍辱、精進、靜慮、般若波羅密
主題中的帖子: 2
文章: 1133
註冊時間: 2006-01-20 , 10:19
個人狀態: 非常忙碌中!
性別: 公仔

Re: [推薦] (必裝) session force

未閱讀文章 yehrussell »

http://phpbb-tw.net/phpbb/viewtopic.php?t=40204



測試過這刪除後的反應, 的確沒有兩樣???


剛才作者回了帖... 提到如果想在所有頁上也用到這功能... 就把 session.php

代碼: 選擇全部

if (($current_time - $userdata['session_time'] > 60) or $session_force) 
砍掉.... 即是你裝 mod 時做到這句就不是 replace 而是刪除...

代碼: 選擇全部

if ( $current_time - $userdata['session_time'] > 60 )  
再來裝外掛

代碼: 選擇全部

############################################################## 
## MOD Title:          session_force 
## MOD Author:         alcaeus < alcaeus@gmx.net > (Alca Eus) http://www.alcae.us.tt 
## MOD Description:    This MOD allows to force a session update. This is very helpful if you 
##                       don't like to see that guests are viewing private pages, even though 
##                       they're just logging in. You could also extend this for other pages 
## MOD Version:        1.0.0 
## 
## Installation Level: Easy 
## Installation Time:  ~1 Minute (1mn by EasyMOD of Nuttzy) 
## Files To Edit:      2 
##      includes/sessions.php 
##      login.php 
## 
## Included Files:     0 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
## 
## 1. MOD Compatibility 
## ----------- 
## This MOD has been successfully tested on phpBB 2.0.11. However, it should work on all versions 
## starting with 2.0.5. If that is not the case, please let me know about it. 
## 
## 2. EasyMOD 
## ----------- 
## This MOD is compatible and can be installed by EasyMOD 
## of Nuttzy (but is not officially EasyMOD Compliant)! 
## http://area51.phpbb.com/phpBB22/viewforum.php?f=15 
## 
## However, on alpha releases of EM and meanwhile beta or 
## final release some actions are NOT performed. 
## You'll have to do them manually ! 
## 
## 3. Official last version link 
## ----------- 
## The latest version of this MOD and other MODs can also be found at my site: 
## http://www.alcae.us.tt/forums.php?f=6 
## 
############################################################## 
## MOD History: 
## 
##   2005-??-?? - Version 1.0.0 
##      - Initial Release 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
# 
#-----[ OPEN ]------------------------------------------------ 
# 
includes/sessions.php 

# 
#-----[ FIND ]------------------------------------------------ 
# 
function session_pagestart($user_ip, $thispage_id) 


# 
#-----[ REPLACE WITH ]---------------------------------------- 
# 
function session_pagestart($user_ip, $thispage_id, $session_force = 0) 


# 
#-----[ FIND ]------------------------------------------------ 
# 
            if ( $current_time - $userdata['session_time'] > 60 ) 


# 
#-----[ REPLACE WITH ]---------------------------------------- 
# 
            if (($current_time - $userdata['session_time'] > 60) or $session_force) 


# 
#-----[ OPEN ]------------------------------------------------ 
# 
login.php 


# 
#-----[ FIND ]------------------------------------------------ 
# 
$userdata = session_pagestart($user_ip, PAGE_LOGIN); 


# 
#-----[ REPLACE WITH ]---------------------------------------- 
# 
$userdata = session_pagestart($user_ip, PAGE_LOGIN, 1); 


# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 
版面鎖定 主題已鎖定

回到「phpBB2」