Various cleanups.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-04-22 20:58:15 +00:00
parent ed915a5aab
commit 6f66293c21

View File

@ -2,23 +2,6 @@
$title = 'Permalink Options';
$parent_file = 'options-general.php';
function add_magic_quotes($array) {
foreach ($array as $k => $v) {
if (is_array($v)) {
$array[$k] = add_magic_quotes($v);
} else {
$array[$k] = addslashes($v);
}
}
return $array;
}
if (!get_magic_quotes_gpc()) {
$_GET = add_magic_quotes($_GET);
$_POST = add_magic_quotes($_POST);
$_COOKIE = add_magic_quotes($_COOKIE);
}
$wpvarstoreset = array('action','standalone', 'option_group_id');
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
$wpvar = $wpvarstoreset[$i];
@ -35,9 +18,9 @@ for ($i=0; $i<count($wpvarstoreset); $i += 1) {
}
}
require_once('optionhandler.php');
require_once('./optionhandler.php');
if ($_POST['Submit']) {
if ($_POST['submit']) {
update_option('permalink_structure', $_POST['permalink_structure']);
$permalink_structure = $_POST['permalink_structure'];
} else {
@ -49,11 +32,11 @@ switch($action) {
default:
$standalone = 0;
include_once('admin-header.php');
require_once('admin-header.php');
if ($user_level <= 6) {
die("You have do not have sufficient permissions to edit the options for this blog.");
}
include('options-head.php');
require('./options-head.php');
?>
<div class="wrap">
<h2>Edit Permalink Structure</h2>
@ -62,7 +45,7 @@ default:
<li><code>%year%</code> --- The year of the post, 4 digits, for example <code>2004</code> </li>
<li><code>%monthnum%</code> --- Month of the year, for example <code>05</code></li>
<li><code>%day% </code>--- Day of the month, for example <code>28</code></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>%postname%</code> --- A sanitized version of the title of the post. So &#8220;This Is A Great Post!&#8221; becomes &#8220;<code>this-is-a-great-post</code>&#8221; in the URI </li>
<li><code>%post_id%</code> --- The unique ID # of the post, for example <code>423</code> <strong></strong></li>
</ul>
<p>So for example a value like:</p>
@ -75,10 +58,10 @@ default:
<form name="form" action="options-permalink.php" method="post">
<p>Use the template tags above to create a virtual site structure:</p>
<p>
<input name="permalink_structure" type="text" style="width: 100%;" value="<?php echo $permalink_structure; ?>" />
<input name="permalink_structure" type="text" style="width: 98%;" value="<?php echo $permalink_structure; ?>" />
</p>
<p class="submit">
<input type="submit" name="Submit" value="Update Permalink Structure">
<input type="submit" name="submit" value="Update Permalink Structure">
</p>
</form>
<?php
@ -120,5 +103,5 @@ echo "</div>\n";
break;
}
include("admin-footer.php")
require('./admin-footer.php');
?>