mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Migration to get_settings and away from globals.
git-svn-id: https://develop.svn.wordpress.org/trunk@957 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -134,7 +134,7 @@ default:
|
||||
$standalone = 0;
|
||||
require_once ('admin-header.php');
|
||||
if ($user_level < 3) {
|
||||
die("You have no right to edit the categories for this blog.<br />Ask for a promotion to your <a href='mailto:$admin_email'>blog admin</a>. :)");
|
||||
die("You have no right to edit the categories for this blog.<br />Ask for a promotion to your <a href='mailto:" . get_settings('admin_email'). "'>blog admin</a>. :)");
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ textarea,input,select {
|
||||
$query = "INSERT INTO $tableusers (user_login,user_pass,user_nickname,user_email,user_url,user_ip,user_domain,user_browser,dateYMDhour,user_level,user_idmode) VALUES ('$user_login','$pass1','$user_nickname','$user_email','$user_url','$user_ip','$user_domain','$user_browser','$user_joindate','1','nickname')";
|
||||
$result = mysql_query($query);
|
||||
if ($result==false) {
|
||||
die ("<b>ERROR</b>: couldn't register an user... please contact the <a href=\"mailto:$admin_email\">webmaster</a> !");
|
||||
die ("<strong>ERROR</strong>: couldn't register an user!");
|
||||
}
|
||||
echo "<li>user <i>$user_login</i>... <b>Done</b></li>";
|
||||
|
||||
@@ -160,7 +160,7 @@ textarea,input,select {
|
||||
$query = "INSERT INTO $tableusers (user_login,user_pass,user_nickname,user_email,user_url,user_ip,user_domain,user_browser,dateYMDhour,user_level,user_idmode) VALUES ('$user_login','$pass1','$user_nickname','$user_email','$user_url','$user_ip','$user_domain','$user_browser','$user_joindate','0','nickname')";
|
||||
$result = mysql_query($query);
|
||||
if ($result==false) {
|
||||
die ("<b>ERROR</b>: couldn't register an user... please contact the <a href=\"mailto:$admin_email\">webmaster</a> !");
|
||||
die ("<strong>ERROR</strong>: couldn't register an user!");
|
||||
}
|
||||
echo ": registered deleted user <i>$user_login</i> at level 0 ";
|
||||
}
|
||||
@@ -196,7 +196,7 @@ textarea,input,select {
|
||||
$result = mysql_query($query) or die(mysql_error());
|
||||
|
||||
if (!$result)
|
||||
die ("Error in posting... contact the <a href=\"mailto:$admin_email\">webmaster</a>");
|
||||
die ("Error in posting...");
|
||||
|
||||
$sql2 = "SELECT * FROM $tableposts WHERE 1=1 ORDER BY ID DESC LIMIT 1";
|
||||
$result2 = mysql_query($sql2);
|
||||
@@ -244,7 +244,7 @@ textarea,input,select {
|
||||
$sql3 = "INSERT INTO $tablecomments (comment_post_ID,comment_author,comment_author_email,comment_author_url,comment_author_IP,comment_date,comment_content) VALUES ('$comment_post_ID','$comment_author','$comment_author_email','$comment_author_url','$comment_author_IP','$comment_date','$comment_content')";
|
||||
$result3 = mysql_query($sql3);
|
||||
if (!$result3)
|
||||
die ("There is an error with the database, it can't store your comment...<br>Contact the <a href=\"mailto:$admin_email\">webmaster</a>");
|
||||
die ("There is an error with the database, it can't store your comment..");
|
||||
}
|
||||
$comments=$c-4;
|
||||
echo ": imported $comments comment";
|
||||
|
||||
@@ -437,7 +437,6 @@ $option_data = array(
|
||||
"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(42,'default_category', 1, '1', 'by default posts will have this category', 8, 20)",
|
||||
"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(43,'subjectprefix', 3, 'blog:', 'subject prefix', 8, 20)",
|
||||
"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(44,'bodyterminator', 3, '___', 'body terminator string (starting from this string, everything will be ignored, including this string)', 8, 20)",
|
||||
"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(45,'emailtestonly', 2, '0', 'set this to true to run in test mode', 8, 20)",
|
||||
"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(46,'use_phoneemail', 2, '0', 'some mobile phone email services will send identical subject & content on the same line if you use such a service, set use_phoneemail to true, and indicate a separator string', 8, 20)",
|
||||
"INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(47,'phoneemail_separator', 3, ':::', 'when you compose your message, you\'ll type your subject then the separator string then you type your login:password, then the separator, then content', 8, 20)",
|
||||
// original options from options page
|
||||
|
||||
@@ -280,7 +280,7 @@ updated</label>
|
||||
$standalone=0;
|
||||
include_once ("./admin-header.php");
|
||||
if ($user_level < get_settings('links_minadminlevel')) {
|
||||
die("You have no right to edit the link categories for this blog.<br>Ask for a promotion to your <a href=\"mailto:$admin_email\">blog admin</a> :)");
|
||||
die("You have do not have sufficient permissions to edit the link categories for this blog. :)");
|
||||
}
|
||||
?>
|
||||
<ul id="adminmenu2">
|
||||
|
||||
@@ -290,7 +290,7 @@ switch ($action) {
|
||||
$standalone=0;
|
||||
include_once ('admin-header.php');
|
||||
if ($user_level < get_settings('links_minadminlevel')) {
|
||||
die("You have no right to edit the links for this blog.<br />Ask for a promotion to your <a href='mailto:$admin_email'>blog admin</a>. :)");
|
||||
die('You have do not have sufficent permissions to edit the links for this blog.');
|
||||
}
|
||||
|
||||
$row = $wpdb->get_row("SELECT *
|
||||
@@ -537,7 +537,7 @@ No</label></td>
|
||||
$standalone=0;
|
||||
include_once ("./admin-header.php");
|
||||
if ($user_level < get_settings('links_minadminlevel')) {
|
||||
die("You have no right to edit the links for this blog.<br>Ask for a promotion to your <a href=\"mailto:$admin_email\">blog admin</a> :)");
|
||||
die("You have do not have sufficient permissions to edit the links for this blog.");
|
||||
}
|
||||
|
||||
switch ($order_by)
|
||||
|
||||
@@ -51,7 +51,7 @@ case 'update':
|
||||
require_once('admin-header.php');
|
||||
|
||||
if ($user_level < 3) {
|
||||
die('<p>Your level is not high enough to moderate comments. Ask for a promotion from your <a href="mailto:$admin_email">blog admin</a>. :)</p>');
|
||||
die('<p>Your level is not high enough to moderate comments.</p>');
|
||||
}
|
||||
|
||||
$item_ignored = 0;
|
||||
@@ -92,7 +92,7 @@ default:
|
||||
require_once('admin-header.php');
|
||||
|
||||
if ($user_level <= 3) {
|
||||
die('<p>Your level is not high enough to moderate comments. Ask for a promotion from your <a href="mailto:$admin_email">blog admin</a>. :)</p>');
|
||||
die('<p>Your level is not high enough to moderate comments.</p>');
|
||||
}
|
||||
?>
|
||||
<ul id="adminmenu2">
|
||||
|
||||
@@ -40,7 +40,7 @@ require_once('optionhandler.php');
|
||||
$standalone = 0;
|
||||
include_once('admin-header.php');
|
||||
if ($user_level <= 3) {
|
||||
die("You have no right to edit the options for this blog.<br />Ask for a promotion to your <a href=\"mailto:$admin_email\">blog admin</a> :)");
|
||||
die("You have do not have sufficient permissions to edit the options for this blog.");
|
||||
}
|
||||
?>
|
||||
<ul id="adminmenu2">
|
||||
|
||||
@@ -40,7 +40,7 @@ require_once('optionhandler.php');
|
||||
$standalone = 0;
|
||||
include_once('admin-header.php');
|
||||
if ($user_level <= 3) {
|
||||
die("You have no right to edit the options for this blog.<br />Ask for a promotion to your <a href=\"mailto:$admin_email\">blog admin</a> :)");
|
||||
die("You have do not have sufficient permissions to edit the options for this blog.");
|
||||
}
|
||||
?>
|
||||
<ul id="adminmenu2">
|
||||
|
||||
@@ -51,7 +51,7 @@ default:
|
||||
$standalone = 0;
|
||||
include_once('admin-header.php');
|
||||
if ($user_level <= 3) {
|
||||
die("You have no right to edit the options for this blog.<br>Ask for a promotion to your <a href=\"mailto:$admin_email\">blog admin</a> :)");
|
||||
die("You have do not have sufficient permissions to edit the options for this blog.");
|
||||
}
|
||||
?>
|
||||
<ul id="adminmenu2">
|
||||
|
||||
@@ -40,7 +40,7 @@ require_once('optionhandler.php');
|
||||
$standalone = 0;
|
||||
include_once('admin-header.php');
|
||||
if ($user_level <= 3) {
|
||||
die("You have no right to edit the options for this blog.<br />Ask for a promotion to your <a href=\"mailto:$admin_email\">blog admin</a> :)");
|
||||
die("You have do not have sufficient permissions to edit the options for this blog.");
|
||||
}
|
||||
?>
|
||||
<ul id="adminmenu2">
|
||||
|
||||
@@ -110,7 +110,7 @@ default:
|
||||
$standalone = 0;
|
||||
include_once("./admin-header.php");
|
||||
if ($user_level <= 3) {
|
||||
die("You have no right to edit the options for this blog.<br>Ask for a promotion from your <a href=\"mailto:$admin_email\">blog admin</a> :)");
|
||||
die("You have do not have sufficient permissions to edit the options for this blog.");
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
+3
-3
@@ -242,7 +242,7 @@ switch($action) {
|
||||
?>
|
||||
<p>Since you’re a newcomer, you’ll have to wait for an admin to raise your level to 1,
|
||||
in order to be authorized to post.<br />
|
||||
You can also <a href="mailto:<?php echo $admin_email ?>?subject=Promotion?">e-mail the admin</a>
|
||||
You can also <a href="mailto:<?php echo get_settings('admin_email'); ?>?subject=Promotion?">e-mail the admin</a>
|
||||
to ask for a promotion.<br />
|
||||
When you’re promoted, just reload this page and you’ll be able to blog. :)
|
||||
</p>
|
||||
@@ -413,7 +413,7 @@ switch($action) {
|
||||
|
||||
$result = $wpdb->query("DELETE FROM $tableposts WHERE ID=$post_id");
|
||||
if (!$result)
|
||||
die('Error in deleting... contact the <a href="mailto:$admin_email">webmaster</a>.');
|
||||
die('Error in deleting...');
|
||||
|
||||
$result = $wpdb->query("DELETE FROM $tablecomments WHERE comment_post_ID=$post_id");
|
||||
|
||||
@@ -751,7 +751,7 @@ function oneclickbookmarklet(blah) {
|
||||
?>
|
||||
<div class="wrap">
|
||||
<p>Since you’re a newcomer, you’ll have to wait for an admin to raise your level to 1, in order to be authorized to post blog items.<br />
|
||||
You can also <a href="mailto:<?php echo $admin_email ?>?subject=Blog posting permission">e-mail the admin</a> to ask for a promotion.<br />
|
||||
You can also <a href="mailto:<?php echo get_settings('admin_email'); ?>?subject=Blog posting permission">e-mail the admin</a> to ask for a promotion.<br />
|
||||
When you’re promoted, just reload this page and you’ll be able to blog. :)</p>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
@@ -94,7 +94,7 @@ case 'update':
|
||||
$query = "UPDATE $tableusers SET user_firstname='$newuser_firstname', $updatepassword user_lastname='$newuser_lastname', user_nickname='$newuser_nickname', user_icq='$newuser_icq', user_email='$newuser_email', user_url='$newuser_url', user_aim='$newuser_aim', user_msn='$newuser_msn', user_yim='$newuser_yim', user_idmode='$newuser_idmode', user_description = '$user_description' WHERE ID = $user_ID";
|
||||
$result = $wpdb->query($query);
|
||||
if (!$result) {
|
||||
die ("<strong>ERROR</strong>: couldn't update your profile... please contact the <a href=\"mailto:$admin_email\">webmaster</a> !<br /><br />$query<br /><br />");
|
||||
die ("<strong>ERROR</strong>: couldn't update your profile...");
|
||||
}
|
||||
header('Location: profile.php?updated=true');
|
||||
break;
|
||||
|
||||
@@ -42,7 +42,7 @@ case 'update':
|
||||
require_once("admin-header.php");
|
||||
|
||||
if ($user_level < 3) {
|
||||
die('<p>You have no right to edit the template for this blog.<br />Ask for a promotion to your <a href="mailto:$admin_email">blog admin</a>. :)</p>');
|
||||
die('<p>You have do not have sufficient permissions to edit templates for this blog.</p>');
|
||||
}
|
||||
|
||||
$newcontent = stripslashes($HTTP_POST_VARS['newcontent']);
|
||||
@@ -62,7 +62,7 @@ default:
|
||||
require_once('admin-header.php');
|
||||
|
||||
if ($user_level <= 3) {
|
||||
die('<p>You have no right to edit the template for this blog.<br>Ask for a promotion to your <a href="mailto:$admin_email">blog admin</a>. :)</p>');
|
||||
die('<p>You have do not have sufficient permissions to edit templates for this blog.</p>');
|
||||
}
|
||||
|
||||
if ('' == $file) {
|
||||
|
||||
@@ -214,7 +214,6 @@ $guessurl = preg_replace('|/wp-admin/.*|i', '', 'http://' . $HTTP_HOST . $REQUES
|
||||
"42" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (42,'default_category', 1, '1', 'by default posts will have this category', 8, 20)",
|
||||
"43" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (43,'subjectprefix', 3, 'blog:', 'subject prefix', 8, 20)",
|
||||
"44" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (44,'bodyterminator', 3, '___', 'body terminator string (starting from this string, everything will be ignored, including this string)', 8, 20)",
|
||||
"45" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (45,'emailtestonly', 2, '0', 'set this to true to run in test mode', 8, 20)",
|
||||
"46" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (46,'use_phoneemail', 2, '0', 'some mobile phone email services will send identical subject & content on the same line if you use such a service, set use_phoneemail to true, and indicate a separator string', 8, 20)",
|
||||
"47" => "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES (47,'phoneemail_separator', 3, ':::', 'when you compose your message, you\'ll type your subject then the separator string then you type your login:password, then the separator, then content', 8, 20)",
|
||||
|
||||
|
||||
+2
-2
@@ -78,7 +78,7 @@ case 'adduser':
|
||||
('$user_login', MD5('$pass1'), '$user_nickname', '$user_email', '$user_ip', '$user_domain', '$user_browser', '$now', '$new_users_can_blog', 'nickname', '$user_firstname', '$user_lastname', '$user_nicename')");
|
||||
|
||||
if ($result == false) {
|
||||
die ('<strong>ERROR</strong>: Couldn’t register you... please contact the <a href="mailto:'.$admin_email.'">webmaster</a> !');
|
||||
die ('<strong>ERROR</strong>: Couldn’t register you!');
|
||||
}
|
||||
|
||||
$stars = '';
|
||||
@@ -89,7 +89,7 @@ case 'adduser':
|
||||
$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, '[' . get_settings('blogname') . '] New User Registration', $message);
|
||||
@mail(get_settings('admin_email'), '[' . get_settings('blogname') . '] New User Registration', $message);
|
||||
header('Location: users.php');
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user