Changeset 6414

Show
Ignore:
Timestamp:
09/23/06 05:53:01 (2 years ago)
Author:
GamerZ
Message:

Time For New Release

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wp-polls/trunk/polls/polls-options.php

    r6352 r6414  
    4747      $poll_template_error = trim($_POST['poll_template_error']); 
    4848      $poll_archive_perpage = intval($_POST['poll_archive_perpage']); 
     49      $poll_archive_url = strip_tags(trim($_POST['poll_archive_url'])); 
     50      $poll_archive_show = intval($_POST['poll_archive_show']); 
    4951      $poll_currentpoll = intval($_POST['poll_currentpoll']); 
    5052      $poll_logging_method = intval($_POST['poll_logging_method']); 
     
    6769      $update_poll_queries[] = update_option('poll_template_error', $poll_template_error); 
    6870      $update_poll_queries[] = update_option('poll_archive_perpage', $poll_archive_perpage); 
     71      $update_poll_queries[] = update_option('poll_archive_url', $poll_archive_url); 
     72      $update_poll_queries[] = update_option('poll_archive_show', $poll_archive_show); 
    6973      $update_poll_queries[] = update_option('poll_currentpoll', $poll_currentpoll); 
    7074      $update_poll_queries[] = update_option('poll_logging_method', $poll_logging_method); 
     
    8589      $update_poll_text[] = __('Poll Error Template'); 
    8690      $update_poll_text[] = __('Archive Polls Per Page Option'); 
     91      $update_poll_text[] = __('Polls Archive URL Option'); 
     92      $update_poll_text[] = __('Show Polls Achive Link Option'); 
    8793      $update_poll_text[] = __('Current Active Poll Option'); 
    8894      $update_poll_text[] = __('Logging Method'); 
     
    231237                              <th align="left" width="30%"><?php _e('Polls Per Page:'); ?></th> 
    232238                              <td align="left"><input type="text" name="poll_archive_perpage" value="<?php echo intval(get_settings('poll_archive_perpage')); ?>" size="2" /></td> 
     239                        </tr> 
     240                        <tr valign="top"> 
     241                              <th align="left" width="30%"><?php _e('Polls Archive URL:'); ?></th> 
     242                              <td align="left"><input type="text" name="poll_archive_url" value="<?php echo get_settings('poll_archive_url'); ?>" size="50" /></td> 
     243                        </tr> 
     244                        <tr valign="top"> 
     245                              <th align="left" width="30%"><?php _e('Display Polls Archive Link Below Poll?'); ?></th> 
     246                              <td align="left"> 
     247                                    <select name="poll_archive_show" size="1"> 
     248                                          <option value="0"<?php selected('0', get_settings('poll_archive_show')); ?>><?php _e('No'); ?></option> 
     249                                          <option value="1"<?php selected('1', get_settings('poll_archive_show')); ?>><?php _e('Yes'); ?></option> 
     250                                    </select> 
     251                              </td> 
    233252                        </tr> 
    234253                  </table> 
  • wp-polls/trunk/polls/polls-widget.php

    r6285 r6414  
    4343                  echo $before_widget.$before_title.$title.$after_title; 
    4444                  get_poll(); 
     45                  display_polls_archive_link(); 
    4546                  echo $after_widget; 
    4647            }            
     
    5657            } 
    5758            if ($_POST['polls-submit']) { 
    58                   $poll_currentpoll = intval($_POST['poll_currentpoll']);                  
     59                  $poll_currentpoll = intval($_POST['poll_currentpoll']); 
     60                  $poll_archive_show = intval($_POST['poll_archive_show']);          
    5961                  $options['title'] = strip_tags(stripslashes($_POST['polls-title'])); 
    6062                  update_option('widget_polls', $options); 
    6163                  update_option('poll_currentpoll', $poll_currentpoll); 
     64                  update_option('poll_archive_show', $poll_archive_show); 
    6265            } 
    63             echo '<p style="text-align: left;"><label for="polls-title">Widget Title:</label>&nbsp;&nbsp;&nbsp;<input type="text" id="polls-title" name="polls-title" value="'.htmlspecialchars($options['title']).'" />'; 
     66            echo '<p style="text-align: left;"><label for="polls-title">Widget Title:</label>&nbsp;&nbsp;&nbsp;<input type="text" id="polls-title" name="polls-title" value="'.htmlspecialchars($options['title']).'" />'."\n"; 
     67            echo '<p style="text-align: left;"><label for="polls-displayarchive">Display Polls Archive Link?</label>&nbsp;&nbsp;&nbsp;'."\n"; 
     68            echo '<select id="polls-displayarchive" name="poll_archive_show" size="1">'."\n"; 
     69            echo '<option value="0"'; 
     70            selected('0', get_settings('poll_archive_show')); 
     71            echo '>'; 
     72            _e('No'); 
     73            echo '</option>'."\n"; 
     74            echo '<option value="1"'; 
     75            selected('1', get_settings('poll_archive_show')); 
     76            echo '>'; 
     77            _e('Yes'); 
     78            echo '</option>'."\n"; 
     79            echo '</select></p>'."\n"; 
    6480            echo '<p style="text-align: left;"><label for="poll_currentpoll">Current Active Poll:</label>&nbsp;&nbsp;&nbsp;'."\n"; 
    6581            echo '<select id="poll_currentpoll" name="poll_currentpoll" size="1">'."\n"; 
  • wp-polls/trunk/polls/polls.php

    r6403 r6414  
    618618      } 
    619619      return $polls_archive_url; 
     620} 
     621 
     622 
     623### Function: Displays Polls Archive Link 
     624function display_polls_archive_link($display = true) { 
     625      if(intval(get_settings('poll_archive_show')) == 1) { 
     626            if($display) { 
     627                  echo "<ul>\n<li><a href=\"".get_settings('poll_archive_url')."\">Polls Archive</a></li></ul>\n"; 
     628            } else{ 
     629                  return "<ul>\n<li><a href=\"".get_settings('poll_archive_url')."\">Polls Archive</a></li></ul>\n"; 
     630            } 
     631      } 
    620632} 
    621633 
     
    967979      // Database Upgrade For WP-Polls 2.12 
    968980      maybe_add_column($wpdb->pollsip, 'pollip_userid', "ALTER TABLE $wpdb->pollsip ADD pollip_userid INT( 10 ) NOT NULL DEFAULT '0';"); 
     981      add_option('poll_archive_url', get_settings('siteurl').'/pollsarchive/', 'Polls Archive URL'); 
     982      add_option('poll_archive_show', 1, 'Show Polls Archive?'); 
    969983      // Set 'manage_polls' Capabilities To Administrator    
    970984      $role = get_role('administrator'); 
  • wp-polls/trunk/readme.html

    r6307 r6414  
    454454                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;?php get_poll();?&gt;&lt;/li&gt;<br /> 
    455455                                    &nbsp;&nbsp;&nbsp;&lt;/ul&gt;<br /> 
     456                                    &nbsp;&nbsp;&nbsp;&lt;?php display_polls_archive_link(); ?&gt;<br /> 
    456457                                    &lt;/li&gt;<br /> 
    457458                                    &lt;?php endif; ?&gt; 
     
    497498                        </li> 
    498499                        <li> 
     500                              Type '<b>pollsarchive</b>' in the post's slug area (without the quotes) 
     501                        </li> 
     502                        <li> 
    499503                              Click 'Publish' 
     504                        </li> 
     505                        <li> 
     506                              If you <b>ARE NOT</b> using nice permalinks, you need to go to 'WP-Admin -> Polls -> Poll Option' and under '<b>Poll Archive -> Polls Archive URL</b>', you need to fill in the URL to the Polls Archive Page you created above. 
    500507                        </li> 
    501508                  </ol>