News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

Searching for censor words

Started by Srinib, August 17, 2012, 03:32:44 PM

Previous topic - Next topic

Srinib

Before a member can use Report to moderator, i want to search for some specific objectionalable words which are Censored Words in a post or a reply. For example, if a word is censored from Apple to Orange(Apple => Orange), i want to search for Orange and delete that particulat post or will try to take some action.

But when i search for Orange nothing comes up. That post is pulled by a search only if i search for Apple.

It should work the other way round. Right?

Chas Large

This is because the "Censor" works on a per user basis and replaces the bad word with the good word on the fly.

So in the post text apple is typed and users who have censoring turned on see orange but those who don't still see apple.

You need to search for apple.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Srinib

Thank you.
But i have two more questions related to this.

  • Where do regular members turn ON or OFF this censor options?I didnot see that in profiles.
  • And how can a admin  make sure that this censoring is always turned ON for all the members?

kat

    Quote from: Srinib on August 17, 2012, 04:10:29 PM
    • Where do regular members turn ON or OFF this censor options?I didnot see that in profiles.

    "Look and layout".

    Quote from: Srinib on August 17, 2012, 04:10:29 PM
    • And how can a admin  make sure that this censoring is always turned ON for all the members?

    Now this is one of those things that SMF does terribly weirdly.

    For some reason, which I couldn't even begin to understand, this is done on a theme-by-theme basis, rather than globally. (Silly, I  agree).

    So, go to Admin>Current theme and you'll see "Allow users to turn off word censoring:"

    Obviously, you'll need to do that for every theme.

    I suppose there IS a kind of logic, thinking about it. On some fora, they have "Adults only" boards, where they enforce a certain theme and leave that theme uncensored. So, maybe it's not so crazy, after all. ;)

    ZerK

    the option is there:
    Profile -> modify profile -> look and layout (ex:http://www.simplemachines.org/community/index.php?action=profile;area=theme)
    it says:  Leave words uncensored, and words are censored by default.

    Srinib

    I am back with two more questions regarding  Censored Words.

    I am already using bunch of Censored Words. And i need to add few more and with that the count may come to something like about 100 plus.


    • If we have so many words to be censored, will it affect the performance? I mean, does the uses take more time(1 or 2 seconds extra) to retrieve the topic he is trying to open?
    • And with so many words, i am finding it difficult to manage. We don't have a "sort out" option here, so that we can check the list of entered words in alphabetical order. I guess there should be a table for this Censored Words. Can someone tell which is that table?

    kat

    A hundred!?!?

    That seems an inordinate amount, to me. Still, it's your forum, not mine, ay? ;)

    Yes, it will affect performance. But, not much, unless those words get used an awful lot.

    Sorry, I don't know where they're stored in the db. :(

    Kays

    QuoteAnd with so many words, i am finding it difficult to manage. We don't have a "sort out" option here, so that we can check the list of entered words in alphabetical order. I guess there should be a table for this Censored Words. Can someone tell which is that table?

    That's actually stored in the settings table in two separate arrays. If you wish to display them alphabetically, in ManagePosts.php look for:


    foreach ($_POST['censor_vulgar'] as $i => $value)
    {
    if (trim(strtr($value, '*', ' ')) == '')
    unset($_POST['censor_vulgar'][$i], $_POST['censor_proper'][$i]);
    }

    $censored_vulgar = $_POST['censor_vulgar'];
    $censored_proper = $_POST['censor_proper'];


    And change that to:


    $censored = array();
    foreach ($_POST['censor_vulgar'] as $i => $value)
    {
    if (trim(strtr($value, '*', ' ')) == '')
    unset($_POST['censor_vulgar'][$i], $_POST['censor_proper'][$i]);
    else
    $censored[$_POST['censor_vulgar'][$i]] = $_POST['censor_proper'][$i];
    }
    ksort($censored);

    foreach ($censored as $naughty => $nice)
    {
    $censored_vulgar[] = $naughty;
    $censored_proper[] = $nice;
    }


    Now this does change the order in the database so I would recommend backing that up first just in case. ;)

    If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
    My Mods


    MrPhil

    Quote from: Srinib on December 07, 2012, 06:13:50 AM
    I am already using bunch of Censored Words. And i need to add few more and with that the count may come to something like about 100 plus.

    The original intent of Censored Words was to allow forum owners to block "objectionable" material (swearing, obscenities, etc. whatever the forum owner deems improper). Are you using it for some other purpose? If so, perhaps someone could suggest a better alternative... Although, the words will likely still be stored in the database.

    Srinib

    Thanks a lot to everybody. I shall try these options. Meanwhile, i am able to bring down the total word count to 51.

    waris

    Go to Admin>Forum>Post and Topics>Censored Word.

    All the words and alternatives are listed there for you to edit.

    Advertisement: