Make WordPress Core

Changeset 957


Ignore:
Timestamp:
03/01/2004 07:55:45 PM (21 years ago)
Author:
saxmatt
Message:

Migration to get_settings and away from globals.

Location:
trunk
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/categories.php

    r862 r957  
    135135    require_once ('admin-header.php');
    136136    if ($user_level < 3) {
    137         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>. :)");
     137        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>. :)");
    138138    }
    139139    ?>
  • trunk/wp-admin/import-greymatter.php

    r883 r957  
    102102        $result = mysql_query($query);
    103103        if ($result==false) {
    104             die ("<b>ERROR</b>: couldn't register an user... please contact the <a href=\"mailto:$admin_email\">webmaster</a> !");
     104            die ("<strong>ERROR</strong>: couldn't register an user!");
    105105        }
    106106        echo "<li>user <i>$user_login</i>... <b>Done</b></li>";
     
    161161                $result = mysql_query($query);
    162162                if ($result==false) {
    163                     die ("<b>ERROR</b>: couldn't register an user... please contact the <a href=\"mailto:$admin_email\">webmaster</a> !");
     163                    die ("<strong>ERROR</strong>: couldn't register an user!");
    164164                }
    165165                echo ": registered deleted user <i>$user_login</i> at level 0 ";
     
    197197
    198198            if (!$result)
    199                 die ("Error in posting... contact the <a href=\"mailto:$admin_email\">webmaster</a>");
     199                die ("Error in posting...");
    200200           
    201201            $sql2 = "SELECT * FROM $tableposts WHERE 1=1 ORDER BY ID DESC LIMIT 1";
     
    245245                    $result3 = mysql_query($sql3);
    246246                    if (!$result3)
    247                         die ("There is an error with the database, it can't store your comment...<br>Contact the <a href=\"mailto:$admin_email\">webmaster</a>");
     247                        die ("There is an error with the database, it can't store your comment..");
    248248                }
    249249                $comments=$c-4;
  • trunk/wp-admin/install.php

    r956 r957  
    438438"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)",
    439439"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)",
    440 "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)",
    441440"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)",
    442441"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)",
  • trunk/wp-admin/link-categories.php

    r654 r957  
    281281    include_once ("./admin-header.php");
    282282    if ($user_level < get_settings('links_minadminlevel')) {
    283       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> :)");
     283      die("You have do not have sufficient permissions to edit the link categories for this blog. :)");
    284284    }
    285285?>
  • trunk/wp-admin/link-manager.php

    r745 r957  
    291291    include_once ('admin-header.php');
    292292    if ($user_level < get_settings('links_minadminlevel')) {
    293       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>. :)");
     293      die('You have do not have sufficent permissions to edit the links for this blog.');
    294294    }
    295295
     
    538538    include_once ("./admin-header.php");
    539539    if ($user_level < get_settings('links_minadminlevel')) {
    540       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> :)");
     540      die("You have do not have sufficient permissions to edit the links for this blog.");
    541541    }
    542542
  • trunk/wp-admin/moderation.php

    r887 r957  
    5252
    5353    if ($user_level < 3) {
    54         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>');
     54        die('<p>Your level is not high enough to moderate comments.</p>');
    5555    }
    5656
     
    9393
    9494    if ($user_level <= 3) {
    95         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>');
     95        die('<p>Your level is not high enough to moderate comments.</p>');
    9696    }
    9797?>
  • trunk/wp-admin/options-discussion.php

    r954 r957  
    4141include_once('admin-header.php');
    4242if ($user_level <= 3) {
    43     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> :)");
     43    die("You have do not have sufficient permissions to edit the options for this blog.");
    4444}
    4545?>
  • trunk/wp-admin/options-general.php

    r954 r957  
    4141include_once('admin-header.php');
    4242if ($user_level <= 3) {
    43     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> :)");
     43    die("You have do not have sufficient permissions to edit the options for this blog.");
    4444}
    4545?>
  • trunk/wp-admin/options-permalink.php

    r945 r957  
    5252    include_once('admin-header.php');
    5353    if ($user_level <= 3) {
    54         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> :)");
     54        die("You have do not have sufficient permissions to edit the options for this blog.");
    5555    }
    5656?>
  • trunk/wp-admin/options-writing.php

    r954 r957  
    4141include_once('admin-header.php');
    4242if ($user_level <= 3) {
    43     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> :)");
     43    die("You have do not have sufficient permissions to edit the options for this blog.");
    4444}
    4545?>
  • trunk/wp-admin/options.php

    r939 r957  
    111111    include_once("./admin-header.php");
    112112    if ($user_level <= 3) {
    113         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> :)");
     113        die("You have do not have sufficient permissions to edit the options for this blog.");
    114114    }
    115115?>
  • trunk/wp-admin/post.php

    r956 r957  
    243243            <p>Since you&#8217;re a newcomer, you&#8217;ll have to wait for an admin to raise your level to 1,
    244244            in order to be authorized to post.<br />
    245             You can also <a href="mailto:<?php echo $admin_email ?>?subject=Promotion?">e-mail the admin</a>
     245            You can also <a href="mailto:<?php echo get_settings('admin_email'); ?>?subject=Promotion?">e-mail the admin</a>
    246246            to ask for a promotion.<br />
    247247            When you&#8217;re promoted, just reload this page and you&#8217;ll be able to blog. :)
     
    414414        $result = $wpdb->query("DELETE FROM $tableposts WHERE ID=$post_id");
    415415        if (!$result)
    416             die('Error in deleting... contact the <a href="mailto:$admin_email">webmaster</a>.');
     416            die('Error in deleting...');
    417417
    418418        $result = $wpdb->query("DELETE FROM $tablecomments WHERE comment_post_ID=$post_id");
     
    752752<div class="wrap">
    753753            <p>Since you&#8217;re a newcomer, you&#8217;ll have to wait for an admin to raise your level to 1, in order to be authorized to post blog items.<br />
    754                 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 />
     754                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 />
    755755                When you&#8217;re promoted, just reload this page and you&#8217;ll be able to blog. :)</p>
    756756</div>
  • trunk/wp-admin/profile.php

    r956 r957  
    9595    $result = $wpdb->query($query);
    9696    if (!$result) {
    97         die ("<strong>ERROR</strong>: couldn't update your profile... please contact the <a href=\"mailto:$admin_email\">webmaster</a> !<br /><br />$query<br /><br />");
     97        die ("<strong>ERROR</strong>: couldn't update your profile...");
    9898    }
    9999    header('Location: profile.php?updated=true');
  • trunk/wp-admin/templates.php

    r945 r957  
    4343
    4444    if ($user_level < 3) {
    45         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>');
     45        die('<p>You have do not have sufficient permissions to edit templates for this blog.</p>');
    4646    }
    4747
     
    6363
    6464    if ($user_level <= 3) {
    65         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>');
     65        die('<p>You have do not have sufficient permissions to edit templates for this blog.</p>');
    6666    }
    6767
  • trunk/wp-admin/upgrade-functions.php

    r956 r957  
    215215        "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)",
    216216        "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)",
    217         "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)",
    218217        "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)",
    219218        "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)",
  • trunk/wp-admin/users.php

    r956 r957  
    7979   
    8080    if ($result == false) {
    81         die ('<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:'.$admin_email.'">webmaster</a> !');
     81        die ('<strong>ERROR</strong>: Couldn&#8217;t register you!');
    8282    }
    8383
     
    9090    $message .= "Login: $user_login\r\n\r\nE-mail: $user_email";
    9191
    92     @mail($admin_email, '[' . get_settings('blogname') . '] New User Registration', $message);
     92    @mail(get_settings('admin_email'), '[' . get_settings('blogname') . '] New User Registration', $message);
    9393    header('Location: users.php');
    9494break;
  • trunk/wp-includes/functions-formatting.php

    r956 r957  
    318318
    319319function convert_smilies($text) {
    320     global $smilies_directory, $use_smilies;
    321320    global $wp_smiliessearch, $wp_smiliesreplace;
    322321    $output = '';
    323     if ($use_smilies) {
     322    if (get_settings('use_smilies')) {
    324323        // HTML loop taken from texturize function, could possible be consolidated
    325324        $textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between
  • trunk/wp-includes/functions.php

    r956 r957  
    933933
    934934function doGeoUrlHeader($posts) {
    935     global $use_default_geourl,$default_geourl_lat,$default_geourl_lon;
    936935    if (count($posts) == 1) {
    937936        // there's only one result  see if it has a geo code
     
    947946        }
    948947    } else {
    949         if($use_default_geourl) {
     948        if(get_settings('use_default_geourl')) {
    950949            // send the default here
    951             echo "<meta name=\"ICBM\" content=\"".$default_geourl_lat.", ".$default_geourl_lon."\" />\n";
     950            echo "<meta name=\"ICBM\" content=\"". get_settings('default_geourl_lat') .", ". get_settings('default_geourl_lon') ."\" />\n";
    952951            echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(get_bloginfo("name")),"unicode")."\" />\n";
    953             echo "<meta name=\"geo.position\" content=\"".$default_geourl_lat.";".$default_geourl_lon."\" />\n";
     952            echo "<meta name=\"geo.position\" content=\"". get_settings('default_geourl_lat') .";". get_settings('default_geourl_lon') ."\" />\n";
    954953        }
    955954    }
  • trunk/wp-includes/template-functions-general.php

    r956 r957  
    2323
    2424function get_bloginfo($show='') {
    25     global $admin_email;
    2625
    2726    $do_perma = 0;
     
    7675            break;
    7776        case 'admin_email':
    78             $output = $admin_email;
     77            $output = get_settings('admin_email');
    7978            break;
    8079        case 'name':
  • trunk/wp-includes/vars.php

    r945 r957  
    263263    $wp_smiliessearch[] = $smiley;
    264264    $smiley_masked = str_replace(' ', '', $smiley);
    265     $wp_smiliesreplace[] = " <img src='$smilies_directory/$img' alt='$smiley_masked' />";
     265    $wp_smiliesreplace[] = " <img src='" . get_settings('smilies_directory') . "/$img' alt='$smiley_masked' />";
    266266}
    267267
  • trunk/wp-login.php

    r956 r957  
    224224        <a href='wp-login.php' title='Check your email first, of course'>Click here to login!</a></p>";
    225225        // send a copy of password change notification to the admin
    226         mail($admin_email, '[' . get_settings('blogname') . "] Password Lost/Change", "Password Lost and Changed for user: $user_login");
     226        mail(get_settings('admin_email'), '[' . get_settings('blogname') . "] Password Lost/Change", "Password Lost and Changed for user: $user_login");
    227227        die();
    228228    }
  • trunk/wp-mail.php

    r914 r957  
    1111$time_difference = get_settings('time_difference');
    1212
    13 if ($use_phoneemail) {
     13if (get_settings('use_phoneemail')) {
    1414    // if you're using phone email, the email will already be in your timezone
    1515    $time_difference = 0;
     
    2222$pop3 = new POP3();
    2323
    24 if(!$pop3->connect($mailserver_url, $mailserver_port)) {
     24if(!$pop3->connect(get_settings('mailserver_url'), get_settings('mailserver_port'))) {
    2525    echo "Ooops $pop3->ERROR <br />\n";
    2626    exit;
    2727}
    2828
    29 $Count = $pop3->login($mailserver_login, $mailserver_pass);
     29$Count = $pop3->login(get_settings('mailserver_login'), get_settings('mailserver_pass'));
    3030if((!$Count) || ($Count == -1)) {
    3131    echo "<h1>Login Failed: $pop3->ERROR</h1>\n";
     
    7777                  $subject = wp_iso_descrambler($subject);
    7878                }
    79                 if ($use_phoneemail) {
    80                     $subject = explode($phoneemail_separator, $subject);
     79                if (get_settings('use_phoneemail')) {
     80                    $subject = explode(get_settings('phoneemail_separator'), $subject);
    8181                    $subject = trim($subject[0]);
    8282                }
    83                 if (!ereg($subjectprefix, $subject)) {
     83                if (!ereg(get_settings('subjectprefix'), $subject)) {
    8484                    continue;
    8585                }
     
    125125    }
    126126
    127     if (preg_match('/'.$subjectprefix.'/', $subject)) {
     127    if (preg_match('/'.get_settings('subjectprefix').'/', $subject)) {
    128128
    129129        $userpassstring = '';
     
    132132        echo "<p><b>$iCount</b></p><p><b>Subject: </b>$subject</p>\n";
    133133
    134         $subject = trim(str_replace($subjectprefix, '', $subject));
     134        $subject = trim(str_replace(get_settings('subjectprefix'), '', $subject));
    135135
    136136        if ($content_type == 'multipart/alternative') {
     
    145145        echo "<p><b>Raw content:</b><br /><pre>".$content.'</pre></p>';
    146146       
    147         $btpos = strpos($content, $bodyterminator);
     147        $btpos = strpos($content, get_settings('bodyterminator'));
    148148        if ($btpos) {
    149149            $content = substr($content, 0, $btpos);
     
    155155        $secondline = $blah[1];
    156156
    157         if ($use_phoneemail) {
    158             $btpos = strpos($firstline, $phoneemail_separator);
     157        if (get_settings('use_phoneemail')) {
     158            $btpos = strpos($firstline, get_settings('phoneemail_separator'));
    159159            if ($btpos) {
    160160                $userpassstring = trim(substr($firstline, 0, $btpos));
    161                 $content = trim(substr($content, $btpos+strlen($phoneemail_separator), strlen($content)));
    162                 $btpos = strpos($content, $phoneemail_separator);
     161                $content = trim(substr($content, $btpos+strlen(get_settings('phoneemail_separator')), strlen($content)));
     162                $btpos = strpos($content, get_settings('phoneemail_separator'));
    163163                if ($btpos) {
    164164                    $userpassstring = trim(substr($content, 0, $btpos));
    165                     $content = trim(substr($content, $btpos+strlen($phoneemail_separator), strlen($content)));
     165                    $content = trim(substr($content, $btpos+strlen(get_settings('phoneemail_separator')), strlen($content)));
    166166                }
    167167            }
     
    219219            }
    220220            if (empty($post_categories)) {
    221                 $post_categories[] = $default_category;
     221                $post_categories[] = get_settings('default_category');
    222222            }
    223223
  • trunk/wp-rdf.php

    r956 r957  
    4040    <dc:language><?php echo get_settings('rss_language'); ?></dc:language>
    4141    <dc:date><?php echo gmdate('Y-m-d\TH:i:s'); ?></dc:date>
    42     <dc:creator><?php echo antispambot($admin_email) ?></dc:creator>
     42    <dc:creator><?php echo antispambot(get_settings('admin_email')) ?></dc:creator>
    4343    <admin:generatorAgent rdf:resource="http://wordpress.org/?v=<?php echo $wp_version ?>"/>
    44     <admin:errorReportsTo rdf:resource="mailto:<?php echo antispambot($admin_email) ?>"/>
     44    <admin:errorReportsTo rdf:resource="mailto:<?php echo antispambot(get_settings('admin_email')) ?>"/>
    4545    <sy:updatePeriod>hourly</sy:updatePeriod>
    4646    <sy:updateFrequency>1</sy:updateFrequency>
  • trunk/wp-register.php

    r956 r957  
    9797   
    9898    if ($result == false) {
    99         die ('<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:'.$admin_email.'">webmaster</a> !');
     99        die ('<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:'.get_settings('admin_email').'">webmaster</a> !');
    100100    }
    101101
     
    108108    $message .= "Login: $user_login\r\n\r\nE-mail: $user_email";
    109109
    110     @mail($admin_email, '[' . get_settings('blogname') . '] New User Registration', $message);
     110    @mail(get_settings('admin_email'), '[' . get_settings('blogname') . '] New User Registration', $message);
    111111
    112112    ?>
  • trunk/wp-rss.php

    r956 r957  
    3333        <lastBuildDate><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</lastBuildDate>
    3434        <docs>http://backend.userland.com/rss092</docs>
    35         <managingEditor><?php echo antispambot($admin_email) ?></managingEditor>
     35        <managingEditor><?php echo antispambot(get_settings('admin_email')) ?></managingEditor>
    3636        <webMaster><?php echo antispambot($admin_email) ?></webMaster>
    3737        <language><?php echo get_settings('rss_language'); ?></language>
  • trunk/wp-settings.php

    r956 r957  
    5050// accessing a single global $all_settings var
    5151if (!strstr($_SERVER['REQUEST_URI'], 'install.php') && !strstr($_SERVER['REQUEST_URI'], 'wp-admin/import')) {
    52     $admin_email = get_settings('admin_email');
    53     $use_smilies = get_settings('use_smilies');
    54     $smilies_directory = get_settings('smilies_directory');
    55     $mailserver_url = get_settings('mailserver_url');
    56     $mailserver_login = get_settings('mailserver_login');
    57     $mailserver_pass = get_settings('mailserver_pass');
    58     $mailserver_port = get_settings('mailserver_port');
    59     $default_category = get_settings('default_category');
    60     $subjectprefix = get_settings('subjectprefix');
    61     $bodyterminator = get_settings('bodyterminator');
    62     $emailtestonly = get_settings('emailtestonly');
    63     $use_phoneemail = get_settings('use_phoneemail');
    64     $phoneemail_separator = get_settings('phoneemail_separator');
    65     $use_default_geourl = get_settings('use_default_geourl');
    66     $default_geourl_lat = get_settings('default_geourl_lat');
    67     $default_geourl_lon = get_settings('default_geourl_lon');
    6852
    6953    $querystring_start = '?';
  • trunk/wp-trackback.php

    r956 r957  
    8282
    8383    if (!$result) {
    84         die ("There is an error with the database, it can't store your comment...<br />Please contact the <a href='mailto:$admin_email'>webmaster</a>.");
     84        die ("There is an error with the database, it can't store your comment...<br />Please contact the webmaster.");
    8585    } else {
    8686        $comment_ID = $wpdb->get_var('SELECT last_insert_id()');
Note: See TracChangeset for help on using the changeset viewer.