Check Before Posting

Started by slinouille, February 11, 2009, 01:18:38 AM

Previous topic - Next topic

slinouille

Link to Mod
Check Before Posting v0.3.2
By Slinouille

Introduction
The mod permits to do some checks before a message is posted.

Features
This mod checks that:
o a link is done to a website you allow or disallow (based on a list you create)
o an image is hosted on a website you allow or not (based on a list you create)
o a subject doesn't have a too big ratio of uppercase letters (define your own ratio)
o a message doesn't have a too big ratio of uppercase letters (define your own ratio)
o Languages : French, English

Installation
Simply install the package to install this modification on the SMF Default Core theme.
Manual edits will be required for other themes.

This mod is compatible with SMF 2.0 Beta 4 Public and above only.

Support
Please use the modification thread for support with this modification.

Changelog
0.3.2 - 27th February 2009
o Correcting an error in source
o New check : uppercase letters ratio in Message

0.3.1 - 23th February 2009
o Packaging errors

0.3 - 20th February 2009
o Links check can be based on a list of allowed or disallowed websites
o Host linked images check can be based on a list of allowed or disallowed websites

0.2 - 11th February 2009
o New check : uppercase letters ratio in Subject
o Changing mod name from Manage Forbidden Links And Images to Check Before Posting

0.1 - 09th February 2009
o Initial release[/hr][/hr]
Visit VAG-Technique.fr
Take a look to my mods

alex30

Can be a useful mod guys.

Thanks slinouille.

qtime

this is a very welcome!
But I have also a big forum running on smf 118, any chances for that version?

chrisb

I would like to see this on 1.1.8 as well, as this will stop people going to other sites

digger

Can you make a list of allowed sites.

slinouille

Quote from: digger on February 11, 2009, 08:49:27 AM
Can you make a list of allowed sites.
It can be an evolution for next release  ;)

Sorry for SMF1.1.8 version but I don't have knowledge and time to realize both. If someone can adapte, please feel free, the code is really simple  ;D
Visit VAG-Technique.fr
Take a look to my mods

edi67

CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

mgrmgr

Quote from: digger on February 11, 2009, 08:49:27 AM
Can you make a list of allowed sites.

Just to give slinouille another nudge besides saying thank you for this mod: I second this wish, because we usually only allow links to our own site in our forum

DareDevil1990

damn i would have loved this mod for smf 1.1.8 :D any chance of making this compatible with it :-s

Marcus Forsberg

#9
Looks very nice.
Swedish:


Modifications.swedish.php


//Begin mod CheckBeforePosting
$txt['enable_check_forbidden_images'] = 'Aktivera kontroll av bilders webbhotell';
$txt['forbidden_images'] = 'Lista över förbjudna webbhotell (Separera med kommatecken)';
$txt['enable_check_forbidden_links'] = 'Aktivera kontroll av länkar';
$txt['forbidden_links'] = 'Hemsidor som inte får länkas (Separera med kommatecken)';
$txt['uppercase_ratio_in_subject'] = 'Antal stora bokstäver som tillåts i en ämnesrad, i procent (tomt för att inaktivera)';
//End mod CheckBeforePosting
	
	
	



Help.swedish.php



// Begin mod CheckBeforePosting
$helptxt['enable_check_forbidden_images'] = 'Denna inställning kontrollerar vilket webbhotell som postade bilder kommer ifrån';
$helptxt['forbidden_images'] = 'Ange en lista över de webbhotell du inte vill visa bilder från, och separera dem med kommatecken, t.ex: imageshack,zimagez.';
$helptxt['enable_check_forbidden_links']='Denna inställning kontrollerar alla länkar som postas i ditt forum.';
$helptxt['forbidden_links']='Ange en lista över hemsidor som inte får länkas, separerade med kommatecken. t.ex: yahoo,google.';
$helptxt['uppercase_ratio_in_subject'] = 'Detta tillåter dig att kontrollera procentantalet stora bokstäver i ett ämnes ämnesrad.<br>- om du lämnar fältet tomt inaktiveras detta,<br>- Om du anger 0, tillåts inga stora bokstäver,<br>- om du anger 100 kan man skriva en hel ämnesrad i stora bokstäver.';
//End mod CheckBeforePosting



Errors.swedish.php


//Begin mod CheckBeforePosting
$txt['error_forbidden_image'] = 'Du kan inte visa bilder som ligger hos %s';
$txt['error_forbidden_link'] = 'Du kan inte länka till %s';
$txt['error_too_many_uppercase_letters_in_subject'] = 'En ämnesrad får inte innehålla så många stora bokstäver';
//End mod CheckBeforePosting
	
	
	







A quick look on the code makes me believe that it wouldn't be very hard to make a 1.1.x-version.

slinouille

Thank you all  :D

@Nas:  thanks for swedish translations.

@mgrmgr: I'll do that once I'll have corrected some other mods on which I've got some troubles  ;)

Really sorry for SMF1.1.8 users but I really don't have time to make it compliant.
Visit VAG-Technique.fr
Take a look to my mods

edi67

mod work but i have a lot of these errors:


8: Undefined index: uppercase_ratio_in_subject
File: /home/crazyzone/data/www/crazyzone.biz/Sources/Post.php
Riga: 1459

8: Undefined index: enable_check_forbidden_links
File: /home/crazyzone/data/www/crazyzone.biz/Sources/Subs.php
Riga: 4201


some solution ?
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

slinouille

@edi67: I'll check that ... but I would like to know what "tool" you are using in order to get warned about those "undefined index" ... should be usefull when debuging mods ;)
Visit VAG-Technique.fr
Take a look to my mods

edi67

Quote from: slinouille on February 13, 2009, 05:09:00 AM
@edi67: I'll check that ... but I would like to know what "tool" you are using in order to get warned about those "undefined index" ... should be usefull when debuging mods ;)

i check the Log Register in admin panel
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

mgrmgr

(List of allowed sites)
Quote from: slinouille on February 12, 2009, 12:32:09 PM
...
@mgrmgr: I'll do that once I'll have corrected some other mods on which I've got some troubles  ;)

LOL - nice solution in v 0.3 - just a little quirk:

the definded $txt variables are defined as  cbb_links_allowed and ..._disallowed,

in ManageSettings.php (for the dropdown-boxes you use cbp_allowed  and cbp_disallowed. I inserted the missing "links_" in Managesettings - works ok now :)

slinouille

@mgrmgr: ok correction will be done ... thank you :)
Visit VAG-Technique.fr
Take a look to my mods

mgrmgr

oups - me again :(

Now I have another problem: Set both fields to "allowed" and two sites in the list: for each posting now both warnings show up - no picture (not even smiley) or anything like a link is contained.

Something I broke or is there anyone having a similar problem?

Just my lazyness to ask before searching for a reason :)

edi67

Quote from: mgrmgr on February 22, 2009, 03:12:46 PM
oups - me again :(

Now I have another problem: Set both fields to "allowed" and two sites in the list: for each posting now both warnings show up - no picture (not even smiley) or anything like a link is contained.

Something I broke or is there anyone having a similar problem?

Just my lazyness to ask before searching for a reason :)

words allowed and disallowed in list of choice not appear,
is i choice allowed or disallowed system DONT permit me to posts nothing, no censored link no permitted link everything seem to be disabled
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

slinouille

oops there is a lot of errors in this package ... I'll delete 0.3 from downloading center and upload a new one.

I must have been confused somewhere ... perhaps too much beers ?
Visit VAG-Technique.fr
Take a look to my mods

slinouille

I've uploaded release 0.3.1 that should correct my previous very bad mod packaging.
I've tested it on my forum and on a fresh rc1 smf forum ... should work as it should ;)
Please tell me if on your forum it's okay?
Visit VAG-Technique.fr
Take a look to my mods

Advertisement: