PDA

View Full Version : How can I eliminate postbit links for guests?


joeychgo
03-19-2014, 08:19 AM
I want to make it so the username in the postbit, is not clickable for guests...

How can I do this?

Barcham
03-19-2014, 01:59 PM
On my board, I have configured the GUEST user permissions so that they cannot view member profiles, or use the search function or view who's on line, etc... So while they can click on a handle and see the drop menu, clicking on any of the links simply brings them to a no permission log in screen that tells them they have to log in or register to see this page. Works fine for me.

joeychgo
03-19-2014, 07:01 PM
its still a link that takes someone to another page. That's not what I want. I want it to not be a link at all for guests.

cellarius
03-19-2014, 08:24 PM
Then you need to go through all templates and wrap conditions around the <a>-Tags. That dropdown does not only show up in postbit.

Seven Skins
03-19-2014, 08:28 PM
Find in postbit template:

{vb:raw memberaction_dropdown}

Replace it with:

<vb:if condition="$show['guest']">{vb:raw post.musername}<vb:else />{vb:raw memberaction_dropdown}</vb:if>

joeychgo
03-19-2014, 11:19 PM
that worked except all formatting is gone for the username.

ozzy47
03-19-2014, 11:45 PM
What is happening by doing it that way is removing some of the classes needed for the display. Undo the above edit, then open your memberaction_dropdown template, and find the following:

<ul class="popupbody popuphover memberaction_body">

Above that add this:
<vb:if condition="$show['member']">

Then find the following:
</ul>

And below that add this:
</vb:if>

joeychgo
03-19-2014, 11:58 PM
Hmmm.. That kind of worked Ozz --

http://www.lincolnvscadillac.com/forum/showthread.php?92967-Idled-car-for-8-hours-straight-issues

The link to the profile is there but doesn't work unless you right click and open in a new window.



Ideally - it wouldn't have a link at all.

ozzy47
03-20-2014, 12:00 AM
Ok give me a minute, stay tuned.

ozzy47
03-20-2014, 12:04 AM
OK find this line:
<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>

And change it to this:
<a class="username {vb:raw memberinfo.online} popupctrl" <vb:if condition="$show['member']">href="{vb:link member, {vb:raw memberinfo}}"</vb:if> 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><vb:if condition="$show['member']"></a></vb:if>

joeychgo
03-20-2014, 12:17 AM
if you meant in addition to the earlier.. Ive done it.

now all text in the first post is subject to hover / ul

http://www.lincolnvscadillac.com/forum/showthread.php?92967-Idled-car-for-8-hours-straight-issues

ozzy47
03-20-2014, 12:27 AM
Hmmm, ok back to the drawing board.

joeychgo
03-20-2014, 12:30 AM
the goal here is to minimize links off page for guests.

ozzy47
03-20-2014, 12:39 AM
Ok was your member action dropdown customized before, or was it stock?

joeychgo
03-20-2014, 12:45 AM
stock I believe

ozzy47
03-20-2014, 12:48 AM
Ok then replace the entire contents with this:

<div class="popupmenu memberaction<vb:if condition="$page_class"> {vb:raw page_class}</vb:if>">
<vb:if condition="$show['guest']">
<span class="username" style="font-size:{vb:stylevar font.fontSize}{vb:stylevar font.units};
font-weight:bold;" 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></span>
<vb:else />
<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>
</vb:if>
<vb:if condition="$show['member']">
<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:comment><li class="left">
<a href="search.php?{vb:raw session.sessionurl}do=finduser&userid={vb:raw memberinfo.userid}&starteronly=1&searchdate=30&beforeafter=after&contenttype=vBForum_Thread" class="siteicon_email">
30 Days
</a>
</li></vb:comment>

{vb:raw template_hook.memberaction_dropdown_items}
</ul>
</vb:if>
</div>

joeychgo
03-20-2014, 12:54 AM
That worked almost perfectly. only thing is the username is a little smaller then before....

ozzy47
03-20-2014, 01:00 AM
Not that I can see on my site, there should be no reason it does that on yours. Since the css is in there:
style="font-size:{vb:stylevar font.fontSize}{vb:stylevar font.units};
font-weight:bold;"

joeychgo
03-20-2014, 01:04 AM
see

ozzy47
03-20-2014, 01:11 AM
Hmmm, that is strange, care to give me a admin account so I can debug it on your site, as I can not replicate it on mine?

joeychgo
03-20-2014, 01:25 AM
sure, stand by for a pm

ozzy47
03-20-2014, 01:29 AM
Okie dokie.

ozzy47
03-20-2014, 01:40 AM
Under normal circumstances the above would have worked for you, but you had a edit in your additional.css that was over riding the class, so I changed, font-size:{vb:stylevar font.fontSize}{vb:stylevar font.units}; to the following, font-size:20px;

So the final is this:
<div class="popupmenu memberaction<vb:if condition="$page_class"> {vb:raw page_class}</vb:if>">
<vb:if condition="$show['guest']">
<span class="username" style="font-size:20px; font-weight:bold;" 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></span>
<vb:else />
<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>
</vb:if>
<vb:if condition="$show['member']">
<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:comment><li class="left">
<a href="search.php?{vb:raw session.sessionurl}do=finduser&userid={vb:raw memberinfo.userid}&starteronly=1&searchdate=30&beforeafter=after&contenttype=vBForum_Thread" class="siteicon_email">
30 Days
</a>
</li></vb:comment>

{vb:raw template_hook.memberaction_dropdown_items}
</ul>
</vb:if>
</div>

joeychgo
03-20-2014, 01:53 AM
Thank you :)))

ozzy47
03-20-2014, 01:54 AM
Not a problem, glad to help. :)

Seven Skins
03-21-2014, 03:06 PM
<a href="https://vborg.vbsupport.ru/showpost.php?p=2488399&postcount=5" target="_blank">This</a> is a tried and tested code, it did not work due to customization in other templates. Anyways problem has been solved.