Changeset 35511

Show
Ignore:
Timestamp:
03/19/08 21:29:02 (4 months ago)
Author:
GamerZ
Message:

First WP 2.5 Commit To WP-Polls

Files:

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,{})) 
     1eval(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  
    22+----------------------------------------------------------------+ 
    33|                                                                                                                                         | 
    4 |     WordPress 2.3 Plugin: WP-Polls 2.30                                                           | 
    5 |     Copyright (c) 2007 Lester "GaMerZ" Chan                                                 | 
     4|     WordPress 2.5 Plugin: WP-Polls 2.30                                                           | 
     5|     Copyright (c) 2008 Lester "GaMerZ" Chan                                                 | 
    66|                                                                                                                                         | 
    77|     File Written By:                                                                                                  | 
     
    2525function delete_poll_message() { 
    2626      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"); 
    2927      setTimeout("remove_poll()", 1000); 
    3028} 
     
    5351function delete_poll_logs_message() { 
    5452      document.getElementById('message').style.display = "block"; 
    55       Fat.fade_element("message", null, 3000, "#FFFF00"); 
    5653      document.getElementById("poll_logs").innerHTML = polls_admin_text_no_poll_logs; 
    5754} 
     
    7875function delete_this_poll_logs_message() { 
    7976      document.getElementById('message').style.display = "block"; 
    80       Fat.fade_element("message", null, 3000, "#FFFF00"); 
    8177      document.getElementById("poll_logs").innerHTML = polls_admin_text_no_poll_logs; 
    8278      document.getElementById("poll_logs_display").style.display = 'none'; 
     
    107103function delete_poll_ans_message() { 
    108104      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"); 
    111105      setTimeout("remove_poll_ans()", 1000); 
    112106      document.getElementById('poll_total_votes').innerHTML = (parseInt(document.getElementById('poll_total_votes').innerHTML) - parseInt(global_poll_aid_votes)); 
     
    146140function opening_poll_message() { 
    147141      document.getElementById('message').style.display = "block"; 
    148       Fat.fade_element("message", null, 3000, "#FFFF00"); 
    149142      document.getElementById("open_poll").style.display = "none"; 
    150143      document.getElementById("close_poll").style.display = "inline"; 
     
    169162function closing_poll_message() { 
    170163      document.getElementById('message').style.display = "block"; 
    171       Fat.fade_element("message", null, 3000, "#FFFF00"); 
    172164      document.getElementById("open_poll").style.display = "inline"; 
    173165      document.getElementById("close_poll").style.display = "none"; 
  • wp-polls/trunk/polls-manager.php

    r31879 r35511  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.3 Plugin: WP-Polls 2.30                                                           | 
    6 |     Copyright (c) 2007 Lester "GaMerZ" Chan                                                 | 
     5|     WordPress 2.5 Plugin: WP-Polls 2.30                                                           | 
     6|     Copyright (c) 2008 Lester "GaMerZ" Chan                                                 | 
    77|                                                                                                                                         | 
    88|     File Written By:                                                                                                  | 
     
    255255                        poll_option.setAttribute('id', "pollq-multiple-" + (count_poll_answer+1)); 
    256256                        // Elements - TD/TR 
    257                         if(count_poll_answer%2 != 0) { poll_tr.style.background = "#eee"; } 
    258257                        poll_tr.setAttribute('id', "poll-answer-new-" + count_poll_answer_new); 
    259258                        poll_td1.setAttribute('width', "20%"); 
     
    296295                  /* ]]> */ 
    297296            </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>'; } ?> 
    299297 
    300298            <!-- Edit Poll --> 
     
    304302            <div class="wrap"> 
    305303                  <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 
    306307                  <!-- Poll Question --> 
    307308                  <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                               <td 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
    311312                              <td width="80%"><input type="text" size="70" name="pollq_question" value="<?php echo htmlspecialchars($poll_question_text); ?>" /></td> 
    312313                        </tr> 
     
    314315                  <!-- Poll Answers --> 
    315316                  <h3><?php _e('Poll Answers', 'wp-polls'); ?></h3> 
    316                   <table width="100%"  border="0" cellspacing="3" cellpadding="3"> 
     317                  <table class="form-table"> 
    317318                        <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> 
    321322                                    <td width="20%" align="right"><strong><?php _e('No. Of Votes', 'wp-polls') ?></strong></td> 
    322323                              </tr> 
     
    330331                                          $pollip_answers[0] = __('Null Votes', 'wp-polls');  
    331332                                          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                                                 } 
    337333                                                $polla_aid = intval($poll_answer->polla_aid); 
    338334                                                $polla_answers = stripslashes($poll_answer->polla_answers); 
    339335                                                $polla_votes = intval($poll_answer->polla_votes); 
    340336                                                $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"; 
    342338                                                echo '<td width="20%"><strong>'.sprintf(__('Answer %s:', 'wp-polls'), $i).'</strong></td>'."\n"; 
    343339                                                echo "<td width=\"60%\"><input type=\"text\" size=\"50\" maxlength=\"200\" name=\"polla_aid-$polla_aid\" value=\"".htmlspecialchars($polla_answers)."\" />&nbsp;&nbsp;&nbsp;"; 
     
    365361                  <!-- Poll Multiple Answers --> 
    366362                  <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
    369365                              <td width="40%" valign="top"><strong><?php _e('Allows Users To Select More Than One Answer?', 'wp-polls'); ?></strong></td> 
    370366                              <td width="60%"> 
     
    394390                  <!-- Poll Start/End Date --> 
    395391                  <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
    398394                              <td width="20%" valign="top"><strong><?php _e('Start Date/Time', 'wp-polls'); ?></strong>:</td> 
    399395                              <td width="80%"> 
     
    456452            <!-- Last Action -->           
    457453            <div id="message" class="updated" style="display: none;"></div> 
    458  
     454             
    459455            <!-- Manage Polls --> 
    460456            <div class="wrap"> 
    461457            <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"> 
    463460                  <thead> 
    464                         <tr class="thead"
     461                        <tr
    465462                              <th><?php _e('ID', 'wp-polls'); ?></th> 
    466463                              <th><?php _e('Question', 'wp-polls'); ?></th>                      
     
    498495                                          } 
    499496                                          if($i%2 == 0) { 
    500                                                 $style = 'style=\'background-color: #eee;\''; 
     497                                                $style = 'class="alternate"'; 
    501498                                          }  else { 
    502                                                 $style = 'style=\'background: none;\''; 
     499                                                $style = ''; 
    503500                                          } 
    504501                                          if($current_poll > 0) { 
    505502                                                if($current_poll == $poll_id) { 
    506                                                       $style = 'style=\'background-color: #b8d4ff;\''; 
     503                                                      $style = 'class="highlight"'; 
    507504                                                } 
    508505                                          } elseif($current_poll == 0) { 
    509506                                                if($poll_id == $latest_poll) { 
    510                                                       $style = 'style=\'background-color: #b8d4ff;\''; 
     507                                                      $style = 'class="highlight"'; 
    511508                                                } 
    512509                                          } else if(in_array($poll_id, $multiple_polls)) { 
    513                                                 $style = 'style=\'background-color: #b8d4ff;\''; 
     510                                                $style = 'class="highlight"'; 
    514511                                          } 
    515512                                          echo "<tr id=\"poll-$poll_id\" $style>\n"; 
     
    556553                  </table> 
    557554            </div> 
     555            <p>&nbsp;</p> 
     556 
    558557            <!-- Polls Stats --> 
    559558            <div class="wrap"> 
    560559            <h2><?php _e('Polls Stats', 'wp-polls'); ?></h2> 
    561                   <table border="0" cellspacing="3" cellpadding="3"> 
     560                  <br style="clear" /> 
     561                  <table class="widefat"> 
    562562                  <tr> 
    563                         <th align="left"><?php _e('Total Polls:', 'wp-polls'); ?></th> 
     563                        <th align="left"><?php _e('Total Polls', 'wp-polls'); ?></th> 
    564564                        <td align="left"><?php echo $i; ?></td> 
    565565                  </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> 
    568568                        <td align="left"><?php echo number_format_i18n($total_ans); ?></td> 
    569569                  </tr> 
    570570                  <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> 
    572572                        <td align="left"><?php echo number_format_i18n($total_votes); ?></td> 
    573573                  </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> 
    576576                        <td align="left"><?php echo number_format_i18n($total_voters); ?></td> 
    577577                  </tr> 
    578578                  </table> 
    579579            </div> 
     580            <p>&nbsp;</p> 
     581 
    580582            <!-- Delete Polls Logs --> 
    581583            <div class="wrap"> 
    582584                  <h2><?php _e('Polls Logs', 'wp-polls'); ?></h2> 
     585                  <br style="clear" /> 
    583586                  <div align="center" id="poll_logs"> 
    584587                  <?php 
  • wp-polls/trunk/polls-options.php

    r22706 r35511  
    4949      $poll_close = intval($_POST['poll_close']); 
    5050      $poll_logging_method = intval($_POST['poll_logging_method']); 
     51      $poll_cookielog_expiry = intval($_POST['poll_cookielog_expiry']); 
    5152      $poll_allowtovote = intval($_POST['poll_allowtovote']); 
    5253      $update_poll_queries = array(); 
     
    6566      $update_poll_queries[] = update_option('poll_close', $poll_close); 
    6667      $update_poll_queries[] = update_option('poll_logging_method', $poll_logging_method); 
     68      $update_poll_queries[] = update_option('poll_cookielog_expiry', $poll_cookielog_expiry); 
    6769      $update_poll_queries[] = update_option('poll_allowtovote', $poll_allowtovote); 
    6870      $update_poll_text[] = __('Poll Bar Style', 'wp-polls'); 
     
    7981      $update_poll_text[] = __('Poll Close Option', 'wp-polls'); 
    8082      $update_poll_text[] = __('Logging Method', 'wp-polls'); 
     83      $update_poll_text[] = __('Cookie And Log Expiry Option', 'wp-polls'); 
    8184      $update_poll_text[] = __('Allow To Vote Option', 'wp-polls'); 
    8285      $i=0; 
     
    130133<div class="wrap">  
    131134      <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 &raquo;', 'wp-polls'); ?>" /> 
    134             </p> 
    135135            <fieldset class="options"> 
    136136                  <legend><?php _e('Poll Bar Style', 'wp-polls'); ?></legend> 
     
    297297                              </td> 
    298298                        </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> 
    299303                  </table> 
    300304            </fieldset> 
  • wp-polls/trunk/polls-uninstall.php

    r22648 r35511  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.3 Plugin: WP-Polls 2.30                                                           | 
    6 |     Copyright (c) 2007 Lester "GaMerZ" Chan                                                 | 
     5|     WordPress 2.5 Plugin: WP-Polls 2.30                                                           | 
     6|     Copyright (c) 2008 Lester "GaMerZ" Chan                                                 | 
    77|                                                                                                                                         | 
    88|     File Written By:                                                                                                  | 
     
    2929$mode = trim($_GET['mode']); 
    3030$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'); 
    3232 
    3333 
  • wp-polls/trunk/readme.html

    r29848 r35511  
    236236                  <p> 
    237237                        <strong>Download:</strong><br /> 
    238                         <strong>&raquo;</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>&raquo;</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>&raquo;</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>&raquo;</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 /> 
    240240                        <strong>&raquo;</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 /> 
    241241                        <strong>&raquo;</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> 
     
    283283                              <strong>Version 2.30 (01-04-2008)</strong> 
    284284                              <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> 
    285290                                    <li>NEW: Uses /wp-polls/ Folder Instead Of /polls/</li> 
    286291                                    <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                  }; 
    1629            } 
    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.addToLang('polls',
    2 insert : 'Insert Poll' 
     1tinyMCE.addI18n("en.polls",
     2     insert_poll : 'Insert Poll' 
    33}); 
  • wp-polls/trunk/wp-polls.php

    r29848 r35511  
    5959            add_submenu_page('wp-polls/polls-manager.php', __('Poll Options', 'wp-polls'), __('Poll Options', 'wp-polls'), 'manage_polls', 'wp-polls/polls-options.php'); 
    6060            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'); 
    6261            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'); 
    6362      } 
     
    244243 
    245244 
    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 
     246add_action('init', 'poll_tinymce_addbuttons'); 
     247function 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
     256function poll_tinymce_registerbutton($buttons) { 
    254257      array_push($buttons, 'separator', 'polls'); 
    255258      return $buttons; 
    256259} 
    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; 
     260function 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; 
    261263} 
    262264 
     
    337339function check_voted_ip($poll_id) { 
    338340      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      } 
    339346      // 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"); 
    341348      if($get_voted_aids) { 
    342349            return $get_voted_aids; 
     
    355362      } 
    356363      $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      } 
    357369      // 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"); 
    359371      if($get_voted_aids) { 
    360372            return $get_voted_aids; 
     
    11991211                        $poll_logging_method = intval(get_option('poll_logging_method')); 
    12001212                        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);                                  
    12021218                        } 
    12031219                        foreach($poll_aid_array as $polla_aid) { 
     
    13821398            $wpdb->query("UPDATE $wpdb->pollsq SET pollq_totalvoters = pollq_totalvotes"); 
    13831399      } 
     1400      // Database Upgrade For WP-Polls 2.30 
     1401      add_option('poll_cookielog_expiry', 0, 'Cookie And Log Expiry Time');    
    13841402      // Set 'manage_polls' Capabilities To Administrator    
    13851403      $role = get_role('administrator');