Plugin Directory

Changeset 154447


Ignore:
Timestamp:
09/13/2009 06:20:08 PM (17 years ago)
Author:
zhykos
Message:

New version (see readme.txt)

Location:
comment-contest/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • comment-contest/trunk/comment-contest.php

    r152584 r154447  
    22/*
    33Plugin Name: Comment Contest
    4 Plugin URI: http://www.nozzhy.com/un-plugin-pour-gerer-un-concours-par-commentaires-sur-votre-blog/
     4Plugin URI: http://www.nozzhy.com/plugins/comment-contest-description/
    55Description: If you create a contest on your website, you can draw all comments in a specific post
    66Author: Thomas "Zhykos" Cicognani
    7 Version: 1.1.1b
     7Version: 1.3
    88Author URI: http://www.nozzhy.com
     9*/
     10
     11/*  Copyright 2009  Comment Contest plugin for Wordpress by Thomas "Zhykos" Cicognani  (email : zhykos@nozzhy.com)
     12
     13    This program is free software; you can redistribute it and/or modify
     14    it under the terms of the GNU General Public License as published by
     15    the Free Software Foundation; either version 2 of the License, or
     16    (at your option) any later version.
     17
     18    This program is distributed in the hope that it will be useful,
     19    but WITHOUT ANY WARRANTY; without even the implied warranty of
     20    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     21    GNU General Public License for more details.
     22
     23    You should have received a copy of the GNU General Public License
     24    along with this program; if not, write to the Free Software
     25    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    926*/
    1027
     
    1532 */
    1633class CommentContest {
    17     var $domain = '';
    18     var $version = '1.1.1b'; // Current version
    19     var $option_ns = '';
    20     var $options = array ();
    21     var $localizationName = "commentContest";
     34    /*private*/var $domain = '';
     35    /*private*/var $version = '1.3'; // Current version
     36    /*private*/var $option_ns = '';
     37    /*private*/var $options = array ();
     38    /*private*/var $localizationName = "commentContest";
     39    /*private*/var $pluginDir = '';
    2240   
    2341    /**
     
    4664            $this->option_ns = get_class ( $this );
    4765           
     66        $this->pluginDir = WP_CONTENT_URL . '/plugins/comment-contest';
     67           
    4868        // Get options
    4969        $this->options = get_option ( $this->option_ns );
     
    124144     * First step<br />
    125145     * Configure the contest's settings
    126      */
    127     private function configure() {
     146     * @param $errorCode Error code (it's the message to display). <i>Null</i> means thers's no error
     147     * @param $previousContestType Contest Type
     148     * @param $numWinners Winners' number
     149     * @param $numParticipation Maximum participation's number
     150     * @param $numPrizes Prizes' number
     151     * @param $ranks Allowed ranks
     152     * @param $email Email to send (<i>null</i> means no email to send)
     153     */
     154    function configure($errorCode = null, $previousContestType = null, $numWinners = null, $numParticipation = null, $numPrizes = null, $ranks = null, $email = null) {
    128155        $configureContest = __("Configure the contest", $this->localizationName);
    129156        $winnersNumber = __("Winners' number", $this->localizationName);
     
    137164        $user = __("Normal user", $this->localizationName);
    138165        $sendmail = __("Automaticaly send a mail to winners", $this->localizationName);
    139         $mailcontent = __("Email's content", $this->localizationName);
     166        $mailcontent = __("Email's content (HTML possible)", $this->localizationName);
     167        $contestType = __("Contest type", $this->localizationName);
    140168        $ok = __("Ok!", $this->localizationName);
    141        
    142         echo "<h1>Comment Contest - $configureContest</h1>
    143         <form action='plugins.php?page=comment-contest.php' method='post'>
    144         $winnersNumber: <input type='text' name='winners' value='2' /><br />
    145         $participationsNumber: <input type='text' name='number' value='1' /><br />
     169        $normalContest = __("Normal contest (random winners)", $this->localizationName);
     170        $speedContest = __("Speed contest (first comments win)", $this->localizationName);
     171        $prizeContest = __("Number of different prizes", $this->localizationName);
     172       
     173        echo "<h1>Comment Contest - $configureContest</h1>";
     174       
     175        if($errorCode != null) {
     176            echo "<div id='message' class='error'><p>$errorCode</p></div>";
     177        }
     178       
     179        $normalType = " checked='checked'";
     180        $speedType = "";
     181       
     182        if($previousContestType != null) {
     183            if($previousContestType == "speed") {
     184                $normalType = "";
     185                $speedType = " checked='checked'";
     186            }
     187        }
     188       
     189        $winnersValue = ($numWinners == null ? 2 : $numWinners);
     190        $participationsValue = ($numParticipation == null ? 1 : $numParticipation);
     191        $prizeValue = ($numPrizes == null ? 1 : $numPrizes);
     192        $userChecked = " checked='checked'";
     193       
     194        if($ranks != null) {
     195            if(in_array(10, $ranks)) {
     196                $adminChecked = " checked='checked'";
     197            } else {
     198                $adminChecked = "";
     199            }
     200           
     201            if(in_array(7, $ranks)) {
     202                $editorChecked = " checked='checked'";
     203            } else {
     204                $editorChecked = "";
     205            }
     206           
     207            if(in_array(2, $ranks)) {
     208                $authorChecked = " checked='checked'";
     209            } else {
     210                $authorChecked = "";
     211            }
     212           
     213            if(in_array(1, $ranks)) {
     214                $contributorChecked = " checked='checked'";
     215            } else {
     216                $contributorChecked = "";
     217            }
     218           
     219            if(in_array(0, $ranks)) {
     220                $subscriberChecked = " checked='checked'";
     221            } else {
     222                $subscriberChecked = "";
     223            }
     224           
     225            if(!in_array(-1, $ranks)) {
     226                $userChecked = "";
     227            }
     228        }
     229       
     230        if($email != null) {
     231            $emailChecked = " checked='checked'";
     232            $mailcontent = stripslashes(html_entity_decode($email));
     233        } else {
     234            $emailChecked = "";
     235        }
     236       
     237        echo "<form action='plugins.php?page=comment-contest.php' method='post'>
     238        <table style='margin-left: -2px'>
     239            <tr style='vertical-align: top'>
     240                <td>$contestType:</td>
     241                <td>
     242                    <input type='radio' name='contestType' value='normal'$normalType /> $normalContest<br />
     243                    <input type='radio' name='contestType' value='speed'$speedType /> $speedContest
     244                </td>
     245            </tr>
     246        </table><br />
     247        $winnersNumber: <input type='text' name='numWinners' value='$winnersValue' /><br />
     248        $participationsNumber: <input type='text' name='numParticipation' value='$participationsValue' /><br />
     249        $prizeContest: <input type='text' name='numPrizes' value='$prizeValue' /><br />
    146250        <table style='margin-left: -2px'>
    147251            <tr style='vertical-align: top'>
    148252                <td>$allowedRanks:</td>
    149253                <td>
    150                     <input type='checkbox' name='rank[]' value='10' /> $administrator<br />
    151                     <input type='checkbox' name='rank[]' value='7' /> $editor<br />
    152                     <input type='checkbox' name='rank[]' value='2' /> $author<br />
    153                     <input type='checkbox' name='rank[]' value='1' /> $contributor<br />
    154                     <input type='checkbox' name='rank[]' value='0' /> $subscriber<br />
    155                     <input type='checkbox' name='rank[]' value='-1' checked='checked' /> $user
     254                    <input type='checkbox' name='rank[]' value='10'$adminChecked /> $administrator<br />
     255                    <input type='checkbox' name='rank[]' value='7'$editorChecked /> $editor<br />
     256                    <input type='checkbox' name='rank[]' value='2'$authorChecked /> $author<br />
     257                    <input type='checkbox' name='rank[]' value='1'$contributorChecked /> $contributor<br />
     258                    <input type='checkbox' name='rank[]' value='0'$subscriberChecked /> $subscriber<br />
     259                    <input type='checkbox' name='rank[]' value='-1'$userChecked /> $user
    156260                </td>
    157261            </tr>
    158262        </table>
    159263        <br />
    160         <input type='checkbox' name='sendmail' /> $sendmail<br />
     264        <input type='checkbox' name='sendmail'$emailChecked /> $sendmail<br />
    161265        <textarea name='mailcontent' rols='10' cols='40'>$mailcontent</textarea>
    162266        <br /><br /><input type='submit' name='features' value='$ok' /></form>";
     
    170274     * @param $numWinners The winners' number
    171275     * @param $numParticipation The participation's number for each person
    172      */
    173     private function choosePost($currentPage, $ranks, $numWinners, $numParticipation, $email) {
     276     * @param $email Email's content
     277     * @param $type The contest's type
     278     * @param $prizes Prizes' number
     279     */
     280    /*private */function choosePost($currentPage, $ranks, $numWinners, $numParticipation, $email, $type, $prizes) {
    174281        global $wpdb;
    175282        $maxArticles = 20;
     
    180287       
    181288        echo "<h1>Comment Contest - $choosePost</h1><form id='postForm' action='plugins.php?page=comment-contest.php' method='post'>";
    182         $query = "SELECT * FROM $wpdb->posts WHERE post_status = 'publish' AND post_type='post' ORDER BY post_date DESC";
     289       
     290        $query = "SELECT * FROM $wpdb->posts WHERE (post_status = 'publish' OR post_status = 'private') AND post_type='post' ORDER BY post_date DESC";
    183291        $posts = $wpdb->get_results ( $query );
    184292        if ($posts) {
     
    193301            <input type='hidden' name='numParticipation' value='$numParticipation' />
    194302            <input type='hidden' name='email' value='$email' />
    195             <input type='hidden' name='postnumber' id='postnumber' value='' /></form>";
     303            <input type='hidden' name='contestType' value='$type' />
     304            <input type='hidden' name='numPrizes' value='$prizes' />
     305            <input type='hidden' name='postnumber' id='postnumber' value='' />";
     306           
    196307            if (count ( $posts ) > $maxArticles) {
    197                 echo "<br /><a href='$url/wp-admin/plugins.php?page=comment-contest.php&amp;pagepost=" . ($currentPage + $maxArticles) . "'>$more</a>";
    198             }
     308                echo "<br /><input type='hidden' name='pagepost' value='" . ($currentPage + $maxArticles) . "' />
     309                <a href='#' onclick='getElementById(\"postnumber\").value=-1; getElementById(\"postForm\").submit()'>$more</a>";
     310            }
     311           
     312            echo "</form>";
    199313        } else {
    200314            $this->error ( $noPost, array ("home") );
     
    209323     * @param $numWinners The winners' number
    210324     * @param $numParticipation The participation's number for each person
    211      */
    212     private function chooseComments($idPost, $ranks, $numWinners, $numParticipation, $email) {
     325     * @param $email Email's content
     326     * @param $type The contest's type
     327     * @param $prizes Prizes' number
     328     * @param $errorMessage Error message
     329     * @param $previousComments Comments previously checked
     330     */
     331    /*private */function chooseComments($idPost, $ranks, $numWinners, $numParticipation, $email, $type, $prizes, $errorMessage = null, $previousComments = null) {
    213332        global $wpdb;
    214        
     333
    215334        $chooseComments = __("Choose comments to include in the contest", $this->localizationName);
    216         $launchContest = __("Launch the contest", $this->localizationName);
     335        $ok = __("Ok!", $this->localizationName);
    217336        $noComment = __("No comment found!", $this->localizationName);
    218337       
    219338        echo "<h1>Comment Contest - $chooseComments</h1>";
     339       
     340        if($errorMessage != null) {
     341            echo "<div id='message' class='error'><p>$errorMessage</p></div>";
     342        }
    220343       
    221344        $filter = null;
     
    251374            $author = "";
    252375            $count = 0;
     376           
    253377            foreach ( $comments as $comment ) {
    254378                $checked = " checked='checked'";
    255379                $from = stripslashes ( $comment->comment_author );
     380               
    256381                if ($author != $from) {
    257382                    $count = 0;
     
    263388                    }
    264389                }
     390               
    265391                $comment_content = stripslashes ( $comment->comment_content );
    266392                $id = stripslashes ( $comment->comment_ID );
     393               
     394                if($previousComments != null) {
     395                    if(in_array($id, $previousComments)) {
     396                        $checked = " checked='checked'";
     397                    } else {
     398                        $checked = "";
     399                    }
     400                }
    267401               
    268402                echo "<input type='checkbox' name='comments[]' value='$id'$checked /> <strong>$from : </strong>" . substr ( strip_tags ( $comment_content ), 0, 100 ) . "<br /><br />";
     
    273407            <input type='hidden' name='numParticipation' value='$numParticipation' />
    274408            <input type='hidden' name='email' value='$email' />
    275             <input type='submit' value='$launchContest' /></form>";
     409            <input type='hidden' name='contestType' value='$type' />
     410            <input type='hidden' name='numPrizes' value='$prizes' />
     411            <input type='submit' value='$ok' /></form>";
    276412        } else {
    277413            $this->error ( $noComment, array ("home") );
     
    280416   
    281417    /**
    282      * Last step<br />
    283      * Display winners
    284      * @param $comments <array[<integer>=><integer>]> The complete participants' list (created with all checkboxes)
     418     * Forth step<br />
     419     * Manage the contest's prizes
     420     * @param $comments The complete participants' list (created with all checkboxes)
    285421     * @param $numWinners The winners' number
    286422     * @param $numParticipation The participation's number for each person
    287      */
    288     private function displayWinners($comments, $numWinners, $numParticipation, $email) {
     423     * @param $email Email's content
     424     * @param $type The contest's type
     425     * @param $prizes Prizes' number
     426     * @param $error Error code
     427     * @param $previousNames Prizes' names previously typed
     428     * @param $previousTo Prizes' places previously typed
     429     */
     430    function choosePrizes($comments, $numWinners, $numParticipation, $email, $type, $prizes, $error = 0, $previousNames = null, $previousTo = null) {
     431        $choosePrizes = __("Prizes' choice", $this->localizationName);
     432        $launchContest = __("Launch the contest", $this->localizationName);
     433        $prizeName = __("Prize name:", $this->localizationName);
     434        $start = __("From", $this->localizationName);
     435        $end = __("to", $this->localizationName);
     436       
     437        echo "<h1>Comment Contest - $choosePrizes</h1>";
     438       
     439        if($error == 1) {
     440            $errorText = __("Please give all prizes!", $this->localizationName);
     441            echo "<div id='message' class='error'><p>$errorText</p></div>";
     442        } elseif($error == 2) {
     443            $errorText = __("Please check all places for each prize", $this->localizationName);
     444            echo "<div id='message' class='error'><p>$errorText</p></div>";
     445        }
     446           
     447        echo "<script type='text/javascript' src='$this->pluginDir/comment-contest.js'></script>
     448            <form action='plugins.php?page=comment-contest.php' method='post'>";
     449
     450        if($prizes == 1) {
     451            echo "$prizeName <input type='text' name='prizeName' /><br />";
     452        } else {
     453            $previousNames = explode(",", $previousNames);
     454            $previousTo = explode(",", $previousTo);
     455           
     456            for($i = 0; $i < $prizes; $i++) {
     457                if($i == 0) {
     458                    $beginNumber = 1;
     459                } else {
     460                    if($previousTo != null) {
     461                        $beginNumber = $previousTo[$i-1] + 1;
     462                    } else {
     463                        $beginNumber = null;
     464                    }
     465                }
     466               
     467                if($i == $prizes - 1) {
     468                    $endField = "readonly='readonly' value='$numWinners'";
     469                } else {
     470                    $endField = "onkeyup='changePlace(this.value, " . ($i + 1) . ")'";
     471                   
     472                    if($previousTo != null) {
     473                        $endField .= " value='$previousTo[$i]'";
     474                    }
     475                }
     476               
     477                if($previousNames != null) {
     478                    $n = " value='" . stripslashes($previousNames[$i]) . "'";
     479                } else {
     480                    $n = null;
     481                }
     482               
     483                echo "$prizeName <input type='text' name='prizeName[]'$n />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$start <input type='text' name='from[]' readonly='readonly' value='$beginNumber' id='to$i' /> $end <input type='text' name='to[]' $endField /><br />";
     484            }
     485        }
     486       
     487        echo "<input type='hidden' name='comments' value='$comments' />
     488            <input type='hidden' name='numWinners' value='$numWinners' />
     489            <input type='hidden' name='numParticipation' value='$numParticipation' />
     490            <input type='hidden' name='email' value='$email' />
     491            <input type='hidden' name='contestType' value='$type' />
     492            <input type='hidden' name='numPrizes' value='$prizes' /><br />
     493            <input type='submit' name='prizesSubmit' value='$launchContest' /></form>";
     494    }
     495   
     496    /**
     497     * Fifth step<br />
     498     * Display winners
     499     * @param $comments The complete participants' list (created with all checkboxes)
     500     * @param $numWinners The winners' number
     501     * @param $numParticipation The participation's number for each person
     502     * @param $email Email's content
     503     * @param $type The contest's type
     504     * @param $prizes Prizes' names
     505     * @param $places Prizes' order
     506     */
     507    /*private */function displayWinners($comments, $numWinners, $numParticipation, $email, $type, $prizes, $places) {
    289508        global $wpdb;
    290509       
     
    303522       
    304523        $tab = null;
     524        $comments = explode(",", $comments);
    305525        foreach ( $comments as $comment => $value ) {
    306526            $tab [] = $value;
    307527        }
    308528       
    309         shuffle ( $tab );
     529        if($type == "normal") {
     530            shuffle ( $tab );
     531        }
     532       
    310533        echo "<h1>Comment Contest - $winners</h1>";
    311534        $stop = false;
    312         $i = 1;
     535        $i = 1; $k = 1;
    313536        $author = "";
     537        $prizeName = __("Prize won:", $this->localizationName);
     538       
     539        if(!is_array($prizes)) {
     540            echo "<h2>$prizeName " . stripslashes($prizes) . "</h2>";
     541        } else {
     542            echo "<h2>$prizeName " . stripslashes($prizes[0]) . "</h2>";
     543        }
     544       
    314545        for($j = 0; $j < count ( $tab ) && ! $stop; $j ++) {
    315546            $query = "SELECT * FROM $wpdb->comments WHERE comment_approved = '1' and comment_id='$tab[$j]'";
     
    321552                $i ++;
    322553                $author = $from;
     554               
     555                if(is_array($prizes) && $j + 1 == $places[$k]) {
     556                    echo "<h2>$prizeName " . stripslashes($prizes[$k++]) . "</h2>";
     557                }
     558               
    323559                echo "<strong>$commentWord</strong> $from <strong>$say</strong> $c->comment_content <br /><br />";
    324560                if($email != null) {
    325                     @wp_mail($c->comment_author_email, $winSubject, base64_decode($email), $message_headers);
     561                    @wp_mail($c->comment_author_email, $winSubject, html_entity_decode($email), $message_headers);
    326562                }
    327563            }
     
    331567            }
    332568        }
     569       
     570        $allParticipants = __("List of all participants:", $this->localizationName);
     571        echo "<br /><br />$allParticipants ";
     572        $tabTemp = null;
     573        for($j = 0; $j < count ( $tab ); $j ++) {
     574            $query = "SELECT comment_author FROM $wpdb->comments WHERE comment_approved = '1' and comment_id='$tab[$j]'";
     575            $tabTemp[] = $wpdb->get_var ( $query );
     576        }
     577        array_unique($tabTemp);
     578        sort($tabTemp);
     579        echo implode(", ", $tabTemp);
    333580    }
    334581   
     
    336583     * Display an error message
    337584     * @param $message The error message
    338      * @param $args The message's parameter.<br />$args[0] must be "post"
    339      */
    340     private function error($message, $args) {
     585     * @param $args The message's parameter. <code>$args[0]</code> must be <i>"post"</i> or <i>"home"</i>
     586     */
     587    /*private */function error($message, $args) {
    341588        $url = get_bloginfo ( 'url' );
    342589        if ($args [0] == 'post') {
     
    349596            <input type='hidden' name='numWinners' value='$args[3]' />
    350597            <input type='hidden' name='numParticipation' value='$args[4]' />
    351             <input type='hidden' name='numParticipation' value='$args[5]' />
     598            <input type='hidden' name='email' value='$args[5]' />
    352599            <input type='submit' value='$chooseComment' /></form>" );
    353600        } elseif ($args [0] == 'home') {
     
    359606   
    360607    /**
     608     * Check fields' format in the prizes' choice
     609     * @param $names The prizes' names
     610     * @param $to The places to go
     611     * @param $from The places to start from
     612     * @return The checks' result : 0 for ok, 1 for names error, 2 for "to" error
     613     */
     614    /*private */function checkPrizes(&$names, $to, $from) {
     615        // Check names format
     616        $test = false;
     617        for($i = 0; $i < count($names); $i++) {
     618            if($names[$i] == "") {
     619                $test = true;
     620            }
     621            $names[$i] = strip_tags($names[$i]);
     622        }
     623       
     624        if($test) {
     625            return 1;
     626        } else {
     627            //Check "To" format
     628            $test = false;
     629            for($i = 0; $i < count($to) && !$test; $i++) {
     630                if(($to[$i] == "") ||
     631                        ($i < count($to) - 1 && $to[$i] > $to[$i + 1]) ||
     632                        ($from[$i] > $to[$i])) {
     633                    $test = true;
     634                }
     635            }
     636           
     637            if($test) {
     638                return 2;
     639            } else {
     640                return 0; // Everything is fine
     641            }
     642        }
     643    }
     644   
     645    /**
    361646     * The page to display in the administration menu
    362647     */
    363648    function AdminHelpPage() {
    364         if (isset ( $_POST ['postnumber'] )) { // Step 3 : Choose comments
    365             $this->chooseComments ( $_POST ['postnumber'], $_POST ['rank'], $_POST ['numWinners'], $_POST ['numParticipation'], $_POST ['email'] );
     649        if(isset($_POST['prizesSubmit'])) { // Step 5 : Display winners
     650           
     651            $res = $this->checkPrizes($_POST['prizeName'], $_POST['to'], $_POST['from']);
     652
     653            if($res == 0) {
     654                $this->displayWinners ( $_POST ['comments'], $_POST ['numWinners'], $_POST ['numParticipation'], $_POST ['email'], $_POST['contestType'], $_POST['prizeName'], $_POST['from'] );
     655            } else {
     656                $this->choosePrizes($_POST ['comments'], $_POST ['numWinners'], $_POST ['numParticipation'], $_POST ['email'], $_POST['contestType'], $_POST['numPrizes'], $res, implode(",", $_POST['prizeName']), implode(",", $_POST['to']));
     657            }
    366658
    367659// ---------------------------------------------------------------------------------
    368 
    369         } elseif (isset ( $_POST ['post'] )) { // Step 4 : Display winners
     660           
     661        }
     662        else if (isset ( $_POST ['postnumber'] ) && $_POST ['postnumber'] != -1) { // Step 3 : Choose comments
     663            $this->chooseComments ( $_POST ['postnumber'], $_POST ['rank'], $_POST ['numWinners'], $_POST ['numParticipation'], $_POST ['email'], $_POST['contestType'], $_POST['numPrizes'] );
     664
     665// ---------------------------------------------------------------------------------
     666
     667        } elseif (isset ( $_POST ['post'] ) && $_POST ['postnumber'] != -1) { // Step 4 : Choose prizes
    370668            $comments = $_POST ['comments'];
    371669           
    372670            if ($comments == null || count ( $comments ) == 0) {
    373671                $selectOneWinner = __("Please select one winner at least!", $this->localizationName);
    374                 $this->error ( $selectOneWinner, array ("post", $_POST ['post'], $_POST ['rank'], $_POST ['numWinners'], $_POST ['numParticipation'], $_POST ['email'] ) );
    375             } elseif (count ( $comments ) <= $_POST ['numWinners']) {
     672                $this->chooseComments ( $_POST ['post'], $_POST ['rank'], $_POST ['numWinners'], $_POST ['numParticipation'], $_POST ['email'], $_POST['contestType'], $_POST['numPrizes'], $selectOneWinner, null );
     673            } elseif (count ( $comments ) < $_POST ['numWinners']) {
    376674                $selectMoreWinner = __("Please select more participants than winners!", $this->localizationName);
    377                 $this->error ( $selectMoreWinner, array ("post", $_POST ['post'], $_POST ['rank'], $_POST ['numWinners'], $_POST ['numParticipation'], $_POST ['email'] ) );
    378             } else {
    379                 $this->displayWinners ( $comments, $_POST ['numWinners'], $_POST ['numParticipation'], $_POST ['email'] );
    380             }
    381            
     675                $this->chooseComments ( $_POST ['post'], $_POST ['rank'], $_POST ['numWinners'], $_POST ['numParticipation'], $_POST ['email'], $_POST['contestType'], $_POST['numPrizes'], $selectMoreWinner, $comments );
     676            } else {
     677                $this->choosePrizes(implode(",", $comments), $_POST ['numWinners'], $_POST ['numParticipation'], $_POST ['email'], $_POST['contestType'], $_POST['numPrizes']);
     678            }
    382679// ---------------------------------------------------------------------------------
    383680
    384         } elseif (isset ( $_POST ['features'] ) || isset ( $_GET ['pagepost'] )) { // Step 2 : Choose an article
    385             // Change the page if needed
    386             $page = (isset ( $_GET ['pagepost'] ) ? intval ( $_GET ['pagepost'] ) : 0);
     681        } elseif (isset ( $_POST ['features'] ) || isset($_POST ['pagepost'])) { // Step 2 : Choose an article
     682            $page = (isset ( $_POST ['pagepost'] ) ? intval ( $_POST ['pagepost'] ) : 0);
    387683            $page = ($page > 0 ? $page : 0);
    388684           
    389685            // Check list
    390             $numWinners = intval ( $_POST ['winners'] );
    391             $numParticipation = intval ( $_POST ['number'] );
     686            $numWinners = intval ( $_POST ['numWinners'] );
     687            $numParticipation = intval ( $_POST ['numParticipation'] );
     688            $numPrizes = intval ( $_POST ['numPrizes'] );
     689           
    392690            if(isset($_POST['sendmail'])) {
    393                 $email = base64_encode($_POST['sendmail']);
     691                $email = stripslashes(htmlentities($_POST['mailcontent']));
    394692            } else {
    395693                $email = null;
    396694            }
    397695           
    398             $emailContentTest = __("Email's content", $this->localizationName);
    399            
     696            $emailContentTest = __("Email's content (HTML possible)", $this->localizationName);
     697
    400698            if (count ( $_POST ['rank'] ) == 0) {
    401699                $selectOneRank = __("Please select one rank at least!", $this->localizationName);
    402                 $this->error ( $selectOneRank, array ("home") );
     700                $this->configure ($selectOneRank, $_POST['contestType'], $numWinners, $numParticipation, $numPrizes, null, $email);
    403701            } elseif ($numWinners == null || $numWinners <= 0) {
    404702                $winnerFormat = __("Wrong winners format!", $this->localizationName);
    405                 $this->error ( $winnerFormat, array ("home") );
     703                $this->configure ($winnerFormat, $_POST['contestType'], $numWinners, $numParticipation, $numPrizes, $_POST ['rank'], $email);
    406704            } elseif ($numParticipation == null || $numParticipation <= 0) {
    407705                $participationsFormat = __("Wrong participations format!", $this->localizationName);
    408                 $this->error ( $participationsFormat, array ("home") );
     706                $this->configure ($participationsFormat, $_POST['contestType'], $numWinners, $numParticipation, $numPrizes, $_POST ['rank'], $email);
    409707            } elseif($email == $emailContentTest) {
    410708                $emailContentError = __("Please change the email's content!", $this->localizationName);
    411                 $this->error ( $emailContentError, array ("home") );
    412             } else {
    413                 $this->choosePost ( $page, implode ( ",", $_POST ['rank'] ), $numWinners, $numParticipation, $email );
     709                $this->configure ($emailContentError, $_POST['contestType'], $numWinners, $numParticipation, $numPrizes, $_POST ['rank'], $email);
     710            } elseif ($numPrizes == null || $numPrizes <= 0 || $numPrizes > $numWinners) {
     711                $prizesFormat = __("Wrong prizes number format! Or choose more winners than prizes!", $this->localizationName);
     712                $this->configure ($prizesFormat, $_POST['contestType'], $numWinners, $numParticipation, $numPrizes, $_POST ['rank'], $email);
     713            } else {
     714                if(is_array($_POST ['rank'])) {
     715                    $tab = implode ( ",", $_POST ['rank'] );
     716                } else {
     717                    $tab = $_POST ['rank'];
     718                }
     719                $this->choosePost ( $page, $tab, $numWinners, $numParticipation, $email, $_POST['contestType'], $numPrizes );
    414720            }
    415721           
  • comment-contest/trunk/languages/commentContest-en_US.po

    r152584 r154447  
    33"Project-Id-Version: Comment Contest\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2009-09-06 21:51+0100\n"
     5"POT-Creation-Date: 2009-09-13 20:03+0100\n"
    66"PO-Revision-Date: \n"
    77"Last-Translator: Zhykos <zhykos@nozzhy.com>\n"
     
    1818"X-Poedit-SearchPath-0: C:\\wamp\\www\\wordpress\\wp-content\\plugins\\comment-contest\n"
    1919
    20 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:75
     20#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:95
    2121msgid "Comment Contest"
    2222msgstr "Comment Contest"
    2323
    24 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:128
     24#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:155
    2525msgid "Configure the contest"
    2626msgstr "Configure the contest"
    2727
    28 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:129
     28#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:156
    2929msgid "Winners' number"
    3030msgstr "Winners' number"
    3131
    32 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:130
     32#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:157
    3333msgid "Maximum participations' number per person"
    3434msgstr "Maximum participations' number per person"
    3535
    36 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:131
     36#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:158
    3737msgid "Allowed ranks to participate"
    3838msgstr "Allowed ranks to participate"
    3939
    40 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:132
     40#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:159
    4141msgid "Administrator"
    4242msgstr "Administrator"
    4343
    44 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:133
     44#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:160
    4545msgid "Editor"
    4646msgstr "Editor"
    4747
    48 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:134
     48#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:161
    4949msgid "Author"
    5050msgstr "Author"
    5151
    52 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:135
     52#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:162
    5353msgid "Contributor"
    5454msgstr "Contributor"
    5555
    56 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:136
     56#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:163
    5757msgid "Subscriber"
    5858msgstr "Subscriber"
    5959
    60 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:137
     60#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:164
    6161msgid "Normal user"
    6262msgstr "Normal user"
    6363
    64 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:138
     64#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:165
    6565msgid "Automaticaly send a mail to winners"
    6666msgstr "Automaticaly send a mail to winners"
    6767
    68 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:139
    69 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:398
    70 msgid "Email's content"
    71 msgstr "Email's content"
    72 
    73 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:140
     68#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:166
     69#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:696
     70msgid "Email's content (HTML possible)"
     71msgstr "Email's content (HTML possible)"
     72
     73#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:167
     74msgid "Contest type"
     75msgstr "Contest type"
     76
     77#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:168
     78#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:432
    7479msgid "Ok!"
    7580msgstr "Ok!"
    7681
    77 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:177
     82#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:169
     83msgid "Normal contest (random winners)"
     84msgstr "Normal contest (random winners)"
     85
     86#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:170
     87msgid "Speed contest (first comments win)"
     88msgstr "Speed contest (first comments win)"
     89
     90#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:171
     91msgid "Number of different prizes"
     92msgstr "Number of different prizes"
     93
     94#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:284
    7895msgid "Choose a post"
    7996msgstr "Choose a post"
    8097
    81 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:178
     98#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:285
    8299msgid "More..."
    83100msgstr "More..."
    84101
    85 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:179
     102#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:286
    86103msgid "No post found!"
    87104msgstr "No post found!"
    88105
    89 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:215
     106#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:334
    90107msgid "Choose comments to include in the contest"
    91108msgstr "Choose comments to include in the contest"
    92109
    93 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:216
     110#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:335
    94111msgid "Launch the contest"
    95112msgstr "Launch the contest"
    96113
    97 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:217
     114#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:336
    98115msgid "No comment found!"
    99116msgstr "No comment found!"
    100117
    101 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:291
     118#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:431
     119msgid "Prizes' choice"
     120msgstr "Prizes' choice"
     121
     122#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:433
     123msgid "Prize name:"
     124msgstr "Prize name:"
     125
     126#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:434
     127msgid "From"
     128msgstr "From"
     129
     130#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:435
     131msgid "to"
     132msgstr "to"
     133
     134#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:440
     135msgid "Please give all prizes!"
     136msgstr "Please give all prizes!"
     137
     138#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:443
     139msgid "Please check all places for each prize"
     140msgstr "Please check all places for each prize"
     141
     142#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:510
    102143msgid "Winners"
    103144msgstr "Winners"
    104145
    105 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:292
     146#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:511
    106147msgid "Comment"
    107148msgstr "Comment:"
    108149
    109 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:293
     150#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:512
    110151msgid "says"
    111152msgstr "says"
    112153
    113 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:294
     154#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:513
    114155msgid "You win a contest"
    115156msgstr "You win a contest"
    116157
    117 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:343
     158#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:537
     159msgid "Prize won:"
     160msgstr "Prize won:"
     161
     162#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:570
     163msgid "List of all participants:"
     164msgstr "List of all participants: "
     165
     166#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:590
    118167msgid "Choose comments"
    119168msgstr "Choose comments"
    120169
    121 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:354
     170#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:601
    122171msgid "Back"
    123172msgstr "Back"
    124173
    125 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:373
     174#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:671
    126175msgid "Please select one winner at least!"
    127176msgstr "Please select one winner at least!"
    128177
    129 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:376
     178#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:674
    130179msgid "Please select more participants than winners!"
    131180msgstr "Please select more participants than winners!"
    132181
    133 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:401
     182#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:699
    134183msgid "Please select one rank at least!"
    135184msgstr "Please select one rank at least!"
    136185
    137 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:404
     186#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:702
    138187msgid "Wrong winners format!"
    139188msgstr "Wrong winners format!"
    140189
    141 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:407
     190#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:705
    142191msgid "Wrong participations format!"
    143192msgstr "Wrong participations format!"
    144193
    145 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:410
     194#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:708
    146195msgid "Please change the email's content!"
    147196msgstr "Please change the email's content!"
    148197
     198#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:711
     199msgid "Wrong prizes number format! Or choose more winners than prizes!"
     200msgstr "Wrong prizes number format! Or choose more winners than prizes!"
     201
  • comment-contest/trunk/languages/commentContest-en_US.pot

    r152584 r154447  
    33"Project-Id-Version: Comment Contest\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2009-09-06 21:51+0100\n"
     5"POT-Creation-Date: 2009-09-13 20:03+0100\n"
    66"PO-Revision-Date: \n"
    77"Last-Translator: Zhykos <zhykos@nozzhy.com>\n"
     
    1818"X-Poedit-SearchPath-0: C:\\wamp\\www\\wordpress\\wp-content\\plugins\\comment-contest\n"
    1919
    20 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:75
     20#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:95
    2121msgid "Comment Contest"
    2222msgstr "Comment Contest"
    2323
    24 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:128
     24#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:155
    2525msgid "Configure the contest"
    2626msgstr "Configure the contest"
    2727
    28 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:129
     28#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:156
    2929msgid "Winners' number"
    3030msgstr "Winners' number"
    3131
    32 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:130
     32#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:157
    3333msgid "Maximum participations' number per person"
    3434msgstr "Maximum participations' number per person"
    3535
    36 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:131
     36#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:158
    3737msgid "Allowed ranks to participate"
    3838msgstr "Allowed ranks to participate"
    3939
    40 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:132
     40#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:159
    4141msgid "Administrator"
    4242msgstr "Administrator"
    4343
    44 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:133
     44#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:160
    4545msgid "Editor"
    4646msgstr "Editor"
    4747
    48 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:134
     48#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:161
    4949msgid "Author"
    5050msgstr "Author"
    5151
    52 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:135
     52#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:162
    5353msgid "Contributor"
    5454msgstr "Contributor"
    5555
    56 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:136
     56#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:163
    5757msgid "Subscriber"
    5858msgstr "Subscriber"
    5959
    60 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:137
     60#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:164
    6161msgid "Normal user"
    6262msgstr "Normal user"
    6363
    64 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:138
     64#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:165
    6565msgid "Automaticaly send a mail to winners"
    6666msgstr "Automaticaly send a mail to winners"
    6767
    68 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:139
    69 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:398
    70 msgid "Email's content"
    71 msgstr "Email's content"
    72 
    73 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:140
     68#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:166
     69#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:696
     70msgid "Email's content (HTML possible)"
     71msgstr "Email's content (HTML possible)"
     72
     73#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:167
     74msgid "Contest type"
     75msgstr "Contest type"
     76
     77#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:168
     78#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:432
    7479msgid "Ok!"
    7580msgstr "Ok!"
    7681
    77 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:177
     82#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:169
     83msgid "Normal contest (random winners)"
     84msgstr "Normal contest (random winners)"
     85
     86#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:170
     87msgid "Speed contest (first comments win)"
     88msgstr "Speed contest (first comments win)"
     89
     90#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:171
     91msgid "Number of different prizes"
     92msgstr "Number of different prizes"
     93
     94#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:284
    7895msgid "Choose a post"
    7996msgstr "Choose a post"
    8097
    81 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:178
     98#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:285
    8299msgid "More..."
    83100msgstr "More..."
    84101
    85 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:179
     102#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:286
    86103msgid "No post found!"
    87104msgstr "No post found!"
    88105
    89 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:215
     106#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:334
    90107msgid "Choose comments to include in the contest"
    91108msgstr "Choose comments to include in the contest"
    92109
    93 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:216
     110#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:335
    94111msgid "Launch the contest"
    95112msgstr "Launch the contest"
    96113
    97 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:217
     114#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:336
    98115msgid "No comment found!"
    99116msgstr "No comment found!"
    100117
    101 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:291
     118#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:431
     119msgid "Prizes' choice"
     120msgstr "Prizes' choice"
     121
     122#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:433
     123msgid "Prize name:"
     124msgstr "Prize name:"
     125
     126#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:434
     127msgid "From"
     128msgstr "From"
     129
     130#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:435
     131msgid "to"
     132msgstr "to"
     133
     134#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:440
     135msgid "Please give all prizes!"
     136msgstr "Please give all prizes!"
     137
     138#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:443
     139msgid "Please check all places for each prize"
     140msgstr "Please check all places for each prize"
     141
     142#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:510
    102143msgid "Winners"
    103144msgstr "Winners"
    104145
    105 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:292
     146#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:511
    106147msgid "Comment"
    107148msgstr "Comment:"
    108149
    109 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:293
     150#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:512
    110151msgid "says"
    111152msgstr "says"
    112153
    113 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:294
     154#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:513
    114155msgid "You win a contest"
    115156msgstr "You win a contest"
    116157
    117 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:343
     158#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:537
     159msgid "Prize won:"
     160msgstr "Prize won:"
     161
     162#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:570
     163msgid "List of all participants:"
     164msgstr "List of all participants: "
     165
     166#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:590
    118167msgid "Choose comments"
    119168msgstr "Choose comments"
    120169
    121 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:354
     170#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:601
    122171msgid "Back"
    123172msgstr "Back"
    124173
    125 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:373
     174#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:671
    126175msgid "Please select one winner at least!"
    127176msgstr "Please select one winner at least!"
    128177
    129 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:376
     178#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:674
    130179msgid "Please select more participants than winners!"
    131180msgstr "Please select more participants than winners!"
    132181
    133 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:401
     182#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:699
    134183msgid "Please select one rank at least!"
    135184msgstr "Please select one rank at least!"
    136185
    137 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:404
     186#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:702
    138187msgid "Wrong winners format!"
    139188msgstr "Wrong winners format!"
    140189
    141 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:407
     190#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:705
    142191msgid "Wrong participations format!"
    143192msgstr "Wrong participations format!"
    144193
    145 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:410
     194#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:708
    146195msgid "Please change the email's content!"
    147196msgstr "Please change the email's content!"
    148197
     198#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:711
     199msgid "Wrong prizes number format! Or choose more winners than prizes!"
     200msgstr "Wrong prizes number format! Or choose more winners than prizes!"
     201
  • comment-contest/trunk/languages/commentContest-fr_FR.po

    r152584 r154447  
    33"Project-Id-Version: Comment Contest\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2009-09-06 21:52+0100\n"
     5"POT-Creation-Date: 2009-09-13 20:04+0100\n"
    66"PO-Revision-Date: \n"
    77"Last-Translator: Zhykos <zhykos@nozzhy.com>\n"
     
    1818"X-Poedit-SearchPath-0: C:\\wamp\\www\\wordpress\\wp-content\\plugins\\comment-contest\n"
    1919
    20 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:75
     20#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:95
    2121msgid "Comment Contest"
    2222msgstr "Comment Contest"
    2323
    24 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:128
     24#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:155
    2525msgid "Configure the contest"
    2626msgstr "Configurations du tirage au sort"
    2727
    28 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:129
     28#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:156
    2929msgid "Winners' number"
    3030msgstr "Nombre de gagnants "
    3131
    32 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:130
     32#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:157
    3333msgid "Maximum participations' number per person"
    3434msgstr "Nombre maximum de participations par personne "
    3535
    36 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:131
     36#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:158
    3737msgid "Allowed ranks to participate"
    3838msgstr "Rangs autoris&eacute;s pour participation "
    3939
    40 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:132
     40#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:159
    4141msgid "Administrator"
    4242msgstr "Administrateur"
    4343
    44 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:133
     44#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:160
    4545msgid "Editor"
    4646msgstr "&Eacute;diteur"
    4747
    48 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:134
     48#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:161
    4949msgid "Author"
    5050msgstr "Auteur"
    5151
    52 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:135
     52#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:162
    5353msgid "Contributor"
    5454msgstr "Contributeur"
    5555
    56 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:136
     56#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:163
    5757msgid "Subscriber"
    5858msgstr "Abonn&eacute;"
    5959
    60 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:137
     60#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:164
    6161msgid "Normal user"
    6262msgstr "Utilisateur normal"
    6363
    64 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:138
     64#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:165
    6565msgid "Automaticaly send a mail to winners"
    6666msgstr "Envoyer automatiquement un email aux gagnants"
    6767
    68 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:139
    69 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:398
    70 msgid "Email's content"
    71 msgstr "Contenu de l'email"
    72 
    73 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:140
     68#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:166
     69#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:696
     70msgid "Email's content (HTML possible)"
     71msgstr "Contenu de l'email (HTML possible)"
     72
     73#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:167
     74msgid "Contest type"
     75msgstr "Type de concours"
     76
     77#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:168
     78#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:432
    7479msgid "Ok!"
    7580msgstr "Ok !"
    7681
    77 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:177
     82#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:169
     83msgid "Normal contest (random winners)"
     84msgstr "Concours normal (gagnants aléatoire)"
     85
     86#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:170
     87msgid "Speed contest (first comments win)"
     88msgstr "Concours rapide (les premiers commentaires gagnent)"
     89
     90#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:171
     91msgid "Number of different prizes"
     92msgstr "Nombre de lots à gagner"
     93
     94#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:284
    7895msgid "Choose a post"
    7996msgstr "Choisir un article"
    8097
    81 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:178
     98#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:285
    8299msgid "More..."
    83100msgstr "Plus..."
    84101
    85 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:179
     102#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:286
    86103msgid "No post found!"
    87104msgstr "Aucun article !"
    88105
    89 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:215
     106#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:334
    90107msgid "Choose comments to include in the contest"
    91108msgstr "Choisir les commentaires &agrave; inclure dans le concours"
    92109
    93 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:216
     110#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:335
    94111msgid "Launch the contest"
    95112msgstr "Lancer le tirage au sort"
    96113
    97 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:217
     114#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:336
    98115msgid "No comment found!"
    99116msgstr "Aucun commentaire !"
    100117
    101 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:291
     118#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:431
     119msgid "Prizes' choice"
     120msgstr "Choix des lots"
     121
     122#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:433
     123msgid "Prize name:"
     124msgstr "Nom du lot :"
     125
     126#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:434
     127msgid "From"
     128msgstr "De"
     129
     130#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:435
     131msgid "to"
     132msgstr "à"
     133
     134#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:440
     135msgid "Please give all prizes!"
     136msgstr "Veuillez préciser tous les lots !"
     137
     138#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:443
     139msgid "Please check all places for each prize"
     140msgstr "Veuillez vérifier toutes les places pour chaque lot !"
     141
     142#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:510
    102143msgid "Winners"
    103144msgstr "Les gagnants"
    104145
    105 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:292
     146#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:511
    106147msgid "Comment"
    107148msgstr "Commentaire de"
    108149
    109 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:293
     150#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:512
    110151msgid "says"
    111152msgstr "avec"
    112153
    113 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:294
     154#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:513
    114155msgid "You win a contest"
    115156msgstr "Vous avez gagné un concours"
    116157
    117 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:343
     158#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:537
     159msgid "Prize won:"
     160msgstr "Lot gagné :"
     161
     162#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:570
     163msgid "List of all participants:"
     164msgstr "Liste des participants au concours :"
     165
     166#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:590
    118167msgid "Choose comments"
    119168msgstr "Rechoisir les commentaires"
    120169
    121 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:354
     170#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:601
    122171msgid "Back"
    123172msgstr "Retour au d&eacute;but"
    124173
    125 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:373
     174#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:671
    126175msgid "Please select one winner at least!"
    127176msgstr "Veuillez s&eacute;lectionner au moins un gagnant !"
    128177
    129 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:376
     178#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:674
    130179msgid "Please select more participants than winners!"
    131180msgstr "Veuillez s&eacute;lectionner plus de participants que de gagnants !"
    132181
    133 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:401
     182#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:699
    134183msgid "Please select one rank at least!"
    135184msgstr "Veuillez s&eacute;lectionner au moins un rang !"
    136185
    137 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:404
     186#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:702
    138187msgid "Wrong winners format!"
    139188msgstr "Veuillez sp&eacute;cifier un nombre correct de gagnants !"
    140189
    141 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:407
     190#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:705
    142191msgid "Wrong participations format!"
    143192msgstr "Veuillez sp&eacute;cifier un nombre correct de participations !"
    144193
    145 #: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:410
     194#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:708
    146195msgid "Please change the email's content!"
    147196msgstr "Veuillez changer le contenu de l'email"
    148197
     198#: C:\wamp\www\wordpress\wp-content\plugins\comment-contest/comment-contest.php:711
     199msgid "Wrong prizes number format! Or choose more winners than prizes!"
     200msgstr "Mauvais format pour les places !"
     201
  • comment-contest/trunk/readme.txt

    r152584 r154447  
    2323
    2424== Frequently Asked Questions ==
    25 TODO
     25
     26= Which PHP version I need? =
     27
     28You need PHP version 4 like Wordpress. The plugin is ready to run with PHP5 but it isn't activated.
    2629
    2730== Screenshots ==
     
    29322. Choose the article in which the contest is running
    30333. Choose the comments
    31 4. The winners are displayed
     344. Choose the prizes to win
     355. The winners are displayed
    3236
    3337== Changelog ==
     
    4751= 1.1.1b =
    4852* Send a mail to the winners at the end. You can choose to do so or not (not tested yet)
     53
     54= 1.1.1 =
     55* Bug fix : send a mail to winners (tested online)
     56* Bug fix : can display other posts
     57
     58= 1.1.2 =
     59* Add the possibility to choose between Normal Contest or Speed Contest. Speed Contest choose winners by sorting them by chronologic order
     60
     61= 1.2 =
     62* Set the prices to win
     63* Change PHP version for the main class. I migrate from PHP5 to version 4 because some servers still use PHP4 and PHP4 is the Wordpress recommandation
     64
     65= 1.3 =
     66* Change error message display (now it's the same message as Wordpress). Old values are put in the fields so the user don't have to type again the values
     67* New winners display
Note: See TracChangeset for help on using the changeset viewer.