vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Conditional needed to hide contact info from certain usergroups on profiles (https://vborg.vbsupport.ru/showthread.php?t=145866)

Strike3ForumsMH 04-27-2007 02:39 AM

Conditional needed to hide contact info from certain usergroups on profiles
 
Hey gang, as the title indicates, I am looking to learn how to make it so certain usergroups do not have access to see the contact info provided in the memberinfo template. On my forums we have had rampant problems with people signing up and essentially viewing hundreds of profiles to gather contact info to then spam, usually with their forum. We used vB's promotions system for awhile now to place users into a special group that lacked profile access and private message access, but I would really like to be able to give the profile access back to everyone, as long as certain usergroups are unable to view the contact info.

So if anyone knows the conditional needed (and where to place it), it would be appreciated as my efforts have either done nothing to the access regarding that or blocked all usergroups somehow.

Thanks for reading this and thanks in advance to anyone who can help.
(Edit: I am aware of Kerry-Anne's hack, but for some reason that did not work for me so I am seeing if there is another alternative.)

Antiblank 04-27-2007 08:28 AM

What about wrapping the content in a conditional statement based on the usergroup:

Code:

<if condition="$post['usergroupid'] != 12">

        <tr class="alt2">
        <td height="5" nowrap="nowrap" width="50%"> <div align="left">
            <a href="private.php?$session[sessionurl]do=newpm&amp;u=$userinfo[userid]&quot;&gt;&lt;">
<img border="0" src="/images/buttons/sendpm.gif" align="left" width="79" height="22"></a>
</td>
          <td height="5" nowrap="nowrap" valign="top" width="50%">
            <div align="left"><if condition="$userinfo['showicq']"> $userinfo[icqicon]
            <a href="#" dir="ltr" onclick="imwindow('icq', '$userinfo[userid]', 500, 450); return false;">$userinfo[icq]</a>
            </if> </div>
        </tr>
        <tr class="alt2">
        <td height="5" nowrap="nowrap" valign="top" width="50%">
            <div align="left"><div class="smallfont">
    <a href="sendmessage.php?$session[sessionurl]do=mailmember&amp;u=$userinfo[userid]&quot; rel=&quot;nofollow">
<img border="0" src="/images/buttons/email.gif" align="left" width="79" height="22"></a></p>
            </div></td>
        <td height="2" nowrap="nowrap" valign="middle" width="50%">
            <div align="left"><if condition="$userinfo['showaim']"> $userinfo[aimicon]
            <a href="#" dir="ltr" onclick="imwindow('aim', '$userinfo[userid]', 400, 200); return false;">$userinfo[aim]</a>
            </if></div></td>
        </tr>
        <tr class="alt2">
        <td height="5" nowrap="nowrap" valign="top" width="50%">
        <div align="left"><div class="smallfont"><if condition="$show['addbuddylist']"> <a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$userinfo[userid]">
<img border="0" src="/images/buttons/addbuddy.gif" width="79" height="22"></a>
            <else /><div class="smallfont"><a href="profile.php?$session[sessionurl]do=removelist&amp;userlist=buddy&amp;u=$userinfo[userid]">
<img border="0" src="/images/buttons/remove.gif" align="left" width="79" height="22"></a>
            </if> </div></td>
        <td height="5" nowrap="nowrap" valign="top" width="50%">
            <div align="left"><if condition="$userinfo['showmsn']"> $userinfo[msnicon]
            <a href="#" dir="ltr" onclick="imwindow('msn', '$userinfo[userid]', 400, 200); return false;">$userinfo[msn]</a>
            </if></div></td>
        </tr>
        <tr class="alt2">
        <td height="5" nowrap="nowrap" valign="top" width="50%">
            <div align="left"><div class="smallfont"><if condition="$show['addignorelist']"><a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=ignore&amp;u=$userinfo[userid]">
<img border="0" src="/images/buttons/block.gif" width="79" height="22" align="left"></a></p>
            <else /><div class="smallfont"><a href="profile.php?$session[sessionurl]do=removelist&amp;userlist=ignore&amp;u=$userinfo[userid]">
<img border="0" src="/images/buttons/addbudy.gif" width="79" align="left" height="22"></a></p>
            </if> </div></td>
        <td height="2" nowrap="nowrap" valign="middle" width="50%">
            <div align="left"><if condition="$userinfo['showyahoo']"> $userinfo[yahooicon]
            <a href="#" dir="ltr" onclick="imwindow('yahoo', '$userinfo[userid]', 400, 200); return false;">$userinfo[yahoo]</a>
            </if></div></td>
        </tr>
<else />
<tr>
<td>
$vbphrase[im_is_private]
</td>
</tr>

</if>

Where group 12 is the Usergroup id of the group you want to not be allowed to see the contact information.

Another option would be if you don't have alot of user groups, then setting the usergroups allowed to view the information instead.

Code:

<if condition="is_member_of($vbulletin->userinfo, 1, 2, 3)">

</if>


Strike3ForumsMH 04-29-2007 03:37 AM

Thanks AntiBlank. I kind of forget how exactly I did it (I did it on Friday), but I did draw much inspiration from your post (I hadn't even though to block out the icons in the postbit) and I am hoping to turn back on the profiles for that usergroup as everything finally seems to be a go with this.

Once again, thank you.

- Reid


All times are GMT. The time now is 01:03 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.00981 seconds
  • Memory Usage 1,730KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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