[Snippet] Word censoring with image replace

Little Mods and Snips 1

[Snippet] Word censoring with image replace

Postby Sekuro » 17 Oct 2011, 17:41

Word censoring with image replace

Replaces defined censore words with an image.
All non-defined censore words are replaced normally.

open

includes/cache.php

find

Code: Select all
                    $censors['replace'][] = $row['replacement'];


replace with

Code: Select all
                    $censors['replace'][] = (preg_match("#\*_(.*?)#", $row['replacement'])) ? '<img src="' . $phpbb_root_path . str_replace('*_', '', $row['replacement']) . '" alt="" />' : $row['replacement'];


make censoring this way (example for the word test): http://www.loaditup.de/files/643108_y75d75m4xw.png
acp > posting > word censoring, if you want an image-replace.

  • enter replacement with additional image path: *_images/image_name.jpg
  • don't forget to put the images in folder images/*.* and name the images sensefull
  • censor list is cached by design, so don't forget to clear board-cache after each editing of censor list
Mod-Bot / Service-Team
User avatar
Sekuro

Tiptop

Tiptop
 
Posts: 241
Joined: 11 Feb 2008, 11:49
 
Resolution: 1440x900


Return to Snip Cl@ss I

Who is online

Users browsing this forum: No registered users and 1 guest

cron