Adding personal options

git-svn-id: http://svn.automattic.com/wordpress/trunk@2760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2005-08-07 19:23:41 +00:00
parent 851ac5a414
commit d9bb04b5a0
10 changed files with 385 additions and 317 deletions

View File

@ -11,7 +11,7 @@ $menu[20] = array(__('Links'), 'manage_links', 'link-manager.php');
$menu[25] = array(__('Presentation'), 'switch_themes', 'themes.php');
$menu[30] = array(__('Plugins'), 'activate_plugins', 'plugins.php');
$menu[35] = array(__('Users'), 'read', 'profile.php');
$menu[40] = array(__('Options'), 'manage_options', 'options-general.php');
$menu[40] = array(__('Options'), 'read', 'options-personal.php');
if ( get_option('use_fileupload') )
$menu[45] = array(__('Upload'), 'upload_files', 'upload.php');
@ -35,12 +35,13 @@ $submenu['link-manager.php'][20] = array(__('Import Links'), 'manage_links', 'li
$submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php');
$submenu['profile.php'][10] = array(__('Authors & Users'), 'edit_users', 'users.php');
$submenu['options-general.php'][5] = array(__('General'), 'manage_options', 'options-general.php');
$submenu['options-general.php'][10] = array(__('Writing'), 'manage_options', 'options-writing.php');
$submenu['options-general.php'][15] = array(__('Reading'), 'manage_options', 'options-reading.php');
$submenu['options-general.php'][20] = array(__('Discussion'), 'manage_options', 'options-discussion.php');
$submenu['options-general.php'][25] = array(__('Permalinks'), 'manage_options', 'options-permalink.php');
$submenu['options-general.php'][30] = array(__('Miscellaneous'), 'manage_options', 'options-misc.php');
$submenu['options-personal.php'][5] = array(__('Personal'), 'read', 'options-personal.php');
$submenu['options-personal.php'][10] = array(__('General'), 'manage_options', 'options-general.php');
$submenu['options-personal.php'][15] = array(__('Writing'), 'manage_options', 'options-writing.php');
$submenu['options-personal.php'][20] = array(__('Reading'), 'manage_options', 'options-reading.php');
$submenu['options-personal.php'][25] = array(__('Discussion'), 'manage_options', 'options-discussion.php');
$submenu['options-personal.php'][30] = array(__('Permalinks'), 'manage_options', 'options-permalink.php');
$submenu['options-personal.php'][35] = array(__('Miscellaneous'), 'manage_options', 'options-misc.php');
$submenu['plugins.php'][5] = array(__('Plugins'), 'activate_plugins', 'plugins.php');
$submenu['plugins.php'][10] = array(__('Plugin Editor'), 'edit_plugins', 'plugin-editor.php');

View File

@ -2,7 +2,7 @@
require_once('admin.php');
$title = __('Discussion Options');
$parent_file = 'options-general.php';
$parent_file = 'options-personal.php';
include('admin-header.php');
@ -19,82 +19,82 @@ if ($action == 'retrospam') {
?>
<div class="wrap">
<h2><?php _e('Discussion Options') ?></h2>
<form name="form1" method="post" action="options.php">
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="'default_pingback_flag','default_ping_status','default_comment_status','comments_notify','moderation_notify','comment_moderation','require_name_email','comment_whitelist','comment_max_links','moderation_keys','blacklist_keys','open_proxy_check'" />
<h2><?php _e('Discussion Options') ?></h2>
<form method="post" action="options.php">
<fieldset class="options">
<legend><?php _e('Usual settings for an article: <em>(These settings may be overridden for individual articles.)</em>') ?></legend>
<ul>
<li>
<label for="default_pingback_flag">
<input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked('1', get_settings('default_pingback_flag')); ?> />
<?php _e('Attempt to notify any Weblogs linked to from the article (slows down posting.)') ?></label>
</li>
<li>
<label for="default_ping_status">
<input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked('open', get_settings('default_ping_status')); ?> />
<?php _e('Allow link notifications from other Weblogs (pingbacks and trackbacks.)') ?></label>
</li>
<li>
<label for="default_comment_status">
<input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked('open', get_settings('default_comment_status')); ?> />
<?php _e('Allow people to post comments on the article') ?></label>
</li>
</ul>
<legend><?php _e('Usual settings for an article: <em>(These settings may be overridden for individual articles.)</em>') ?></legend>
<ul>
<li>
<label for="default_pingback_flag">
<input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked('1', get_settings('default_pingback_flag')); ?> />
<?php _e('Attempt to notify any Weblogs linked to from the article (slows down posting.)') ?></label>
</li>
<li>
<label for="default_ping_status">
<input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked('open', get_settings('default_ping_status')); ?> />
<?php _e('Allow link notifications from other Weblogs (pingbacks and trackbacks.)') ?></label>
</li>
<li>
<label for="default_comment_status">
<input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked('open', get_settings('default_comment_status')); ?> />
<?php _e('Allow people to post comments on the article') ?></label>
</li>
</ul>
</fieldset>
<fieldset class="options">
<legend><?php _e('E-mail me whenever:') ?></legend>
<ul>
<li>
<label for="comments_notify">
<input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked('1', get_settings('comments_notify')); ?> />
<?php _e('Anyone posts a comment') ?> </label>
</li>
<li>
<label for="moderation_notify">
<input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked('1', get_settings('moderation_notify')); ?> />
<?php _e('A comment is held for moderation') ?> </label>
</li>
</ul>
<legend><?php _e('E-mail me whenever:') ?></legend>
<ul>
<li>
<label for="comments_notify">
<input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked('1', get_settings('comments_notify')); ?> />
<?php _e('Anyone posts a comment') ?> </label>
</li>
<li>
<label for="moderation_notify">
<input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked('1', get_settings('moderation_notify')); ?> />
<?php _e('A comment is held for moderation') ?> </label>
</li>
</ul>
</fieldset>
<fieldset class="options">
<legend><?php _e('Before a comment appears:') ?></legend>
<ul>
<li>
<label for="comment_moderation">
<input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked('1', get_settings('comment_moderation')); ?> />
<?php _e('An administrator must approve the comment (regardless of any matches below)') ?> </label>
</li>
<li><label for="require_name_email"><input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked('1', get_settings('require_name_email')); ?> /> <?php _e('Comment author must fill out name and e-mail') ?></label></li>
<li><label for="comment_whitelist"><input type="checkbox" name="comment_whitelist" id="comment_whitelist" value="1" <?php checked('1', get_settings('comment_whitelist')); ?> /> <?php _e('Comment author must have a previously approved comment') ?></label></li>
</ul>
<legend><?php _e('Before a comment appears:') ?></legend>
<ul>
<li>
<label for="comment_moderation">
<input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked('1', get_settings('comment_moderation')); ?> />
<?php _e('An administrator must approve the comment (regardless of any matches below)') ?> </label>
</li>
<li><label for="require_name_email"><input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked('1', get_settings('require_name_email')); ?> /> <?php _e('Comment author must fill out name and e-mail') ?></label></li>
<li><label for="comment_whitelist"><input type="checkbox" name="comment_whitelist" id="comment_whitelist" value="1" <?php checked('1', get_settings('comment_whitelist')); ?> /> <?php _e('Comment author must have a previously approved comment') ?></label></li>
</ul>
</fieldset>
<fieldset class="options">
<legend><?php _e('Comment Moderation') ?></legend>
<p><?php printf(__('Hold a comment in the queue if it contains more than %s links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="text" id="comment_max_links" size="3" value="' . get_settings('comment_max_links'). '" />' ) ?></p>
<legend><?php _e('Comment Moderation') ?></legend>
<p><?php printf(__('Hold a comment in the queue if it contains more than %s links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="text" id="comment_max_links" size="3" value="' . get_settings('comment_max_links'). '" />' ) ?></p>
<p><?php _e('When a comment contains any of these words in its content, name, URI, e-mail, or IP, hold it in the moderation queue: (Separate multiple words with new lines.) <a href="http://codex.wordpress.org/Spam_Words">Common spam words</a>.') ?></p>
<p>
<textarea name="moderation_keys" cols="60" rows="4" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('moderation_keys'); ?></textarea>
</p>
<p>
<a id="retrospambutton" href="options-discussion.php?action=retrospam"><?php _e('Check past comments against moderation list'); ?></a>
</p>
<p><?php _e('When a comment contains any of these words in its content, name, URI, e-mail, or IP, hold it in the moderation queue: (Separate multiple words with new lines.) <a href="http://codex.wordpress.org/Spam_Words">Common spam words</a>.') ?></p>
<p>
<textarea name="moderation_keys" cols="60" rows="4" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('moderation_keys'); ?></textarea>
</p>
<p>
<a id="retrospambutton" href="options-discussion.php?action=retrospam"><?php _e('Check past comments against moderation list'); ?></a>
</p>
</fieldset>
<fieldset class="options">
<legend><?php _e('Comment Blacklist') ?></legend>
<p><?php _e('This is a list of words that you want completely blacklisted from your blog. Be very careful what you add here, because if a comment matches something here it will be completely nuked and there will be no notification. Remember that partial words can match, so if there is any chance something here might match it would be better to put it in the moderation box above.') ?></p>
<p>
<textarea name="blacklist_keys" cols="60" rows="4" id="blacklist_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('blacklist_keys'); ?></textarea>
</p>
<p><label for="open_proxy_check">
<input name="open_proxy_check" type="checkbox" id="open_proxy_check" value="1" <?php checked('1', get_settings('open_proxy_check')); ?> />
<?php _e('Blacklist comments from open and insecure proxies.') ?></label></p>
<legend><?php _e('Comment Blacklist') ?></legend>
<p><?php _e('This is a list of words that you want completely blacklisted from your blog. Be very careful what you add here, because if a comment matches something here it will be completely nuked and there will be no notification. Remember that partial words can match, so if there is any chance something here might match it would be better to put it in the moderation box above.') ?></p>
<p>
<textarea name="blacklist_keys" cols="60" rows="4" id="blacklist_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('blacklist_keys'); ?></textarea>
</p>
<p><label for="open_proxy_check">
<input name="open_proxy_check" type="checkbox" id="open_proxy_check" value="1" <?php checked('1', get_settings('open_proxy_check')); ?> />
<?php _e('Blacklist comments from open and insecure proxies.') ?></label></p>
</fieldset>
<p class="submit">
<input type="submit" name="Submit" value="<?php _e('Update Options') ?>" />
</p>
</form>
<p class="submit">
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="'default_pingback_flag','default_ping_status','default_comment_status','comments_notify','moderation_notify','comment_moderation','require_name_email','comment_whitelist','comment_max_links','moderation_keys','blacklist_keys','open_proxy_check'" />
<input type="submit" name="Submit" value="<?php _e('Update Options') ?>" />
</p>
</form>
</div>
<?php include('./admin-footer.php'); ?>

View File

@ -2,109 +2,109 @@
require_once('admin.php');
$title = __('General Options');
$parent_file = 'options-general.php';
$parent_file = 'options-personal.php';
include('admin-header.php');
?>
<div class="wrap">
<h2><?php _e('General Options') ?></h2>
<form name="form1" method="post" action="options.php">
<input type="hidden" name="action" value="update" />
<input type="hidden" name="action" value="update" /> <input type="hidden" name="page_options" value="'blogname','blogdescription','siteurl','admin_email','users_can_register','gmt_offset','date_format','time_format','home','start_of_week','comment_registration','default_role'" />
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Weblog title:') ?></th>
<td><input name="blogname" type="text" id="blogname" value="<?php form_option('blogname'); ?>" size="40" /></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Tagline:') ?></th>
<td><input name="blogdescription" type="text" id="blogdescription" style="width: 95%" value="<?php form_option('blogdescription'); ?>" size="45" />
<br />
<h2><?php _e('General Options') ?></h2>
<form name="form1" method="post" action="options.php">
<input type="hidden" name="action" value="update" />
<input type="hidden" name="action" value="update" /> <input type="hidden" name="page_options" value="'blogname','blogdescription','siteurl','admin_email','users_can_register','gmt_offset','date_format','time_format','home','start_of_week','comment_registration','default_role'" />
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Weblog title:') ?></th>
<td><input name="blogname" type="text" id="blogname" value="<?php form_option('blogname'); ?>" size="40" /></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Tagline:') ?></th>
<td><input name="blogdescription" type="text" id="blogdescription" style="width: 95%" value="<?php form_option('blogdescription'); ?>" size="45" />
<br />
<?php _e('In a few words, explain what this weblog is about.') ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('WordPress address (URI):') ?></th>
<td><input name="siteurl" type="text" id="siteurl" value="<?php form_option('siteurl'); ?>" size="40" class="code" /></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Blog address (URI):') ?></th>
<td><input name="home" type="text" id="home" value="<?php form_option('home'); ?>" size="40" class="code" /><br /><?php _e('If you want your blog homepage to be different than the directory you installed WordPress in, enter that address here. '); ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('E-mail address:') ?> </th>
<td><input name="admin_email" type="text" id="admin_email" value="<?php form_option('admin_email'); ?>" size="40" class="code" />
<br />
</tr>
<tr valign="top">
<th scope="row"><?php _e('WordPress address (URI):') ?></th>
<td><input name="siteurl" type="text" id="siteurl" value="<?php form_option('siteurl'); ?>" size="40" class="code" /></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Blog address (URI):') ?></th>
<td><input name="home" type="text" id="home" value="<?php form_option('home'); ?>" size="40" class="code" /><br /><?php _e('If you want your blog homepage to be different than the directory you installed WordPress in, enter that address here. '); ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('E-mail address:') ?> </th>
<td><input name="admin_email" type="text" id="admin_email" value="<?php form_option('admin_email'); ?>" size="40" class="code" />
<br />
<?php _e('This address is used only for admin purposes.') ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Membership:') ?></th>
<td> <label for="users_can_register">
<input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked('1', get_settings('users_can_register')); ?> />
<?php _e('Anyone can register') ?></label><br />
<label for="comment_registration">
<input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', get_settings('comment_registration')); ?> />
<?php _e('Users must be registered and logged in to comment') ?>
</label>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Membership:') ?></th>
<td> <label for="users_can_register">
<input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked('1', get_settings('users_can_register')); ?> />
<?php _e('Anyone can register') ?></label><br />
<label for="comment_registration">
<input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', get_settings('comment_registration')); ?> />
<?php _e('Users must be registered and logged in to comment') ?>
</label>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('New User Default Role:') ?></th>
<td><label for="default_role">
<select name="default_role" id="default_role"><?php
foreach($wp_roles->role_names as $role => $name) {
$selected = (get_settings('default_role') == $role) ? 'selected="selected"' : '';
echo "<option {$selected} value=\"{$role}\">{$name}</option>";
}
?></select></label>
</td>
</tr>
</table>
<fieldset class="options">
<legend><?php _e('Date and Time') ?></legend>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr>
<th scope="row" width="33%"><?php _e('<abbr title="Coordinated Universal Time">UTC</abbr> time is:') ?> </th>
<td><code><?php echo gmdate('Y-m-d g:i:s a'); ?></code></td>
</tr>
<tr>
<th scope="row"><?php _e('Times in the weblog should differ by:') ?> </th>
<td><input name="gmt_offset" type="text" id="gmt_offset" size="2" value="<?php form_option('gmt_offset'); ?>" />
<?php _e('hours') ?> </td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><?php _e('The following use the same syntax as the <a href="http://php.net/date">PHP <code>date()</code> function</a>. Save option to update sample output.') ?> </td>
</tr>
<tr>
<th scope="row"><?php _e('Default date format:') ?></th>
<td><input name="date_format" type="text" id="date_format" size="30" value="<?php form_option('date_format'); ?>" /><br />
</tr>
<tr valign="top">
<th scope="row"><?php _e('New User Default Role:') ?></th>
<td><label for="default_role">
<select name="default_role" id="default_role"><?php
foreach($wp_roles->role_names as $role => $name) {
$selected = (get_settings('default_role') == $role) ? 'selected="selected"' : '';
echo "<option {$selected} value=\"{$role}\">{$name}</option>";
}
?></select></label>
</td>
</tr>
</table>
<fieldset class="options">
<legend><?php _e('Date and Time') ?></legend>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr>
<th scope="row" width="33%"><?php _e('<abbr title="Coordinated Universal Time">UTC</abbr> time is:') ?> </th>
<td><code><?php echo gmdate('Y-m-d g:i:s a'); ?></code></td>
</tr>
<tr>
<th scope="row"><?php _e('Times in the weblog should differ by:') ?> </th>
<td><input name="gmt_offset" type="text" id="gmt_offset" size="2" value="<?php form_option('gmt_offset'); ?>" />
<?php _e('hours') ?> </td>
</tr>
<tr>
<th scope="row">&nbsp;</th>
<td><?php _e('The following use the same syntax as the <a href="http://php.net/date">PHP <code>date()</code> function</a>. Save option to update sample output.') ?> </td>
</tr>
<tr>
<th scope="row"><?php _e('Default date format:') ?></th>
<td><input name="date_format" type="text" id="date_format" size="30" value="<?php form_option('date_format'); ?>" /><br />
<?php _e('Output:') ?> <strong><?php echo mysql2date(get_settings('date_format'), current_time('mysql')); ?></strong></td>
</tr>
<tr>
<th scope="row"><?php _e('Default time format:') ?></th>
<td><input name="time_format" type="text" id="time_format" size="30" value="<?php form_option('time_format'); ?>" /><br />
</tr>
<tr>
<th scope="row"><?php _e('Default time format:') ?></th>
<td><input name="time_format" type="text" id="time_format" size="30" value="<?php form_option('time_format'); ?>" /><br />
<?php _e('Output:') ?> <strong><?php echo gmdate(get_settings('time_format'), current_time('timestamp')); ?></strong></td>
</tr>
<tr>
<th scope="row"><?php _e('Weeks in the calendar should start on:') ?></th>
<td><select name="start_of_week" id="start_of_week">
<?php
</tr>
<tr>
<th scope="row"><?php _e('Weeks in the calendar should start on:') ?></th>
<td><select name="start_of_week" id="start_of_week">
<?php
for ($day_index = 0; $day_index <= 6; $day_index++) :
if ($day_index == get_settings('start_of_week')) $selected = " selected='selected'";
else $selected = '';
if ($day_index == get_settings('start_of_week')) $selected = " selected='selected'";
else $selected = '';
echo "\n\t<option value='$day_index' $selected>$weekday[$day_index]</option>";
endfor;
?>
</select></td>
</tr>
</tr>
</table>
</fieldset>
<p class="submit">
<input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
</p>
</form>
</fieldset>
<p class="submit">
<input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
</p>
</form>
</div>
<?php include("admin-footer.php") ?>

View File

@ -2,7 +2,7 @@
require_once('admin.php');
$title = __('Miscellaneous Options');
$parent_file = 'options-general.php';
$parent_file = 'options-personal.php';
include('admin-header.php');
@ -10,62 +10,62 @@ include('admin-header.php');
<div class="wrap">
<h2><?php _e('Miscellaneous Options') ?></h2>
<form name="miscoptions" method="post" action="options.php">
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="'hack_file','use_fileupload','fileupload_realpath','fileupload_url','fileupload_allowedtypes','fileupload_maxk','fileupload_maxk','fileupload_minlevel','use_geo_positions','use_linksupdate'" />
<fieldset class="options">
<legend>
<input name="use_fileupload" type="checkbox" id="use_fileupload" value="1" <?php checked('1', get_settings('use_fileupload')); ?> />
<label for="use_fileupload"><?php _e('Allow File Uploads') ?></label></legend>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr>
<th width="33%" valign="top" scope="row"><?php _e('Destination directory:') ?> </th>
<td>
<input name="fileupload_realpath" type="text" id="fileupload_realpath" value="<?php form_option('fileupload_realpath'); ?>" size="50" /><br />
<?php printf(__('Recommended: <code>%s</code>'), ABSPATH . 'wp-content') ?>
</td>
</tr>
<tr>
<th valign="top" scope="row"><?php _e('URI of this directory:') ?> </th>
<td>
<input name="fileupload_url" type="text" id="fileupload_url" value="<?php form_option('fileupload_url'); ?>" size="50" /><br />
<?php printf(__('Recommended: <code>%s</code>'), get_settings('siteurl') . '/wp-content') ?>
</td>
</tr>
<tr>
<th scope="row"><?php _e('Maximum size:') ?> </th>
<td><input name="fileupload_maxk" type="text" id="fileupload_maxk" value="<?php form_option('fileupload_maxk'); ?>" size="4" />
<?php _e('Kilobytes (KB)') ?></td>
</tr>
<tr>
<th valign="top" scope="row"><?php _e('Allowed file extensions:') ?></th>
<td><input name="fileupload_allowedtypes" type="text" id="fileupload_allowedtypes" value="<?php form_option('fileupload_allowedtypes'); ?>" size="40" />
<br />
<?php _e('Recommended: <code>jpg jpeg png gif</code>') ?></td>
</tr>
<tr>
<th scope="row"><?php _e('Minimum level to upload:') ?></th>
<td><select name="fileupload_minlevel" id="fileupload_minlevel">
<?php
for ($i = 1; $i < 11; $i++) {
if ($i == get_settings('fileupload_minlevel')) $selected = " selected='selected'";
else $selected = '';
echo "\n\t<option value='$i' $selected>$i</option>";
}
?>
</select></td>
</tr>
</table>
</fieldset>
<p><input name="use_linksupdate" type="checkbox" id="use_linksupdate" value="1" <?php checked('1', get_settings('use_linksupdate')); ?> />
<label for="use_linksupdate"><?php _e('Track Links&#8217; Update Times') ?></label></p>
<p>
<label><input type="checkbox" name="hack_file" value="1" <?php checked('1', get_settings('hack_file')); ?> /> <?php _e('Use legacy <code>my-hacks.php</code> file support') ?></label>
</p>
<p class="submit">
<input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
</p>
<form method="post" action="options.php">
<fieldset class="options">
<legend>
<input name="use_fileupload" type="checkbox" id="use_fileupload" value="1" <?php checked('1', get_settings('use_fileupload')); ?> />
<label for="use_fileupload"><?php _e('Allow File Uploads') ?></label></legend>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr>
<th width="33%" valign="top" scope="row"><?php _e('Destination directory:') ?> </th>
<td>
<input name="fileupload_realpath" type="text" id="fileupload_realpath" value="<?php form_option('fileupload_realpath'); ?>" size="50" /><br />
<?php printf(__('Recommended: <code>%s</code>'), ABSPATH . 'wp-content') ?>
</td>
</tr>
<tr>
<th valign="top" scope="row"><?php _e('URI of this directory:') ?> </th>
<td>
<input name="fileupload_url" type="text" id="fileupload_url" value="<?php form_option('fileupload_url'); ?>" size="50" /><br />
<?php printf(__('Recommended: <code>%s</code>'), get_settings('siteurl') . '/wp-content') ?>
</td>
</tr>
<tr>
<th scope="row"><?php _e('Maximum size:') ?> </th>
<td><input name="fileupload_maxk" type="text" id="fileupload_maxk" value="<?php form_option('fileupload_maxk'); ?>" size="4" />
<?php _e('Kilobytes (KB)') ?></td>
</tr>
<tr>
<th valign="top" scope="row"><?php _e('Allowed file extensions:') ?></th>
<td><input name="fileupload_allowedtypes" type="text" id="fileupload_allowedtypes" value="<?php form_option('fileupload_allowedtypes'); ?>" size="40" />
<br />
<?php _e('Recommended: <code>jpg jpeg png gif</code>') ?></td>
</tr>
<tr>
<th scope="row"><?php _e('Minimum level to upload:') ?></th>
<td><select name="fileupload_minlevel" id="fileupload_minlevel">
<?php
for ($i = 1; $i < 11; $i++) {
if ($i == get_settings('fileupload_minlevel')) $selected = " selected='selected'";
else $selected = '';
echo "\n\t<option value='$i' $selected>$i</option>";
}
?>
</select></td>
</tr>
</table>
</fieldset>
<p><input name="use_linksupdate" type="checkbox" id="use_linksupdate" value="1" <?php checked('1', get_settings('use_linksupdate')); ?> />
<label for="use_linksupdate"><?php _e('Track Links&#8217; Update Times') ?></label></p>
<p>
<label><input type="checkbox" name="hack_file" value="1" <?php checked('1', get_settings('hack_file')); ?> /> <?php _e('Use legacy <code>my-hacks.php</code> file support') ?></label>
</p>
<p class="submit">
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="'hack_file','use_fileupload','fileupload_realpath','fileupload_url','fileupload_allowedtypes','fileupload_maxk','fileupload_maxk','fileupload_minlevel','use_geo_positions','use_linksupdate'" />
<input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
</p>
</form>
</div>

View File

@ -2,7 +2,7 @@
require_once('admin.php');
$title = __('Permalink Options');
$parent_file = 'options-general.php';
$parent_file = 'options-personal.php';
function add_js() {
?>

View File

@ -0,0 +1,16 @@
<?php
require_once('admin.php');
if ( isset( $_POST['action'] ) ) {
if ( !isset( $_POST['rich_editing'] ) )
$_POST['rich_editing'] = 'false';
update_user_option( $current_user->id, 'rich_editing', $wpdb->escape($_POST['rich_editing']), true );
do_action('personal_options_update');
$goback = add_query_arg('updated', 'true', $_SERVER['HTTP_REFERER']);
$goback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $goback);
wp_redirect($goback);
}
?>

View File

@ -0,0 +1,35 @@
<?php
require_once('admin.php');
$title = __('Personal Options');
$parent_file = 'options-personal.php';
include('admin-header.php');
?>
<div class="wrap">
<h2><?php _e('Personal Options') ?></h2>
<form id="personal-options" method="post" action="options-personal-update.php">
<p><?php _e('Personal options are just for you, they don&#8217;t affect other users on blog.'); ?><input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="'rich_editing'<?php do_action('personal_option_list'); ?>" /></p>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Editing:') ?></th>
<td><label for="rich_editing">
<input name="rich_editing" type="checkbox" id="rich_editing" value="true" <?php checked('true', get_user_option('rich_editing')); ?> />
<?php _e('Use the visual rich editor when writing') ?></label></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('More:') ?></th>
<td>We should really figure out what else to put here.</td>
</tr>
<?php do_action('personal_options_table'); ?>
</table>
</fieldset>
<p class="submit">
<input type="submit" name="Submit" value="<?php _e('Update Personal Options') ?> &raquo;" />
</p>
</form>
</div>
<?php include('admin-footer.php'); ?>

View File

@ -2,7 +2,7 @@
require_once('admin.php');
$title = __('Reading Options');
$parent_file = 'options-general.php';
$parent_file = 'options-personal.php';
include('admin-header.php');
?>
@ -10,54 +10,54 @@ include('admin-header.php');
<div class="wrap">
<h2><?php _e('Reading Options') ?></h2>
<form name="form1" method="post" action="options.php">
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="'posts_per_page','what_to_show','posts_per_rss','rss_use_excerpt','blog_charset','gzipcompression' " />
<fieldset class="options">
<legend><?php _e('Blog Pages') ?></legend>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Show at most:') ?></th>
<td>
<input name="posts_per_page" type="text" id="posts_per_page" value="<?php form_option('posts_per_page'); ?>" size="3" />
<select name="what_to_show" id="what_to_show" >
<option value="days" <?php selected('days', get_settings('what_to_show')); ?>><?php _e('days') ?></option>
<option value="posts" <?php selected('posts', get_settings('what_to_show')); ?>><?php _e('posts') ?></option>
</select>
</td>
</tr>
</table>
</fieldset>
<fieldset class="options">
<legend><?php _e('Blog Pages') ?></legend>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Show at most:') ?></th>
<td>
<input name="posts_per_page" type="text" id="posts_per_page" value="<?php form_option('posts_per_page'); ?>" size="3" />
<select name="what_to_show" id="what_to_show" >
<option value="days" <?php selected('days', get_settings('what_to_show')); ?>><?php _e('days') ?></option>
<option value="posts" <?php selected('posts', get_settings('what_to_show')); ?>><?php _e('posts') ?></option>
</select>
</td>
</tr>
</table>
</fieldset>
<fieldset class="options">
<legend><?php _e('Syndication Feeds') ?></legend>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Show the most recent:') ?></th>
<td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php form_option('posts_per_rss'); ?>" size="3" /> <?php _e('posts') ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('For each article, show:') ?> </th>
<td>
<label><input name="rss_use_excerpt" type="radio" value="0" <?php checked(0, get_settings('rss_use_excerpt')); ?> /> <?php _e('Full text') ?></label><br />
<label><input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, get_settings('rss_use_excerpt')); ?> /> <?php _e('Summary') ?></label>
</td>
</tr>
</table>
</fieldset>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Encoding for pages and feeds:') ?></th>
<td><input name="blog_charset" type="text" id="blog_charset" value="<?php form_option('blog_charset'); ?>" size="20" class="code" /><br />
<?php _e('The character encoding you write your blog in (UTF-8 is <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></td>
</tr>
</table>
<p>
<label><input type="checkbox" name="gzipcompression" value="1" <?php checked('1', get_settings('gzipcompression')); ?> />
<?php _e('WordPress should compress articles (gzip) if browsers ask for them') ?></label>
</p>
<p class="submit">
<input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
</p>
<fieldset class="options">
<legend><?php _e('Syndication Feeds') ?></legend>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Show the most recent:') ?></th>
<td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php form_option('posts_per_rss'); ?>" size="3" /> <?php _e('posts') ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('For each article, show:') ?> </th>
<td>
<label><input name="rss_use_excerpt" type="radio" value="0" <?php checked(0, get_settings('rss_use_excerpt')); ?> /> <?php _e('Full text') ?></label><br />
<label><input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, get_settings('rss_use_excerpt')); ?> /> <?php _e('Summary') ?></label>
</td>
</tr>
</table>
</fieldset>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<th width="33%" scope="row"><?php _e('Encoding for pages and feeds:') ?></th>
<td><input name="blog_charset" type="text" id="blog_charset" value="<?php form_option('blog_charset'); ?>" size="20" class="code" /><br />
<?php _e('The character encoding you write your blog in (UTF-8 is <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></td>
</tr>
</table>
<p>
<label><input type="checkbox" name="gzipcompression" value="1" <?php checked('1', get_settings('gzipcompression')); ?> />
<?php _e('WordPress should compress articles (gzip) if browsers ask for them') ?></label>
</p>
<p class="submit">
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="'posts_per_page','what_to_show','posts_per_rss','rss_use_excerpt','blog_charset','gzipcompression' " />
<input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
</p>
</form>
</div>
<?php include('./admin-footer.php'); ?>

View File

@ -2,22 +2,20 @@
require_once('admin.php');
$title = __('Writing Options');
$parent_file = 'options-general.php';
$parent_file = 'options-personal.php';
include('admin-header.php');
?>
<div class="wrap">
<h2><?php _e('Writing Options') ?></h2>
<form name="form1" method="post" action="options.php">
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="'default_post_edit_rows','use_smilies','rich_editing','ping_sites','mailserver_url', 'mailserver_port','mailserver_login','mailserver_pass','default_category','default_email_category'" />
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<th width="33%" scope="row"> <?php _e('Size of the post box:') ?></th>
<td><input name="default_post_edit_rows" type="text" id="default_post_edit_rows" value="<?php form_option('default_post_edit_rows'); ?>" size="2" style="width: 1.5em; " />
<?php _e('lines') ?></td>
</tr>
<h2><?php _e('Writing Options') ?></h2>
<form method="post" action="options.php">
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<th width="33%" scope="row"> <?php _e('Size of the post box:') ?></th>
<td><input name="default_post_edit_rows" type="text" id="default_post_edit_rows" value="<?php form_option('default_post_edit_rows'); ?>" size="2" style="width: 1.5em; " />
<?php _e('lines') ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Formatting:') ?></th>
<td>
@ -29,46 +27,46 @@ include('admin-header.php');
<?php _e('Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display') ?></label>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Default post category:') ?></th>
<td><select name="default_category" id="default_category">
<tr valign="top">
<th scope="row"><?php _e('Default post category:') ?></th>
<td><select name="default_category" id="default_category">
<?php
$categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name");
foreach ($categories as $category) :
if ($category->cat_ID == get_settings('default_category')) $selected = " selected='selected'";
else $selected = '';
echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>";
echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>";
endforeach;
?>
</select></td>
</tr>
</select></td>
</tr>
</table>
<fieldset class="options">
<legend><?php _e('Writing by e-mail') ?></legend>
<p><?php printf(__('To post to WordPress by e-mail you must set up a secret e-mail account with POP3 access. Any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret. Here are three random strings you could use: <code>%s</code>, <code>%s</code>, <code>%s</code>.'), substr(md5(uniqid(microtime())),0,5), substr(md5(uniqid(microtime())),0,5), substr(md5(uniqid(microtime())),0,5)) ?></p>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<th scope="row"><?php _e('Mail server:') ?></th>
<td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option('mailserver_url'); ?>" size="40" />
<label for="mailserver_port"><?php _e('Port:') ?></label>
<input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option('mailserver_port'); ?>" size="6" />
</td>
</tr>
<tr valign="top">
<th width="33%" scope="row"><?php _e('Login name:') ?></th>
<td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option('mailserver_login'); ?>" size="40" /></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Password:') ?></th>
<td>
<input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php form_option('mailserver_pass'); ?>" size="40" />
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Default post by mail category:') ?></th>
<td><select name="default_email_category" id="default_email_category">
<legend><?php _e('Writing by e-mail') ?></legend>
<p><?php printf(__('To post to WordPress by e-mail you must set up a secret e-mail account with POP3 access. Any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret. Here are three random strings you could use: <code>%s</code>, <code>%s</code>, <code>%s</code>.'), substr(md5(uniqid(microtime())),0,5), substr(md5(uniqid(microtime())),0,5), substr(md5(uniqid(microtime())),0,5)) ?></p>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<th scope="row"><?php _e('Mail server:') ?></th>
<td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option('mailserver_url'); ?>" size="40" />
<label for="mailserver_port"><?php _e('Port:') ?></label>
<input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option('mailserver_port'); ?>" size="6" />
</td>
</tr>
<tr valign="top">
<th width="33%" scope="row"><?php _e('Login name:') ?></th>
<td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option('mailserver_login'); ?>" size="40" /></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Password:') ?></th>
<td>
<input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php form_option('mailserver_pass'); ?>" size="40" />
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Default post by mail category:') ?></th>
<td><select name="default_email_category" id="default_email_category">
<?php
//Alreay have $categories from default_category
foreach ($categories as $category) :
@ -77,22 +75,24 @@ else $selected = '';
echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>";
endforeach;
?>
</select></td>
</tr>
</table>
</select></td>
</tr>
</table>
</fieldset>
<fieldset class="options">
<legend><?php _e('Update Services') ?></legend>
<p><?php _e('When you publish a new post, WordPress automatically notifies the following site update services. For more about this, see <a href="http://codex.wordpress.org/Update_Services">Update Services</a> on the Codex. Separate multiple service URIs with line breaks.') ?></p>
<textarea name="ping_sites" id="ping_sites" style="width: 98%;" rows="3" cols="50"><?php form_option('ping_sites'); ?></textarea>
<legend><?php _e('Update Services') ?></legend>
<p><?php _e('When you publish a new post, WordPress automatically notifies the following site update services. For more about this, see <a href="http://codex.wordpress.org/Update_Services">Update Services</a> on the Codex. Separate multiple service URIs with line breaks.') ?></p>
<textarea name="ping_sites" id="ping_sites" style="width: 98%;" rows="3" cols="50"><?php form_option('ping_sites'); ?></textarea>
</fieldset>
<p class="submit">
<input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
<p class="submit">
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="'default_post_edit_rows','use_smilies','rich_editing','ping_sites','mailserver_url', 'mailserver_port','mailserver_login','mailserver_pass','default_category','default_email_category'" />
<input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
</p>
</form>
</div>
<?php include('./admin-footer.php') ?>
<?php include('./admin-footer.php') ?>

View File

@ -299,6 +299,16 @@ function get_option($option) {
return get_settings($option);
}
function get_user_option( $option ) {
global $wpdb, $current_user;
if ( isset( $current_user->data->{$wpdb->prefix . $option} ) ) // Blog specific
return $current_user->data->{$wpdb->prefix . $option};
elseif ( isset( $current_user->data->{$option} ) ) // User specific and cross-blog
return $current_user->data->{$option};
else // Blog global
return get_option( $option );
}
function form_option($option) {
echo htmlspecialchars( get_option($option), ENT_QUOTES );
}
@ -349,6 +359,12 @@ function update_option($option_name, $newvalue) {
return true;
}
function update_user_option( $user_id, $option_name, $newvalue, $global = false ) {
global $wpdb;
if ( !$global )
$option_name = $wpdb->prefix . $option_name;
return update_usermeta( $user_id, $option_name, $newvalue );
}
// thx Alex Stapleton, http://alex.vort-x.net/blog/
function add_option($name, $value = '', $description = '', $autoload = 'yes') {