****************************************************************************** ****************************************************************************** * MOD NAME: VIP HTML [ 6.7.x ] * ****************************************************************************** * DESCRIPTION: VIPHTML™ allows admins/mods or special people to post html * * in forums where it is disabled for the average person. * ****************************************************************************** * AUTHORS: Brett * *ORIGINAL AUTHOR: Greg Hard * * DATE: 04-06-2004 * ****************************************************************************** * COMPATABILITY: 6.7.x * ****************************************************************************** * FILES MODIFIED: cp2_forumedit.pl, cp2_editprofile.pl, cp2_membermanage.cgi * * ubb_lib_posting.cgi, cp2_forums.cgi * ------------------------- COPYRIGHT NOTICE ----------------------------------- Code contained in this archive may only be used if you are Infopop or an Infopop licensee only. Usage of code in this archive for coding purposes is restricted for UBB-related purposes only. Furthermore, users must obtain written permission of one of the 2 contributors to this hack before using code from this hack in any other hacks. You may freely add this hack to as many UBBs you own as long as you are licensed from Infopop to do so. Distribution either in part or in whole of this archive or any files thereof is not permitted. You may not remove any copyright notices displayed by this hack. The copyright must be visible to the human eye with little effort. If don't own a LEGAL license to UBB 6, you have NO RIGHT to use this hack. If you disagree to the conditions outlined above, you may not use this code at all. ### WARNING: BACK UP ALL FILES BEFORE APPLYING THIS MODFICATION. ### ########################################################################### ######################################################## ###Open cp2_forumedit.pl ######################################################## ######## # find # ######## # HTML my $html = { type => "checkbox", name => "html", checked => $options->[4] eq "is" ? 1 : 0, title => $vars_wordlets_cp2{forums_t_html}, }; ################ # replace with # ################ # HTML my $html = { type => "radio", name => "html", title => $vars_wordlets_cp2{forums_t_html}, options => [ { name => "Yes, for all", value => "is", selected => ($options->[4] eq "is" ? 1 : 0) }, { name => "Admins/VIPS Only", value => "vip", selected => ($options->[4] eq "vip" ? 1 : 0) }, { name => "No, disallow for all", value => "no", selected => ($options->[4] eq "is not" ? 1 : 0) }, ], }; ######################################################## ###Open cp2_editprofile.pl ######################################################## ######## # find # ######## { type => "header", level => 2, title => $vars_wordlets_cp2{editprofile_other}, }, ############## # Add above: # ############## { type => "selectlist", size => $forum_size, multi => 1, title => "VIP Permissions", desc => "When a forum is set to VIP and admin's only, this is where you can set which forums the user can post HTML on if user is not set to admin already.", name => "vip_html", options => &MakeForumSelectList({ show_cats => 0, show_all => 0, bold_cats => 1, selected_forums => [split(/\, /, $profile[67])], nosel_cats => 1, }), }, ######################################################## ###Open cp2_membermanage.cgi ######################################################## ######## # find # ######## # Process sig - graemlins ############## # Add above: # ############## # VIP if(ref(\$in{vip_html}) !~ m/SCALAR/i) { my @vip; foreach my $vip(@{ $in{vip_html} }) { push @vip, $vip; } $profile->[67] = join(", ", @vip); } else { $profile->[67] = $in{vip_html}; } ######################################################## ###Open cp2_forums.cgi ######################################################## ######## # find # ######## # 4: Allow HTML? $original[4] = $in{html} ? "is" : "is not"; ################ # replace with # ################ # 4: Allow HTML? $original[4] = !$in{html} ? 'is not' : $in{html}; ######################################################## ###Open ubb_lib.cgi ######################################################## ######## # find # ######## $vars_config{'MaxMemFields'} = 43; ################ # replace with # ################ $vars_config{'MaxMemFields'} = 71; #total fields permitted in member file(this is a large number so it does not conflict with other hacks) ######################################################## ###Open ubb_lib_posting.cgi ######################################################## ######## # find # ######## if ($_[0] eq 'is') { ################ # replace with # ################ if ($_[0] eq 'is' || $_[0] eq 'vip') { ######## # find # ######## # If HTML is not enabled, disable it if (!$is_html) { $message =~ s//>/g; } # end if ################ # replace with # ################ # If HTML is not enabled, disable it # VIP HTML my @user_profile = &OpenProfile($user_number); my @good_forums = split(/\, /, $user_profile[67]) if $user_profile[67]; my $authority_bool = ($user_profile[8] eq 'Administrator' || $user_profile[8] eq 'MegaModerator' || $user_profile[8] eq 'Moderator'); my $g = 0; foreach(@good_forums) { if($good_forums[$_] eq $_) { $g = 1; last; } } if(((($user_profile[67] && $g ne 1) || $authority_bool) && $vars_forums{$in{f}}->[4] eq 'vip') || ($vars_forums{$in{f}}->[4] eq 'is' && $authority_bool)) { } else { $message =~ s//>/g; } #end if ######## That's It!