Migration to get_settings

git-svn-id: https://develop.svn.wordpress.org/trunk@956 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg
2004-03-01 06:13:32 +00:00
parent 37c361e964
commit 59155a15f3
30 changed files with 109 additions and 155 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ if ($standalone == 0) {
<title>WordPress &rsaquo; <?php bloginfo('name') ?> &rsaquo; <?php echo $title; ?></title>
<link rel="stylesheet" href="wp-admin.css" type="text/css" />
<link rel="shortcut icon" href="../wp-images/wp-favicon.png" />
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $blog_charset ?>" />
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo get_settings('blog_charset'); ?>" />
<?php
if ($redirect==1) {
?>
+1 -1
View File
@@ -71,7 +71,7 @@ window.close()
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WordPress > Bookmarklet</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $blog_charset ?>" />
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo get_settings('blog_charset'); ?>" />
<link rel="stylesheet" href="wp-admin.css" type="text/css" />
<link rel="shortcut icon" href="../wp-images/wp-favicon.png" />
<script type="text/javascript" language="javascript">
+2 -2
View File
@@ -2,7 +2,7 @@
<div class="wrap">
<?php
$allowed_users = explode(" ", trim($fileupload_allowedusers));
$allowed_users = explode(" ", trim(get_settings('fileupload_allowedusers')));
$submitbutton_text = 'Save';
$toprow_title = 'Editing Post #' . $postdata['ID'];
@@ -11,7 +11,7 @@ $form_extra = "' />\n<input type='hidden' name='post_ID' value='$post->ID";
$colspan = 2;
$form_pingback = '<input type="hidden" name="post_pingback" value="0" />';
$form_prevstatus = '<input type="hidden" name="prev_status" value="'.$post_status.'" />';
if ($use_trackback) {
if (get_settings('use_trackback')) {
$form_trackback = '<p><label for="trackback"><a href="http://wordpress.org/docs/reference/post/#trackback" title="Help on trackbacks"><strong>TrackBack</strong> an <acronym title="Uniform Resource Locator">URL</acronym></a></label>
(Separate multiple <acronym title="Uniform Resource Locator">URL</acronym>s with spaces.)<br />
<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. str_replace("\n", ' ', $to_ping) .'" /></p>';
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
$allowed_users = explode(" ", trim($fileupload_allowedusers));
$allowed_users = explode(" ", trim(get_settings('fileupload_allowedusers')));
$submitbutton_text = 'Edit this!';
$toprow_title = 'Editing Comment # '.$commentdata['comment_ID'];
+3 -3
View File
@@ -2,20 +2,20 @@
<div class="wrap">
<?php
$allowed_users = explode(" ", trim($fileupload_allowedusers));
$allowed_users = explode(" ", trim(get_settings('fileupload_allowedusers')));
$submitbutton_text = 'Blog this!';
$toprow_title = 'New Post';
$form_action = 'post';
$form_extra = '';
if ($use_pingback) {
if (get_settings('use_pingback')) {
$form_pingback = '<input type="checkbox" class="checkbox" name="post_pingback" value="1" ';
if ($post_pingback) $form_pingback .= 'checked="checked" ';
$form_pingback .= 'tabindex="7" id="pingback" /> <label for="pingback"><strong>PingBack</strong> the <acronym title="Uniform Resource Locators">URL</acronym>s in this post</label> <a href="http://wordpress.org/docs/reference/post/#pingback" title="Help on Pingbacks">?</a><br />';
} else {
$form_pingback = '';
}
if ($use_trackback) {
if (get_settings('use_trackback')) {
$form_trackback = '<p><label for="trackback"><a href="http://wordpress.org/docs/reference/post/#trackback" title="Help on trackbacks"><strong>TrackBack</strong> an <acronym title="Uniform Resource Locator">URL</acronym></a>:</label> (Separate multiple <acronym title="Uniform Resource Locator">URL</acronym>s with spaces.)<br />
<input type="text" name="trackback_url" style="width: 360px" id="trackback" tabindex="7" /></p>';
if ('' != $pinged) {
-3
View File
@@ -419,7 +419,6 @@ $option_data = array(
"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(25,'rss_use_excerpt', 2, '1', 'use the excerpt field for rss feed.', 8, 20)",
"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(26,'use_weblogsping', 2, '0', 'set this to true if you want your site to be listed on http://weblogs.com when you add a new post', 8, 20)",
"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(27,'use_blodotgsping', 2, '0', 'set this to true if you want your site to be listed on http://blo.gs when you add a new post', 8, 20)",
"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(28,'blodotgsping_url', 3, 'http://example.com', 'You shouldn\'t need to change this.', 8, 30)",
"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(29,'use_trackback', 2, '1', 'set this to 0 or 1, whether you want to allow your posts to be trackback\'able or not note: setting it to zero would also disable sending trackbacks', 8, 20)",
"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(30,'use_pingback', 2, '1', 'set this to 0 or 1, whether you want to allow your posts to be pingback\'able or not note: setting it to zero would also disable sending pingbacks', 8, 20)",
//file upload
@@ -700,8 +699,6 @@ $url = $_POST['url'];
if (isset($url)) {
$query= "UPDATE $tableoptions set option_value='$url' where option_id=1"; //siteurl
$q = $wpdb->query($query);
$query= "UPDATE $tableoptions set option_value='$url' where option_id=28"; //blodotgsping_url
$q = $wpdb->query($query);
$query= "UPDATE $tableoptions set option_value='$url/wp-images/smilies' where option_id=17"; //smilies_directory
$q = $wpdb->query($query);
}
+1 -1
View File
@@ -99,7 +99,7 @@ switch ($step) {
}
else // try to get the upload file.
{
$uploaddir = $fileupload_realpath;
$uploaddir = get_settings('fileupload_realpath');
$uploadfile = $uploaddir.'/'.$_FILES['userfile']['name'];
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile))
+2 -2
View File
@@ -13,8 +13,8 @@ foreach ($menu as $item) {
$self = str_replace('/wp-admin/', '', $PHP_SELF);
if ((substr($self, -20) == substr($item[1], -20) && empty($parent_file)) || ($parent_file && ($item[1] == $parent_file))) $class = ' class="current"';
if ($user_level >= $item[0]) {
if (('upload.php' == $item[1] && $use_fileupload && ($user_level >= $fileupload_minlevel)
&& (in_array($user_login, explode(' ', $allowed_users)) || (trim($fileupload_allowedusers)==""))) || 'upload.php' != $item[1])
if (('upload.php' == $item[1] && get_settings('use_fileupload') && ($user_level >= get_settings('fileupload_minlevel'))
&& (in_array($user_login, explode(' ', $allowed_users)) || (trim(get_settings('fileupload_allowedusers'))==''))) || 'upload.php' != $item[1])
echo "\n\t<li><a href='{$item[1]}'$class>{$item[2]}</a></li>";
}
}
+5 -5
View File
@@ -707,17 +707,17 @@ switch($action) {
<p>
<?php
$bookmarklet_height= ($use_trackback) ? 460 : 420;
$bookmarklet_height= (get_settings('use_trackback')) ? 460 : 420;
if ($is_NS4 || $is_gecko) {
?>
<a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}void(window.open('<?php echo get_settings('siteurl') ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'WordPress bookmarklet','scrollbars=yes,width=600,height=460,left=100,top=150,status=yes'));">Press It
- <?php echo $blogname ?></a>
- <?php echo get_settings('blogname'); ?></a>
<?php
} else if ($is_winIE) {
?>
<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;void(btw=window.open('<?php echo get_settings('siteurl') ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'<?php echo $bookmarklet_tbpb ?>&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();">Press it
- <?php echo $blogname ?></a>
- <?php echo get_settings('blogname'); ?></a>
<script type="text/javascript" language="JavaScript">
<!--
function oneclickbookmarklet(blah) {
@@ -733,12 +733,12 @@ function oneclickbookmarklet(blah) {
} else if ($is_opera) {
?>
<a href="javascript:void(window.open('<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));">Press it
- <?php echo $blogname ?></a>
- <?php echo get_settings('blogname'); ?></a>
<?php
} else if ($is_macIE) {
?>
<a href="javascript:Q='';if(top.frames.length==0);void(btw=window.open('<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();">Press it
- <?php echo $blogname ?></a>
- <?php echo get_settings('blogname'); ?></a>
<?php
}
?>
+8 -8
View File
@@ -178,9 +178,9 @@ break;
case 'IErightclick':
$bookmarklet_tbpb = ($use_trackback) ? '&trackback=1' : '';
$bookmarklet_tbpb .= ($use_pingback) ? '&pingback=1' : '';
$bookmarklet_height= ($use_trackback) ? 590 : 550;
$bookmarklet_tbpb = (get_settings('use_trackback')) ? '&trackback=1' : '';
$bookmarklet_tbpb .= (get_settings('use_pingback')) ? '&pingback=1' : '';
$bookmarklet_height= (get_settings('use_trackback')) ? 590 : 550;
?>
@@ -191,7 +191,7 @@ case 'IErightclick':
<p>To have a one-click bookmarklet, just copy and paste this<br />into a new text file:</p>
<?php
$regedit = "REGEDIT4\r\n[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Post To &WP : ".$blogname."]\r\n@=\"javascript:doc=external.menuArguments.document;Q=doc.selection.createRange().text;void(btw=window.open('". get_settings('siteurl') ."/wp-admin/bookmarklet.php?text='+escape(Q)+'".$bookmarklet_tbpb."&popupurl='+escape(doc.location.href)+'&popuptitle='+escape(doc.title),'bookmarklet','scrollbars=no,width=480,height=".$bookmarklet_height.",left=100,top=150,status=yes'));btw.focus();\"\r\n\"contexts\"=hex:31\"";
$regedit = "REGEDIT4\r\n[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Post To &WP : ". get_settings('blogname') ."]\r\n@=\"javascript:doc=external.menuArguments.document;Q=doc.selection.createRange().text;void(btw=window.open('". get_settings('siteurl') ."/wp-admin/bookmarklet.php?text='+escape(Q)+'".$bookmarklet_tbpb."&popupurl='+escape(doc.location.href)+'&popuptitle='+escape(doc.title),'bookmarklet','scrollbars=no,width=480,height=".$bookmarklet_height.",left=100,top=150,status=yes'));btw.focus();\"\r\n\"contexts\"=hex:31\"";
?>
<pre style="margin: 20px; background-color: #cccccc; border: 1px dashed #333333; padding: 5px; font-size: 12px;"><?php echo $regedit; ?></pre>
<p>Save it as wordpress.reg, and double-click on this file in an Explorer<br />
@@ -216,9 +216,9 @@ default:
include_once('admin-header.php');
$profiledata=get_userdata($user_ID);
$bookmarklet_tbpb = ($use_trackback) ? '&trackback=1' : '';
$bookmarklet_tbpb .= ($use_pingback) ? '&pingback=1' : '';
$bookmarklet_height= ($use_trackback) ? 480 : 440;
$bookmarklet_tbpb = (get_settings('use_trackback')) ? '&trackback=1' : '';
$bookmarklet_tbpb .= (get_settings('use_pingback')) ? '&pingback=1' : '';
$bookmarklet_height= (get_settings('use_trackback')) ? 480 : 440;
?>
<?php if ($updated) { ?>
@@ -323,7 +323,7 @@ default:
function addPanel()
{
if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function"))
window.sidebar.addPanel("WordPress Post: <?php echo $blogname ?>","<?php echo get_settings('siteurl'); ?>/wp-admin/sidebar.php","");
window.sidebar.addPanel("WordPress Post: <?php echo get_settings('blogname'); ?>","<?php echo get_settings('siteurl'); ?>/wp-admin/sidebar.php","");
else
alert('No Sidebar found! You must use Mozilla 0.9.4 or later!');
}
-1
View File
@@ -196,7 +196,6 @@ $guessurl = preg_replace('|/wp-admin/.*|i', '', 'http://' . $HTTP_HOST . $REQUES
"25" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (25,'rss_use_excerpt', 2, '1', 'use the excerpt field for rss feed.', 8, 20)",
"26" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (26,'use_weblogsping', 2, '0', 'set this to true if you want your site to be listed on http://weblogs.com when you add a new post', 8, 20)",
"27" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (27,'use_blodotgsping', 2, '0', 'set this to true if you want your site to be listed on http://blo.gs when you add a new post', 8, 20)",
"28" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (28,'blodotgsping_url', 3, 'http://example.com', 'You shouldn\'t need to change this.', 8, 30)",
"29" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (29,'use_trackback', 2, '1', 'set this to false or true, whether you want to allow your posts to be trackback\'able or not note: setting it to false would also disable sending trackbacks', 8, 20)",
"30" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (30,'use_pingback', 2, '1', 'set this to false or true, whether you want to allow your posts to be pingback\'able or not note: setting it to false would also disable sending pingbacks', 8, 20)",
//file upload
+12 -12
View File
@@ -6,10 +6,10 @@ require_once('admin-header.php');
if ($user_level == 0) //Checks to see if user has logged in
die ("Cheatin' uh ?");
if (!$use_fileupload) //Checks if file upload is enabled in the config
if (!get_settings('use_fileupload')) //Checks if file upload is enabled in the config
die ("The admin disabled this function");
$allowed_types = explode(' ', trim($fileupload_allowedtypes));
$allowed_types = explode(' ', trim(get_settings('fileupload_allowedtypes')));
if ($HTTP_POST_VARS['submit']) {
$action = 'upload';
@@ -17,7 +17,7 @@ if ($HTTP_POST_VARS['submit']) {
$action = '';
}
if (!is_writable($fileupload_realpath))
if (!is_writable(get_settings('fileupload_realpath')))
$action = 'not-writable';
?>
@@ -27,7 +27,7 @@ if (!is_writable($fileupload_realpath))
switch ($action) {
case 'not-writable':
?>
<p>It doesn't look like you can use the file upload feature at this time because the directory you have specified (<code><?php echo $fileupload_realpath; ?></code>) doesn't appear to be writable by WordPress. Check the permissions on the directory and for typos.</p>
<p>It doesn't look like you can use the file upload feature at this time because the directory you have specified (<code><?php echo $get_settings('fileupload_realpath'); ?></code>) doesn't appear to be writable by WordPress. Check the permissions on the directory and for typos.</p>
<?php
break;
@@ -42,7 +42,7 @@ case '':
<p>
<label for="img1">File:</label>
<br />
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $fileupload_maxk * 1024 ?>" />
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo get_settings('fileupload_maxk') * 1024 ?>" />
<input type="file" name="img1" id="img1" size="35" class="uploadform" /></p>
<p>
<label for="imgdesc">Description:</label><br />
@@ -96,10 +96,10 @@ case 'upload':
}
if (strlen($imgalt)) {
$pathtofile = $fileupload_realpath."/".$imgalt;
$pathtofile = get_settings('fileupload_realpath')."/".$imgalt;
$img1 = $HTTP_POST_VARS['img1'];
} else {
$pathtofile = $fileupload_realpath."/".$img1_name;
$pathtofile = get_settings('fileupload_realpath')."/".$img1_name;
$img1 = $HTTP_POST_FILES['img1']['tmp_name'];
}
@@ -118,8 +118,8 @@ case 'upload':
}
if (file_exists($pathtofile) && !strlen($imgalt)) {
$i = explode(" ",$fileupload_allowedtypes);
$i = implode(", ",array_slice($i, 1, count($i)-2));
$i = explode(' ', get_settings('fileupload_allowedtypes'));
$i = implode(', ',array_slice($i, 1, count($i)-2));
$moved = move_uploaded_file($img1, $pathtofile2);
// if move_uploaded_file() fails, try copy()
if (!$moved) {
@@ -138,7 +138,7 @@ case 'upload':
<p> filename '<?php echo $img1; ?>' moved to '<?php echo "$pathtofile2 - $img2_name"; ?>'</p>
<p>Confirm or rename:</p>
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $fileupload_maxk*1024 ?>" />
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo get_settings('fileupload_maxk') *1024 ?>" />
<input type="hidden" name="img1_type" value="<?php echo $img1_type;?>" />
<input type="hidden" name="img1_name" value="<?php echo $img2_name;?>" />
<input type="hidden" name="img1_size" value="<?php echo $img1_size;?>" />
@@ -197,9 +197,9 @@ die();
if ( ereg('image/',$img1_type)) {
$piece_of_code = "&lt;img src=&quot;$fileupload_url/$img1_name&quot; alt=&quot;$imgdesc&quot; /&gt;";
$piece_of_code = "&lt;img src=&quot;". get_settings('fileupload_url') ."/$img1_name&quot; alt=&quot;$imgdesc&quot; /&gt;";
} else {
$piece_of_code = "&lt;a href=&quot;$fileupload_url/$img1_name&quot; title=&quot;$imgdesc&quot; /&gt;$imgdesc&lt;/a&gt;";
$piece_of_code = "&lt;a href=&quot;". get_settings('fileupload_url') . "/$img1_name&quot; title=&quot;$imgdesc&quot; /&gt;$imgdesc&lt;/a&gt;";
};
?>
+2 -2
View File
@@ -86,10 +86,10 @@ case 'adduser':
$stars .= '*';
}
$message = "New user registration on your blog $blogname:\r\n\r\n";
$message = 'New user registration on your blog ' . get_settings('blogname') . ":\r\n\r\n";
$message .= "Login: $user_login\r\n\r\nE-mail: $user_email";
@mail($admin_email, "[$blogname] New User Registration", $message);
@mail($admin_email, '[' . get_settings('blogname') . '] New User Registration', $message);
header('Location: users.php');
break;