diff --git a/db/db.code.version.txt b/db/db.code.version.txt index dde92dd..76a8b2b 100644 --- a/db/db.code.version.txt +++ b/db/db.code.version.txt @@ -1 +1 @@ -82 +83 diff --git a/db/db.update.83.sql b/db/db.update.83.sql new file mode 100644 index 0000000..b3efe61 --- /dev/null +++ b/db/db.update.83.sql @@ -0,0 +1 @@ +INSERT INTO `config` ( `var` , `val` , `category`, `ord` , `description` , `year`) VALUES ('participant_project_summary_wordmin', 0, 'Participant Registration', 1110, 'The minimum number of words acceptable in the project summary', -1); diff --git a/register_participants_project.php b/register_participants_project.php index 5c413ac..5601356 100644 --- a/register_participants_project.php +++ b/register_participants_project.php @@ -87,7 +87,7 @@ echo mysql_error(); { $summarywords=preg_split("/[\s,]+/",$_POST['summary']); $summarywordcount=count($summarywords); - if($summarywordcount>$config['participant_project_summary_wordmax']) + if($summarywordcount>$config['participant_project_summary_wordmax'] || $summarywordcount<$config['participant_project_summary_wordmin']) $summarycountok=0; else $summarycountok=1; @@ -176,6 +176,7 @@ else if($newstatus=="complete") function countwords() { var wordmax=; + var wordmin=; var summaryobj=document.getElementById('summary'); var wordcountobj=document.getElementById('wordcount'); var wordcountmessageobj=document.getElementById('wordcountmessage'); @@ -183,7 +184,7 @@ function countwords() var wordarray=summaryobj.value.replace(/\s+/g," ").split(" "); var wordcount=wordarray.length; - if(wordcount>wordmax) + if(wordcount>wordmax || wordcount$summarywordcount/"; echo i18n("%1 words maximum",array($config['participant_project_summary_wordmax'])); + if($config['participant_project_summary_wordmin'] > 0) + { + echo i18n(", %1 words minimum", array($config['participant_project_summary_wordmin'])); + } echo ""; echo "";