UBB.Dev
Posted By: Moderator [6.0x] Disabling pictures for certain users - 04/12/2001 3:52 AM
OK, this my first hack so go easy on me, it's rough and dirty, but works (just).

in ubb_lib.cgi - find
if ($_[1] eq 'ON') {
$_[0] =~ s/([img])(S+?)([/img])/ /isg;
}

replace with
$picbanned = "0";

open(PICBANLIST, "$vars_config{VariablesPath}/vars_picbanlist.cgi") || die " cannot open picbanlist";
while( )
{
chomp;
if( $_ eq $_[2] )
{
$picbanned = "1";
}
}

close( PICBANLIST );

if ( ($_[1] eq 'ON') && ( $picbanned ne '1' ) )
{
$_[0] =~ s/([img])(S+?)([/img])/ /isg;
}
else
{
$_[0] =~ s/([img])(S+?)([/img])/ /isg;
}

Make a file called vars_picbanlist.cgi in the CGI directory, and put the usernames who you want not to be able to post pictures in posts.

Then in ubb_edit_post.cgi, ubb_new_topic.cgi and ubb_new_reply.cgi

find
$message = &UBBCode("$message", "$this_forum[10);

replace with
$message = &UBBCode("$message", "$this_forum[10]", "$username" );

Now, when the users in the vars_picbanlist.cgi file try to put pictures in posts, they will be greeted with the default missing picture icon.

Things to do
1) Make it good!
2) Add a option in Member Restrictions when a admin calls up a user profile, to enable/disable this option
3) Did I mention, make it good!!
© UBB.Developers