PDA

View Full Version : Add "post user note" to drop down on member name


PyroChixRock
08-18-2012, 10:44 AM
When you click on a users name in a thread, it gives you a drop down menu with some options like "view profile" etc. I'd like to add the option to post a user note in that menu but I'm not sure how. Anyone have a snazzy trick up their sleeve to share? :D

the closest I could find on here was this thread...https://vborg.vbsupport.ru/showthread.php?t=232654

kh99
08-18-2012, 11:00 AM
Yeah, you can edit the memberaction_dropdown template and add choices to that menu (you'll have to study it a little to see the html used for each choice, but it's not that complicated). If you wanted to make it a product, you could also create a plugin that adds the code to the memberaction_dropdown_items template hook.

PyroChixRock
08-19-2012, 12:54 AM
I think (hope) I have the code all sorted, but I'm getting this error.

The following error occurred when attempting to evaluate this template:

Parse error: syntax error, unexpected ')' in /htdocs/www/testforum/includes/adminfunctions_template.php(5432) : eval()'d code on line 96

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

Line 96 of adminfunctions_templates.php says: * @param string The name of the product this template is associated with

Code I'm trying to add
<vb:if condition="is_member_of($bbuserinfo, 5, 6,)">
<li class="left">
<a href="usernote.php?do=newnote&amp;userid={vb:raw memberinfo.userid}">
{vb:rawphrase post_user_note}
</a>
</li>

Any ideas?

kh99
08-19-2012, 12:58 AM
I'd have to see the whole thing to know what was wrong, but if you're trying to insert some js code, try surrounding it with <vb:literal>...</vb:literal> tags.

PyroChixRock
08-19-2012, 01:08 AM
the whole thing is that template you mentioned...here it is. I'm trying to add to the bottom the option for mods and admin (user groups 5,6) to "post user note"

<div class="popupmenu memberaction<vb:if condition="$page_class"> {vb:raw page_class}</vb:if>">
<a class="username {vb:raw memberinfo.online} popupctrl" href="{vb:link member, {vb:raw memberinfo}}" title="{vb:rawphrase {vb:raw memberinfo['onlinestatusphrase']}, {vb:raw memberinfo.username}}"><strong><vb:if condition="$memberinfo['musername']">{vb:raw memberinfo.musername}<vb:else />{vb:raw memberinfo.username}</vb:if></strong></a>
<ul class="popupbody popuphover memberaction_body">
<li class="left">
<a href="{vb:link member, {vb:raw memberinfo}}" class="siteicon_profile">
{vb:rawphrase view_profile}
</a>
</li>

<li class="right">
<a href="search.php?{vb:raw session.sessionurl}do=finduser&amp;userid={vb:raw memberinfo.userid}&amp;contenttype=vBForum_Post&amp;showpo sts=1" class="siteicon_forum" rel="nofollow">
{vb:rawphrase view_forum_posts}
</a>
</li>

<vb:if condition="$show['pmlink']">
<li class="left">
<a href="private.php?{vb:raw session.sessionurl}do=newpm&amp;u={vb:raw memberinfo.userid}" class="siteicon_message" rel="nofollow">
{vb:rawphrase private_message}
</a>
</li>
</vb:if>

<vb:if condition="$show['viewblog']">
<li class="right">
<a href="{vb:raw $vboptions.vbblog_url}{vb:if "$vboptions['vbblog_url']", '/', ''}blog.php?{vb:raw session.sessionurl}u={vb:raw memberinfo.userid}" class="siteicon_blog" rel="nofollow">
{vb:rawphrase view_blog_entries}
</a>
</li>
</vb:if>

<vb:if condition="$show['homepage']">
<li class="left">
<a href="{vb:raw memberinfo.homepage}" class="siteicon_homepage">
{vb:rawphrase visit_homepage}
</a>
</li>
</vb:if>

<vb:if condition="$show['viewarticles']">
<li class="right">
<a href="{vb:raw memberinfo.author_list_url}" class="siteicon_article" rel="nofollow">
{vb:rawphrase view_articles}
</a>
</li>
</vb:if>

<vb:if condition="$show['addfriend']">
<li class="left">
<a href="profile.php?{vb:raw session.sessionurl}do=addlist&amp;userlist=buddy&amp;u={vb :raw memberinfo.userid}" class="siteicon_add">
{vb:rawphrase add_as_contact}
</a>
</li>
</vb:if>

<vb:if condition="$show['emaillink']">
<li class="right">
<a href="sendmessage.php?{vb:raw session.sessionurl}do=mailmember&amp;u={vb:raw memberinfo.userid}" class="siteicon_email">
{vb:rawphrase send_email}
</a>
</li>
</vb:if>

<vb:if condition="is_member_of($bbuserinfo, 5, 6,)">
<li class="left">
<a href="usernote.php?do=newnote&amp;userid={vb:raw memberinfo.userid}">
{vb:rawphrase post_user_note}
</a>
</li>
</vb:if>
{vb:raw template_hook.memberaction_dropdown_items}
</ul>
</div>

--------------- Added 1345342367 at 1345342367 ---------------

thanks again for the help :)

kh99
08-19-2012, 01:26 AM
I think it might be this line:

<vb:if condition="is_member_of($bbuserinfo, 5, 6,)">


you need to delete the comma after the 6.

PyroChixRock
08-19-2012, 01:27 AM
wow...sorry i missed that! thanks, it worked.