The Arcive of vBulletin Modifications Site. |
|
Details »»
|
|||||||||||||||||||||||||
Does anyone know where VB does this? I can't for the life of me find it! I added a little thing in the control panel options called "HTML Censoring" where you can stick in tags that you don't want displayed. For instance, on our HTML enabled forums someone discovered that you can embed sounds < bgsound > into posts and that really trashed everything. So, we had to turn HTML off, and people really like it (create tables, colors and such), and so I want to turn HTML back on, but just create a list of "bad" tags that will *not* be turned into HTML... So you could do something like:
Code:
<B>This is bold</B> <table> <tr> <td> etc </td> </tr> </table> This is ok too. <bgsound = "http://www.bob.com/a_Really_annoying_wav.wav" loop="forever"> BAD! Will be either deleted or turned into the <g; whatever tags so it will just appear on the board instead of being turned into HTML. I'm looking in showthread.php and I see Code:
$htmlcodeon=iif($foruminfo[allowhtml]==1,$ontext,$offtext); Thanks, Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
Never mind, I found it.. Sheesh, I am tired or something, and it's only Sunday afternoon! Ok, if anyone wants this hack I'll post it, otherwise this thread can die.
|
|
#3
|
|||
|
|||
|
please share, sounds nice.
|
|
#4
|
|||
|
|||
|
Ok, a couple of easy things to do:
Edit /admin/options.php: On or about line 68 you'll see Code:
<li><a href=\"#styles\">Styles Options</a></li> Code:
<li><a href=\"#html\">HTML Censoring Options</a></li> Code:
</table> <div align=\"center\"><center><table border=\"0\"> <tr> <td><p><p align=\"center\"><input type=\"submit\" name=\"submit\" value=\"Submit\"></p></p></td> <td><p><p align=\"center\"><input type=\"reset\" name=\"reset\" value=\"Reset\"></p></p></td> </tr> </table> </center></div> </form>"; Code:
<!--/// Start HTML Censoring --> <tr><td colspan=2><hr></td></tr> <tr><td><a name=\"html\"></a><b>HTML </b></td></tr> <tr> <td><p><b>enable html censoring</b></p></td> <td><p>Yes<input type=\"radio\" name=\"newoption[censorhtml]\" ".iif($censorhtml==1,"checked","")." value=\"1\"> No <input type=\"radio\" name=\"newoption[censorhtml]\" ".iif($censorhtml==0,"checked","")." value=\"0\"></p></td> </tr> <tr> <td><p><b>HTML censor text</b></p></td> <td><p><input type=\"text\" size=\"35\" name=\"newoption[htmlcensortext]\" value=\"$htmlcensortext\"></p></td></tr> <!--/// End HTML Censoring --> Now open /global.php (not the one in /admin). Find (around line 421) the line that reads: Code:
$bbcode=censortext($bbcode); Code:
if( $dohtml == 1 ) {
$bbcode = censorhtml( $bbcode );
} // end if
Here is the function: Code:
// ###################### Start censorhtml #######################
function censorhtml( $text ) {
global $censorhtml, $htmlcensortext;
if( $censorhtml == 1 ) {
$censorword = explode( " ", $htmlcensortext );
while( list( $key, $val ) = each( $censorword ) ) {
if( $val != "" ) {
$clean_val = substr( $val, 1 );
$text = str_replace( $val, "<" . $clean_val, $text );
} // end if
} // end while
} // end if
return $text;
} // end function censorhtml
Now you can play around in the options control panel to make changes. You have to dot the "Enable Censoring" thing in the HTML Censoring section or otherwise it will skip censoring the HTML. Also, you enter in your censor tags like this: Code:
<bgsound <sometag <someothertag |
|
#5
|
|||
|
|||
|
Of course, you need to "enable HTML" on the forum in which you post to in order to make the code active.
|
![]() |
|
|