View Single Post
  #5  
Old 04-13-2004, 04:57 AM
EvilLS1's Avatar
EvilLS1 EvilLS1 is offline
 
Join Date: Apr 2002
Location: Georgia, USA
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well since you're a fellow F-Body owner & car enthusiast I'll help ya out.


Run this query via phpmyadmin:

ALTER TABLE user ADD pban smallint(5) unsigned DEFAULT 1 NOT NULL

In admincp/user.php find:
Code:
	{
		print_profilefield_row($profilefield, $userfield);
	}
Below it add:
Code:
print_yes_no_row($vbphrase['can_edit_profile'], 'pban',$user[pban]);
Find:
Code:
if ($_POST['do'] == 'update')
{
	globalize($_POST, array(
		'password',
		'user',
		'membergroup',
		'modifyavatar',
		'birthday',
		'signature',
		'modifyprofilepic',
		'joindate',
		'lastvisit',
		'lastactivity',
		'lastpost',
		'options',
		'referrer',
		'threaddisplaymode' => INT
	));
Replace it with:
Code:
if ($_POST['do'] == 'update')
{
	globalize($_POST, array(
		'password',
		'user',
		'membergroup',
		'modifyavatar',
		'birthday',
		'signature',
		'modifyprofilepic',
		'joindate',
		'lastvisit',
		'lastactivity',
		'lastpost',
		'options',
		'referrer',
		'pban',
		'threaddisplaymode' => INT
	));
Find:
Code:
		$DB_site->query("
			INSERT INTO " . TABLE_PREFIX . "usertextfield
				(userid, signature)
			VALUES
				($userid, '" . addslashes($signature) . "')
		");
	}
Below it add:
Code:
 $DB_site->query("UPDATE " . TABLE_PREFIX . "user SET pban=$pban WHERE userid=$userid");
In profile.php find:
Code:
if ($_REQUEST['do'] == 'editprofile')
{
Below it add:
Code:
  if ($bbuserinfo[pban]==0) 
{
	print_no_permission();
  }
If you want to stop them from editing other things just place that same code under whichever parts you don't want them to edit. For example, if you wanted to stop them from editing the options you would find this:
Code:
if ($_REQUEST['do'] == 'editoptions')
{
And add this below it:

Code:
  if ($bbuserinfo[pban]==0) 
{
	print_no_permission();
  }
Same goes for the avatar, signature, and whatever else you want to limit. Or if you prefer to limit them from everything you would just add that code below this:
Code:
// ############################################################################
// ALL FUNCTIONS BELOW HERE REQUIRE 'canmodifyprofile' PERMISSION, SO CHECK IT
In your admincp under "Languages & Phrases" click "Phrase Manager", then click "Add new Phrase". Add the following phrase:

Varname: can_edit_profile
Text: Can edit Profile?

Then to lock a member from editing his profile you would just click user options and set can edit profile to "no".
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01166 seconds
  • Memory Usage 1,782KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (11)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete