User Administration Link on Profile

Ответы на вопросы, связанные с модами для phpBB 2.0.x, кроме относящихся к форуму Для авторов (phpBB 2.0.x).
фрося
phpBB 1.4.1
Сообщения: 47
Стаж: 19 лет 9 месяцев

User Administration Link on Profile

Сообщение фрося »

МОД:

Код: Выделить всё

###############################################################################
## 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">&nbsp;(<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 ]----------------------------
# 

# 
#------------------------------------------------------------------------------
# 
Проблема в том, что при клике на ссылку редактирования профиля пользователя (в его профиле), выкидывает на главную страницу форума (хотя линк ведёт в ажминку... :roll: )
Аватара пользователя
Balamut
Former team member
Сообщения: 2214
Стаж: 20 лет 1 месяц
Откуда: {postrow.POSTER_FROM}
Поблагодарили: 68 раз

Сообщение Balamut »

Я бы попробовал заменить

Код: Выделить всё

                "U_ADMIN_PROFILE" => append_sid("admin/admin_users.$phpEx?mode=edit&u=" . $profiledata['user_id'])) 
на

Код: Выделить всё

		"U_ADMIN_PROFILE" => append_sid("admin/admin_users.$phpEx?mode=edit&" . POST_USERS_URL . '=' . $profiledata['user_id'] . '&sid=' . $userdata['session_id'])) 
:wink:

ЗЫ. По поддержкам модов есть отдельный раздел... :evil:
//
// That's all, Folks!
// -------------------------------------------------

Вернуться в «Поддержка модов для phpBB 2.0.x»