Mod Name / Version: Restrict Viewing User Profiles By Group 1.1
Description: This mod will disallow viewing of User profiles except by Admins, Mods, and a specified user group.
See installation instructions below
Working Under: UBB.Threads 6.5
Mod Status: Beta
Any pre-requisites: N/A
Author(s): Zackary
Date: 10/27/04
Credits: UnixSpot for requesting it
Files Altered: threads > showprofile.php
threads > languages > showprofile.php
threads > includes > config.inc.php
New Files: None
Database Altered: NO
Info/Instructions: Friendly reminder, BACKUP your files prior to modifying them!
Go to your board, configure your groups to use the one you want to have access to member profiles. Remember if a user is an Admin or Moderator they'll see the profile regardless of group membership.
If you don't know the number of the group you want to allow to view profiles, go into your Control Panel. Click on Group Management under the Forums Menu. Find the group you want to use and make note of the group number listed to the left of the name. (Just to the left of the Delete check box)
IMPORTANT!!! In the first step, you'll replace the XXX with the number of the group you want to use. If you want to use multiple groups, place a | between the numbers. (i.e. 5|9)
Open threads > includes > config.inc.php ADD to the end of the file right before the ?> <br />$config['view_profiles'] = "XXX"; <br />
Open threads > showprofile.php FIND: <br />$thisuser = $userob -> authenticate("U_PictureView,U_Number,U_TimeOffset,U_TimeFormat,U_Ignored,U_OC_Userid"); <br />
REPLACE WITH: <br />$thisuser = $userob -> authenticate("U_PictureView,U_Number,U_TimeOffset,U_TimeFormat,U_Ignored,U_OC_Userid,U_Groups,U_Status"); <br />
FIND: <br />if ($User == 1) { <br /> $html -> not_right($ubbt_lang['NO_LONGER'],$Cat); <br />} <br />
ADD AFTER: <br />if ((!preg_match("/$config[view_profiles]/",$thisuser['U_Groups'])) && ($thisuser['U_Status'] != "Administrator") && ($thisuser['U_Status'] != "Moderator")) { <br /> $html -> not_right($ubbt_lang['NO_VIEW_PROFILE'],$Cat); <br />} <br /> <br />else { <br />
FIND: <br />if (!$debug) { <br /> include("$thispath/templates/$tempstyle/showprofile.tmpl"); <br />} <br />
ADD AFTER: Open threads > languages > showprofile.php ADD to the end of the file right before the ?>
<br />$ubbt_lang['NO_VIEW_PROFILE'] = "I'm sorry you do not have permissions to view user profiles. If you feel this is in error, please contact an Administrator."; <br />
You can edit this string to say what you want.
You are done!
----
[EDIT: 10/27/2004 - I was unhappy with hard coding this right into the showprofile.php, so I went ahead with my original plan to add it to the config file. In my mind this makes more sense.
Instructions have been updated to reflect this change. This is now version 1.1.

]
Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.
Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.