[強化] Show user groups 1.3.5

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
天霜
竹貓忠實會員
竹貓忠實會員
文章: 882
註冊時間: 2003-04-15 19:40
來自: 星之鄉學園
聯繫:

[強化] Show user groups 1.3.5

文章 天霜 »

代碼: 選擇全部

############################################################## 
## MOD Title:          Show user groups
## MOD Author:         Niels < ncr@db9.dk > (Niels Chr. R鷣) http://mods.db9.dk 
## MOD Description:    This mod will add information about the
##                     posters current membership of any
##                     usergroups, they belong to. The list is
##                     shown beside the users posts/users profile.
## MOD Version:        1.3.5
## MOD Compatibility:  2.0.6
## 
## Installation Level: Easy
## Installation Time:  5 Minutes (1mn by EasyMOD of Nuttzy)
## Files To Edit:      6
##      viewtopic.php
##      includes/template.php
##      includes/usercp_viewprofile.php
##      templates/subSilver/profile_view_body.tpl
##      templates/subSilver/subSilver.cfg
##      templates/subSilver/viewtopic_body.tpl
##
## Included Files:     6
##      root/includes/functions_usergroup.php
##      root/templates/subSilver/show_usergroup.tpl
##      root/templates/subSilver/show_usergroup_as_dropdown.tpl
##      root/templates/subSilver/images/groups_diamond3.gif
##      root/templates/subSilver/images/groups_snow.gif
##      root/templates/subSilver/images/groups_star2.gif
##
############################################################## 
## 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. Full MOD description
## -----------
## This mod will add information about the posters current
## membership of any usergroups, they belong to. The list
## is shown beside the users posts/users profile. Hidden
## groups are shown in itallic (only if the viewing user also
## are a member).
## Now also support show images for usergroups.
##
## 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?sid=&f=15
##
## 3. Official last version link
## -----------
## Meanwhile the phpBB group validation and as the MOD is not yet
## in the phpBB MOD database, check this official link for updates...
## http://mods.db9.dk/viewtopic.php?t=11
##
############################################################## 
## MOD History: 
## 
##   2003-12-22 - Version 1.3.5
##      - phpBB template & EasyMOD compliance enhancement
## 
##   2003-10-13 - Version 1.3.4
##      - fixed a problem with missing images
##
##   2003-10-10 - Version 1.3.3
##      - fixed a problem with drop-down list in users profile
##
##   2003-09-04 - Version 1.3.2
##      - fixed a problem with viewtopic.php (change the included file)
##	- added new features to template.php
##
##   2003-08-29 - Version 1.3.1
##      - updated the included file functions_usergroup.php
##
##   2003-08-27 - Version 1.3.0
##      - Complete re-write, now uses own template file to
##        define the show layout
##      - Name changed from "member of" to "Show usergroup" as
##        it is more correct
##
##   2003-08-27 - Version 1.2.7
##      - fixing a bug, witch couse by version 1.2.4, made
##        hidden group visible
##
##   2003-08-23 - Version 1.2.6
##      - now rewritten how-to, to be EM ready
##
##   ????-??-?? - Version 1.2.5
##      - improved code, now uses 1 SQL, and improved the
##        options in template code
##
##   ????-??-?? - Version 1.2.4
##      - code changed to allow more flex style control
##
##   ????-??-?? - Version 1.2.3
##      - confirmed for 2.0.5 by "kooky"
##
##   ????-??-?? - Version 1.2.2
##      - support images as well, code the group id into the
##        template image file (e.g. subSilver.cfg)
##
##   ????-??-?? - Version 1.2.1
##      - added commas between usergroups
##
##   ????-??-?? - Version 1.2.0
##      - fixed a bug, causing user group to be none
##      - also confirmed for phpBB2 version 2.0.2
##
##   ????-??-?? - Version 0.9.2
##      - History started, security update, now hidden groups
##        are hidden if users are not allowed to view
##
##   ????-??-?? - Version 0.9.1
##      - updated by to version 2.0.1. by J廨獽e Gamez
##        < Jerome@campinvaders.net> http://www.campinvaders.net
##
##   ????-??-?? - Version 0.9.0
##      - Initial release phpBB2 RC-1
##
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
  • 額外修正:
    修正訪客會顯示"群組:沒有"字樣的問題
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

viewtopic.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

// Start add - Show usergroups MOD
	if (display_usergroups($userdata['user_id'],$poster_id,'postrow'))
	{
		$template->append_block_vars('postrow',array(
		'L_USER_GROUP' =>$lang['Usergroups'],
		'L_GO' => $lang['Go']));
	} else
	{
		$template->append_block_vars('postrow',array(
		'L_NO_USER_GROUP' =>$lang['Usergroups'],
		'L_NO_USERGROUPS'=> $lang['None']));
	} 
// End add - Show usergroups MOD
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#

代碼: 選擇全部

// Start add - Show usergroups MOD
	if ( $poster_id != ANONYMOUS )
	{
		if (display_usergroups($userdata['user_id'],$poster_id,'postrow'))
		{
			$template->append_block_vars('postrow',array(
			'L_USER_GROUP' =>$lang['Usergroups'] . ': ',
			'L_GO' => $lang['Go']));
		} else
		{
			$template->append_block_vars('postrow',array(
			'L_NO_USER_GROUP' =>$lang['Usergroups'] . ': ',
			'L_NO_USERGROUPS'=> $lang['None']));
		} 
	}
// End add - Show usergroups MOD
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

<br/>{postrow.L_USER_GROUP}{postrow.L_NO_USER_GROUP}: {postrow.SHOW_USERGROUPS}{postrow.L_NO_USERGROUPS}
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#

代碼: 選擇全部

<br/>{postrow.L_USER_GROUP}{postrow.L_NO_USER_GROUP}{postrow.SHOW_USERGROUPS}{postrow.L_NO_USERGROUPS}
#
#-----[ SAVE/CLOSE ALL FILES 儲存/關閉所有檔案 ]-------------------
#
# EoM 外掛修正結束


  • 追加修改:
    個人資料頁面的群組名單後補上一個Go按鈕
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

templates/subSilver/show_usergroup_as_dropdown.tpl
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

	<noscript>
		<input type="submit" value="{L_GO}" class="liteoption" />
	</noscript>
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#

代碼: 選擇全部

		<input type="submit" value="{L_GO}" class="liteoption" />
#
#-----[ SAVE/CLOSE ALL FILES 儲存/關閉所有檔案 ]-------------------
#
# EoM 外掛修正結束


  • 追加修改:
    文章頁面個人資料如果沒有加入群組則就不予顯示群組資訊
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

templates/subSilver/viewtopic_body.tpl
#
#-----[ DELETE 刪除 ]----------------------------------------------
#

代碼: 選擇全部

{postrow.L_NO_USER_GROUP}
#
#-----[ DELETE 刪除 ]----------------------------------------------
#

代碼: 選擇全部

{postrow.L_NO_USERGROUPS}
#
#-----[ SAVE/CLOSE ALL FILES 儲存/關閉所有檔案 ]-------------------
#
# EoM 外掛修正結束


  • 追加修改:
    群組圖示的提示文字由群組名稱改為群組名稱 群組描述
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

includes/functions_usergroup.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

function display_usergroups($viewer,$user,$blockname='',$template_file='')
{
	global $db,$template,$lang,$phpEx,$images;
	$sql = "SELECT  g.group_name,
#
#-----[ IN LINE AFTER, ADD 在指定之後, 加上 ]----------------------
#

代碼: 選擇全部

 g.group_description,
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

			$group_img = ($images['groups'][$group['group_id']]) ? '<img src="'.$images['groups'][$group['group_id']].'" border="0" alt="'.$group['group_name'].'">' : '';
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#

代碼: 選擇全部

			$group_img = ($images['groups'][$group['group_id']]) ? '<img src="' . $images['groups'][$group['group_id']] . '" border="0" alt="' . $group['group_name'] . '
' . ereg_replace('<[^>]+>', '', $group['group_description']) . '">' : '';
#
#-----[ SAVE/CLOSE ALL FILES 儲存/關閉所有檔案 ]-------------------
#
# EoM 外掛修正結束
主題已鎖定

回到「非官方認證外掛」