1 頁 (共 1 頁)

[外掛] Hidden Login MOD 在登入頁面增加一個隱藏選項

發表於 : 2006-07-07 18:26
kkt
功能描述: 在登入頁面增加一個隱藏選項, 同時可在首頁加上即時隱藏選項

測試狀況: 這外掛裝後要每次在登入時選擇是否隱藏, 而登出後個人資料的隱藏被預設為否.

========================================

代碼: 選擇全部

##############################################################
## MOD Title: Hidden Login MOD
## MOD Author: eviL3 < evil@ut4e.com > (Igor Wiedler) http://evil.ut4e.com/
## MOD Description: Allows users to login Hidden, so they aren't listed in
##                  the "who's online" part.
##
## MOD Version:      0.1.3
##
## Installation Level: Easy
## Installation Time: 3 Minutes
## Files To Edit:
##         includes/page_header.php
##         login.php
##         language/lang_english/lang_main.php
##         templates/subSilver/index_body.tpl
##         templates/subSilver/login_body.tpl
##
## Included Files:   (n/a)
##############################################################
## 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:
##
## I know that olympus has something like this. But i had the Idea already
## before i saw it in phpbb3 beta1. Thanks to noobarmy who also had this Idea :)
##
## I'd also like to thank Kalipo who gave me some good tipps :)
##
##############################################################
## MOD History:
##
##   2006-06-20 - Version 0.1.0
##      - First release
##
##   2006-06-21 - Version 0.1.1
##      - Small lang addition
##      - If not hidden, log in unhidden
##
##   2006-06-21 - Version 0.1.2
##      - Template fixes
##      - Don't show when logging into admin
##
##   2006-06-21 - Version 0.1.3
##      - Fix resetting when logging into admin
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------------
#
includes/page_header.php

#
#-----[ FIND ]------------------------------------------------
#
	'L_AUTO_LOGIN' => $lang['Log_me_in'],

#
#-----[ AFTER, ADD ]------------------------------------------------
#
	'L_HIDE_LOGIN' => $lang['Hidden_login'],
	'L_HIDE_LOGIN_LONG' => $lang['Hidden_login_long'],

#
#-----[ FIND ]------------------------------------------------
#
	//
	// Allow autologin?

#
#-----[ BEFORE, ADD ]------------------------------------------------
#
	$template->assign_block_vars('switch_allow_hidelogin', array());

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

#
#-----[ FIND ]------------------------------------------------
#
$autologin

#
#-----[ AFTER, ADD ]------------------------------------------------
#
					$hidelogin = ( isset($HTTP_POST_VARS['hidelogin']) ) ? TRUE : 0;

#
#-----[ FIND ]------------------------------------------------
#
					// Reset login tries
					$db->sql_query

#
#-----[ AFTER, ADD ]------------------------------------------------
#
          // Hidelogin 
          if( !$userdata['session_logged_in'] ) 
          { 
            if( $hidelogin ) 
            { 
              $db->sql_query('UPDATE ' . USERS_TABLE . ' SET  user_allow_viewonline = 0 WHERE user_id = ' . $row['user_id']); 
            } 
            else 
            { 
              $db->sql_query('UPDATE ' . USERS_TABLE . ' SET  user_allow_viewonline = 1 WHERE user_id = ' . $row['user_id']); 
            } 
          }

#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------------
#
$lang['Log_me_in']

#
#-----[ AFTER, ADD ]-----------------------------------------
#
$lang['Hidden_login'] = 'Hide';
$lang['Hidden_login_long'] = 'Log me in as hidden';

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/index_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
		<!-- END switch_allow_autologin -->

#
#-----[ AFTER, ADD ]-----------------------------------------
#
		&nbsp;&nbsp;{L_HIDE_LOGIN}
		<input class="text" type="checkbox" name="hidelogin" />

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/login_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
		  <!-- END switch_allow_autologin -->
	
#
#-----[ AFTER, ADD ]-----------------------------------------
#
		  <!-- BEGIN switch_allow_hidelogin -->
		  <tr align="center"> 
			<td colspan="2"><span class="gen">{L_HIDE_LOGIN_LONG}: <input type="checkbox" name="hidelogin" /></span></td>
		  </tr>
		  <!-- END switch_allow_hidelogin -->

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM

==========================================

語系檔中文部份:

代碼: 選擇全部


#
#-----[ 打開 ]------------------------------------------------
#
language/lang_chinese_traditional_taiwan/lang_main.php

#
#-----[ FIND ]------------------------------------------------
#
$lang['Log_me_in']

#
#-----[ AFTER, ADD ]-----------------------------------------
#
$lang['Hidden_login'] = '隱藏';
$lang['Hidden_login_long'] = '隱藏在線狀態';


ps. 如不需在首頁顯示隱藏選項, index_body.tpl 的部份可以略過.




.