Код: Выделить всё
###############################################################################
## Mod Title: User Administration Link on Profile
## Mod Version: 1.0.0
## Author: Matthijs van de Water < matthijs@vandewater.tk >
## Description: This will add a link to the User Administration
## of the Administrator Control Panel on the 'view
## profile' page. Will only display the link when
## user is ADMIN.
##
## Installation Level: Intermediate
## Installation Time: 5-10 Minutes
## Files To Edit: 3
## Included Files: none
###############################################################################
##
## Installation Notes:
##
## Edit the files as listed below.
## Changes need to be made to the 'profile_view_body.tpl',
## 'usercp_viewprofile.php' and 'lang_main.php' files.
## This presumes you use the subSilver template!
###############################################################################
#
#-----[ FIND IN usercp_viewprofile.php ]---------------------------------------
#
$page_title = $lang['Viewing_profile'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
#
#-----[ ADD BEFORE ]-----------------------------------------------------------
#
if($userdata['user_level'] == ADMIN)
{
$template->assign_vars(array(
"L_USER_ADMIN_FOR" => $lang['User_admin_for'],
"U_ADMIN_PROFILE" => append_sid("admin/admin_users.$phpEx?mode=edit&u=" . $profiledata['user_id']))
);
$template->assign_block_vars("switch_user_admin", array());
}
#
#-----[ SAVE usercp_viewprofile.php ]------------------------------------------
#
#
#-----[ FIND IN templates/subSilver/profile_view_body.tpl ]--------------------
#
<td class="catRight" width="60%"><b><span class="gen">{L_ABOUT_USER}</span></b></td>
#
#-----[ CHANGE TO ]------------------------------------------------------------
#
<td class="catRight" width="60%"><b><span class="gen">{L_ABOUT_USER}</span></b>
<!-- BEGIN switch_user_admin -->
<span class="gen"> (<a target="_admin" href="{U_ADMIN_PROFILE}" class="gen">{L_USER_ADMIN_FOR} {USERNAME}</a>)</span>
<!-- END switch_user_admin -->
</td>
#
#-----[ SAVE templates/subSilver/profile_view_body.tpl ]-----------------------
#
#
#-----[ FIND IN languages/lang_english/lang_main.php ]-------------------------
#
$lang['About_user'] = "All about %s"; // %s is username
#
#-----[ ADD AFTER ]------------------------------------------------------------
#
$lang['User_admin_for'] = "User Administration for";
#
#-----[ SAVE languages/lang_english/lang_main.php ]----------------------------
#
#
#------------------------------------------------------------------------------
#
