Thread: Administrative and Maintenance Tools - Admin Log In As User
View Single Post
  #318  
Old 01-07-2011, 12:42 AM
iBaker's Avatar
iBaker iBaker is offline
 
Join Date: Oct 2006
Location: Melbourne, Australia
Posts: 152
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Everyone keeps asking how to fix this mod for v4.1...I posted the fix back at post 202 (I was aka Wilfred1 but after asking .org twice to combine my usernames they haven't responded) so I thought it might help if I attached the complete mod with the fixes in it for use on v4.1 PL2.

Attachment 125317

For my site I have also made these two changes that you may like to also do but note they suit my site and may not suit yours.

1. Make the link look part of the list in the user profile:
Attachment 125318

Change the entire memberinfo_block_admin_log_in_as_user template to just having:
Code:
<li><img src="{vb:stylevar imgdir_siteicons}/network.png" class="inlineimg" alt="" /> <a href="member.php?{vb:raw session.sessionurl}u={vb:raw userinfo.userid}&amp;admin_log_in_as_user={vb:raw userinfo.userid}" rel="nofollow">{vb:rawphrase log_in_as_user}</a></li>
In the MEMBERINFO template starting at line 262 you will find:
Code:
                    </ul>
                </div>
            </div>
          <vb:comment>sidebar</vb:comment>
          {vb:raw template_hook.profile_sidebar_first}
Replace that with:
Code:
                          {vb:raw template_hook.profile_sidebar_first}
                    </ul>
                </div>
            </div>
          <vb:comment>sidebar</vb:comment>


2. Add the link to the Member Action Drop Down

Attachment 125319

Open the memberaction_dropdown template you find almost at the bottom this block of code:
Code:
        <vb:if condition="$show['emaillink']">
        <li class="right">
            <img src="{vb:stylevar imgdir_siteicons}/email.png" alt="" />
            <a href="sendmessage.php?{vb:raw session.sessionurl}do=mailmember&amp;u={vb:raw memberinfo.userid}" rel='nofollow'>
                {vb:rawphrase send_email}
            </a>
        </li>
        </vb:if>
Right below that add this block:
Code:
        <vb:if condition="is_member_of($bbuserinfo, 5,6)">
        <li class="right">
            <img src="{vb:stylevar imgdir_siteicons}/network.png" class="inlineimg" alt="" />
            <a href="member.php?{vb:raw session.sessionurl}u={vb:raw memberinfo.userid}&amp;admin_log_in_as_user={vb:raw memberinfo.userid}" rel="nofollow">
                Log In As This User
            </a>
        </li>
        </vb:if>
NOTE in the added block above you will need to change the usergroup ID's to the ones to match the ones your have given permissions to use the mod. For example in the above you will see bbuserinfo, 5,6 this shows that I have given permission to Usergroups 5 and 6 to use the mod.

Hope this helps so others don't have to go trolling through all the previous thread posts.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01322 seconds
  • Memory Usage 1,798KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete