• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • 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.
  • 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

dutchbb

Well-known member
#1
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!
 

Vincent

Well-known member
#5
You could also do this for non-admins with "Throphies", "Home Page", "Post Profile Post", "Start Conversation", "Search all threads/posts", "Follow" etc :p
 

Vincent

Well-known member
#6
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
 
#7
This is what I have done to make it a little bit more useful for my users :)

Code:
<xen:require css="message_user_info.css" />

<div class="messageUserInfo" itemscope="itemscope" itemtype="http://data-vocabulary.org/Person">
<div class="messageUserBlock">
	<xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
		<div class="avatarHolder">
			<xen:avatar user="$user" size="m" />
			<!-- slot: message_user_info_avatar -->
		</div>
	</xen:hook>

<xen:if is="!{$isQuickReply}">
	<xen:hook name="message_user_info_text" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
		<h3 class="userText">
			<!-- Start Template Mod :: Edit User Menu by dutchbb -->
				<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 style ="cursor: pointer" onClick="window.open('admin.php?users/{$user.user_id}/edit','edit','width=1000,height=850')"><b>{xen:phrase 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>{xen:phrase 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>{xen:phrase ban_user}</b></a></li>
							</xen:if>
								<li><a style ="cursor: pointer" onClick="window.open('conversations/add?to={$user.username}','add','width=1000,height=850')">{xen:phrase start_conversation}</a></li>
								<li><a style ="cursor: pointer" onClick="window.open('{xen:string censor, $user.homepage}','hp','width=1000,height=850')">{xen:phrase home_page}</a></li>
								<li><a style ="cursor: pointer" onClick="window.open('search/member?user_id={$user.user_id}','hp','width=1000,height=850')">Find all Posts</a></li>
								<li><a style ="cursor: pointer" onClick="window.open('search/member?user_id={$user.user_id}&content=thread','hp','width=1000,height=850')">Find all Threads</a></li>
								<li><a style ="cursor: pointer" onClick="window.open('members/{$user.username}.{$user.user_id}/','hp','width=1000,height=850')">Go To Profile</a></li>
						</ul>
					</div>
				</div>
			<!-- End Template Mod :: Edit User Menu by dutchbb -->
			<xen:if is="!{$user.is_admin}"><xen:if hascontent="true"><em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle, $user}</xen:contentcheck></em></xen:if></xen:if>
			<!-- slot: message_user_info_text -->
		</h3>
	</xen:hook>
	<xen:if is="{$user.is_admin}">
		<span class="userrank">Developer</span>
	</xen:if>
	<xen:if hascontent="true">
		<div class="extraUserInfo">
			<xen:contentcheck>
			<xen:hook name="message_user_info_extra" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
				<xen:if is="@messageShowRegisterDate">
					<dl class="pairsInline">
						<dt>{xen:phrase member_since}:</dt>
						<dd>{xen:date $user.register_date}</dd>
					</dl>
				</xen:if>
				<xen:if is="@messageShowMessageCount">
					<dl class="pairsInline">
						<dt>{xen:phrase message_count}:</dt>
						<dd><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}" class="concealed">{xen:number $user.message_count}</a></dd>
					</dl>
				</xen:if>
				<xen:if is="@messageShowTotalLikes">
					<dl class="pairsInline">
						<dt>{xen:phrase likes_received}:</dt>
						<dd>{xen:number $user.like_count}</dd>
					</dl>
				</xen:if>
				<xen:if is="@messageShowTrophyPoints">
					<dl class="pairsInline">
						<dt>{xen:phrase trophy_points}:</dt>
						<dd><a href="{xen:link 'members/trophies', $user}" class="OverlayTrigger concealed">{xen:number $user.trophy_points}</a></dd>
					</dl>
				</xen:if>
				<xen:if is="@messageShowGender AND {$user.gender}">
					<dl class="pairsInline">
						<dt>{xen:phrase gender}:</dt>
						<dd itemprop="gender"><xen:if is="{$user.gender} == 'male'">{xen:phrase male}<xen:else />{xen:phrase female}</xen:if></dd>
					</dl>
				</xen:if>
				<xen:if is="@messageShowOccupation AND {$user.occupation}">
					<dl class="pairsInline">
						<dt>{xen:phrase occupation}:</dt>
						<dd itemprop="role">{xen:string censor, $user.occupation}</dd>
					</dl>
				</xen:if>
				<xen:if is="@messageShowLocation AND {$user.location}">
					<dl class="pairsInline">
						<dt>{xen:phrase location}:</dt>
						<dd><a href="{xen:link 'misc/location-info', '', 'location={xen:string censor, $user.location}'}" target="_blank" rel="nofollow" itemprop="address" class="concealed">{xen:string censor, $user.location}</a></dd>
					</dl>
				</xen:if>
				<xen:if is="@messageShowHomepage AND {$user.homepage}">
					<dl class="pairsInline">
						<dt>{xen:phrase home_page}:</dt>
						<dd><a href="{xen:string censor, $user.homepage}" rel="nofollow" target="_blank" itemprop="url">{xen:string censor, $user.homepage}</a></dd>
					</dl>
				</xen:if>
				<xen:comment>
				<xen:foreach loop="{$user.identities}" key="$service" value="$account">
					<dl class="pairsInline">
						<dt>{$service}</dt>
						<dd>{$account}</dd>
					</dl>
				</xen:foreach>
				</xen:comment>
			</xen:hook>
			</xen:contentcheck>
		</div>
	</xen:if>
</xen:if>

	<span class="arrow"><span></span></span>
</div>
</div>
EDIT: Added ML :p
very nice Thank You
 

ddmmh

Well-known member
#8
This is what I have done to make it a little bit more useful for my users :)

Code:
<xen:require css="message_user_info.css" />

<div class="messageUserInfo" itemscope="itemscope" itemtype="http://data-vocabulary.org/Person">
<div class="messageUserBlock">
	<xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
		<div class="avatarHolder">
			<xen:avatar user="$user" size="m" />
			<!-- slot: message_user_info_avatar -->
		</div>
	</xen:hook>

<xen:if is="!{$isQuickReply}">
	<xen:hook name="message_user_info_text" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
		<h3 class="userText">
			<!-- Start Template Mod :: Edit User Menu by dutchbb -->
				<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 style ="cursor: pointer" onClick="window.open('admin.php?users/{$user.user_id}/edit','edit','width=1000,height=850')"><b>{xen:phrase 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>{xen:phrase 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>{xen:phrase ban_user}</b></a></li>
							</xen:if>
								<li><a style ="cursor: pointer" onClick="window.open('conversations/add?to={$user.username}','add','width=1000,height=850')">{xen:phrase start_conversation}</a></li>
								<li><a style ="cursor: pointer" onClick="window.open('{xen:string censor, $user.homepage}','hp','width=1000,height=850')">{xen:phrase home_page}</a></li>
								<li><a style ="cursor: pointer" onClick="window.open('search/member?user_id={$user.user_id}','hp','width=1000,height=850')">Find all Posts</a></li>
								<li><a style ="cursor: pointer" onClick="window.open('search/member?user_id={$user.user_id}&content=thread','hp','width=1000,height=850')">Find all Threads</a></li>
								<li><a style ="cursor: pointer" onClick="window.open('members/{$user.username}.{$user.user_id}/','hp','width=1000,height=850')">Go To Profile</a></li>
						</ul>
					</div>
				</div>
			<!-- End Template Mod :: Edit User Menu by dutchbb -->
			<xen:if is="!{$user.is_admin}"><xen:if hascontent="true"><em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle, $user}</xen:contentcheck></em></xen:if></xen:if>
			<!-- slot: message_user_info_text -->
		</h3>
	</xen:hook>
	<xen:if is="{$user.is_admin}">
		<span class="userrank">Developer</span>
	</xen:if>
	<xen:if hascontent="true">
		<div class="extraUserInfo">
			<xen:contentcheck>
			<xen:hook name="message_user_info_extra" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
				<xen:if is="@messageShowRegisterDate">
					<dl class="pairsInline">
						<dt>{xen:phrase member_since}:</dt>
						<dd>{xen:date $user.register_date}</dd>
					</dl>
				</xen:if>
				<xen:if is="@messageShowMessageCount">
					<dl class="pairsInline">
						<dt>{xen:phrase message_count}:</dt>
						<dd><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}" class="concealed">{xen:number $user.message_count}</a></dd>
					</dl>
				</xen:if>
				<xen:if is="@messageShowTotalLikes">
					<dl class="pairsInline">
						<dt>{xen:phrase likes_received}:</dt>
						<dd>{xen:number $user.like_count}</dd>
					</dl>
				</xen:if>
				<xen:if is="@messageShowTrophyPoints">
					<dl class="pairsInline">
						<dt>{xen:phrase trophy_points}:</dt>
						<dd><a href="{xen:link 'members/trophies', $user}" class="OverlayTrigger concealed">{xen:number $user.trophy_points}</a></dd>
					</dl>
				</xen:if>
				<xen:if is="@messageShowGender AND {$user.gender}">
					<dl class="pairsInline">
						<dt>{xen:phrase gender}:</dt>
						<dd itemprop="gender"><xen:if is="{$user.gender} == 'male'">{xen:phrase male}<xen:else />{xen:phrase female}</xen:if></dd>
					</dl>
				</xen:if>
				<xen:if is="@messageShowOccupation AND {$user.occupation}">
					<dl class="pairsInline">
						<dt>{xen:phrase occupation}:</dt>
						<dd itemprop="role">{xen:string censor, $user.occupation}</dd>
					</dl>
				</xen:if>
				<xen:if is="@messageShowLocation AND {$user.location}">
					<dl class="pairsInline">
						<dt>{xen:phrase location}:</dt>
						<dd><a href="{xen:link 'misc/location-info', '', 'location={xen:string censor, $user.location}'}" target="_blank" rel="nofollow" itemprop="address" class="concealed">{xen:string censor, $user.location}</a></dd>
					</dl>
				</xen:if>
				<xen:if is="@messageShowHomepage AND {$user.homepage}">
					<dl class="pairsInline">
						<dt>{xen:phrase home_page}:</dt>
						<dd><a href="{xen:string censor, $user.homepage}" rel="nofollow" target="_blank" itemprop="url">{xen:string censor, $user.homepage}</a></dd>
					</dl>
				</xen:if>
				<xen:comment>
				<xen:foreach loop="{$user.identities}" key="$service" value="$account">
					<dl class="pairsInline">
						<dt>{$service}</dt>
						<dd>{$account}</dd>
					</dl>
				</xen:foreach>
				</xen:comment>
			</xen:hook>
			</xen:contentcheck>
		</div>
	</xen:if>
</xen:if>

	<span class="arrow"><span></span></span>
</div>
</div>
EDIT: Added ML :p
Nice, screenshots??
 
#12
@VincentU: window.open isnt really working with the extended version, especially 'find posts' aso open a window without scrollbars which isnt usable
 

dutchbb

Well-known member
#15
Great work. Instead of using onclick="window.open()", why not just use target="_blank"?
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.
 
#18
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="$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 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="$user" itemprop="name" rich="true" />
                </xen:if>
            <!-- End Template Mod :: Edit User Menu -->