1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to prevent spammers from russia, china, etc on phpld directories

Discussion in 'Security' started by Moreno, Mar 14, 2011.

  1. #1
    i just wanted to share some kind of phpld stuff. If you are running a phpld directory and have lots of spam from russian or chinese websites and dont want to remove them day by day manually, simply add some code to your submit.php:

    Look for the following code:

       if (strlen (trim ($data['URL'])) > 0 && !preg_match ('#^http[s]?:\/\/#i', $data['URL']))
          $data['URL'] = "http://".$data['URL'];
    Code (markup):
    Right behind this code add the following code:

       if (preg_match("/.ru/.cn/i", $data['URL']))
                unset ($data);
                $reason = _L('We dont allow this kind of websites').'.';
                gotoUnauthorized($reason);
    Code (markup):
    This code prevents submitting .ru and .cn websites. You can add other domain extensions as well.
     
    Moreno, Mar 14, 2011 IP
  2. john.c

    john.c Active Member

    Messages:
    115
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #2
    You can use : System > Ban Control > Ban Domain > Add : *ru, *cn , *.ect
     
    john.c, Mar 15, 2011 IP
  3. Montreal Classifieds

    Montreal Classifieds Active Member

    Messages:
    808
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    60
    #3
    still it will not stop the spam, it will stop submitting domains with such extensions, and of course it will prevent submitting good websites with such extensions.
    Manual editing is the only way.
     
    Montreal Classifieds, Mar 19, 2011 IP
  4. Moreno

    Moreno Well-Known Member

    Messages:
    155
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    125
    #4
    No this option does not work, this is what i tried first.
     
    Moreno, Sep 20, 2011 IP
  5. Nick_Hostinizer

    Nick_Hostinizer Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Don't you think you will miss out on genuine russian and other sites as well? Just banning the domain extension wouldn't help. Because you'd find more com and net sites spamming the hell out of directories. Better option is, implementing the spam control tools like complex-ed captchas and adding some "tick boxes" which are not in default phpld scripts.
     
    Nick_Hostinizer, Oct 10, 2011 IP
  6. visualgaurd

    visualgaurd Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    thanks for the help. it's good post and we do this by saving our directory from spam which mostly being happened by chines and Russian but they have also good website which they do submission so that time what we do? So it's better we remove it manually or if somebody don't like to remove manually then it's better to implement this code in submit page. it's working well.
     
    visualgaurd, Dec 22, 2011 IP
  7. shibli123

    shibli123 Well-Known Member

    Messages:
    325
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #7
    wow.. very helpful information. can you give some tips about the preventing spammers in wp blog? i use akismet but still i have to delete those spams manually.
     
    shibli123, Jan 21, 2012 IP