Changeset 6414
- Timestamp:
- 09/23/06 05:53:01 (2 years ago)
- Files:
-
- wp-polls/tags/wp-polls211.zip (added)
- wp-polls/trunk/polls/polls-options.php (modified) (4 diffs)
- wp-polls/trunk/polls/polls-widget.php (modified) (2 diffs)
- wp-polls/trunk/polls/polls.php (modified) (2 diffs)
- wp-polls/trunk/polls/wp-polls.php (deleted)
- wp-polls/trunk/readme.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wp-polls/trunk/polls/polls-options.php
r6352 r6414 47 47 $poll_template_error = trim($_POST['poll_template_error']); 48 48 $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']); 49 51 $poll_currentpoll = intval($_POST['poll_currentpoll']); 50 52 $poll_logging_method = intval($_POST['poll_logging_method']); … … 67 69 $update_poll_queries[] = update_option('poll_template_error', $poll_template_error); 68 70 $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); 69 73 $update_poll_queries[] = update_option('poll_currentpoll', $poll_currentpoll); 70 74 $update_poll_queries[] = update_option('poll_logging_method', $poll_logging_method); … … 85 89 $update_poll_text[] = __('Poll Error Template'); 86 90 $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'); 87 93 $update_poll_text[] = __('Current Active Poll Option'); 88 94 $update_poll_text[] = __('Logging Method'); … … 231 237 <th align="left" width="30%"><?php _e('Polls Per Page:'); ?></th> 232 238 <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> 233 252 </tr> 234 253 </table> wp-polls/trunk/polls/polls-widget.php
r6285 r6414 43 43 echo $before_widget.$before_title.$title.$after_title; 44 44 get_poll(); 45 display_polls_archive_link(); 45 46 echo $after_widget; 46 47 } … … 56 57 } 57 58 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']); 59 61 $options['title'] = strip_tags(stripslashes($_POST['polls-title'])); 60 62 update_option('widget_polls', $options); 61 63 update_option('poll_currentpoll', $poll_currentpoll); 64 update_option('poll_archive_show', $poll_archive_show); 62 65 } 63 echo '<p style="text-align: left;"><label for="polls-title">Widget Title:</label> <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> <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> '."\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"; 64 80 echo '<p style="text-align: left;"><label for="poll_currentpoll">Current Active Poll:</label> '."\n"; 65 81 echo '<select id="poll_currentpoll" name="poll_currentpoll" size="1">'."\n"; wp-polls/trunk/polls/polls.php
r6403 r6414 618 618 } 619 619 return $polls_archive_url; 620 } 621 622 623 ### Function: Displays Polls Archive Link 624 function 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 } 620 632 } 621 633 … … 967 979 // Database Upgrade For WP-Polls 2.12 968 980 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?'); 969 983 // Set 'manage_polls' Capabilities To Administrator 970 984 $role = get_role('administrator'); wp-polls/trunk/readme.html
r6307 r6414 454 454 <li><?php get_poll();?></li><br /> 455 455 </ul><br /> 456 <?php display_polls_archive_link(); ?><br /> 456 457 </li><br /> 457 458 <?php endif; ?> … … 497 498 </li> 498 499 <li> 500 Type '<b>pollsarchive</b>' in the post's slug area (without the quotes) 501 </li> 502 <li> 499 503 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. 500 507 </li> 501 508 </ol>
