******************************************************************************** ******************************************************************************** * HACK NAME: URL Spam Prevention * ******************************************************************************** * DESCRIPTION: Stop junior members and unregistered people from posting * * URLs (ftp etc) and replaces them with an explanation * * CREATED BY: Dave2/Dave Wickham * * DATE: 09/12/2002 * * VERSION: Version 1.0beta2 * * DEMO: http://www.aagames.co.uk/cgi-bin/ultimatebb.cgi * ******************************************************************************** * REQUIREMENTS: Valid licence, UBB.classic >= 6.3.0 * * COMPATABILITY: Tested on UBB.classic 6.3.0 * ******************************************************************************** * INSTALLATION: 1) Hack the files as noted. * * 2) Upload ALL the files in ASCII. * ******************************************************************************** * DISCLAIMER: By using this hack, the user implicitly agrees that they * * are willingly modifying any and all files at their own * * risk. Should any errors occur either as a direct or * * indirect result of said modifications the user agrees not * * to hold Infopop Corporation or any of the individuals * * listed above accountable. * * * * * * IN OTHER WORDS: PLEASE MAKE BACKUP COPIES OF EVERY FILE YOU PLAN TO * * MODIFY PRIOR TO MODIFICATION!! * * * * * * FOR MORE TIPS AND TRICKS FOR USE WITH THE ULTIMATE BULLETIN BOARD * * PLEASE VISIT US AT: * * * * http://www.ubbdev.com/ * * (c)2001 UBB Developers Network * ******************************************************************************** ################################################################################ ##############################BEGIN HACK######################################## ################################################################################ ########## MODIFY: cgi/ubb_lib_posting.cgi ########## #### FIND: $user_profile[12] = &UBBCode(&ConvertReturns(&prep_for_edit($user_profile[12], undef, $allow_images)), $allow_images); #### REPLACE WITH: $user_profile[12] = &UBBCode(&ConvertReturns(&prep_for_edit($user_profile[12], undef, $allow_images)), $allow_images, 1); #### #### ########## END of ubb_lib_posting.cgi ########## Save and close ########## MODIFY: cgi/ubb_profile.cgi ########## #### FIND: $sig_html = &UBBCode($sig_html, $ubb_code_images); #### REPLACE WITH: $sig_html = &UBBCode($sig_html, $ubb_code_images, 1); #### #### ########## END of ubb_profile.cgi ########## Save and close ########## MODIFY: cgi/ubb_lib.cgi ########## #### FIND: $_[0] = &auto_url($_[0]); unless ($_[0] =~ /\[\/.+]/) { return ($_[0]); } # only process if there are ubbcode tags #### REPLACE WITH: $_[0] = &auto_url($_[0], $_[2]); unless ($_[0] =~ /\[\/.+]/) { return ($_[0]); } # only process if there are ubbcode tags #### #### FIND: sub auto_url { my $check = shift; $check =~ s/(^|\s)(http:\/\/\S+)(\.|\,|\))?/$1$2<\/a>$3/isg; $check =~ s/(^|\s)(https:\/\/\S+)(\.|\,|\))?/$1$2<\/a>$3/isg; $check =~ s/(^|\s)(ftp:\/\/\S+)(\.|\,|\))?/$1$2<\/a>$3/isg; $check =~ s/(^|\s)(www\.\S+)(\.|\,|\))?/$1$2<\/a>$3/isg; return ($check); } # end auto_url #### REPLACE WITH: sub auto_url { my $is_sig = $_[1]; my $check = shift; if ((($user_profile[8]) && ($user_profile[8] ne "$vars_misc{custom_titles}->{0}")) || ($is_sig eq "1")) { $check =~ s/(^|\s)(http:\/\/\S+)(\.|\,|\))?/$1$2<\/a>$3/isg; $check =~ s/(^|\s)(https:\/\/\S+)(\.|\,|\))?/$1$2<\/a>$3/isg; $check =~ s/(^|\s)(ftp:\/\/\S+)(\.|\,|\))?/$1$2<\/a>$3/isg; $check =~ s/(^|\s)(www\.\S+)(\.|\,|\))?/$1$2<\/a>$3/isg; } else { $vars_wordlets{url_nuked} =~ s/%%ULTIMATEBB%%/$ULTIMATEBB/i; $check =~ s/(^|\s)(http:\/\/\S+)(\.|\,|\))?/$1$vars_wordlets{url_nuked}<\/i>$3/isg; $check =~ s/(^|\s)(https:\/\/\S+)(\.|\,|\))?/$1$vars_wordlets{url_nuked}<\/i>$3/isg; $check =~ s/(^|\s)(ftp:\/\/\S+)(\.|\,|\))?/$1$vars_wordlets{url_nuked}<\/i>$3/isg; $check =~ s/(^|\s)(www\.\S+)(\.|\,|\))?/$1$vars_wordlets{url_nuked}<\/i>$3/isg; } return ($check); } # end auto_url #### #### FIND: $match++ if $_[0] =~ s/(\[URL\])(http|https|ftp)(:\/\/\S+?)(\[\/URL\])/&urlize("$2$3", "$2$3")/eisg; $match++ if $_[0] =~ s/(\[URL\])(\S+?)(\[\/URL\])/&urlize("http:\/\/$2", $2)/eisg; $match++ if $_[0] =~ s/(\[URL=)(http|https|ftp)(:\/\/\S+?)(\])(.+?)(\[\/URL\])/&urlize("$2$3", $5)/eisg; $match++ if $_[0] =~ s/(\[URL=)(\S+?)(\])(.+?)(\[\/URL\])/&urlize("http:\/\/$2", $4)/eisg; $match++ if $_[0] =~ s/(\[EMAIL\])(\S+\@\S+?)(\[\/EMAIL\])/&urlize("mailto:$2", $2)/eisg; #### REPLACE WITH: if ((($user_profile[8]) && ($user_profile[8] ne "$vars_misc{custom_titles}->{0}")) || ($_[2] eq "1")) { $match++ if $_[0] =~ s/(\[URL\])(http|https|ftp)(:\/\/\S+?)(\[\/URL\])/&urlize("$2$3", "$2$3")/eisg; $match++ if $_[0] =~ s/(\[URL\])(\S+?)(\[\/URL\])/&urlize("http:\/\/$2", $2)/eisg; $match++ if $_[0] =~ s/(\[URL=)(http|https|ftp)(:\/\/\S+?)(\])(.+?)(\[\/URL\])/&urlize("$2$3", $5)/eisg; $match++ if $_[0] =~ s/(\[URL=)(\S+?)(\])(.+?)(\[\/URL\])/&urlize("http:\/\/$2", $4)/eisg; } else { $vars_wordlets{url_nuked} =~ s/%%ULTIMATEBB%%/$ULTIMATEBB/i; $match++ if $_[0] =~ s/(\[URL\])(http|https|ftp)(:\/\/\S+?)(\[\/URL\])/$vars_wordlets{url_nuked}<\/i>/isg; $match++ if $_[0] =~ s/(\[URL\])(\S+?)(\[\/URL\])/$vars_wordlets{url_nuked}<\/i>/isg; $match++ if $_[0] =~ s/(\[URL=)(http|https|ftp)(:\/\/\S+?)(\])(.+?)(\[\/URL\])/$vars_wordlets{url_nuked}<\/i>/isg; $match++ if $_[0] =~ s/(\[URL=)(\S+?)(\])(.+?)(\[\/URL\])/$vars_wordlets{url_nuked}<\/i>/isg; } $match++ if $_[0] =~ s/(\[EMAIL\])(\S+\@\S+?)(\[\/EMAIL\])/&urlize("mailto:$2", $2)/eisg; #### #### ########## END of ubb_lib.cgi ########## Save and close ########## MODIFY templates/public_faq.pl ########## #### FIND:
Are there any censor features? #### ADD BELOW:
Can I post URLs? #### #### FIND: The message board administrators have the power to censor certain words that may be posted. This censoring is not an exact science, however, so certain words may be censored out of context. Please realize that the censoring, if any censoring is being performed, is being done by a computer based on the words that are being screened. Words that are censored are replaced with asterisks.

#### ADD BELOW:
$vars_style{FontTag}URL-posting Prevention
This message board enforces "anti-spam" measures to stop people simply signing up to promote another site. If unregistered posting is allowed, no URLs may be posted by unregistered users. Registered members who have less than thirty posts also may not post URLs. If a URL is cut which you believe is of use to the discussion, please PM an Administrator or Moderator of the forum with the details, but hyphenating the protocol - e.g. "h-t-t-p-:-/-/". Any users deliberately circumventing this protection will be warned and have the URL removed. Signatures are not affected by this.

#### #### ########## END of public_faq.pl ########## Save and close ########## MODIFY variables/vars_wordlets.cgi ########## #### ADD: q!url_nuked! => q!Sorry, URL removed - Click for more information!, #### #### ########## END of vars_wordlets.cgi ########## Save and close ################################################################################ ################################END HACK######################################## ################################################################################ ########## POSSIBLE PROBLEMS ########## #### I think that the newer UBB.classic versions use wordletised FAQs. If you #### want this written to make use of that, feel free to buy me a new licence ;) ###### ###### #### If this file is all on one line, you probably use Windows or a Mac. These #### platforms use different ways to end lines in text files, and this hack was #### written in Linux (a UNIX clone). Try a more advanced text editor, e.g. #### wordpad for Windows. ########## ##########