vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   [SOLVED] User name options (https://vborg.vbsupport.ru/showthread.php?t=324284)

Stratis 01-25-2017 04:04 PM

[SOLVED] User name options
 
1 Attachment(s)
Can some one please help me with this?


https://vborg.vbsupport.ru/attachmen...4&d=1485367101


When visitor clicks on the username in postbit... will see the three above options.
He cannot go further on because he must be register, but I want these three option not visible to visitors.


Where can I search for this, or how can I make it possible? Thanks in advanced

Kane@airrifle 01-25-2017 05:20 PM

Maybe in style, postbit or postbit_legacy depending on which you use, find
Code:

<div class="username_container">
Under that is:
Code:

<vb:if condition="$post['userid']">
Change that to
Code:

<vb:if condition="$post['userid'] AND !$show['guest']">
That will have the effect of completely disabling the dropdown profile menu for guests

Caveat, have not tried this myself....

Stratis 01-26-2017 06:28 AM

Kane
That's it. <vb:if condition="$post['userid']">
{vb:raw memberaction_dropdown}

I will try to find how to disable it, because I use there a <div class
so the above code you give changes take effect there to. Smaller letter show up to username and bold goes off

Thank you very much

Kane@airrifle 01-26-2017 07:07 AM

Tested it now and see what you are saying about the CSS.

Also, there is one more place to hide the dropdown from guests and that is in threadbit, lastpostby...

More digging required I think.

Stratis 01-26-2017 08:03 AM

Ok with postbit_legacy, I put some code required in mine postpit.css
and it is ok using your code above.


* Now as you say for threadbit, lastpostby I did not realize for that one, must find it :)


Thank you

Kane@airrifle 01-26-2017 08:26 AM

Another more inelegant way would be to edit the memberaction_dropdown template

Replace default code with.
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">
                <vb:if condition="$show['member']">
                <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:raw template_hook.memberaction_dropdown_items}
        </ul></vb:if>
</div>

This will have the effect of blocking the whole UL to guests, everywhere.

Stratis 01-26-2017 10:04 AM

Quote:

Originally Posted by Kane@airrifle (Post 2581352)
This will have the effect of blocking the whole UL to guests, everywhere.


Yes, yes that has effect to all positions. The only problem for me with this is that username is clickable (without though showing something) but only I see a white line with border that I can not describe it well, its something with css.


You gave me a very good idea where to play around and fix this as my needs.
Thank you for you precious help for another time. :)

--------------- Added [DATE]1485433449[/DATE] at [TIME]1485433449[/TIME] ---------------

Found if I put code here above


<vb:if condition="$show['member']">
<ul class="popupbody popuphover memberaction_body">


I do not see that line I describe before, but still clickable. but ok...

Kane@airrifle 01-26-2017 10:39 AM

We both learnt something :up:

Stratis 01-26-2017 10:46 AM

Quote:

Originally Posted by Kane@airrifle (Post 2581359)
We both learnt something :up:

I learned, you knew :)


Thanks

MarkFL 01-26-2017 11:03 AM

1 Attachment(s)
Hey Stratis,

Try this simple product I have attached. If it works as you want, you can revert any changes made to your "memberaction_dropdown" template. :)

There are no settings, once you import it, it is active, and will only prevent guests from access to the dropdown. ;)


All times are GMT. The time now is 04:38 AM.

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.02203 seconds
  • Memory Usage 1,754KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete