Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Kays on December 04, 2007, 11:39:17 PM

Title: Delete Spam Posts
Post by: Kays on December 04, 2007, 11:39:17 PM
Link to mod (http://custom.simplemachines.org/mods/index.php?mod=1007)

This mod will allow a moderator or admin to delete a spam post and dock the member's post count by one.
It also logs the deleted message in the Moderator's logs. As well it also logs any message which has been modified by a mod or admin. It is selectable in the Admin CP under the Posts and Topics option.
The display message can be edited there also.



V1.0
Initial release.
- Spam Post replaced by pre-set message and the member's post count is reduced by one.
- The deleted post is recorded in Moderator's log. (SMF1.1 only)
- Modified posts are also now copied to the Moderator's log. (SMF 1.1 only)

V1.1
- Added the original subject of the post to the Moderator's log.
- Cleaned up the display in the moderator's log.

V1.2
- Added the option to award the member bad karma as well.
- Added the option to place a copy of the deleted post in the recycle board.
- Fixed a bug in the Moderator's logs which caused removed posts and topics to show in a box as well
- If the message in a modified post was not changed, the message body will now not be displayed in the Moderator's log.
- Changed the code in Display.template.php so that the Delete Spam Post link won't show if the poster is a moderator or admin. (Thanks to JohnyB for the suggestion)
- Added an install script to enable the mod in $modsettings when it is installed.
- Added an un-install script which can be run separately if you wish to remove any database enties added by the mod
- Added Portuguese translation. Thanks to ne.miguelito

V1.3
- Updated for 2.0 RC2
- Due to changes in how the moderator log is created, a copy of the original post is no longer displayed.

V1.4
- Updated for 2.0 RC3

V1.5
- Corrected several bugs with the SMF 2.0 version. Thanks go to Bugo (http://www.simplemachines.org/community/index.php?action=profile;u=229017) for the corrections.

V1.6
- Updated for 2.0 RC5 +.
- Added the option to remove the database entries on uninstall.
- Added Russian translation. Thanks to Bugo
Title: Re: Delete Spam Posts
Post by: capabmx on December 05, 2007, 02:27:16 AM
Very great addition, and congrats on making it, and also thank you! I'm installing this one immediately, IMHO it will be a great deterrent to get people to stop spamming.
Title: Re: Delete Spam Posts
Post by: Teunel on December 05, 2007, 08:33:13 AM
Thanks for making it, really appriciating it! ;)
Title: Re: Delete Spam Posts
Post by: goldenboy48 on December 23, 2007, 03:03:31 PM
I get this :(

Fatal error: Cannot redeclare preparsecode() (previously declared in /home/ecricnet/public_html/forums/Sources/Subs-Post.php:158) in /home/ecricnet/public_html/forums/Sources/Subs-Post.php on line 286
Title: Re: Delete Spam Posts
Post by: ne.miguelito on December 23, 2007, 07:22:32 PM
when I click in Delete Spam Post appears this:

Fatal error: Cannot redeclare preparsecode() (previously declared in /home/nemigue/public_html/Sources/Subs-Post.php:158) in /home/nemigue/public_html/Sources/Subs-Post.php on line 286

somebody can help...
Title: Re: Delete Spam Posts
Post by: ne.miguelito on December 25, 2007, 09:30:24 PM
nobody knows the solution?
Title: Re: Delete Spam Posts
Post by: goldenboy48 on December 26, 2007, 02:41:49 AM
please help
Title: Re: Delete Spam Posts
Post by: Bulakbol on December 26, 2007, 05:41:10 PM
Not sure but maybe you installed the mod twice.
Title: Re: Delete Spam Posts
Post by: goldenboy48 on December 26, 2007, 05:42:39 PM
didn't do that
Title: Re: Delete Spam Posts
Post by: Bulakbol on December 26, 2007, 05:51:02 PM
Attach your Sources/Subs-post.php so others can look at it and find what is wrong.
Title: Re: Delete Spam Posts
Post by: goldenboy48 on December 26, 2007, 06:07:21 PM
Here you go
Title: Re: Delete Spam Posts
Post by: goldenboy48 on January 02, 2008, 01:59:41 AM
Please please help....This is a great Mod. HELPPPPPP!!!
Title: Re: Delete Spam Posts
Post by: Kays on January 05, 2008, 01:28:33 AM
Sorry for the delay.

I can't see what could be causing that problem. This mod doesn't alter that file.

Line 289 is suppose to be the un_preparsecode() function not parsercode() as the error indicates.

Which other mods do you have installed or did you install at the same time as this one?.
Title: Re: Delete Spam Posts
Post by: ne.miguelito on February 14, 2008, 06:15:46 AM
to see the same mistake here: http://www.simplemachines.org/community/index.php?topic=222201.0


that it was solved...
Title: Re: Delete Spam Posts
Post by: Kays on February 16, 2008, 02:18:20 PM
Thanks ne.miguelito, I've just updated it. As well I've added some more features. See the first post.

You will need to uninstall an older version in order to update.
Title: Re: Delete Spam Posts
Post by: ne.miguelito on February 16, 2008, 02:33:32 PM
Tks, link this mod: http://custom.simplemachines.org/mods/index.php?mod=1007
Title: Re: Delete Spam Posts
Post by: Kays on February 16, 2008, 03:00:17 PM
Ooops... Thanks again. :)
Title: Re: Delete Spam Posts
Post by: ne.miguelito on February 16, 2008, 03:46:16 PM
That this error:

Fatal error: Call to undefined function addslahes() in /home/nemigue/public_html/Sources/Post.php on line 2429
Title: Re: Delete Spam Posts
Post by: ne.miguelito on February 16, 2008, 09:32:18 PM
Help me...
Title: Re: Delete Spam Posts
Post by: Kays on February 16, 2008, 11:54:27 PM
Sorry, spelling error on my part. Please redownload it. I have corrected it.
Title: Re: Delete Spam Posts
Post by: ne.miguelito on February 17, 2008, 12:04:44 PM
In "Moderation Log" that this error


Parse error: syntax error, unexpected '<', expecting ')' in /home/nemigue/public_html/Sources/Modlog.php on line 149

Title: Re: Delete Spam Posts
Post by: Kays on February 17, 2008, 06:11:43 PM
Ok, that's fixed now and should be the end of the errors.

My apologies for not thoroughly checking it before uploading it.
Title: Re: Delete Spam Posts
Post by: ne.miguelito on February 17, 2008, 07:37:04 PM
Link to mod is: http://custom.simplemachines.org/mods/index.php?mod=1007  not: http://www.simplemachines.org/community/index.php?topic=222201.0

it is better to correct...
Title: Re: Delete Spam Posts
Post by: ne.miguelito on February 17, 2008, 08:00:34 PM
translate to Portuguese:


Modifications.portuguse.php

$txt['deletespampost_spamcop'] = '{SpamCop}';
$txt['deletespampost_spammer'] = '{Spammer}';
$txt['modlog_ac_deletespam'] = 'Spam\'s Apagados';
$txt['deletespampost_link'] = 'Apagar a Mensagem Spam';
$txt['deletespampost_confirm'] = 'Você deseja apagar esta mensagem?';
$txt['deletespampost_admin1'] = 'Permitir apagar mensagens Spam rápido.';
$txt['deletespampost_admin2'] = 'Insira a mensagem que deseja mostrar. HTML e BBC são permitidos. '. $txt['deletespampost_spamcop']. ' e '. $txt['deletespampost_spammer']. ' vão ser substituídos pelo moderador e nomes do spam respectivamente. Limpar o campo para a mensagem padrão.';
$txt['deletespampost_admin3'] = 'Pré-Visualizar:';
$txt['deletespampost_admin4'] = 'Conceder Karma negativo aos membros também';
$txt['deletespampost_admin5'] = 'Colocar uma cópia da mensagem original no quadro da Reciclagem';
$txt['deletespampost_error1'] = 'Desculpe, mas você não tem permissão para fazer isto.';
$txt['deletespampost_error2'] = 'Desculpe, você já apagou esta Mensagem Spam.';
$txt['deletespampost_message'] = '[b]Esta Mensagem foi apagada por '. $txt['deletespampost_spamcop']. ' porque foi considerada como Spam![/b]';
$txt['deletespampost_message'] .= "\n". '[i]'. $txt['deletespampost_spammer']. 'a contagem das suas mensagens teve uma redução de 1.[/i]';
$txt['deletespampost_no_change'] = '[i]O corpo da mensagem não foi alterado.[/i]';



Help.potruguese.php

$helptxt['deletespampost'] = 'Activando esta opção vai permitir aos moderadores e administradores apagar mensagens spam deixando a mensagem a baixo. Com isto a contagem de mensagens dos membros vai ser reduzida em uma unidade. Se o registo da moderação está activado os conteúdos das mensagens apagadas vão ser mostrados nos registos dos moderadores. Assim como alguma mensagem que seja modificada por algum moderador ou administrador.';
Title: Re: Delete Spam Posts
Post by: Kays on February 17, 2008, 08:14:58 PM
Thanks,ne.miguelito. :)

I've changed the link and have updated the mod with the translation.
Title: Re: Delete Spam Posts
Post by: ne.miguelito on February 17, 2008, 08:38:52 PM
Tks  ;)
Title: Re: Delete Spam Posts
Post by: goldenboy48 on February 17, 2008, 09:45:48 PM
SMF Package Parser says

"ERROR: The package-info.xml file is invalid!"
Title: Re: Delete Spam Posts
Post by: Kays on February 17, 2008, 10:44:45 PM
Thanks, PanesarV . That's been fixed too.
Title: Re: Delete Spam Posts
Post by: ne.miguelito on February 18, 2008, 08:53:18 PM
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Apagados] ftf', 1, 255), SUBSTRING('ftf', 1, 65534), SUBSTRING('Tugamen', 1, 2' at line 4
Ficheiro: /home/nemigue/public_html/Sources/Subs-Post.php
Linha: 1536

Because the translation Portuguese this string its wrong:

$txt['modlog_ac_deletespam'] = 'Spam\'s Apagados';

correct:

$txt['modlog_ac_deletespam'] = 'Spam Apagados';

Sorry...
Title: Re: Delete Spam Posts
Post by: Kays on February 19, 2008, 06:37:28 PM
I've corrected it and re-uploaded the mod.
Title: Re: Delete Spam Posts
Post by: Slug1 on March 13, 2008, 10:00:47 PM
Hello, just want you to know that your Mod is great. I was wondering if it's possible to have both the 'Delete Spam Post' and the original 'Report to Moderator' options in a post for the Moderator position and above? Maybe side by side.

I ask this cause I also use a Mod called 'Create Topic on Report to Moderator'. With this I have a board in a Leadership section called 'Reported Posts' where a copy of any post that is reported is moved. I do this so I have a copy of the original post before an edit or deletion is done. This way Global Mods+ in the leadership can track these reported posts without having to access the Logs.

Thanks for any help!



Title: Re: Delete Spam Posts
Post by: Kays on March 13, 2008, 11:31:56 PM
To do that, in the change in Display.template.php instead of this:

// Maybe they want to report this post to the moderator(s)?
elseif ($context['can_report_moderator'])


Use this:

// Maybe they want to report this post to the moderator(s)?
if ($context['can_report_moderator'])
Title: Re: Delete Spam Posts
Post by: Slug1 on March 14, 2008, 06:04:36 AM
Thank you, I'll do this edit tonight after work and see how it goes.  :)

Title: Re: Delete Spam Posts
Post by: Slug1 on March 14, 2008, 07:10:44 PM
Quote from: Kays on March 13, 2008, 11:31:56 PM
To do that, in the change in Display.template.php instead of this:
It worked great, Thank you!
Title: Re: Delete Spam Posts
Post by: Sickthing on August 18, 2008, 02:01:22 PM
I installed this mod tonight and had a massive failure afterwards.  This is the error I get when I click on home or anything else:

QuoteWarning: Unexpected character in input: ''' (ASCII=39) state=1 in .../Themes/default/languages/Modifications.english.php on line 69

Parse error: syntax error, unexpected ',' in .../Themes/default/languages/Modifications.english.php on line 69

60: $txt['modlog_ac_deletespam'] = 'Deleted Spam';
61: $txt['deletespampost_link'] = 'Delete Spam Post';
62: $txt['deletespampost_confirm'] = 'Do you wish to delete this post?';
63: $txt['deletespampost_admin1'] = 'Allow quick deletion of Spam Posts.';
64: $txt['deletespampost_admin2'] = 'Enter the message you wish to display. HTML and BBC are allowed. '. $txt['deletespampost_spamcop']. ' and '. $txt['deletespampost_spammer']. ' will be replaced by the moderator\'s and spammer\'s names respectively. Clear the field for the default message.';
65: $txt['deletespampost_admin3'] = 'Preview:';
66: $txt['deletespampost_admin4'] = 'Award the member negative karma also';
67: $txt['deletespampost_admin5'] = 'Place a copy of the original post in the recycle board';
68: $txt['deletespampost_error1'] = 'Sorry, but you don\'t have permission to do this.';

69: $txt['deletespampost_error2'] = Sorry, you have already deleted th

70:
71:

That is where the file ends now.   why is it that the only time I need a back up is when I don't have one.  :)
Title: Re: Delete Spam Posts
Post by: Sickthing on August 18, 2008, 02:06:52 PM
Okay i fixed it by removing everything after line 57.   I can put it back if need be.

I'm running SMF1.15 and 1.2 of your mod.  Hope your still here. I tried to uninstall the mod but I was not able to.  I get this:  (I have learned my lesson, always backup before installing mods)
Quote
Installing this package will perform the following actions:
   Type    Action    Description
1.    Execute Modification    ./index.php    Test successful
2.    Execute Modification    ./Sources/Modlog.php    Test successful
3.    Execute Modification    ./Sources/ManagePosts.php    Test successful
4.    Execute Modification    ./Sources/Post.php    Test failed
5.    Execute Modification    ./Themes/default/Admin.template.php    Test successful
6.    Execute Modification    ./Themes/default/Display.template.php    Test successful
7.    Execute Modification    ./Themes/default/Modlog.template.php    Test successful
8.    Execute Modification    -    Modification parse error
Title: Re: Delete Spam Posts
Post by: Sickthing on August 18, 2008, 02:45:58 PM
looks like the error was on my end.  I was out of disk space is it safe just to force an install over the top of it now that the disk space problem is solved?
Title: Re: Delete Spam Posts
Post by: Miyagi on September 06, 2008, 01:09:49 AM
great mod. big props.

works in 1.1.5 if anyone is wondering...
Title: Re: Delete Spam Posts
Post by: Chit-Chat ChatterBox Boss on June 27, 2009, 03:11:45 AM
I was wondering if anyone could update this to smf 2.0 ?
Title: Re: Delete Spam Posts
Post by: [SAP]Francis on November 14, 2009, 12:36:43 PM
Quote from: Chit-Chat ChatterBox Boss on June 27, 2009, 03:11:45 AM
I was wondering if anyone could update this to smf 2.0 ?
Same..?
Title: Re: Delete Spam Posts
Post by: Kays on November 14, 2009, 12:41:10 PM
I'll look into updating it for 2.0.
Title: Re: Delete Spam Posts
Post by: Kays on December 06, 2009, 01:51:57 PM
Sorry about the delay. but this mod now has been updated for 2.0 RC2.

Unfortunately, due to the changes in how the moderation log is put together for 2.0. It is no longer possible to display the body of the deleted message or that of any modified messages as before.
Title: Re: Delete Spam Posts
Post by: sunman4008 on February 08, 2010, 12:40:13 PM
Hello,

I just tried to install in 1.1.1.11 and I get this:     Execute Modification     ./Sources/Post.php     Test failed

How do I fix that?

-Mike
Title: Re: Delete Spam Posts
Post by: Kays on February 08, 2010, 12:49:33 PM
Hi, can you attach that file to a post so I can have a look at it.

Don't install the mod until I do.
Title: Re: Delete Spam Posts
Post by: Joker™ on March 02, 2010, 03:58:59 AM
bro can u explain how it'll look after the removal of message .... as i cant see anything like u shown in pics

im using RC2 default curve theme
Title: Re: Delete Spam Posts
Post by: Joker™ on March 05, 2010, 01:23:50 AM
Quote from: sid2varun on March 02, 2010, 03:58:59 AM
bro can u explain how it'll look after the removal of message .... as i cant see anything like u shown in pics

im using RC2 default curve theme

bump**
Title: Re: Delete Spam Posts
Post by: Kays on March 05, 2010, 08:52:49 AM
There should be a link in the bottom of a post replacing the "Report to moderator" link.
Title: Re: Delete Spam Posts
Post by: Joker™ on March 05, 2010, 09:50:36 AM
ummm no such link for me there

plz see the pic attached ... i've cleared site cache also , also have enabled options from admin cp
Title: Re: Delete Spam Posts
Post by: Kays on March 06, 2010, 02:49:48 PM
In looking at it, I think that's normal. It won't show if it's your own post. Or in the recycle board.
Title: Re: Delete Spam Posts
Post by: Joker™ on March 06, 2010, 10:14:02 PM
thats a test post in general board by another user
Title: Re: Delete Spam Posts
Post by: poomkupz on April 02, 2010, 03:42:17 PM
Pls Upgrade To Rc3

Thank you Very Much
Title: Re: Delete Spam Posts
Post by: Kays on April 12, 2010, 12:41:30 AM
Updated for 2.0 RC3.

@ sid2varun
Are you still having this problem? I can't seem to reproduce it in my testing

Title: Re: Delete Spam Posts
Post by: Joker™ on April 12, 2010, 02:48:44 PM
bro .. im using pretty heavily modified RC2 .... will upgrade to final version only now ....

If it works ok on RC3 then will try on my test site in my pc ... right now im out ...
Title: Re: Delete Spam Posts
Post by: Bugo on July 11, 2010, 02:07:39 AM
Kays, maybe make a small fix in install_20xml?

updateMemberData($row['id_member'], array('karmaBad' => '+'));

Column 'karmaBad' doesn't exists in SMF 2.0 ('karma_bad' only).

Also I think it makes sense to replace this block
     $smcFunc['db_query']('', '
SELECT
subject, body, id_member, poster_name, poster_email, poster_ip, icon
FROM {db_prefix}messages
WHERE id_msg = {int:msg}
LIMIT 1',
array(
'msg' => $_REQUEST['msg'],
)
);

$row = $smcFunc['db_fetch_assoc']($request);
$smcFunc['db_free_result']($request);

on this:
$request = $smcFunc['db_query']('', '
SELECT
subject, body, id_member, poster_name, poster_email, poster_ip, icon
FROM {db_prefix}messages
WHERE id_msg = {int:msg}
LIMIT 1',
array(
'msg' => $_REQUEST['msg'],
)
);

$row = $smcFunc['db_fetch_assoc']($request);
$smcFunc['db_free_result']($request);

Errors in the log will disappear ;)
Title: Re: Delete Spam Posts
Post by: Kays on July 19, 2010, 11:24:02 AM
Thanks Bugo, just got a chance to update the mod. :)
Title: Re: Delete Spam Posts
Post by: Bugo on July 19, 2010, 11:55:38 AM
Well, then add russian translation :) For SMF 1.x and 2.x separately.
Title: Re: Delete Spam Posts
Post by: Robert A. Rosenberg on February 16, 2011, 05:18:51 PM
I have this mod on but it does not seem to be working. The post just gets deleted instead of being replaced with the template text. What am I doing wrong or how do I delete a SPAM post so this mod gets triggered.

Thank You.
Title: Re: Delete Spam Posts
Post by: Kays on February 20, 2011, 10:37:09 PM
Sorry for the delay Bugo and thanks. I just noticed the translations.

The mod has been updated for 2.0 RC5. Russian translation added.

Quote from: Robert A. Rosenberg on February 16, 2011, 05:18:51 PM
I have this mod on but it does not seem to be working. The post just gets deleted instead of being replaced with the template text. What am I doing wrong or how do I delete a SPAM post so this mod gets triggered.

Thank You.

Are you clicking on the "Delete Spam Post" link at the bottom right of the post?
If so, any errors on the error log?