Changeset 754147
- Timestamp:
- 08/09/2013 04:45:18 PM (13 years ago)
- Location:
- comment-contest/trunk
- Files:
-
- 7 added
- 1 deleted
- 12 edited
- 3 copied
-
comment-contest.php (modified) (3 diffs)
-
css (added)
-
css/comment-contest.css (added)
-
css/comment-contest.min.css (added)
-
css/index.html (copied) (copied from comment-contest/trunk/js/index.html)
-
img/help.png (added)
-
img/index.html (copied) (copied from comment-contest/trunk/js/index.html)
-
js/OrgZhyweb_WPCommentContest_jQuery.js (modified) (8 diffs)
-
js/OrgZhyweb_WPCommentContest_jQuery.min.js (added)
-
js/jquery.tipTip.minified.js (added)
-
lang/comment-contest-fr_FR.mo (modified) (previous)
-
lang/comment-contest-fr_FR.po (modified) (1 diff)
-
lang/index.html (copied) (copied from comment-contest/trunk/js/index.html)
-
php/OrgZhyweb_WPCommentContest_AbstractTableUI.php (modified) (1 diff)
-
php/OrgZhyweb_WPCommentContest_MainUI.php (modified) (4 diffs)
-
php/OrgZhyweb_WPCommentContest_TableRemoveUI.php (deleted)
-
php/OrgZhyweb_WPCommentContest_TableUI.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
screenshot-3.png (modified) (previous)
-
screenshot-4.png (modified) (previous)
-
screenshot-5.png (modified) (previous)
-
screenshot-6.png (modified) (previous)
-
screenshot-7.png (added)
Legend:
- Unmodified
- Added
- Removed
-
comment-contest/trunk/comment-contest.php
r688171 r754147 5 5 Description: If you create a contest on your website, you can draw all comments in a specific post 6 6 Author: Thomas "Zhykos" Cicognani 7 Version: 2. 07 Version: 2.1 8 8 Author URI: http://www.zhyweb.org/ 9 9 */ … … 69 69 */ 70 70 public function orgZhyweb_wpCommentContest_loadJsCSS() { 71 // Comment Contest Javascript file (needs jQuery )72 wp_register_script('OrgZhywebWPCommentContest.js', plugins_url('/js/OrgZhyweb_WPCommentContest_jQuery. js', __FILE__), array('jquery', 'jquery-ui-core', 'jquery-ui-dialog'));71 // Comment Contest Javascript file (needs jQuery, jQueryUI and jQueryUI Dialog) 72 wp_register_script('OrgZhywebWPCommentContest.js', plugins_url('/js/OrgZhyweb_WPCommentContest_jQuery.min.js', __FILE__), array('jquery', 'jquery-ui-core', 'jquery-ui-dialog')); 73 73 wp_enqueue_script('OrgZhywebWPCommentContest.js'); 74 75 // Tooltips by TipTip (needs jQuery) 76 wp_register_script('TipTip.js', plugins_url('/js/jquery.tipTip.minified.js', __FILE__), array('jquery')); 77 wp_enqueue_script('TipTip.js'); 74 78 75 79 // jQueryUI Dialog style 76 80 wp_enqueue_style('wp-jquery-ui-dialog'); 81 82 // Plugin CSS 83 wp_enqueue_style('comment-contest.css', plugins_url('/css/comment-contest.min.css', __FILE__)); 77 84 } 78 85 … … 99 106 100 107 /** 101 * Modify the posts table.102 108 * Display the content of the contest column. It's a link to contest page. 103 109 * If no comment posted, cannot launch contest. -
comment-contest/trunk/js/OrgZhyweb_WPCommentContest_jQuery.js
r688171 r754147 17 17 18 18 /* 19 * Display/Hide empty messages in table (messages shown because there isn't any comment in the table) 20 */ 21 function updateEmptyTableMessages() { 22 // Display/Hide "no comment found" message in Contest table 23 if (jQuery('#the-list-contest tr:visible').size() <= 0) { 24 jQuery("#comment-contest-not-found-tr").show(); 25 } else { 26 jQuery("#comment-contest-not-found-tr").hide(); 27 } 28 29 // Display/Hide "no comment found" message in Removed Comments table 30 if (jQuery('#the-list-no-contest tr:visible').size() <= 0) { 31 jQuery("#comment-no-contest-not-found-tr").show(); 32 } else { 33 jQuery("#comment-no-contest-not-found-tr").hide(); 34 } 35 } 36 37 /* 38 * Move comment into Removed Comments (table with comment which wont be used for contest) 19 * Selected comment won't be used for contest 20 * @param commentID Comment ID 21 * @since 2.0 39 22 */ 40 23 function commentContestDelete(commentID) { 41 jQuery("#comment-contest-" + commentID).hide(); 42 jQuery("#comment-no-contest-" + commentID).show(); 43 44 updateEmptyTableMessages(); 45 } 46 47 /* 48 * Move comment into Removed Comments (table with comment which wont be used for contest) 24 jQuery("#comment-contest-" + commentID).removeClass("cheatComment"); 25 jQuery("#comment-contest-" + commentID).addClass("removedComment"); 26 jQuery("#restoreLink-" + commentID).show(); 27 jQuery("#deleteLink-" + commentID).hide(); 28 29 jQuery("#stopCheatLink-" + commentID).hide(); 30 jQuery("#cheatLink-" + commentID).show(); 31 } 32 33 /* 34 * Selected comment must be used for contest 35 * @param commentID Comment ID 36 * @since 2.0 49 37 */ 50 38 function commentContestRestore(commentID) { 51 jQuery("#comment-contest-" + commentID).show(); 52 jQuery("#comment-no-contest-" + commentID).hide(); 53 54 updateEmptyTableMessages(); 39 jQuery("#comment-contest-" + commentID).removeClass("removedComment"); 40 jQuery("#deleteLink-" + commentID).show(); 41 jQuery("#restoreLink-" + commentID).hide(); 42 } 43 44 /** 45 * Selected comment will win (if winners number greater than cheating comments number) 46 * @param commentID Comment ID 47 * @since 2.1 48 */ 49 function commentContestCheat(commentID) { 50 jQuery("#comment-contest-" + commentID).removeClass("removedComment"); 51 jQuery("#comment-contest-" + commentID).addClass("cheatComment"); 52 jQuery("#stopCheatLink-" + commentID).show(); 53 jQuery("#cheatLink-" + commentID).hide(); 54 55 jQuery("#deleteLink-" + commentID).show(); 56 jQuery("#restoreLink-" + commentID).hide(); 57 } 58 59 /** 60 * Selected comment won't win anymore (except if it will be randomly choosen during the contest last step) 61 * @param commentID Comment ID 62 * @since 2.1 63 */ 64 function commentContestStopCheat(commentID) { 65 jQuery("#comment-contest-" + commentID).removeClass("cheatComment"); 66 jQuery("#stopCheatLink-" + commentID).hide(); 67 jQuery("#cheatLink-" + commentID).show(); 55 68 } 56 69 57 70 /* 58 71 * Select all comments in the table which have the role "roleID" 59 */ 60 function selectRoleInTable(roleID, tableID) { 72 * @since 2.1 73 */ 74 function selectRole(roleID) { 61 75 // Browse all table lines 62 jQuery('# ' + tableID + 'tr').each(function() {76 jQuery('#contestForm tr').each(function() { 63 77 var line = jQuery(this); 64 78 … … 78 92 79 93 /* 80 * Select all comments (in the contest table) which have the role "roleID"81 */82 function selectRoleInContest(roleID) {83 selectRoleInTable(roleID, "inContestForm");84 }85 86 /*87 * Select all comments (in the deleted comments table) which have the role "roleID"88 */89 function selectRoleInNoContest(roleID) {90 selectRoleInTable(roleID, "outContestForm");91 }92 93 /*94 94 * Shuffle an array 95 95 * @param myArray Array to shuffle 96 96 * @see http://sedition.com/perl/javascript-fy.html 97 * @since 2.0 97 98 */ 98 99 function fisherYates(myArray) { … … 113 114 114 115 jQuery(document).ready(function() { 115 // ------------------------ DELETE COMMENTS FROM CONTEST ------------------------------- 116 117 // ------------------------ Tooltips (Help) -------------------------------- 118 119 // Code from BackWPup - WordPress Backup Plugin 120 // http://marketpress.com/product/backwpup-pro/ 121 122 jQuery('.help').tipTip({ 123 'attribute': 'title', 124 'fadeIn': 50, 125 'fadeOut': 50, 126 'keepAlive': true, 127 'activation': 'hover', 128 'maxWidth': 400 129 }); 130 131 jQuery(".help").tipTip(); 132 133 // ------------------------ END Tooltips (Help) ---------------------------- 134 135 136 // ------------------------ DELETE COMMENTS FROM CONTEST ------------------- 137 /** 138 * Remove all checked comments 139 * @since 2.0 140 */ 116 141 function deleteSelectedComments() { 117 jQuery('# inContestForm input[id^="cb-select"]:checked').each(function(index, domElem) {142 jQuery('#contestForm input[id^="cb-select"]:checked').each(function(index, domElem) { 118 143 if (domElem.id.indexOf("-all-") == -1) { 119 144 commentContestDelete(jQuery(this).val()); … … 124 149 } 125 150 126 jQuery("# inContestForm #doaction").click(function() {127 if (jQuery('# inContestForm select[name="action"]').val() == 'delete') {151 jQuery("#contestForm #doaction").click(function() { 152 if (jQuery('#contestForm select[name="action"]').val() == 'delete') { 128 153 deleteSelectedComments(); 129 154 } 130 155 }); 131 156 132 jQuery("# inContestForm #doaction2").click(function() {133 if (jQuery('# inContestForm select[name="action2"]').val() == 'delete') {157 jQuery("#contestForm #doaction2").click(function() { 158 if (jQuery('#contestForm select[name="action2"]').val() == 'delete') { 134 159 deleteSelectedComments(); 135 160 } 136 161 }); 137 // ------------------------ end DELETE COMMENTS FROM CONTEST --------------------------- 138 139 140 // ------------------------ RESTORE COMMENTS FOR CONTEST ------------------------------- 162 // ------------------------ end DELETE COMMENTS FROM CONTEST --------------- 163 164 165 // ------------------------ RESTORE COMMENTS FOR CONTEST ------------------- 166 /** 167 * Restore all checked comments 168 * @since 2.0 169 */ 141 170 function restoreSelectedComments() { 142 jQuery('# outContestForm input[id^="cb-select"]:checked').each(function(index, domElem) {171 jQuery('#contestForm input[id^="cb-select"]:checked').each(function(index, domElem) { 143 172 if (domElem.id.indexOf("-all-") == -1) { 144 173 commentContestRestore(jQuery(this).val()); … … 149 178 } 150 179 151 jQuery("# outContestForm #doaction").click(function() {152 if (jQuery('# outContestForm select[name="action"]').val() == 'restore') {180 jQuery("#contestForm #doaction").click(function() { 181 if (jQuery('#contestForm select[name="action"]').val() == 'restore') { 153 182 restoreSelectedComments(); 154 183 } 155 184 }); 156 185 157 jQuery("# outContestForm #doaction2").click(function() {158 if (jQuery('# outContestForm select[name="action2"]').val() == 'restore') {186 jQuery("#contestForm #doaction2").click(function() { 187 if (jQuery('#contestForm select[name="action2"]').val() == 'restore') { 159 188 restoreSelectedComments(); 160 189 } 161 190 }); 162 // ------------------------ end RESTORE COMMENTS FOR CONTEST --------------- ------------163 164 165 // ------------------------ CHECK FORM VALUES-------------------------------191 // ------------------------ end RESTORE COMMENTS FOR CONTEST --------------- 192 193 194 // ------------------------ RESULT TABLE ----------------------------------- 166 195 jQuery("#dialog-modal-winners").dialog({ 167 196 height: 500, … … 171 200 dialogClass: 'wp-dialog', 172 201 open: function() { 202 // While opening the result dialog... 203 var nbWinners = jQuery('#zwpcc_nb_winners').val(); 204 var commentsNormal = new Array(); 205 var commentsCheat = new Array(); 206 173 207 // Get all comments ID which are used for the contest 174 var comments = new Array(); 175 jQuery('#inContestForm tr').each(function() { 208 jQuery('#contestForm tr').each(function() { 176 209 var line = jQuery(this); 177 if (line.css("display") != "none") { 178 // Get only displayed lines 210 211 // Get only normal et cheating lines 212 if (!line.hasClass("removedComment")) { 179 213 var commentID = line.find('.zhyweb_comment_contest_id').html(); 180 if (commentID != null && commentID != "") { 181 // Don't get table header and footer 182 comments.push(commentID); 214 215 // Don't get table header and footer 216 if (commentID != null && commentID != "") { 217 if (line.hasClass("cheatComment")) { 218 commentsCheat.push(commentID); 219 } else { 220 commentsNormal.push(commentID); 221 } 183 222 } 184 223 } … … 190 229 }); 191 230 192 // Randomize array 193 fisherYates(comments); 194 195 // Display winners 196 var nbWinners = jQuery('#zwpcc_nb_winners').val(); 197 for (var i = 0; i < nbWinners; i++) { 231 // Randomize arrays 232 fisherYates(commentsCheat); 233 if (commentsCheat.length < nbWinners) { 234 // Optimisation 235 fisherYates(commentsNormal); 236 } 237 238 // Show winners 239 var comments = jQuery.merge(commentsCheat, commentsNormal); 240 for (var i = 0; i < nbWinners && i < comments.length; i++) { 198 241 jQuery("#result-comment-contest-" + comments[i]).show(); 199 } 200 } 201 }); 202 242 if (i >= 1) { 243 // Sort table 244 jQuery("#result-comment-contest-" + comments[i - 1]).after(jQuery("#result-comment-contest-" + comments[i])); 245 } 246 } 247 } 248 }); 249 250 // Launch contest Button 203 251 jQuery("#zwpcc_form").submit(function() { 204 252 launch = true; … … 223 271 return false; 224 272 }); 225 // ------------------------ end CHECK FORM VALUES-------------------------------273 // ------------------------ end RESULT TABLE ------------------------------- 226 274 227 275 }); -
comment-contest/trunk/lang/comment-contest-fr_FR.po
r688171 r754147 3 3 "Project-Id-Version: Comment Contest v2.0\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: \n"6 "PO-Revision-Date: 2013-0 3-24 15:48:08+0000\n"7 "Last-Translator: Thomas 'zhykos'Cicognani <tcicognani@zhyweb.org>\n"5 "POT-Creation-Date: 2013-08-09 18:37+0100\n" 6 "PO-Revision-Date: 2013-08-09 18:38+0100\n" 7 "Last-Translator: Thomas \"Zhykos\" Cicognani <tcicognani@zhyweb.org>\n" 8 8 "Language-Team: \n" 9 "Language: fr_FR\n" 9 10 "MIME-Version: 1.0\n" 10 11 "Content-Type: text/plain; charset=UTF-8\n" 11 12 "Content-Transfer-Encoding: 8bit\n" 12 13 "Plural-Forms: nplurals=2; plural=n>1;\n" 13 "X-Generator: CSL v1.x\n" 14 "X-Poedit-Language: French\n" 15 "X-Poedit-Country: FRANCE\n" 16 "X-Poedit-SourceCharset: utf-8\n" 17 "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n" 14 "X-Generator: Poedit 1.5.5\n" 15 "X-Poedit-SourceCharset: UTF-8\n" 16 "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;" 17 "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n" 18 18 "X-Poedit-Basepath: \n" 19 "X- Poedit-Bookmarks:\n"19 "X-Textdomain-Support: yes\n" 20 20 "X-Poedit-SearchPath-0: .\n" 21 "X-Textdomain-Support: yes" 22 23 #: comment-contest.php: 8521 22 # @ comment-contest 23 #: comment-contest.php:92 php/OrgZhyweb_WPCommentContest_MainUI.php:64 24 24 #: php/OrgZhyweb_WPCommentContest_MainUI.php:65 25 #: php/OrgZhyweb_WPCommentContest_MainUI.php:66 26 #@ comment-contest 25 #: D:\www\zhyweb\wp-content\plugins\comment-contest/comment-contest.php:92 26 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:64 27 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:65 27 28 msgid "Comment Contest" 28 29 msgstr "Comment Contest" 29 30 30 #: comment-contest.php:96 31 #@ comment-contest 31 # @ comment-contest 32 #: comment-contest.php:103 33 #: D:\www\zhyweb\wp-content\plugins\comment-contest/comment-contest.php:103 32 34 msgid "Contest" 33 35 msgstr "Concours" 34 36 35 #: comment-contest.php:115 36 #: php/OrgZhyweb_WPCommentContest_MainUI.php:74 37 #@ comment-contest 37 # @ comment-contest 38 #: comment-contest.php:121 php/OrgZhyweb_WPCommentContest_MainUI.php:74 39 #: D:\www\zhyweb\wp-content\plugins\comment-contest/comment-contest.php:121 40 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:74 38 41 msgid "Launch contest" 39 42 msgstr "Lancer le concours" 40 43 41 #: comment-contest.php:117 42 #@ comment-contest 44 # @ comment-contest 45 #: comment-contest.php:123 46 #: D:\www\zhyweb\wp-content\plugins\comment-contest/comment-contest.php:123 43 47 msgid "No comment" 44 48 msgstr "Aucun commentaire" 45 49 50 # @ comment-contest 46 51 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:65 47 52 #: php/OrgZhyweb_WPCommentContest_TableResults.php:33 48 #@ comment-contest 53 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:65 54 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_TableResults.php:33 49 55 msgid "Author" 50 56 msgstr "Auteur" 51 57 58 # @ comment-contest 52 59 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:66 53 60 #: php/OrgZhyweb_WPCommentContest_TableResults.php:34 54 #@ comment-contest 61 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:66 62 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_TableResults.php:34 55 63 msgid "Comment" 56 64 msgstr "Commentaire" 57 65 66 # @ comment-contest 58 67 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:102 59 # , php-format60 # @ comment-contest68 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:102 69 #, php-format 61 70 msgid "Select: %s" 62 71 msgstr "Sélectionner : %s" 63 72 73 # @ comment-contest 64 74 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:135 65 # @ comment-contest75 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:135 66 76 msgid "Select comment" 67 77 msgstr "Sélectionner le commentaire" 68 78 69 # . translators: 2: comment date, 3: comment time79 # @ comment-contest 70 80 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:221 71 # , php-format72 # @ comment-contest81 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:221 82 #, php-format 73 83 msgid "Submitted on <a href=\"%1$s\">%2$s at %3$s</a>" 74 84 msgstr "Soumis le <a href=\"%1$s\">%2$s à %3$s</a>" 75 85 76 # . translators: comment date format. See http://php.net/date86 # @ comment-contest 77 87 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:222 78 # @ comment-contest88 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:222 79 89 msgid "Y/m/d" 80 90 msgstr "d / m / Y" 81 91 82 # . translators: comment time format. See http://php.net/date92 # @ comment-contest 83 93 #: php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:229 84 # , php-format85 # @ comment-contest94 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_AbstractTableUI.php:229 95 #, php-format 86 96 msgid "In reply to <a href=\"%1$s\">%2$s</a>." 87 97 msgstr "En réponse à <a href=\"%1$s\">%2$s</a>." 88 98 89 #: php/OrgZhyweb_WPCommentContest_MainUI.php:48 90 #@ comment-contest 99 # @ comment-contest 100 #: php/OrgZhyweb_WPCommentContest_MainUI.php:47 101 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:47 91 102 msgid "URL must have 'post' parameter as integer" 92 103 msgstr "Le paramètre 'post' dans l'URL doit être un nombre entier" 93 104 94 #: php/OrgZhyweb_WPCommentContest_MainUI.php:51 95 #@ comment-contest 105 # @ comment-contest 106 #: php/OrgZhyweb_WPCommentContest_MainUI.php:50 107 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:50 96 108 msgid "You have to be administrator to access this page" 97 msgstr "Vous devez disposer de droits d'administrateur pour accéder à cette page" 98 99 #: php/OrgZhyweb_WPCommentContest_MainUI.php:69 100 #, php-format 101 #@ comment-contest 109 msgstr "" 110 "Vous devez disposer de droits d'administrateur pour accéder à cette page" 111 112 # @ comment-contest 113 #: php/OrgZhyweb_WPCommentContest_MainUI.php:68 114 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:68 115 #, php-format 102 116 msgid "Contest on post \"%s\"" 103 117 msgstr "Concours pour l'article \"%s\"" 104 118 105 #: php/OrgZhyweb_WPCommentContest_MainUI.php:73 106 #@ comment-contest 119 # @ comment-contest 120 #: php/OrgZhyweb_WPCommentContest_MainUI.php:72 121 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:72 107 122 msgid "Number of winners:" 108 123 msgstr "Nombre de gagnants :" 109 124 125 #: php/OrgZhyweb_WPCommentContest_MainUI.php:73 126 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:73 127 msgid "Number of comments used to determine winners" 128 msgstr "Nombre de commentaires utilisés pour déterminer les gagnants" 129 130 # @ comment-contest 110 131 #: php/OrgZhyweb_WPCommentContest_MainUI.php:79 111 # @ comment-contest132 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:79 112 133 msgid "Winners" 113 134 msgstr "Gagnants" 114 135 136 # @ comment-contest 115 137 #: php/OrgZhyweb_WPCommentContest_MainUI.php:108 116 # @ comment-contest138 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:108 117 139 msgid "Comments used for the contest:" 118 140 msgstr "Commentaires utilisés pour le concours :" 119 141 120 #: php/OrgZhyweb_WPCommentContest_MainUI.php:117 121 #@ comment-contest 122 msgid "Not used comments:" 123 msgstr "Commentaires non utilisés :" 124 125 #: php/OrgZhyweb_WPCommentContest_MainUI.php:130 126 #@ comment-contest 142 #: php/OrgZhyweb_WPCommentContest_MainUI.php:109 143 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:109 144 msgid "" 145 "The table below shows all available comments. You have to choose which ones " 146 "you want for the contest.<br /> - You can select users who have the same " 147 "Wordpress role (see User page).<br /> - You can remove comments from contest " 148 "(don't be used to determine winners). Removed comments still are visible " 149 "with red background color.<br /> - You can also cheat by adding comments " 150 "into a cheating list. All cheating comments will always win! (only if the " 151 "cheating list length is less than the winners number). Cheating comments " 152 "still are visible with green background color.<br /> - The other comments " 153 "(white/grey background) are only used if there isn't enough cheating " 154 "comments." 155 msgstr "" 156 "Le tableau ci-dessous affiche tous les commentaires disponibles. Vous devez " 157 "choisir ceux à utiliser pour le concours.<br /> - Vous pouvez choisir des " 158 "utilisateurs ayant le même rôle Wordpress (voir la page des Utilisateurs)." 159 "<br /> - Vous pouvez supprimer un commentaire du concours (ne sera donc pas " 160 "utilisé pour déterminer les gagnants). Les commentaires supprimés seront " 161 "toujours visibles mais affichés avec un fond rouge.<br /> - Vous pouvez " 162 "aussi tricher en ajoutant des commentaires dans la liste de triche. Tous les " 163 "commentaires de triche gagnent ! (seulement si la liste de triche est plus " 164 "petite que le nombre de gagnants). Les commentaires de triche sont affichés " 165 "avec un fond vert.<br /> - Les autres comentaires (fond blanc/gris) ne sont " 166 "utilisés que s'il n'a pas assez de commentaire de triche." 167 168 # @ comment-contest 169 #: php/OrgZhyweb_WPCommentContest_MainUI.php:126 170 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:126 127 171 msgid "URL 'post' parameter has to be valid" 128 172 msgstr "Le paramètre 'post' dans l'URL n'est pas valide" 129 173 130 #: php/OrgZhyweb_WPCommentContest_MainUI.php:142 131 #, php-format 132 #@ comment-contest 133 msgid "To use the plug-in, go to <a href=\"%s\">articles page</a> then you'll find a link to launch contests" 134 msgstr "Pour utiliser le plug-in, aller à la <a href=\"%s\">page des articles</a> puis cliquez sur le lien dédié au lancement de concours" 135 136 #: php/OrgZhyweb_WPCommentContest_MainUI.php:144 137 #@ comment-contest 174 # @ comment-contest 175 #: php/OrgZhyweb_WPCommentContest_MainUI.php:138 176 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:138 177 #, php-format 178 msgid "" 179 "To use the plug-in, go to <a href=\"%s\">articles page</a> then you'll find " 180 "a link to launch contests" 181 msgstr "" 182 "Pour utiliser le plug-in, aller à la <a href=\"%s\">page des articles</a> " 183 "puis cliquez sur le lien dédié au lancement de concours" 184 185 # @ comment-contest 186 #: php/OrgZhyweb_WPCommentContest_MainUI.php:140 187 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:140 138 188 msgid "Support:" 139 189 msgstr "Support :" 140 190 141 #: php/OrgZhyweb_WPCommentContest_MainUI.php:145 142 #@ comment-contest 191 # @ comment-contest 192 #: php/OrgZhyweb_WPCommentContest_MainUI.php:141 193 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:141 143 194 msgid "Official page:" 144 195 msgstr "Page officielle :" 145 196 146 #: php/OrgZhyweb_WPCommentContest_MainUI.php:149 147 #@ comment-contest 197 # @ comment-contest 198 #: php/OrgZhyweb_WPCommentContest_MainUI.php:145 199 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_MainUI.php:145 148 200 msgid "Debug:" 149 201 msgstr "Debug :" 150 202 151 #: php/OrgZhyweb_WPCommentContest_TableRemoveUI.php:41 152 #: php/OrgZhyweb_WPCommentContest_TableRemoveUI.php:46 153 #@ comment-contest 203 # @ comment-contest 204 #: php/OrgZhyweb_WPCommentContest_TableUI.php:41 205 #: php/OrgZhyweb_WPCommentContest_TableUI.php:50 206 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_TableUI.php:41 207 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_TableUI.php:50 208 msgid "Delete" 209 msgstr "Supprimer" 210 211 # @ comment-contest 212 #: php/OrgZhyweb_WPCommentContest_TableUI.php:42 213 #: php/OrgZhyweb_WPCommentContest_TableUI.php:51 214 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_TableUI.php:42 215 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_TableUI.php:51 154 216 msgid "Restore" 155 217 msgstr "Restaurer" 156 218 157 #: php/OrgZhyweb_WPCommentContest_TableUI.php:41 158 #: php/OrgZhyweb_WPCommentContest_TableUI.php:46 159 #@ comment-contest 160 msgid "Delete" 161 msgstr "Supprimer" 162 219 #: php/OrgZhyweb_WPCommentContest_TableUI.php:43 220 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_TableUI.php:43 221 msgid "Cheat" 222 msgstr "Tricher" 223 224 #: php/OrgZhyweb_WPCommentContest_TableUI.php:44 225 #: D:\www\zhyweb\wp-content\plugins\comment-contest/php/OrgZhyweb_WPCommentContest_TableUI.php:44 226 msgid "Stop cheating" 227 msgstr "Ne plus tricher" -
comment-contest/trunk/php/OrgZhyweb_WPCommentContest_AbstractTableUI.php
r688171 r754147 248 248 foreach ($actions as $action => $link) { 249 249 ++$i; 250 if ($i == 1) { 251 $sep = ''; 252 } else { 250 $sep = ''; 251 if ($i == 3) { 253 252 $sep = ' | '; 254 253 } -
comment-contest/trunk/php/OrgZhyweb_WPCommentContest_MainUI.php
r688171 r754147 18 18 19 19 require_once 'OrgZhyweb_WPCommentContest_TableUI.php'; 20 require_once 'OrgZhyweb_WPCommentContest_TableRemoveUI.php';21 20 require_once 'OrgZhyweb_WPCommentContest_TableResults.php'; 22 21 … … 71 70 // Contest parameters 72 71 echo "<div id=\"zwpcc_error_message\" style=\"color: red\"></div>" 73 . __('Number of winners:', "comment-contest") . " <input type=\"text\" id=\"zwpcc_nb_winners\" value=\"1\"/><br /><br />" 72 . __('Number of winners:', "comment-contest") . " <input type=\"text\" id=\"zwpcc_nb_winners\" value=\"1\"/>" 73 . "<img src=\"$this->pluginDir/img/help.png\" alt=\"Help\" class=\"help\" title=\"". __('Number of comments used to determine winners', "comment-contest") . "\" /><br /><br />" 74 74 . "<input type=\"submit\" class=\"button action\" value=\"" . __('Launch contest', "comment-contest") . "\" />"; 75 75 … … 106 106 $this->displayHeaderPage($postID); 107 107 108 echo "<br /><br /><hr /><h3>" . __('Comments used for the contest:', "comment-contest") . "</h3> 109 <div id='inContestForm'>"; 108 echo "<br /><br /><hr /><h3 style=\"float: left;\">" . __('Comments used for the contest:', "comment-contest") . "</h3> 109 <img src=\"$this->pluginDir/img/help.png\" alt=\"Help\" class=\"help\" id=\"mainHelp\" title=\"". __("The table below shows all available comments. You have to choose which ones you want for the contest.<br />" 110 . " - You can select users who have the same Wordpress role (see User page).<br />" 111 . " - You can remove comments from contest (don't be used to determine winners). Removed comments still are visible with red background color.<br />" 112 . " - You can also cheat by adding comments into a cheating list. All cheating comments will always win! (only if the cheating list length is less than the winners number). Cheating comments still are visible with green background color.<br />" 113 . " - The other comments (white/grey background) are only used if there isn't enough cheating comments.", "comment-contest") . "\" /> 114 <div id='contestForm'>"; 110 115 111 116 $list = new OrgZhyweb_WPCommentContest_TableUI($postID); … … 113 118 $list->views(); 114 119 $list->display(); 115 116 echo "</div><br /><hr />117 <h3>" . __('Not used comments:', "comment-contest") . "</h3>118 <div id='outContestForm'>";119 120 $list2 = new OrgZhyweb_WPCommentContest_TableRemoveUI($postID);121 $list2->prepare_items();122 $list2->views();123 $list2->display();124 120 125 121 echo "</div>"; -
comment-contest/trunk/php/OrgZhyweb_WPCommentContest_TableUI.php
r688171 r754147 39 39 protected function getActions($commentID) { 40 40 $actions = array( 41 'delete' => "<a href='javascript:;' onclick='commentContestDelete($commentID)' class='delete'>" . __('Delete', "comment-contest") . '</a>'); 41 'delete' => "<a href='javascript:;' onclick='commentContestDelete($commentID)' id='deleteLink-$commentID' class='delete'>" . __('Delete', "comment-contest") . '</a>', 42 'restore' => "<a href='javascript:;' onclick='commentContestRestore($commentID)' id='restoreLink-$commentID' class='restoreLink'>" . __('Restore', "comment-contest") . '</a>', 43 'cheat' => "<a href='javascript:;' onclick='commentContestCheat($commentID)' id='cheatLink-$commentID' class='cheatLink'>" . __('Cheat', "comment-contest") . '</a>', 44 'stopcheat' => "<a href='javascript:;' onclick='commentContestStopCheat($commentID)' id='stopCheatLink-$commentID' class='stopCheatLink'>" . __('Stop cheating', "comment-contest") . '</a>'); 42 45 return $actions; 43 46 } 44 47 45 48 public function get_bulk_actions() { 46 $actions = array('delete' => __('Delete', "comment-contest")); 49 $actions = array( 50 'delete' => __('Delete', "comment-contest"), 51 'restore' => __('Restore', "comment-contest")); 47 52 return $actions; 48 53 } 49 54 50 55 protected function getViewFunction($roleID) { 51 return "selectRole InContest(\"$roleID\")";56 return "selectRole(\"$roleID\")"; 52 57 } 53 58 } -
comment-contest/trunk/readme.txt
r688171 r754147 4 4 Tags: comments, contest, concours, commentaire, zhykos, zhyweb 5 5 Requires at least: 3.3 6 Tested up to: 3. 5.16 Tested up to: 3.6 7 7 Stable tag: trunk 8 8 License: GPLv2 or later … … 43 43 3. Manage the comments 44 44 4. Choose to delete a comment from the contest 45 5. You can restore deleted comments 46 6. Result table with winner(s) 45 5. You can restore deleted comments (deleted comments are red) 46 6. Cheat: this comment will win! (cheating comments are green) 47 7. Result table with winner(s) 47 48 48 49 == Changelog == 50 51 = 2.1 = 52 * Fix: Result array wasn't sorted (most recent comment was always on the top) 53 * New: Add cheat. Selected comments always win 54 * New: Add help 55 * Update: Only use one table to choose comments 56 * Misc: Check compatibility with Wordpress 3.6 57 * Misc: Minimize Javascript and CSS 49 58 50 59 = 2.0 = … … 122 131 * Compatibility with Wordpress 3.5.1 123 132 133 = 2.1 = 134 * New table 135 * Cheat and help added 136 * Compatibility with Wordpress 3.6 137 124 138 == Credits == 125 139 126 140 = Images = 127 141 * Comment contest icon is based on http://www.iconfinder.com/icondetails/49848/128/media_random_shuffle_icon and http://www.iconfinder.com/icondetails/33565/64/chat_comment_talk_icon 142 * Help icon by http://www.visualpharm.com/
Note: See TracChangeset
for help on using the changeset viewer.