The great option REMIX.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-04-15 07:53:45 +00:00
parent bb47a88b57
commit 4f909d4cc5
6 changed files with 86 additions and 11 deletions

View File

@ -91,15 +91,17 @@ This address is used only for admin purposes. </td>
</tr> </tr>
<tr> <tr>
<th scope="row">&nbsp;</th> <th scope="row">&nbsp;</th>
<td>The following use the same syntax as the <a href="http://php.net/date">PHP <code>date()</code> function</a>. </td> <td>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>
<tr> <tr>
<th scope="row">Default date format:</th> <th scope="row">Default date format:</th>
<td><input name="date_format" type="text" id="date_format" size="30" value="<?php echo get_settings('date_format'); ?>" /></td> <td><input name="date_format" type="text" id="date_format" size="30" value="<?php echo get_settings('date_format'); ?>" /><br />
Output: <strong><?php echo date(get_settings('date_format'), current_time('timestamp')); ?></strong></td>
</tr> </tr>
<tr> <tr>
<th scope="row">Default time format:</th> <th scope="row">Default time format:</th>
<td><input name="time_format" type="text" id="time_format" size="30" value="<?php echo get_settings('time_format'); ?>" /></td> <td><input name="time_format" type="text" id="time_format" size="30" value="<?php echo get_settings('time_format'); ?>" /><br />
Output: <strong><?php echo date(get_settings('time_format'), current_time('timestamp')); ?></strong></td>
</tr> </tr>
</table> </table>
</fieldset> </fieldset>

View File

@ -23,8 +23,8 @@ $submenu = <<<END
<li><a href="options-reading.php">Reading</a></li> <li><a href="options-reading.php">Reading</a></li>
<li><a href="options-discussion.php">Discussion</a></li> <li><a href="options-discussion.php">Discussion</a></li>
<li><a href="options-misc.php">Miscellaneous</a></li> <li><a href="options-misc.php">Miscellaneous</a></li>
<li><a href="options-permalink.php">Permalinks</a></li>
$groups $groups
<li class="last"><a href="options-permalink.php">Permalinks</a></li>
</ul> </ul>
END; END;
@ -33,7 +33,7 @@ foreach ($sublines as $subline) {
preg_match('/href="([^"]+)"/', $subline, $url); preg_match('/href="([^"]+)"/', $subline, $url);
if (substr($_SERVER['REQUEST_URI'], -8) == substr($url[1], -8)) { if (substr($_SERVER['REQUEST_URI'], -8) == substr($url[1], -8)) {
$subline = str_replace('a hr', 'a class="current" hr', $subline); $subline = str_replace('a hr', 'a class="current" hr', $subline);
if ($_SERVER["REQUEST_URI"] == $url[1]) { if (str_replace('/wp-admin/', '', $_SERVER["REQUEST_URI"]) == $url[1]) {
$subline = preg_replace('|href=".*?"|', '', $subline); $subline = preg_replace('|href=".*?"|', '', $subline);
} }
} }

View File

@ -44,7 +44,56 @@ include('options-head.php');
<h2>Miscellaneous Options</h2> <h2>Miscellaneous Options</h2>
<form name="form1" method="post" action="options.php"> <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="action" value="update" /> <input type="hidden" name="page_options" value="'hack_file' " /> <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'" />
<fieldset class="options">
<legend>File Uploads</legend>
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<th scope="row"><label for="use_fileupload">Allow file uploads:</label></th>
<td>
<input name="use_fileupload" type="checkbox" id="use_fileupload" value="1" <?php checked('1', get_settings('use_fileupload')); ?> />
</td>
</tr>
<tr valign="top">
<th width="33%" scope="row"> Destination directory: </th>
<td>
<input name="fileupload_realpath" type="text" id="fileupload_realpath" value="<?php echo get_settings('fileupload_realpath'); ?>" size="50" /><br />
Recommended: <code><?php echo ABSPATH . 'wp-content'; ?></code>
</td>
</tr>
<tr valign="top">
<th scope="row">URI of this directory: </th>
<td>
<input name="fileupload_url" type="text" id="fileupload_url" value="<?php echo get_settings('fileupload_url'); ?>" size="50" /><br />
Recommended: <code><?php echo get_settings('siteurl') . '/wp-content'; ?></code>
</td>
</tr>
<tr valign="top">
<th scope="row">Maximum size: </th>
<td><input name="fileupload_maxk" type="text" id="fileupload_maxk" value="<?php echo get_settings('fileupload_maxk'); ?>" size="4">
Kilobytes (KB)</td>
</tr>
<tr valign="top">
<th scope="row">Allowed file extensions:</th>
<td><input name="fileupload_allowedtypes" type="text" id="fileupload_allowedtypes" value="<?php echo get_settings('fileupload_allowedtypes'); ?>" size="40">
<br>
Recommended: <code>jpg jpeg png gif </code></td>
</tr>
<tr valign="top">
<th scope="row">Minimum level to upload:</th>
<td><select name="fileupload_minlevel" id="fileupload_minlevel">
<?php
for ($i = 0; $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> <p>
<label> <label>
<input type="checkbox" name="hack_file" value="1" <?php checked('1', get_settings('hack_file')); ?> /> <input type="checkbox" name="hack_file" value="1" <?php checked('1', get_settings('hack_file')); ?> />

View File

@ -65,7 +65,13 @@ default:
<li><code>%postname%</code> --- A sanitized version of the title of the post. So &quot;This Is A Great Post!&quot; becomes &quot;<code>this-is-a-great-post</code>&quot; in the URI </li> <li><code>%postname%</code> --- A sanitized version of the title of the post. So &quot;This Is A Great Post!&quot; becomes &quot;<code>this-is-a-great-post</code>&quot; in the URI </li>
<li><code>%post_id%</code> --- The unique ID # of the post, for example <code>423</code> <strong></strong></li> <li><code>%post_id%</code> --- The unique ID # of the post, for example <code>423</code> <strong></strong></li>
</ul> </ul>
<p>So for example a value like <code>/archives/%year%/%monthnum%/%day%/%postname%/</code> could give you a permalink like <code>/archives/2003/05/23/my-cheese-sandwich/</code> . For this to work you'll need mod_rewrite installed on your server for the rule generation rule to work below. In the future there may be other options. </p> <p>So for example a value like </p>
<p><code>/archives/%year%/%monthnum%/%day%/%postname%/</code> </p>
<p>would give you a permalink like </p>
<p><code>/archives/2003/05/23/my-cheese-sandwich/</code> . </p>
<p> In general for this you must use mod_rewrite, however if you put a filename at the beginning WordPress will attempt to use that to pass the arguments, example:</p>
<p><code>/index.php/archives/%year%/%monthnum%/%day%/%postname%/</code> </p>
<p>If you use this option you can ignore the mod_rewrite rules. </p>
<form name="form" action="options-permalink.php" method="post"> <form name="form" action="options-permalink.php" method="post">
<p>Use the template tags above to create a virtual site structure:</p> <p>Use the template tags above to create a virtual site structure:</p>
<p> <p>
@ -86,14 +92,18 @@ if ('/' != substr($site_root, -1)) $site_root = $site_root . '/';
?> ?>
<form action""> <form action"">
<textarea rows="5" style="width: 100%;">RewriteEngine On <p>
<textarea rows="5" style="width: 100%;">RewriteEngine On
RewriteBase <?php echo $site_root; ?> RewriteBase <?php echo $site_root; ?>
<?php <?php
$rewrite = rewrite_rules('', $permalink_structure); $rewrite = rewrite_rules('', $permalink_structure);
foreach ($rewrite as $match => $query) { foreach ($rewrite as $match => $query) {
echo 'RewriteRule ^' . $match . ' ' . $site_root . $query . " [QSA]\n"; echo 'RewriteRule ^' . $match . ' ' . $site_root . $query . " [QSA]\n";
} }
?></textarea> ?>
</textarea>
</p>
<p>If your <code>.htaccess</code> file is writable by WordPress, you can <a href="templates.php?file=.htaccess">edit it through your template interface</a>.</p>
</form> </form>
</div> </div>
<?php <?php

View File

@ -45,7 +45,7 @@ include('options-head.php');
<h2>Writing Options</h2> <h2>Writing Options</h2>
<form name="form1" method="post" action="options.php"> <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="'default_post_edit_rows','blog_charset','use_smilies','use_balanceTags','advanced_edit','ping_sites'" /> <input type="hidden" name="page_options" value="'default_post_edit_rows','blog_charset','use_smilies','use_balanceTags','advanced_edit','ping_sites','mailserver_url', 'mailserver_port',mailserver_login','mailserver_pass','default_category'" />
<table width="100%" cellspacing="2" cellpadding="5" class="editform"> <table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top"> <tr valign="top">
<th scope="row"> When starting a post, show: </th> <th scope="row"> When starting a post, show: </th>
@ -103,7 +103,16 @@ Advanced controls</label>
</tr> </tr>
<tr valign="top"> <tr valign="top">
<th scope="row">Usual category:</th> <th scope="row">Usual category:</th>
<td>&nbsp;</td> <td><select name="default_category" id="default_category">
<?php
$categories = $wpdb->get_results("SELECT * FROM $tablecategories 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>";
endforeach;
?>
</select></td>
</tr> </tr>
</table> </table>
</fieldset> </fieldset>

View File

@ -710,9 +710,14 @@ function upgrade_110() {
$wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 1"); $wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 1");
$wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 2"); $wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 2");
$wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 3"); $wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 3");
$wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 4");
$wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 5");
$wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 6"); $wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 6");
$wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 7"); $wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 7");
$wpdb->query("UPDATE $tableoptiongroups SET group_name = 'Link Manager' WHERE group_id = 8");
$wpdb->query("UPDATE $tableoptiongroups SET group_name = 'Geo-data' WHERE group_id = 9");
// Add blog_charset option // Add blog_charset option
if(!$wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = 'blog_charset'")) { if(!$wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = 'blog_charset'")) {
$wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_admin_level) VALUES ('blog_charset', 3, 'utf-8', 8)"); $wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_admin_level) VALUES ('blog_charset', 3, 'utf-8', 8)");