Minimum length of comments Minimum length of comments
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Minimum length of comments

Started by Mannie_, March 06, 2010, 12:15:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mannie_

Hello,
I wonder if it is also possible to set a minimum length for comments on my gallery. http://www.pixelnutz.com/gallery/
Example, when someone makes a comment with only 1 worth "wow" that it tells them it is to short. I would like this so users should give a constructive comment.
Hope it is possible

lurkalot

Not a stock setting as far as I'm aware.

Just a thought though.  Would this just encourage people to post gobbally gook, like ------5£------$---*-------^----just so they could leave a comment?

Could get a bit messy. ;)
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

Mannie_

i don't think people will leave comments like that, i just want to know if it is possible to do it in the code, if i knew how to code that and where. On the community i am trying to set up i would like real feedback on images instead of people just saying "wow"

Joe Carver

File referenced from cpg ver. 1.4.26.

Open/edit db_input.php. - Back up first.

Find (around line 123):
        if ($msg_author == '' || $msg_body == '') cpg_die(ERROR, $lang_db_input_php['empty_name_or_com'], __FILE__, __LINE__);

Add this directly below:
$comm_length = strlen($msg_body);
if ($comm_length < 4) cpg_die(ERROR, 'Your comment is too short go back and redo', __FILE__, __LINE__);


You can change the error message to a lang. file string or other message and you can change the 4 to any number you would like.

Be careful making edits. This worked just now on my cpg1.4.26 test gallery, but I can offer no guarantees or deeper support for this mod..

Mannie_

thanks, after cookin dinner i will do this. will mark as solved since i have faith in you :)