Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 09-17-2000 Last Update: Never Installs: 0
 
No support by the author.

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 &ltg; 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);
but further searches for this variable in the file result in nothing! Also, it doesn't appear in global.php either. How does VB know to replace < > with the HTML equivalents?

Thanks,

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 09-17-2000, 04:04 PM
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #3  
Old 09-17-2000, 04:56 PM
Guest
 
Posts: n/a
Default

please share, sounds nice.
Reply With Quote
  #4  
Old 09-17-2000, 05:19 PM
Guest
 
Posts: n/a
Default

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>
Add the following line to the bottom of the big list of options. Really, it doesn't matter where it goes, just somewhere in the list is fine.

Code:
<li><a href=\"#html\">HTML Censoring Options</a></li>
Ok. Further on down in options.php (around line 610) you will see
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>";
That is the end of the table. Place the following code anywhere above that:

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 -->
Ok. Save, close, and upload the file to your server.

Now open /global.php (not the one in /admin). Find (around line 421) the line that reads:
Code:
    $bbcode=censortext($bbcode);
Add this right after that:

Code:
    if( $dohtml == 1 ) {
          
      $bbcode = censorhtml( $bbcode );
        
    } // end if
Ok. That is the call to the censorhtml function.. Now all you have to do is add the function anywhere inside of global.php. I placed mine directly after the censortext( ) function (near line 457).

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
That's it! Then save, close, and upload global.php to the server.

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
Should be straightforward. Works ok on our server / boards.
Reply With Quote
  #5  
Old 09-17-2000, 05:21 PM
Guest
 
Posts: n/a
Default

Of course, you need to "enable HTML" on the forum in which you post to in order to make the code active.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:15 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03724 seconds
  • Memory Usage 2,234KB
  • Queries Executed 18 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (10)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete