Changeset 35511
- Timestamp:
- 03/19/08 21:29:02 (4 months ago)
- Files:
-
- wp-polls/trunk/polls-admin-js-packed.js (modified) (1 diff)
- wp-polls/trunk/polls-admin-js.js (modified) (7 diffs)
- wp-polls/trunk/polls-manager.php (modified) (11 diffs)
- wp-polls/trunk/polls-options.php (modified) (5 diffs)
- wp-polls/trunk/polls-uninstall.php (modified) (2 diffs)
- wp-polls/trunk/polls-usage.php (deleted)
- wp-polls/trunk/readme.html (modified) (2 diffs)
- wp-polls/trunk/tinymce/plugins/polls/editor_plugin.js (modified) (1 diff)
- wp-polls/trunk/tinymce/plugins/polls/images (deleted)
- wp-polls/trunk/tinymce/plugins/polls/img (added)
- wp-polls/trunk/tinymce/plugins/polls/img/poll.gif (added)
- wp-polls/trunk/tinymce/plugins/polls/langs/en.js (modified) (1 diff)
- wp-polls/trunk/wp-polls.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wp-polls/trunk/polls-admin-js-packed.js
r31879 r35511 1 eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(' x 1=1D 1t(1l);x f=0;x u=0;x F=0;5 P(){3.2(\'4\').8.7="i";g.e("4",h,k,"#s");g.e("l-"+f,h,D,"#O");N("M()",D)}5 M(){3.2("1d").J(3.2("l-"+f))}5 1b(a,b){17=m(b);9(17){f=a;1.p();1.6("r",1s);1.6("v",a);1.j=\'t\';1.n=\'4\';1.o=P;1.q()}}5 19(){3.2(\'4\').8.7="i";g.e("4",h,k,"#s");3.2("S").A=18}5 1f(a){z=m(a);9(z){9(3.2("y").Q==R){1.p();1.6("r",1e);1.6("y","L");1.j=\'t\';1.n=\'4\';1.o=19;1.q()}G{K(1c)}}}5 I(){3.2(\'4\').8.7="i";g.e("4",h,k,"#s");3.2("S").A=18;3.2("1a").8.7=\'E\';3.2("1A").8.7=\'i\'}5 1z(a,b){z=m(b);9(z){9(3.2("y").Q==R){f=a;1.p();1.6("r",1y);1.6("y","L");1.6("v",a);1.j=\'t\';1.n=\'4\';1.o=I;1.q()}G{K(1x)}}}5 16(){3.2(\'4\').8.7="i";g.e("4",h,k,"#s");g.e("l-15-"+u,h,D,"#O");N("14()",D);3.2(\'C\').A=(w(3.2(\'C\').A)-w(F));C=w(3.2(\'13\').H);12=w(3.2("1w-"+u).H);B=(C-12);9(B<0){B=0}3.2(\'13\').H=w(B)}5 14(){3.2("1v").J(3.2("l-15-"+u))}5 1u(a,b,c,d){Y=m(d);9(Y){f=a;u=b;F=c;1.p();1.6("r",1r);1.6("v",a);1.6("1q",b);1.j=\'t\';1.n=\'4\';1.o=16;1.q()}}5 X(){3.2(\'4\').8.7="i";g.e("4",h,k,"#s");3.2("W").8.7="E";3.2("10").8.7="V"}5 1p(a,b){U=m(b);9(U){f=a;1.p();1.6("r",1o);1.6("v",a);1.j=\'t\';1.n=\'4\';1.o=X;1.q()}}5 T(){3.2(\'4\').8.7="i";g.e("4",h,k,"#s");3.2("W").8.7="V";3.2("10").8.7="E"}5 1n(a,b){Z=m(b);9(Z){f=a;1.p();1.6("r",1m);1.6("v",a);1.j=\'t\';1.n=\'4\';1.o=T;1.q()}}5 1k(a,b){x c=11(1j);1i(1h(c)){c=11(1g)}9(c>0){9(a==\'1B\'){1C(b,\'[l=\'+c+\']\')}G{1E\'[l=\'+c+\']\'}}}',62,103,'|polls_admin|getElementById|document|message|function|setVar|display|style|if|||||fade_element|global_poll_id|Fat|null|block|method|3000|poll|confirm|element|onCompletion|reset|runAJAX|do|FFFF00|POST|global_poll_aid|pollq_id|parseInt|var|delete_logs_yes|delete_poll_logs_confirm|innerHTML|poll_total_votes_new|poll_total_votes|1000|none|global_poll_aid_votes|else|value|delete_this_poll_logs_message|removeChild|alert|yes|remove_poll|setTimeout|FF3333|delete_poll_message|checked|true|poll_logs|closing_poll_message|open_poll_confirm|inline|open_poll|opening_poll_message|delete_poll_ans_confirm|close_poll_confirm|close_poll|prompt|poll_answer_vote|pollq_totalvotes|remove_poll_ans|answer|delete_poll_ans_message|delete_poll_confirm|polls_admin_text_no_poll_logs|delete_poll_logs_message|poll_logs_display|delete_poll|polls_admin_text_checkbox_delete_all_logs|manage_polls|polls_admin_text_delete_all_logs|delete_poll_logs|polls_admin_text_enter_poll_id_again|isNaN|while|polls_admin_text_enter_poll_id|insertPoll|polls_admin_ajax_url|polls_admin_text_close_poll|closing_poll|polls_admin_text_open_poll|opening_poll|polla_aid|polls_admin_text_delete_poll_ans|polls_admin_text_delete_poll|sack|delete_poll_ans|poll_answers|polla_votes|polls_admin_text_checkbox_delete_poll_logs|polls_admin_text_delete_poll_logs|delete_this_poll_logs|poll_logs_display_none|code|edInsertContent|new|return'.split('|'),0,{}))1 eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('o 1=1x 1n(1d);o e=0;o u=0;o A=0;4 K(){2.3(\'8\').7.6="f";Y("S()",R)}4 S(){2.3("1j").W(2.3("w-"+e))}4 1a(a,b){E=k(b);9(E){e=a;1.l();1.5("n",1w);1.5("p",a);1.g=\'i\';1.j=\'8\';1.m=K;1.h()}}4 M(){2.3(\'8\').7.6="f";2.3("N").s=12}4 1h(a){r=k(a);9(r){9(2.3("t").J==I){1.l();1.5("n",19);1.5("t","H");1.g=\'i\';1.j=\'8\';1.m=M;1.h()}z{G(18)}}}4 F(){2.3(\'8\').7.6="f";2.3("N").s=12;2.3("17").7.6=\'y\';2.3("16").7.6=\'f\'}4 15(a,b){r=k(b);9(r){9(2.3("t").J==I){e=a;1.l();1.5("n",14);1.5("t","H");1.5("p",a);1.g=\'i\';1.j=\'8\';1.m=F;1.h()}z{G(13)}}}4 D(){2.3(\'8\').7.6="f";Y("C()",R);2.3(\'x\').s=(q(2.3(\'x\').s)-q(A));x=q(2.3(\'11\').B);10=q(2.3("1v-"+u).B);v=(x-10);9(v<0){v=0}2.3(\'11\').B=q(v)}4 C(){2.3("1t").W(2.3("w-1s-"+u))}4 1r(a,b,c,d){X=k(d);9(X){e=a;u=b;A=c;1.l();1.5("n",1q);1.5("p",a);1.5("1o",b);1.g=\'i\';1.j=\'8\';1.m=D;1.h()}}4 V(){2.3(\'8\').7.6="f";2.3("U").7.6="y";2.3("T").7.6="L"}4 1m(a,b){Q=k(b);9(Q){e=a;1.l();1.5("n",1l);1.5("p",a);1.g=\'i\';1.j=\'8\';1.m=V;1.h()}}4 P(){2.3(\'8\').7.6="f";2.3("U").7.6="L";2.3("T").7.6="y"}4 1k(a,b){O=k(b);9(O){e=a;1.l();1.5("n",1i);1.5("p",a);1.g=\'i\';1.j=\'8\';1.m=P;1.h()}}4 1p(a,b){o c=Z(1g);1f(1e(c)){c=Z(1u)}9(c>0){9(a==\'1c\'){1b(b,\'[w=\'+c+\']\')}z{1y\'[w=\'+c+\']\'}}}',62,97,'|polls_admin|document|getElementById|function|setVar|display|style|message|if|||||global_poll_id|block|method|runAJAX|POST|element|confirm|reset|onCompletion|do|var|pollq_id|parseInt|delete_poll_logs_confirm|innerHTML|delete_logs_yes|global_poll_aid|poll_total_votes_new|poll|poll_total_votes|none|else|global_poll_aid_votes|value|remove_poll_ans|delete_poll_ans_message|delete_poll_confirm|delete_this_poll_logs_message|alert|yes|true|checked|delete_poll_message|inline|delete_poll_logs_message|poll_logs|close_poll_confirm|closing_poll_message|open_poll_confirm|1000|remove_poll|close_poll|open_poll|opening_poll_message|removeChild|delete_poll_ans_confirm|setTimeout|prompt|poll_answer_vote|pollq_totalvotes|polls_admin_text_no_poll_logs|polls_admin_text_checkbox_delete_poll_logs|polls_admin_text_delete_poll_logs|delete_this_poll_logs|poll_logs_display_none|poll_logs_display|polls_admin_text_checkbox_delete_all_logs|polls_admin_text_delete_all_logs|delete_poll|edInsertContent|code|polls_admin_ajax_url|isNaN|while|polls_admin_text_enter_poll_id|delete_poll_logs|polls_admin_text_close_poll|manage_polls|closing_poll|polls_admin_text_open_poll|opening_poll|sack|polla_aid|insertPoll|polls_admin_text_delete_poll_ans|delete_poll_ans|answer|poll_answers|polls_admin_text_enter_poll_id_again|polla_votes|polls_admin_text_delete_poll|new|return'.split('|'),0,{})) wp-polls/trunk/polls-admin-js.js
r26538 r35511 2 2 +----------------------------------------------------------------+ 3 3 | | 4 | WordPress 2. 3Plugin: WP-Polls 2.30 |5 | Copyright (c) 200 7Lester "GaMerZ" Chan |4 | WordPress 2.5 Plugin: WP-Polls 2.30 | 5 | Copyright (c) 2008 Lester "GaMerZ" Chan | 6 6 | | 7 7 | File Written By: | … … 25 25 function delete_poll_message() { 26 26 document.getElementById('message').style.display = "block"; 27 Fat.fade_element("message", null, 3000, "#FFFF00");28 Fat.fade_element("poll-" + global_poll_id, null, 1000, "#FF3333");29 27 setTimeout("remove_poll()", 1000); 30 28 } … … 53 51 function delete_poll_logs_message() { 54 52 document.getElementById('message').style.display = "block"; 55 Fat.fade_element("message", null, 3000, "#FFFF00");56 53 document.getElementById("poll_logs").innerHTML = polls_admin_text_no_poll_logs; 57 54 } … … 78 75 function delete_this_poll_logs_message() { 79 76 document.getElementById('message').style.display = "block"; 80 Fat.fade_element("message", null, 3000, "#FFFF00");81 77 document.getElementById("poll_logs").innerHTML = polls_admin_text_no_poll_logs; 82 78 document.getElementById("poll_logs_display").style.display = 'none'; … … 107 103 function delete_poll_ans_message() { 108 104 document.getElementById('message').style.display = "block"; 109 Fat.fade_element("message", null, 3000, "#FFFF00");110 Fat.fade_element("poll-answer-" + global_poll_aid, null, 1000, "#FF3333");111 105 setTimeout("remove_poll_ans()", 1000); 112 106 document.getElementById('poll_total_votes').innerHTML = (parseInt(document.getElementById('poll_total_votes').innerHTML) - parseInt(global_poll_aid_votes)); … … 146 140 function opening_poll_message() { 147 141 document.getElementById('message').style.display = "block"; 148 Fat.fade_element("message", null, 3000, "#FFFF00");149 142 document.getElementById("open_poll").style.display = "none"; 150 143 document.getElementById("close_poll").style.display = "inline"; … … 169 162 function closing_poll_message() { 170 163 document.getElementById('message').style.display = "block"; 171 Fat.fade_element("message", null, 3000, "#FFFF00");172 164 document.getElementById("open_poll").style.display = "inline"; 173 165 document.getElementById("close_poll").style.display = "none"; wp-polls/trunk/polls-manager.php
r31879 r35511 3 3 +----------------------------------------------------------------+ 4 4 | | 5 | WordPress 2. 3Plugin: WP-Polls 2.30 |6 | Copyright (c) 200 7Lester "GaMerZ" Chan |5 | WordPress 2.5 Plugin: WP-Polls 2.30 | 6 | Copyright (c) 2008 Lester "GaMerZ" Chan | 7 7 | | 8 8 | File Written By: | … … 255 255 poll_option.setAttribute('id', "pollq-multiple-" + (count_poll_answer+1)); 256 256 // Elements - TD/TR 257 if(count_poll_answer%2 != 0) { poll_tr.style.background = "#eee"; }258 257 poll_tr.setAttribute('id', "poll-answer-new-" + count_poll_answer_new); 259 258 poll_td1.setAttribute('width', "20%"); … … 296 295 /* ]]> */ 297 296 </script> 298 <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade">'.stripslashes($text).'</div>'; } else { echo '<div id="message" class="updated" style="display: none;"></div>'; } ?>299 297 300 298 <!-- Edit Poll --> … … 304 302 <div class="wrap"> 305 303 <h2><?php _e('Edit Poll', 'wp-polls'); ?></h2> 304 305 <?php if(!empty($text)) { echo '<!-- Last Action --><br class="clear" /><div id="message" class="updated fade">'.stripslashes($text).'</div>'; } else { echo '<div id="message" class="updated" style="display: none;"></div>'; } ?> 306 306 307 <!-- Poll Question --> 307 308 <h3><?php _e('Poll Question', 'wp-polls'); ?></h3> 308 <table width="100%" border="0" cellspacing="3" cellpadding="3">309 <tr style="background-color: #eee;">310 <t d width="20%"><strong><?php _e('Question', 'wp-polls') ?></strong></td>309 <table class="form-table"> 310 <tr> 311 <th scope="row" valign="top"><?php _e('Question', 'wp-polls') ?></th> 311 312 <td width="80%"><input type="text" size="70" name="pollq_question" value="<?php echo htmlspecialchars($poll_question_text); ?>" /></td> 312 313 </tr> … … 314 315 <!-- Poll Answers --> 315 316 <h3><?php _e('Poll Answers', 'wp-polls'); ?></h3> 316 <table width="100%" border="0" cellspacing="3" cellpadding="3">317 <table class="form-table"> 317 318 <thead> 318 <tr class="thead">319 <td width="20%"><strong><?php _e('Answer No. :', 'wp-polls') ?></strong></td>320 <td width="60%"><strong><?php _e('Answer Text :', 'wp-polls') ?></strong></td>319 <tr > 320 <td width="20%"><strong><?php _e('Answer No.', 'wp-polls') ?></strong></td> 321 <td width="60%"><strong><?php _e('Answer Text', 'wp-polls') ?></strong></td> 321 322 <td width="20%" align="right"><strong><?php _e('No. Of Votes', 'wp-polls') ?></strong></td> 322 323 </tr> … … 330 331 $pollip_answers[0] = __('Null Votes', 'wp-polls'); 331 332 foreach($poll_answers as $poll_answer) { 332 if($i%2 == 0) {333 $style = 'style=\'background: none;\'';334 } else {335 $style = 'style=\'background-color: #eee;\'';336 }337 333 $polla_aid = intval($poll_answer->polla_aid); 338 334 $polla_answers = stripslashes($poll_answer->polla_answers); 339 335 $polla_votes = intval($poll_answer->polla_votes); 340 336 $pollip_answers[$polla_aid] = $polla_answers; 341 echo "<tr id=\"poll-answer-$polla_aid\" $style>\n";337 echo "<tr id=\"poll-answer-$polla_aid\">\n"; 342 338 echo '<td width="20%"><strong>'.sprintf(__('Answer %s:', 'wp-polls'), $i).'</strong></td>'."\n"; 343 339 echo "<td width=\"60%\"><input type=\"text\" size=\"50\" maxlength=\"200\" name=\"polla_aid-$polla_aid\" value=\"".htmlspecialchars($polla_answers)."\" /> "; … … 365 361 <!-- Poll Multiple Answers --> 366 362 <h3><?php _e('Poll Multiple Answers', 'wp-polls') ?></h3> 367 <table width="100%" border="0" cellspacing="3" cellpadding="3">368 <tr style="background-color: #eee;">363 <table class="form-table"> 364 <tr> 369 365 <td width="40%" valign="top"><strong><?php _e('Allows Users To Select More Than One Answer?', 'wp-polls'); ?></strong></td> 370 366 <td width="60%"> … … 394 390 <!-- Poll Start/End Date --> 395 391 <h3><?php _e('Poll Start/End Date', 'wp-polls'); ?></h3> 396 <table width="100%" border="0" cellspacing="3" cellpadding="3">397 <tr style="background-color: #eee;">392 <table class="form-table"> 393 <tr> 398 394 <td width="20%" valign="top"><strong><?php _e('Start Date/Time', 'wp-polls'); ?></strong>:</td> 399 395 <td width="80%"> … … 456 452 <!-- Last Action --> 457 453 <div id="message" class="updated" style="display: none;"></div> 458 454 459 455 <!-- Manage Polls --> 460 456 <div class="wrap"> 461 457 <h2><?php _e('Manage Polls', 'wp-polls'); ?></h2> 462 <table width="100%" border="0" cellspacing="3" cellpadding="3"> 458 <br style="clear" /> 459 <table class="widefat"> 463 460 <thead> 464 <tr class="thead">461 <tr> 465 462 <th><?php _e('ID', 'wp-polls'); ?></th> 466 463 <th><?php _e('Question', 'wp-polls'); ?></th> … … 498 495 } 499 496 if($i%2 == 0) { 500 $style = ' style=\'background-color: #eee;\'';497 $style = 'class="alternate"'; 501 498 } else { 502 $style = ' style=\'background: none;\'';499 $style = ''; 503 500 } 504 501 if($current_poll > 0) { 505 502 if($current_poll == $poll_id) { 506 $style = ' style=\'background-color: #b8d4ff;\'';503 $style = 'class="highlight"'; 507 504 } 508 505 } elseif($current_poll == 0) { 509 506 if($poll_id == $latest_poll) { 510 $style = ' style=\'background-color: #b8d4ff;\'';507 $style = 'class="highlight"'; 511 508 } 512 509 } else if(in_array($poll_id, $multiple_polls)) { 513 $style = ' style=\'background-color: #b8d4ff;\'';510 $style = 'class="highlight"'; 514 511 } 515 512 echo "<tr id=\"poll-$poll_id\" $style>\n"; … … 556 553 </table> 557 554 </div> 555 <p> </p> 556 558 557 <!-- Polls Stats --> 559 558 <div class="wrap"> 560 559 <h2><?php _e('Polls Stats', 'wp-polls'); ?></h2> 561 <table border="0" cellspacing="3" cellpadding="3"> 560 <br style="clear" /> 561 <table class="widefat"> 562 562 <tr> 563 <th align="left"><?php _e('Total Polls :', 'wp-polls'); ?></th>563 <th align="left"><?php _e('Total Polls', 'wp-polls'); ?></th> 564 564 <td align="left"><?php echo $i; ?></td> 565 565 </tr> 566 <tr >567 <th align="left"><?php _e('Total Polls\' Answers :', 'wp-polls'); ?></th>566 <tr class="alternate"> 567 <th align="left"><?php _e('Total Polls\' Answers', 'wp-polls'); ?></th> 568 568 <td align="left"><?php echo number_format_i18n($total_ans); ?></td> 569 569 </tr> 570 570 <tr> 571 <th align="left"><?php _e('Total Votes Casted :', 'wp-polls'); ?></th>571 <th align="left"><?php _e('Total Votes Casted', 'wp-polls'); ?></th> 572 572 <td align="left"><?php echo number_format_i18n($total_votes); ?></td> 573 573 </tr> 574 <tr >575 <th align="left"><?php _e('Total Voters :', 'wp-polls'); ?></th>574 <tr class="alternate"> 575 <th align="left"><?php _e('Total Voters', 'wp-polls'); ?></th> 576 576 <td align="left"><?php echo number_format_i18n($total_voters); ?></td> 577 577 </tr> 578 578 </table> 579 579 </div> 580 <p> </p> 581 580 582 <!-- Delete Polls Logs --> 581 583 <div class="wrap"> 582 584 <h2><?php _e('Polls Logs', 'wp-polls'); ?></h2> 585 <br style="clear" /> 583 586 <div align="center" id="poll_logs"> 584 587 <?php wp-polls/trunk/polls-options.php
r22706 r35511 49 49 $poll_close = intval($_POST['poll_close']); 50 50 $poll_logging_method = intval($_POST['poll_logging_method']); 51 $poll_cookielog_expiry = intval($_POST['poll_cookielog_expiry']); 51 52 $poll_allowtovote = intval($_POST['poll_allowtovote']); 52 53 $update_poll_queries = array(); … … 65 66 $update_poll_queries[] = update_option('poll_close', $poll_close); 66 67 $update_poll_queries[] = update_option('poll_logging_method', $poll_logging_method); 68 $update_poll_queries[] = update_option('poll_cookielog_expiry', $poll_cookielog_expiry); 67 69 $update_poll_queries[] = update_option('poll_allowtovote', $poll_allowtovote); 68 70 $update_poll_text[] = __('Poll Bar Style', 'wp-polls'); … … 79 81 $update_poll_text[] = __('Poll Close Option', 'wp-polls'); 80 82 $update_poll_text[] = __('Logging Method', 'wp-polls'); 83 $update_poll_text[] = __('Cookie And Log Expiry Option', 'wp-polls'); 81 84 $update_poll_text[] = __('Allow To Vote Option', 'wp-polls'); 82 85 $i=0; … … 130 133 <div class="wrap"> 131 134 <h2><?php _e('Poll Options', 'wp-polls'); ?></h2> 132 <p class="submit">133 <input type="submit" name="Submit" class="button" value="<?php _e('Update Options »', 'wp-polls'); ?>" />134 </p>135 135 <fieldset class="options"> 136 136 <legend><?php _e('Poll Bar Style', 'wp-polls'); ?></legend> … … 297 297 </td> 298 298 </tr> 299 <tr valign="top"> 300 <th align="left" width="30%"><?php _e('Expiry Time For Cookie And Log:', 'wp-polls'); ?></th> 301 <td align="left"><input type="text" name="poll_cookielog_expiry" value="<?php echo intval(get_option('poll_cookielog_expiry')); ?>" size="10" /> <?php _e('seconds (0 to disable)', 'wp-polls'); ?></td> 302 </tr> 299 303 </table> 300 304 </fieldset> wp-polls/trunk/polls-uninstall.php
r22648 r35511 3 3 +----------------------------------------------------------------+ 4 4 | | 5 | WordPress 2. 3Plugin: WP-Polls 2.30 |6 | Copyright (c) 200 7Lester "GaMerZ" Chan |5 | WordPress 2.5 Plugin: WP-Polls 2.30 | 6 | Copyright (c) 2008 Lester "GaMerZ" Chan | 7 7 | | 8 8 | File Written By: | … … 29 29 $mode = trim($_GET['mode']); 30 30 $polls_tables = array($wpdb->pollsq, $wpdb->pollsa, $wpdb->pollsip); 31 $polls_settings = array('poll_template_voteheader', 'poll_template_votebody', 'poll_template_votefooter', 'poll_template_resultheader', 'poll_template_resultbody', 'poll_template_resultbody2', 'poll_template_resultfooter', 'poll_template_resultfooter2', 'poll_template_disable', 'poll_template_error', 'poll_currentpoll', 'poll_latestpoll', 'poll_archive_perpage', 'poll_ans_sortby', 'poll_ans_sortorder', 'poll_ans_result_sortby', 'poll_ans_result_sortorder', 'poll_logging_method', 'poll_allowtovote', 'poll_archive_show', 'poll_archive_url', 'poll_bar', 'poll_close', 'poll_ajax_style', 'poll_template_pollarchivelink', 'widget_polls', 'poll_archive_displaypoll', 'poll_template_pollarchiveheader', 'poll_template_pollarchivefooter' );31 $polls_settings = array('poll_template_voteheader', 'poll_template_votebody', 'poll_template_votefooter', 'poll_template_resultheader', 'poll_template_resultbody', 'poll_template_resultbody2', 'poll_template_resultfooter', 'poll_template_resultfooter2', 'poll_template_disable', 'poll_template_error', 'poll_currentpoll', 'poll_latestpoll', 'poll_archive_perpage', 'poll_ans_sortby', 'poll_ans_sortorder', 'poll_ans_result_sortby', 'poll_ans_result_sortorder', 'poll_logging_method', 'poll_allowtovote', 'poll_archive_show', 'poll_archive_url', 'poll_bar', 'poll_close', 'poll_ajax_style', 'poll_template_pollarchivelink', 'widget_polls', 'poll_archive_displaypoll', 'poll_template_pollarchiveheader', 'poll_template_pollarchivefooter', 'poll_cookielog_expiry'); 32 32 33 33 wp-polls/trunk/readme.html
r29848 r35511 236 236 <p> 237 237 <strong>Download:</strong><br /> 238 <strong>»</strong> <a href="http://lesterchan.net/others/downloads.php?id=10" title="http://lesterchan.net/others/downloads.php?id=10">WP-Polls 2.30 For WordPress 2. 3.x</a><br />239 <strong>»</strong> <a href="http://lesterchan.net/others/downloads/wp-polls220.zip" title="http://lesterchan.net/others/downloads/wp-polls220.zip">WP-Polls 2.20 For WordPress 2.1.x And 2.2.x</a><br />238 <strong>»</strong> <a href="http://lesterchan.net/others/downloads.php?id=10" title="http://lesterchan.net/others/downloads.php?id=10">WP-Polls 2.30 For WordPress 2.5.x</a><br /> 239 <strong>»</strong> <a href="http://lesterchan.net/others/downloads/wp-polls220.zip" title="http://lesterchan.net/others/downloads/wp-polls220.zip">WP-Polls 2.20 For WordPress 2.1.x, 2.2.x And 2.3.x</a><br /> 240 240 <strong>»</strong> <a href="http://lesterchan.net/others/downloads/wp-polls213.zip" title="http://lesterchan.net/others/downloads/wp-polls213.zip">WP-Polls 2.13 For WordPress 2.0.x</a><br /> 241 241 <strong>»</strong> <a href="http://lesterchan.net/others/downloads/wp-polls202a.zip" title="http://lesterchan.net/others/downloads/wp-polls202a.zip">WP-Polls 2.02a For WordPress 1.5.2</a> … … 283 283 <strong>Version 2.30 (01-04-2008)</strong> 284 284 <ul> 285 <li>NEW: Works For WordPress 2.5 Only</li> 286 <li>NEW: Updated WP-Polls TinyMCE Plugin To Work With TinyMCE 3.0</li> 287 <li>NEW: Add Time Expiry For Cookie/Log</li> 288 <li>NEW: Removed polls-usage.php</li> 289 <li>NEW: Removed "Fade Anything Technique" In Polls Admin</li> 285 290 <li>NEW: Uses /wp-polls/ Folder Instead Of /polls/</li> 286 291 <li>NEW: Uses wp-polls.php Instead Of polls.php</li> wp-polls/trunk/tinymce/plugins/polls/editor_plugin.js
r29848 r35511 1 tinyMCE.importPluginLanguagePack('polls', 'en'); 2 var TinyMCE_PollsPlugin = { 3 getInfo : function() { 4 return { 5 longname : 'WP-Polls', 6 author : 'Lester Chan', 7 authorurl : 'http://lesterchan.net', 8 infourl : 'http://lesterchan.net/portfolio/programming.php', 9 version : "2.30" 10 }; 11 }, 12 getControlHTML : function(cn) { 13 switch (cn) { 14 case "polls": 15 return tinyMCE.getButtonHTML(cn, 'lang_polls_insert', '{$pluginurl}/images/poll.gif', 'mcePollInsert'); 1 (function() { 2 tinymce.PluginManager.requireLangPack('polls'); 3 tinymce.create('tinymce.plugins.PollsPlugin', { 4 init : function(ed, url) { 5 ed.addCommand('mcePollInsert', function() { 6 ed.execCommand('mceInsertContent', 0, insertPoll('visual', '')); 7 }); 8 ed.addButton('polls', { 9 title : 'polls.insert_poll', 10 cmd : 'mcePollInsert', 11 image : url + '/img/poll.gif' 12 }); 13 ed.onNodeChange.add(function(ed, cm, n) { 14 cm.setActive('polls', n.nodeName == 'IMG'); 15 }); 16 }, 17 18 createControl : function(n, cm) { 19 return null; 20 }, 21 getInfo : function() { 22 return { 23 longname : 'WP-Polls', 24 author : 'Lester Chan', 25 authorurl : 'http://lesterchan.net', 26 infourl : 'http://lesterchan.net/portfolio/programming.php', 27 version : '2.30' 28 }; 16 29 } 17 return ""; 18 }, 19 execCommand : function(editor_id, element, command, user_interface, value) { 20 switch (command) { 21 case "mcePollInsert": 22 tinyMCE.execInstanceCommand(editor_id, "mceInsertContent", false, insertPoll('visual', '')); 23 return true; 24 } 25 return false; 26 } 27 }; 28 tinyMCE.addPlugin("polls", TinyMCE_PollsPlugin); 30 }); 31 tinymce.PluginManager.add('polls', tinymce.plugins.PollsPlugin); 32 })(); wp-polls/trunk/tinymce/plugins/polls/langs/en.js
r29848 r35511 1 tinyMCE.add ToLang('polls',{2 insert: 'Insert Poll'1 tinyMCE.addI18n("en.polls", { 2 insert_poll : 'Insert Poll' 3 3 }); wp-polls/trunk/wp-polls.php
r29848 r35511 59 59 add_submenu_page('wp-polls/polls-manager.php', __('Poll Options', 'wp-polls'), __('Poll Options', 'wp-polls'), 'manage_polls', 'wp-polls/polls-options.php'); 60 60 add_submenu_page('wp-polls/polls-manager.php', __('Poll Templates', 'wp-polls'), __('Poll Templates', 'wp-polls'), 'manage_polls', 'wp-polls/polls-templates.php'); 61 add_submenu_page('wp-polls/polls-manager.php', __('Poll Usage', 'wp-polls'), __('Poll Usage', 'wp-polls'), 'manage_polls', 'wp-polls/polls-usage.php');62 61 add_submenu_page('wp-polls/polls-manager.php', __('Uninstall WP-Polls', 'wp-polls'), __('Uninstall WP-Polls', 'wp-polls'), 'manage_polls', 'wp-polls/polls-uninstall.php'); 63 62 } … … 244 243 245 244 246 ### Function: Add Quick Tag For Poll In TinyMCE, Coutesy Of An-Archos (http://an-archos.com/anarchy-media-player) 247 add_filter('mce_plugins', 'poll_mce_plugins', 5); 248 function poll_mce_plugins($plugins) { 249 array_push($plugins, '-polls'); 250 return $plugins; 251 } 252 add_filter('mce_buttons', 'poll_mce_buttons', 5); 253 function poll_mce_buttons($buttons) { 245 ### Function: Add Quick Tag For Poll In TinyMCE >= WordPress 2.5 246 add_action('init', 'poll_tinymce_addbuttons'); 247 function poll_tinymce_addbuttons() { 248 if(!current_user_can('edit_posts') && ! current_user_can('edit_pages')) { 249 return; 250 } 251 if(get_user_option('rich_editing') == 'true') { 252 add_filter("mce_external_plugins", "poll_tinymce_addplugin"); 253 add_filter('mce_buttons', 'poll_tinymce_registerbutton'); 254 } 255 } 256 function poll_tinymce_registerbutton($buttons) { 254 257 array_push($buttons, 'separator', 'polls'); 255 258 return $buttons; 256 259 } 257 add_action('tinymce_before_init','poll_external_plugins'); 258 function poll_external_plugins() { 259 echo 'tinyMCE.loadPlugin("polls", "'.get_option('siteurl').'/wp-content/plugins/wp-polls/tinymce/plugins/polls/");' . "\n"; 260 return; 260 function poll_tinymce_addplugin($plugin_array) { 261 $plugin_array['polls'] = get_option('siteurl').'/wp-content/plugins/wp-polls/tinymce/plugins/polls/editor_plugin.js'; 262 return $plugin_array; 261 263 } 262 264 … … 337 339 function check_voted_ip($poll_id) { 338 340 global $wpdb; 341 $log_expiry = intval(get_option('poll_cookielog_expiry')); 342 $log_expiry_sql = ''; 343 if($log_expiry > 0) { 344 $log_expiry_sql = 'AND ('.current_time('timestamp').'-(pollip_timestamp+0)) < '.$log_expiry; 345 } 339 346 // Check IP From IP Logging Database 340 $get_voted_aids = $wpdb->get_col("SELECT pollip_aid FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_ip = '".get_ipaddress()."' ");347 $get_voted_aids = $wpdb->get_col("SELECT pollip_aid FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_ip = '".get_ipaddress()."' $log_expiry_sql"); 341 348 if($get_voted_aids) { 342 349 return $get_voted_aids; … … 355 362 } 356 363 $pollsip_userid = intval($user_ID); 364 $log_expiry = intval(get_option('poll_cookielog_expiry')); 365 $log_expiry_sql = ''; 366 if($log_expiry > 0) { 367 $log_expiry_sql = 'AND ('.current_time('timestamp').'-(pollip_timestamp+0)) < '.$log_expiry; 368 } 357 369 // Check User ID From IP Logging Database 358 $get_voted_aids = $wpdb->get_col("SELECT pollip_aid FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_userid = $pollsip_userid ");370 $get_voted_aids = $wpdb->get_col("SELECT pollip_aid FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_userid = $pollsip_userid $log_expiry_sql"); 359 371 if($get_voted_aids) { 360 372 return $get_voted_aids; … … 1199 1211 $poll_logging_method = intval(get_option('poll_logging_method')); 1200 1212 if($poll_logging_method == 1 || $poll_logging_method == 3) { 1201 $vote_cookie = setcookie("voted_".$poll_id, $poll_aid, time() + 30000000, COOKIEPATH); 1213 $cookie_expiry = intval(get_option('poll_cookielog_expiry')); 1214 if($cookie_expiry == 0) { 1215 $cookie_expiry = 30000000; 1216 } 1217 $vote_cookie = setcookie("voted_".$poll_id, $poll_aid, ($pollip_timestamp + $cookie_expiry), COOKIEPATH); 1202 1218 } 1203 1219 foreach($poll_aid_array as $polla_aid) { … … 1382 1398 $wpdb->query("UPDATE $wpdb->pollsq SET pollq_totalvoters = pollq_totalvotes"); 1383 1399 } 1400 // Database Upgrade For WP-Polls 2.30 1401 add_option('poll_cookielog_expiry', 0, 'Cookie And Log Expiry Time'); 1384 1402 // Set 'manage_polls' Capabilities To Administrator 1385 1403 $role = get_role('administrator');
