vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Add "post user note" to drop down on member name (https://vborg.vbsupport.ru/showthread.php?t=286794)

PyroChixRock 08-18-2012 09:44 AM

Add "post user note" to drop down on member name
 
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 10: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-18-2012 11:54 PM

I think (hope) I have the code all sorted, but I'm getting this error.

Quote:

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:
Quote:

* @param string The name of the product this template is associated with
Code I'm trying to add
Code:

    <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-18-2012 11:58 PM

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 12: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"

Code:

<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;showposts=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 [DATE]1345342367[/DATE] at [TIME]1345342367[/TIME] ---------------

thanks again for the help :)

kh99 08-19-2012 12:26 AM

I think it might be this line:

Code:

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

you need to delete the comma after the 6.

PyroChixRock 08-19-2012 12:27 AM

wow...sorry i missed that! thanks, it worked.


All times are GMT. The time now is 07:32 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01530 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete