Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Minimum length of comments  (Read 2860 times)

0 Members and 1 Guest are viewing this topic.

Mannie_

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 51
Minimum length of comments
« on: March 06, 2010, 12:15:04 pm »

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
Logged

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 947
  • +Tinyportal Support team.
Re: Minimum length of comments
« Reply #1 on: March 07, 2010, 12:58:57 pm »

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. ;)
Logged
Running SMF 2.1.4  / Tinyportal 3.0.0, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

Mannie_

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 51
Re: Minimum length of comments
« Reply #2 on: March 07, 2010, 01:08:45 pm »

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"
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Minimum length of comments
« Reply #3 on: March 07, 2010, 04:20:26 pm »

File referenced from cpg ver. 1.4.26.

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

Find (around line 123):
Code: [Select]
        if ($msg_author == '' || $msg_body == '') cpg_die(ERROR, $lang_db_input_php['empty_name_or_com'], __FILE__, __LINE__);
Add this directly below:
Code: [Select]
$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_

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 51
Re: Minimum length of comments
« Reply #4 on: March 07, 2010, 04:28:51 pm »

thanks, after cookin dinner i will do this. will mark as solved since i have faith in you :)
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.