1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
    Dismiss Notice
  3. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Convenient & clean user edit menu for thread view

Discussion in 'Template Modifications [Archive]' started by dutchbb, Mar 15, 2011.

  1. dutchbb

    dutchbb Well-Known Member

    Tired of opening new browser tabs for user edits? This quick menu allows admins to edit users from within the thread view. The ACP opens in a convenient pop-up window.

    admin_menu_threadview.png
    Install:

    Open template: message_user_info

    Find:
    Code:
                <xen:username user="$user" itemprop="name" rich="true" />
    Replace with:
    Code:
    <!-- Start Template Mod :: Edit User Menu by dutchbb -->
    <xen:if is="{$visitor.is_admin}">
    	<div class="Popup">
    		<span style="display:inline" rel="Menu"><xen:username user="$user" itemprop="name" rich="true" style="display:inline" /></span>
    		<div class="Menu JsOnly formPopup">
    			<ul class="secondaryContent blockLinksList">
    				<li><a style ="cursor: pointer" onClick="window.open('admin.php?users/{$user.user_id}/edit','edit','width=1000,height=850')"><b>Edit User</b></a></li>
    				<li><a style ="cursor: pointer" onClick="window.open('admin.php?users/{$user.user_id}/avatar','edit','width=1000,height=650')"><b>Edit Avatar</b></a></li>
    				<li><a style ="cursor: pointer" onClick="window.open('admin.php?banning/users/{$user.user_id}/add','ban','width=1000,height=650')"><b>Ban User</b></a></li>
    			</ul>
    		</div>
    	</div>
    <xen:else />
    	<xen:username user="$user" itemprop="name" rich="true" />
    </xen:if>
    <!-- End Template Mod :: Edit User Menu by dutchbb -->
    Done!
     
  2. gmaister22

    gmaister22 Active Member

    Greaaaaat!!
     
    dutchbb likes this.
  3. Allan

    Allan Well-Known Member

    Very usefull !

    Thank you :)
     
    dutchbb likes this.
  4. Wuebit

    Wuebit Well-Known Member

    Nice one Dutchbb very handy :X3:
     
  5. Vincent

    Vincent Well-Known Member

    You could also do this for non-admins with "Throphies", "Home Page", "Post Profile Post", "Start Conversation", "Search all threads/posts", "Follow" etc :p
     
    erich37 likes this.
  6. Vincent

    Vincent Well-Known Member

    This is what I have done to make it a little bit more useful for my users :)

    Code:
    			<!-- Start Template Mod :: Edit User Menu by dutchbb -->
    				<xen:if is="{$visitor.user_id}">
    					<div class="Popup">
    						<span style="display:inline" rel="Menu"><xen:username user="$user" itemprop="name" rich="true" style="display:inline" /></span>
    						<div class="Menu JsOnly formPopup">
    							<ul class="secondaryContent blockLinksList">
    								<xen:if is="{$visitor.is_admin}">
    									<li><a href="admin.php?users/{$user.user_id}/edit"><b>Edit User</b></a></li>
    									<li><a href="admin.php?users/{$user.user_id}/avatar"><b>Edit Avatar</b></a></li>
    									<li><a href="admin.php?banning/users/{$user.user_id}/add"><b>Ban User</b></a></li>
    								</xen:if>
    									<li><a href="/conversations/add?to={$user.username}">Start Conversation</a></li>
    									<li><a href="{xen:string censor, $user.homepage}" target="_blank">Home Page</a></li>
    									<li><a href="/search/member?user_id={$user.user_id}">Find all Posts</a></li>
    									<li><a href="/search/member?user_id={$user.user_id}&content=thread">Find all Threads</a></li>
    									<li><a href="/members/{$user.username}.{$user.user_id}/">Go To Profile</a></li>
    							</ul>
    						</div>
    					</div>
    				<xen:else />
    					<xen:username user="$user" itemprop="name" rich="true" />
    				</xen:if>
    			<!-- End Template Mod :: Edit User Menu by dutchbb -->
    EDIT: Added ML :p
     
    nhokfu, erich37, Alien and 3 others like this.
  7. sylwester

    sylwester Member

    very nice Thank You
     
  8. ddmmh

    ddmmh Well-Known Member

    Nice, screenshots??
     
  9. Vincent

    Vincent Well-Known Member

    ddmmh likes this.
  10. Nasr

    Nasr Well-Known Member

    As a guest, the links do not work correctly. You probably need to take a look at it again.
     
  11. James

    James Well-Known Member

    Great work. Instead of using onclick="window.open()", why not just use target="_blank"?
     
  12. high1976

    high1976 Active Member

    @VincentU: window.open isnt really working with the extended version, especially 'find posts' aso open a window without scrollbars which isnt usable
     
  13. Vincent

    Vincent Well-Known Member

    True, I forgot the guest check, I'll do that soon.
    Browser?
     
  14. Sador

    Sador Well-Known Member

    Added, thanks!
     
  15. dutchbb

    dutchbb Well-Known Member

    Thanks. It allows me to resize the pop-up window to an appropriate size, also it makes the pop-up less clunky by removing some browser functionality. Can of course be changed if not to your own liking.
     
  16. high1976

    high1976 Active Member

    Opera 11.0: no scrollbar but scrollable via mousewheel
    FF 3.8: no scrollbars, not scrollable via mousewheel
    Chrome 11: scrollbars
    IE9: not working at all, all popups end up with:

    HLXBans - HL & HL2 Finally Meet - Error


    The requested page could not be found.
     
  17. Vincent

    Vincent Well-Known Member

    I have made some fixes
    • Guests cannot see the menu anymore
    • The windows are removed, saw no real use for it
    • Some links have been fixed :)
     
    high1976, Alien and laztrix like this.
  18. high1976

    high1976 Active Member

    working great, just added some small changes:
    -using xen:link so its even working in subdirs like /forum/
    -homepage is only visible if user has one
    -phrases are used for multilanguage. you need to create 2 new ones for posts/threads (at least I couldnt find a matching one in default
    -admin-related stuff is opened in a new tab

    PHP:
                <!-- Start Template Mod :: Edit User Menu -->
                    <
    xen:if is="{$visitor.user_id}">
                        <
    div class="Popup">
                            <
    span style="display:inline" rel="Menu"><xen:username user="$useritemprop="name" rich="true" style="display:inline" /></span>
                            <
    div class="Menu JsOnly formPopup">
                                <
    ul class="secondaryContent blockLinksList">
                                    <
    xen:if is="{$visitor.is_admin}">
                                        <
    li><a target="_blank" href="{xen:link 'admin.php?users/{$user.user_id}/edit'}"><b>{xen:phrase edit_user}</b></a></li>
                                        <
    li><a target="_blank" href="{xen:link 'admin.php?users/{$user.user_id}/avatar'}"><b>{xen:phrase edit_avatar}</b></a></li>
                                        <
    li><a target="_blank" href="{xen:link 'admin.php?banning/users/{$user.user_id}/add'}"><b>{xen:phrase ban_user}</b></a></li>
                                    </
    xen:if>
                                        <
    li><a href="{xen:link 'conversations/add?to={$user.username}'}">{xen:phrase start_new_conversation}</a></li>
                                        <
    xen:if is="{$user.homepage}">
                                            <
    li><a href="{xen:string censor, $user.homepage}" target="_blank">{xen:phrase home_page}</a></li>
                                        </
    xen:if>
                                        <
    li><a href="{xen:link 'search/member?user_id={$user.user_id}'}">{xen:phrase find_all_posts}</a></li>
                                        <
    li><a href="{xen:link 'search/member?user_id={$user.user_id}&content=thread'}">{xen:phrase find_all_threads}</a></li>
                                        <
    li><a href="{xen:link 'members/{$user.username}.{$user.user_id}/'}">{xen:phrase view_this_users_profile_page_details}</a></li>
                                </
    ul>
                            </
    div>
                        </
    div>
                    <
    xen:else />
                        <
    xen:username user="$useritemprop="name" rich="true" />
                    </
    xen:if>
                <!-- 
    End Template Mod :: Edit User Menu -->
    
     
    Reedswood, erich37 and Alien like this.
  19. Alien

    Alien Well-Known Member

    Those make some nice changes, perhaps they can be integrated...
     
    gmaister22 likes this.
  20. gmaister22

    gmaister22 Active Member

    +1 !!!!!!!!!! :)
     

Share This Page