| 1 |
<?php |
| 2 |
/* |
| 3 |
+----------------------------------------------------------------+ |
| 4 |
| | |
| 5 |
| WordPress 2.0 Plugin: WP-Print 2.05 | |
| 6 |
| Copyright (c) 2005 Lester "GaMerZ" Chan | |
| 7 |
| | |
| 8 |
| File Written By: | |
| 9 |
| - Lester "GaMerZ" Chan | |
| 10 |
| - http://www.lesterchan.net | |
| 11 |
| | |
| 12 |
| File Information: | |
| 13 |
| - Print Options Page | |
| 14 |
| - wp-content/plugins/print/print-options.php | |
| 15 |
| | |
| 16 |
+----------------------------------------------------------------+ |
| 17 |
*/ |
| 18 |
|
| 19 |
|
| 20 |
### Variables Variables Variables |
| 21 |
$base_name = plugin_basename('print/print-options.php'); |
| 22 |
$base_page = 'admin.php?page='.$base_name; |
| 23 |
$id = intval($_GET['id']); |
| 24 |
|
| 25 |
### If Form Is Submitted |
| 26 |
if($_POST['Submit']) { |
| 27 |
$print_options = array(); |
| 28 |
$print_options['comments'] = intval($_POST['print_comments']); |
| 29 |
$print_options['links'] = intval($_POST['print_links']); |
| 30 |
$print_options['images'] = intval($_POST['print_images']); |
| 31 |
$update_print_queries = array(); |
| 32 |
$update_print_text = array(); |
| 33 |
$update_print_queries[] = update_option('print_options', $print_options); |
| 34 |
$update_print_text[] = __('Print Options'); |
| 35 |
$i=0; |
| 36 |
$text = ''; |
| 37 |
foreach($update_print_queries as $update_print_query) { |
| 38 |
if($update_print_query) { |
| 39 |
$text .= '<font color="green">'.$update_print_text[$i].' '.__('Updated').'</font><br />'; |
| 40 |
} |
| 41 |
$i++; |
| 42 |
} |
| 43 |
if(empty($text)) { |
| 44 |
$text = '<font color="red">'.__('No Print Option Updated').'</font>'; |
| 45 |
} |
| 46 |
} |
| 47 |
|
| 48 |
### Get Print Options |
| 49 |
$print_options = get_settings('print_options'); |
| 50 |
?> |
| 51 |
<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?> |
| 52 |
<div class="wrap"> |
| 53 |
<h2><?php _e('Print Options'); ?></h2> |
| 54 |
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> |
| 55 |
<fieldset class="options"> |
| 56 |
<legend><?php _e('Print Options'); ?></legend> |
| 57 |
<table width="100%" border="0" cellspacing="3" cellpadding="3"> |
| 58 |
<tr valign="top"> |
| 59 |
<th align="left" width="30%"><?php _e('Print Comments?'); ?></th> |
| 60 |
<td align="left"> |
| 61 |
<select name="print_comments" size="1"> |
| 62 |
<option value="1"<?php selected('1', $print_options['comments']); ?>><?php _e('Yes'); ?></option> |
| 63 |
<option value="0"<?php selected('0', $print_options['comments']); ?>><?php _e('No'); ?></option> |
| 64 |
</select> |
| 65 |
</td> |
| 66 |
</tr> |
| 67 |
<tr valign="top"> |
| 68 |
<th align="left" width="30%"><?php _e('Print Links?'); ?></th> |
| 69 |
<td align="left"> |
| 70 |
<select name="print_links" size="1"> |
| 71 |
<option value="1"<?php selected('1', $print_options['links']); ?>><?php _e('Yes'); ?></option> |
| 72 |
<option value="0"<?php selected('0', $print_options['links']); ?>><?php _e('No'); ?></option> |
| 73 |
</select> |
| 74 |
</td> |
| 75 |
</tr> |
| 76 |
<tr valign="top"> |
| 77 |
<th align="left" width="30%"><?php _e('Print Images?'); ?></th> |
| 78 |
<td align="left"> |
| 79 |
<select name="print_images" size="1"> |
| 80 |
<option value="1"<?php selected('1', $print_options['images']); ?>><?php _e('Yes'); ?></option> |
| 81 |
<option value="0"<?php selected('0', $print_options['images']); ?>><?php _e('No'); ?></option> |
| 82 |
</select> |
| 83 |
</td> |
| 84 |
</tr> |
| 85 |
</table> |
| 86 |
</fieldset> |
| 87 |
<div align="center"> |
| 88 |
<input type="submit" name="Submit" class="button" value="<?php _e('Update Options'); ?>" /> <input type="button" name="cancel" value="Cancel" class="button" onclick="javascript:history.go(-1)" /> |
| 89 |
</div> |
| 90 |
</form> |
| 91 |
</div> |