-

Adapt Mod Jquerry/AntiSpam

Support for phpBB3, phpBB3 Modifications, and phpBB3 styles
Forum rules
Bugs go in the Bug Tracker

Adapt Mod Jquerry/AntiSpam

Postby geolim4 » Sun Apr 24, 2011 5:48 pm

Hello all, i have litle request, but for start, AntiSpam is an awesome mod but i have tried to adapt antispam to quickedit, and fail.... My modif work correctly but if i edit with quick edit and i add SPAM word, all topic is in waiting moderation, and not the SPAM post


find:
Code: Select all
// Store message, sync counters


add after:
Code: Select all
   // START Anti-Spam ACP
   $sc_title = (empty($post_data['topic_title'])) ? $post_data['post_subject'] : $post_data['topic_title'];
   $asacp_is_spam = false;
   if ($config['asacp_spam_words_posting_action'] && antispam::spam_words(array($sc_title, $message_parser->message)))
   {
      switch ($config['asacp_spam_words_posting_action'])
      {
         case 1 :
            $user->add_lang('mods/asacp');
            antispam::add_log('LOG_SPAM_POST_DENIED', array($sc_title, $message_parser->message));
            $error[] = $user->lang['SPAM_DENIED'];
         break;

         case 2 :
            $asacp_is_spam = true;
         break;
      }
   }
   // END Anti-Spam ACP


find:
Code: Select all
$redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false);


add before:
Code: Select all
         // START Anti-Spam ACP
         if ($asacp_is_spam)
         {
            $data['force_approved_state'] = false;
         }
         // END Anti-Spam ACP


add after:
Code: Select all
         // START Anti-Spam ACP
         antispam::submit_post($mode, $data['post_id']);
         // END Anti-Spam ACP

so i have adapted since posting.php to quickedit.php:

find:
Code: Select all
      // Don't execute all that if we already have errors
      if($qe_error == '')


add before:
Code: Select all
   // START Anti-Spam ACP
   $sc_title = (empty($post_data['topic_title'])) ? $post_data['post_subject'] : $post_data['topic_title'];
   $asacp_is_spam = false;
   if ($config['asacp_spam_words_posting_action'] && antispam::spam_words(array($sc_title, $message_parser->message)))
   {
      switch ($config['asacp_spam_words_posting_action'])
      {
         case 1 :
            $user->add_lang('mods/asacp');
            antispam::add_log('LOG_SPAM_POST_DENIED', array($sc_title, $message_parser->message));
            $error[] = $user->lang['SPAM_DENIED'];
         break;

         case 2 :
            $asacp_is_spam = true;
         break;
      }
   }
   // END Anti-Spam ACP

find:
Code: Select all
    submit_post('edit', $post_data['post_subject'], $post_data['topic_first_poster_name'], $post_data['topic_type'], $poll, $data);

add before:
Code: Select all
         // START Anti-Spam ACP
         if ($asacp_is_spam)
         {
            $data['force_approved_state'] = false;
         }
         // END Anti-Spam ACP

add after:
Code: Select all
         // START Anti-Spam ACP
         antispam::submit_post($mode, $data['post_id']);
         // END Anti-Spam ACP


Mod quick edit:
http://www.phpbb.com/customise/db/mod/j ... uick_edit/
But ask me file of this mod because i have modified this file for fix issue error.
If you need acces ACP/FTP no problem ;)
And sorry for my bad english i'm french....i try :x
Thank for your help :D
geolim4
Donor
Donor
 
Posts: 19
Joined: Sun Apr 24, 2011 5:37 pm
Blog: View Blog (0)

Re: Adapt Mod Jquerry/AntiSpam

Postby EXreaction » Fri Apr 29, 2011 5:56 pm

Does that issue only happen when you edit the first post or any post? Does it happen even if the message does not have spam in it?
Grateful for the mods I've built? Then donate!
User avatar
EXreaction
Site Owner
Site Owner
 
Posts: 4988
Joined: Wed Jun 28, 2006 5:08 pm
Blog: View Blog (53)

Re: Adapt Mod Jquerry/AntiSpam

Postby geolim4 » Sat Apr 30, 2011 11:29 am

Any post ;) And if i edit first post or other without spam world, any problem...
geolim4
Donor
Donor
 
Posts: 19
Joined: Sun Apr 24, 2011 5:37 pm
Blog: View Blog (0)

Re: Adapt Mod Jquerry/AntiSpam

Postby EXreaction » Sun May 01, 2011 10:52 am

What do you mean by "without spam world, any problem"? Does it happen only when there is a spam word or every time?
Grateful for the mods I've built? Then donate!
User avatar
EXreaction
Site Owner
Site Owner
 
Posts: 4988
Joined: Wed Jun 28, 2006 5:08 pm
Blog: View Blog (53)

Re: Adapt Mod Jquerry/AntiSpam

Postby geolim4 » Wed May 04, 2011 8:09 am

Only when there a spam world, if i don't add spam word, it work fine...
geolim4
Donor
Donor
 
Posts: 19
Joined: Sun Apr 24, 2011 5:37 pm
Blog: View Blog (0)

Re: Adapt Mod Jquerry/AntiSpam

Postby EXreaction » Thu May 05, 2011 7:12 pm

Are you sure that it's actually setting the topic to be unapproved and you're not just seeing the flag on the topic that there is an unapproved post? I've looked through the code and I don't see where it could set the whole topic to unapproved.
Grateful for the mods I've built? Then donate!
User avatar
EXreaction
Site Owner
Site Owner
 
Posts: 4988
Joined: Wed Jun 28, 2006 5:08 pm
Blog: View Blog (53)

Re: Adapt Mod Jquerry/AntiSpam

Postby geolim4 » Fri May 06, 2011 6:59 am

Hello, my setting is the following:

When a post contain a SPAM Word, the post will be waiting modération action
but
If i edit with QuickEdit for add a SPAM work, all the topic will be waiting moderation action.

Do you want a login/Password for test on my forum ?

Cheers :D
geolim4
Donor
Donor
 
Posts: 19
Joined: Sun Apr 24, 2011 5:37 pm
Blog: View Blog (0)

Re: Adapt Mod Jquerry/AntiSpam

Postby EXreaction » Fri May 06, 2011 11:49 am

Yes, that would be helpful
Grateful for the mods I've built? Then donate!
User avatar
EXreaction
Site Owner
Site Owner
 
Posts: 4988
Joined: Wed Jun 28, 2006 5:08 pm
Blog: View Blog (53)

Re: Adapt Mod Jquerry/AntiSpam

Postby geolim4 » Sat May 07, 2011 5:15 am

Done (in MP)


Last bumped by geolim4 on Sat May 07, 2011 5:15 am.
geolim4
Donor
Donor
 
Posts: 19
Joined: Sun Apr 24, 2011 5:37 pm
Blog: View Blog (0)


Return to phpBB3 Support



Who is online

Users browsing this forum: chenbyut2, fdropr2ef, fgdgfdv40w, gfd3dmtr10, hangcxue14, hkji3r0i20, hkji5d4u92 and 6 guests

cron