News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Anti-spam mod request

Started by H, June 28, 2006, 12:28:54 PM

Previous topic - Next topic

winrules

Quote from: Daniel15 on November 06, 2006, 01:02:11 AM
Since nobody's started coding this, I'll see if I can do it ;)
Daniel, it's a really easy mod to do, the problem is where to put the messages that are marked for spam. You can't just delete them, because they might be a false positive.


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


Daniel15

Well, if I do work on this, it may not be for a few weeks, as I have exams next week.
Quote
Daniel, it's a really easy mod to do, the problem is where to put the messages that are marked for spam. You can't just delete them, because they might be a false positive.

I was thinking add an additional field in the {$db_prefix}messages table, named 'spam'. If the message is (possibly) spam, set that field to '1'. Then, edit the queries which retrieve the posts (not sure what file, I can't check at the moment) to have WHERE ........ AND spam='0' on the end... Basically, don't retrieve any of the spam messages.

There would also be an admin panel, quite similar to the WordPress one. Spam messages would automatically be deleted after 15 days.
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

winrules

Yeah, that's preetu much what I was doing (I had started the mod, but got busy. I might finish it).


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


Daniel15

Well, if you're going to do this, then I won't :P
I really want to do this MOD, but I have exams at the moment, so I can't (currently, I have 4 exams left, which I'm doing next week).
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Daniel15

OK, I just started this about 2 hours ago. Here's what I've done so far:
NOTE: It doesn't yet connect to Akismet to check if the message is actually spam (this is probably the easiest bit). At the moment, it treats all replies as spam, for testing purposes :P

If someone posts a reply which is considered by Akismet to be spam, they'll be returned to the topic, and notified about it (see the message at the top of the page, and next to the reply's subject):

Members browsing the forum won't see the replies marked as spam, they will be hidden.

The admin panel so far looks like this (note that it doesn't actually do anything yet):


So, this is what's done so far:

  • [Post.php] Check for spam on submittion of reply
  • [Display.php] Hide posts marked as spam
  • [Akismet.php, Akismet.template.php] Basic admin panel (not functioning)

Here's what I need to do:

  • [Post.php] Actually send the post to Akismet (this is probably the easiest bit)
  • [Post.php] Make it check new topics as well as replies (this will be done slightly differently compared to replies)
  • [Akismet.php, Akismet.template.php] Finish the admin panel
  • Make spam posts increase total spam count (it's currently not used)

What do you think so far? :D
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

H

-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

winrules

Looks Good. You'll have to remember to hide posts marked as spam in other places too though.

* winrules thinks you have WAY too many icons in the notification area of the taskbar


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


Daniel15

#27
QuoteLooks Good. You'll have to remember to hide posts marked as spam in other places too though.
Like where? You mean like on the recent posts list?

Quote* winrules thinks you have WAY too many icons in the notification area of the taskbar
Yeah, this is my "play around with random stuff" computer :P. I usually use my laptop running Ubuntu Linux :)

Anyways... Let's see:

  • Kayako LiveSupport (for live support at www.cwhnetworks.com)
  • NOD32
  • Opera - "You have email" icon
  • MySQL (some really old version)
  • Windows saying "Windows Updates is currently disabled" (it was using 100% CPU so I turned it off)
  • Windows Live Messenger
  • Some font program
  • A LAN icon which spontaenously appeared :P
  • An icon from keyboard driver indicating Numlock is off
  • Keyboard icon (A4tech driver)
  • Startup Faster 2004 (trial version)
  • A4Tech mouse driver
  • TPG Usage meter (for measuring Internet usage from my ISP - www.tpg.com.au)
  • Apache (a release from when Apache2 just came out :P)
  • Intel graphics card driver (for horrid Intel 810E)
  • DaemonTools
  • Dynamic-Sig.com Client :D
  • TightVNC (which I've never used before, I just installed it and completely forgot about it :P)
  • Something
  • Speaker
  • Trial of NetLimiter
It is a bit much, isn't it :P

EDIT: First beta version released! Until I get a proper webpage set up, please see http://www.dansoftaustralia.net/downloads/file/26/SMF-Akismet-0.1-BETA.html to download it.
Note that I haven't tested it in SMF 1.1, but it should work (the MOD should apply successfully). Also, there's bound to be some bugs in this release, so please tell me if you find any!
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Jacen

Looks good, I'm not going to install it now... but I will when it's out of beta :)
"I've always found that sticking your fingers in your ears and humming loudly solves a whole slew of problems."

Col

I'm curious: what happens with posts when Akismet is down or plain slow?

Laibeus Lord

#30
Bug report in your 1.1rc3.xml installation

You got the same code twice as shown below:  (in SSI.php)

<operation>
<search position="before"><![CDATA[
AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . "
AND $user_info[query_see_board]
AND ms.ID_MSG = t.ID_FIRST_MSG
]]></search>
<add><![CDATA[
AND t.spam = 0
]]></add>
</operation>

<operation>
<search position="before"><![CDATA[
WHERE t.ID_LAST_MSG >= " . ($modSettings['maxMsgID'] - 35 * min($num_recent, 5)) . "
AND t.ID_LAST_MSG = m.ID_MSG
AND b.ID_BOARD = t.ID_BOARD" . (empty($exclude_boards) ? '' : "
AND b.ID_BOARD NOT IN (" . implode(', ', $exclude_boards) . ")") . "
AND $user_info[query_see_board]
AND ms.ID_MSG = t.ID_FIRST_MSG
]]></search>
<add><![CDATA[
AND t.spam = 0



Also, you forgot to put the search "position" in this line:

<file name="$sourcedir/Post.php">
<operation>
<search><![CDATA[
if (!empty($_POST['move']) && allowedTo('move_any'))
redirectexit('action=movetopic;topic=' . $topic . '.0' . (empty($_REQUEST['goback']) ? '' : ';goback'));
]]></search>


So far only those ^_^
Hope it helps :)

(I prefer installing mods manually that's why I saw those ^^ )

back to installation of SMF Akismet..


UPDATE:
search position ^_^

<file name="$sourcedir/Profile.php">
<operation>
<search position=""><![CDATA[
AND m.ID_TOPIC = t.ID_TOPIC
AND t.ID_BOARD = b.ID_BOARD" . (empty($range_limit) ? '' : "
AND $range_limit") . "
AND $user_info[query_see_board]
]]></search>



Daniel15

Thanks for the bug report, Laibeus Lord. I did no testing on SMF 1.1 RC3 at all, so I was expecting some errors :P
When I have more spare time, I'll update the mod to fully support SMF 1.1 (do all modifications to the SMF files from scratch) :)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Laibeus Lord

Quote from: Daniel15 on December 09, 2006, 02:25:56 AM
Thanks for the bug report, Laibeus Lord. I did no testing on SMF 1.1 RC3 at all, so I was expecting some errors :P
When I have more spare time, I'll update the mod to fully support SMF 1.1 (do all modifications to the SMF files from scratch) :)

np ^_^  Glad to be of help.

I have it installed to my SMF1.1Final template installation (which I will use to upgrade my other SMF1.1 RC3 forums), so far so good.  I'm not getting spam reports yet tho.  Anyway, I posted another bug here ->

http://www.simplemachines.org/community/index.php?topic=127326.new#new

For some weird reason, the thread above (link) didn't show up when I did a search of "Akismet" here in SMF Forums hehe.  So I posted the latest report there instead (of here).

^_^


Daniel15

Laibeus Lord, the redundant bit in SSI.php has been removed now, in the latest development version :D And I also added the search position on where I forgot it :P
Diff: http://server.daniel15.com/cgi-bin/viewvc.cgi/smf-akismet/trunk/install-smf1.1rc3.xml?r1=2&r2=10

I'm thinking of making this MOD SMF 1.1-only, as then it will have less bugs in it (stupid mistakes and assumptions by me mainly). Would this disadvantage one (is anyone still using SMF 1.0)?
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

chougard

Is this supposed to take more than 30 seconds to install? After hitting apply mod it loads for 30 seconds and then displays
Fatal error: Maximum execution time of 30 seconds exceeded in /home2/chougard/public_html/forum/Sources/Subs-Package.php on line 2915

Daniel15

No, that's not normal chougard.
Do other MODs install correctly? What version of SMF are you using?
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

chougard

Never mind. I edited a line of code. That messed it up.

Daniel15

#37
My new version of this MOD will be coming out soon (I've been working on it, doing various things). The main things are SMF 1.1 compatibility ("official" compatibility :P), and updates to make it comply with the SMF coding standards (indentation style, and other small things).


EDIT: Akismet mod 1.0 now out! Until it's approved, you'll need to download it from my site at http://www.dansoftaustralia.net/downloads/file/27/Akismet-1.0.html

Release announcement:


Akismet Spam Protection for SMF

What is it?
This is a SMF modification implementing the Akismet spam protection service. The MOD requires SMF 1.1 Final (but it may still work on SMF 1.1 RC3, that was not tested).
NOTE: If you were testing out the Beta version of this mod, you'll need to uninstall it before installing version 1.0!

How do I use it?
Firstly, you'll need to sign up for a free API key at http://wordpress.com/api-keys/. Then, install this mod via the SMF Package Manager. Once it's installed, there will be a new 'Akismet Configuration' option in the admin panel, under the 'Forum' section. Enter your API key in, and you're all set!

How do I know it's working?
You test it, of course! Simply write a new topic with the subject of 'akismet-test-123', and it will be classified as spam by the mod. This tests that the mod is installed correctly. An additional test is writing a guest post with a name of 'viagra-test-123'. Any message with this name will be marked as spam by the Akismet service. If this message is also detected as spam, then everything is working perfectly :)

CHANGELOG from 0.1 Beta --> 1.0
- Updated MOD files to comply with SMF standards
- Now parses BBCode in posts in the Akismet admin panel
- Added version information to admin section
- Now marks any posts with subject of 'akismet-test-123' as spam (for testing purposes)
- In Subs-Post.php, use $posterOptions and $msgOptions arrays rather than $_POST variables
- Moved 'Akismet Configuration' option from Configuration heading to Forum heading
- Moved position of Spam warning above the topic buttons
- Moved 'Flagged as spam' message next to subject, rather than under it

Known Issues
- Only admins can moderate the spam comments (Delete all spam, Mark as 'Not Spam'). This may change in a future release, to also allow moderators access.
- Statistics may be incorrect after deleting spam messages. Recounting all the statistics should fix this
- There is currently no way to mark existing posts as spam (false negatives).


(c) 2006 DanSoft Australia - http://www.dansoftaustralia.net/. This mod is released under the same license agreement as SMF itself.
Version: 1.0 (Build 2)
Release Date: 12th December 2006

Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

chougard

#38
Thanks! For anyone that is getting timeout errors, go into the options part of the package manager, and make all files writable. Then install. After installing, make it that the standard files are writable.

Edit: After installing and giving it my key, when posting I am presented with a white screen when I hit post. It is this mod because it will work when I uninstall it. I can only post akismet-test-123. Everything else does not work!
Mods Installed
1.     Admin Notepad      1.0
2.    Global Headers Footers    1.3
3.    Global Announcements    1.0
4.    SMF Arcade    1.3.1-MOD-E1.5
5.    SMFShop    2.3

Here are the errors I got
Error connecting to host: rest.akismet.com Error number: 113 Error message: No route to host
File: /home2/chougard/public_html/forum/Sources/Akismet.class.php
Line: 322

fsockopen(): unable to connect to rest.akismet.com:80
File: /home2/chougard/public_html/forum/Sources/Akismet.class.php
Line: 319

Those were in the error log.

Jacen

Looks to me like the mod is unable to connect to the spam database and doesn't have an error handling routine for that.
"I've always found that sticking your fingers in your ears and humming loudly solves a whole slew of problems."

Advertisement: