b2config.php replaced with wp-config.sample.php

wp-settings.php is a new fie which sets up the old globals from b2config
mysmilies.php is a new file with custom smilies  (Ex-content of b2config)
day-month-trans.php file with Dayname and monthname transalations (Ex-content of b2config)


git-svn-id: http://svn.automattic.com/wordpress/trunk@215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
mikelittle 2003-06-12 22:44:37 +00:00
parent ffc321125c
commit 0bc861330d
6 changed files with 210 additions and 351 deletions

View File

@ -1,338 +0,0 @@
<?php
/* *
* WordPress's config file *
* */
// Reminder: everything that starts with #, /* or // is a comment
/* Start editing */
// $siteurl is your blog's URL: for example, 'http://mydomain.com/wordpress' (no trailing slash !)
// $blogfilename is the name of the default file for your blog
// $blogname is the name of your blog
$siteurl = 'http://example.com'; // Double check this, it's very important.
$blogfilename = 'index.php';
$blogname = "my weblog";
$blogdescription = "babblings !";
// Your email (obvious eh?)
$admin_email = 'you@example.com';
// ** MySQL settings **
define('DB_NAME', 'b2'); // The name of the database
define('DB_USER', 'user'); // Your MySQL username
define('DB_PASSWORD', 'pass'); // ...and password
define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
// If you've finished up to here you should be able to install now.
// set this to 0 or 1, whether you want new users to be able to post entries once they registered
$new_users_can_blog = 0;
// set this to 0 or 1, whether you want to allow users to register on your blog.
$users_can_register = 1;
// day at the start of the week: 0 for Sunday, 1 for Monday, 2 for Tuesday, etc
$start_of_week = 1;
// database tables' names (change them if you want to have multiple b2's in a single database)
$tableposts = 'b2posts';
$tableusers = 'b2users';
$tablesettings = 'b2settings';
$tablecategories = 'b2categories';
$tablecomments = 'b2comments';
// tables for link manager
$tablelinks = "b2links";
$tablelinkcategories = "b2linkcategories";
// ** Post preview function **
// set this to 1 if you want to use the 'preview' function
$use_preview = 1;
// ** Text formatting options **
// these options can help you format your text without using too much html
$use_bbcode = 0; // use BBCode, like [b]bold[/b]
$use_gmcode = 0; // use GreyMatter-styles: **bold** \italic\ __underline__
$use_quicktags = 1; // buttons for HTML tags (they won't work on IE Mac yet)
// IMPORTANT! set this to 0 if you are using Chinese, Japanese, Korean,
// or other double-bytes languages
$use_htmltrans = 1;
// this could help balance your HTML code. if it gives bad results, set it to 0
$use_balanceTags = 1;
// ** Image upload **
// set this to 0 to disable file upload, or 1 to enable it
$use_fileupload = 0;
// enter the real path of the directory where you'll upload the pictures
// if you're unsure about what your real path is, please ask your host's support staff
// note that the directory must be writable by the webserver (ChMod 766)
// note for windows-servers users: use forwardslashes instead of backslashes
//$fileupload_realpath = '/home/your/site/b2/images';
$fileupload_realpath = '/home/example/public_html/images';
// enter the URL of that directory (it's used to generate the links to the pictures)
$fileupload_url = 'http://example.com/images';
// accepted file types, you can add to that list if you want
// note: add a space before and after each file type
// example: $fileupload_allowedtypes = ' jpg gif png ';
$fileupload_allowedtypes = ' jpg gif png ';
// by default, most servers limit the size of uploads to 2048 KB
// if you want to set it to a lower value, here it is (you cannot set a higher value)
$fileupload_maxk = '96';
// you may not want all users to upload pictures/files, so you can set a minimum level for this
$fileupload_minlevel = '1';
// ...or you may authorize only some users. enter their logins here, separated by spaces
// if you leave that variable blank, all users who have the minimum level are authorized to upload
// note: add a space before and after each login name
// example: $fileupload_allowedusers = ' barbara anne ';
$fileupload_allowedusers = '';
// ** RSS syndication options **
// these options are used by b2rdf.php (1.0), b2rss.php (0.92), and b2rss2.php (2.0)
// note: if you don't want to syndicate your news, you can delete these files
// number of last posts to syndicate
$posts_per_rss = 10;
// the language of your blog ( see this: http://backend.userland.com/stories/storyReader$16 )
$rss_language = 'en';
// for b2rss.php: allow encoded HTML in <description> tag? 1=yes, 0=no
$rss_encoded_html = 0;
// length (in words) of excerpts in the RSS feed? 0=unlimited
// note: in b2rss.php, this will be set to 0 if you use encoded HTML
$rss_excerpt_length = 50;
//use the excerpt field for rss feed.
$rss_use_excerpt = 1;
// ** Weblogs.com ping **
// set this to 1 if you want your site to be listed on http://weblogs.com when you add a new post
$use_weblogsping = 0;
// ** Blo.gs ping **
// set this to 1 if you want your site to be listed on http://blo.gs when you add a new post
$use_blodotgsping = 0;
// You shouldn't need to change this.
$blodotgsping_url = $siteurl;
// ** Trackback / PingBack **
// 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
$use_trackback = 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
$use_pingback = 1;
// ** Comments options **
// set this to 1 to require e-mail and name, or 0 to allow comments without e-mail/name
$require_name_email = 0;
// here is a list of the tags that are allowed in the comments.
// you can add tags to the list, just add them in the string,
// add only the opening tag: for example, only '<a>' instead of '<a href=""></a>'
$comment_allowed_tags = '<b><i><strong><em><code><blockquote><p><br><strike><a>';
// set this to 1 to let every author be notified about comments on their posts
$comments_notify = 1;
// ** Smilies options **
// set this to 1 to enable smiley conversion in posts
// (note: this makes smiley conversion in ALL posts)
$use_smilies = 0;
// the directory where your smilies are (no trailing slash)
$smilies_directory = $siteurl . '/b2-img/smilies';
// here's the conversion table, you can modify it if you know what you're doing
$b2smiliestrans = array(
':)' => 'icon_smile.gif',
':D' => 'icon_biggrin.gif',
':-D' => 'icon_biggrin.gif',
':grin:' => 'icon_biggrin.gif',
':)' => 'icon_smile.gif',
':-)' => 'icon_smile.gif',
':smile:' => 'icon_smile.gif',
':(' => 'icon_sad.gif',
':-(' => 'icon_sad.gif',
':sad:' => 'icon_sad.gif',
':o' => 'icon_surprised.gif',
':-o' => 'icon_surprised.gif',
':eek:' => 'icon_surprised.gif',
'8O' => 'icon_eek.gif',
'8-O' => 'icon_eek.gif',
':shock:' => 'icon_eek.gif',
':?' => 'icon_confused.gif',
':-?' => 'icon_confused.gif',
':???:' => 'icon_confused.gif',
'8)' => 'icon_cool.gif',
'8-)' => 'icon_cool.gif',
':cool:' => 'icon_cool.gif',
':lol:' => 'icon_lol.gif',
':x' => 'icon_mad.gif',
':-x' => 'icon_mad.gif',
':mad:' => 'icon_mad.gif',
':P' => 'icon_razz.gif',
':-P' => 'icon_razz.gif',
':razz:' => 'icon_razz.gif',
':oops:' => 'icon_redface.gif',
':cry:' => 'icon_cry.gif',
':evil:' => 'icon_evil.gif',
':twisted:' => 'icon_twisted.gif',
':roll:' => 'icon_rolleyes.gif',
':wink:' => 'icon_wink.gif',
';)' => 'icon_wink.gif',
';-)' => 'icon_wink.gif',
':!:' => 'icon_exclaim.gif',
':?:' => 'icon_question.gif',
':idea:' => 'icon_idea.gif',
':arrow:' => 'icon_arrow.gif',
':|' => 'icon_neutral.gif',
':-|' => 'icon_neutral.gif',
':neutral:' => 'icon_neutral.gif',
':mrgreen:' => 'icon_mrgreen.gif',
);
// the weekdays and the months.. translate them if necessary
$weekday[0]='Sunday';
$weekday[1]='Monday';
$weekday[2]='Tuesday';
$weekday[3]='Wednesday';
$weekday[4]='Thursday';
$weekday[5]='Friday';
$weekday[6]='Saturday';
// the months, translate them if necessary - note: this isn't active everywhere yet
$month['01']='January';
$month['02']='February';
$month['03']='March';
$month['04']='April';
$month['05']='May';
$month['06']='June';
$month['07']='July';
$month['08']='August';
$month['09']='September';
$month['10']='October';
$month['11']='November';
$month['12']='December';
// This is the name of the include directory. No "/" allowed.
$b2inc = 'b2-include';
// ** Querystring Configuration ** (don't change if you don't know what you're doing)
$querystring_start = '?';
$querystring_equal = '=';
$querystring_separator = '&amp;';
// ** Configuration for b2mail.php ** (skip this if you don't intend to blog via email)
// mailserver settings
$mailserver_url = 'mail.example.com';
$mailserver_login = 'login@example.com';
$mailserver_pass = 'password';
$mailserver_port = 110;
// by default posts will have this category
$default_category = 1;
// subject prefix
$subjectprefix = 'blog:';
// body terminator string (starting from this string, everything will be ignored, including this string)
$bodyterminator = "___";
// set this to 1 to run in test mode
$thisisforfunonly = 0;
////// Special Configuration for some phone email services
// some mobile phone email services will send identical subject & content on the same line
// if you use such a service, set $use_phoneemail to 1, and indicate a separator string
// 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
$use_phoneemail = 0;
$phoneemail_separator = ':::';
/* Stop editing */
$HTTP_HOST = getenv('HTTP_HOST'); /* domain name */
$REMOTE_ADDR = getenv('REMOTE_ADDR'); /* visitor's IP */
$HTTP_USER_AGENT = getenv('HTTP_USER_AGENT'); /* visitor's browser */
$server = DB_HOST;
$loginsql = DB_USER;
$passsql = DB_PASSWORD;
$path = $siteurl;
$base = DB_NAME;
// This should get us the relative path of WordPress and the absolute path on the server. Yipee!
$relpath = '';
$url = explode('/', $siteurl);
for ($i = 3; $i < count($url); $i++) {
$relpath .= '/'. $url[$i];
}
$abspath = getenv('DOCUMENT_ROOT') . $relpath . '/';
$b2inc = "/$b2inc";
$pathserver = &$siteurl;
require_once($abspath.$b2inc.'/wp-db.php');
?>

25
day-month-trans.php Normal file
View File

@ -0,0 +1,25 @@
<?php
// the weekdays and the months.. translate them if necessary
$weekday[0]='Sunday';
$weekday[1]='Monday';
$weekday[2]='Tuesday';
$weekday[3]='Wednesday';
$weekday[4]='Thursday';
$weekday[5]='Friday';
$weekday[6]='Saturday';
// the months, translate them if necessary - note: this isn't active everywhere yet
$month['01']='January';
$month['02']='February';
$month['03']='March';
$month['04']='April';
$month['05']='May';
$month['06']='June';
$month['07']='July';
$month['08']='August';
$month['09']='September';
$month['10']='October';
$month['11']='November';
$month['12']='December';
?>

50
mysmilies.php Normal file
View File

@ -0,0 +1,50 @@
<?php
// here's the conversion table, you can modify it if you know what you're doing
$b2smiliestrans = array(
':)' => 'icon_smile.gif',
':D' => 'icon_biggrin.gif',
':-D' => 'icon_biggrin.gif',
':grin:' => 'icon_biggrin.gif',
':)' => 'icon_smile.gif',
':-)' => 'icon_smile.gif',
':smile:' => 'icon_smile.gif',
':(' => 'icon_sad.gif',
':-(' => 'icon_sad.gif',
':sad:' => 'icon_sad.gif',
':o' => 'icon_surprised.gif',
':-o' => 'icon_surprised.gif',
':eek:' => 'icon_surprised.gif',
'8O' => 'icon_eek.gif',
'8-O' => 'icon_eek.gif',
':shock:' => 'icon_eek.gif',
':?' => 'icon_confused.gif',
':-?' => 'icon_confused.gif',
':???:' => 'icon_confused.gif',
'8)' => 'icon_cool.gif',
'8-)' => 'icon_cool.gif',
':cool:' => 'icon_cool.gif',
':lol:' => 'icon_lol.gif',
':x' => 'icon_mad.gif',
':-x' => 'icon_mad.gif',
':mad:' => 'icon_mad.gif',
':P' => 'icon_razz.gif',
':-P' => 'icon_razz.gif',
':razz:' => 'icon_razz.gif',
':oops:' => 'icon_redface.gif',
':cry:' => 'icon_cry.gif',
':evil:' => 'icon_evil.gif',
':twisted:' => 'icon_twisted.gif',
':roll:' => 'icon_rolleyes.gif',
':wink:' => 'icon_wink.gif',
';)' => 'icon_wink.gif',
';-)' => 'icon_wink.gif',
':!:' => 'icon_exclaim.gif',
':?:' => 'icon_question.gif',
':idea:' => 'icon_idea.gif',
':arrow:' => 'icon_arrow.gif',
':|' => 'icon_neutral.gif',
':-|' => 'icon_neutral.gif',
':neutral:' => 'icon_neutral.gif',
':mrgreen:' => 'icon_mrgreen.gif',
);
?>

View File

@ -66,14 +66,15 @@
<h2>New users: 5-minute install.</h2>
<ol>
<li>Unzip the package in an empty directory.</li>
<li>Open b2config.php in a text editor, and modify the variables as explained
in the comments. Comments are lines that start with # or /* or //</li>
<li>Copy wp-config.sample.php to wp-config.php. Open wp-config.php in a text editor
and modify the variables as explained in the comments. Comments are lines
that start with # or /* or //</li>
<li>Upload everything. This release is designed to sit in your root folder,
IE the folder where your WordPress-powered page will reside.</li>
<li>CHMOD 666 the <code>weblogs.com.changes.cache</code> file.</li>
<li> Launch <a href="wp-admin/wp-install.php">wp-install.php</a> in your
browser. This should setup the MySQL database for your blog. If there
is an error, double check your b2config.php file, and try again. If
is an error, double check your wp-config.php file, and try again. If
it fails again, please go to the <a href="http://wordpress.org/support/">support
forums</a> and make a post with all the information about the failure
(error messages, etc), and your setup (the PHP and MySQL versions on
@ -108,7 +109,7 @@
<li>The templates are so much better, and there is so much more going
on than before it's probably worth it to start from scratch and work
back to your design.</li>
<li>You <em>must</em> update your <code>b2config.php</code>. There's all
<li>You <em>must</em> update your <code>wp-config.php</code>. There's all
sort of new stuff in there.</li>
<li>WordPress issues should be discussed in our <a href="http://wordpress.org/support/">support
forums</a>.</li>
@ -199,15 +200,15 @@
This displays the day of the week when the post was made. It works like
the_time(), in that it would appear at every post. Weekdays can be obtained
with a custom date format string in the_time() or the_date(), but for
non-english weekdays you have to edit b2config.php<br />
non-english weekdays you have to edit day-month-trans.php<br />
<strong>Note: this tag is OBSOLETE, the_time() and the_date() now use
weekdays/months from b2config.php</strong><br />
weekdays/months from day-month-trans.php</strong><br />
<br />
<strong>&lt;?php the_weekday_date() ?&gt;</strong> <span style="font-family: Courier New, Courrier, mono; color: #ff9900; font-weight:bold;">*</span><br />
Like the_weekday(), but works like the_date(), in that it would appear
only on new days.<br />
<strong>Note: this tag is OBSOLETE, the_time() and the_date() now use
weekdays/months from b2config.php</strong><br />
weekdays/months from day-month-trans.php</strong><br />
<div class="params">Parameters:
<ul>
<li>string to display before the weekday_date (default is blank)</li>
@ -453,7 +454,7 @@
<div class="params">Parameters:
<ul>
<li>string: can be 'name' to display the name of your weblog (you
set it in b2config.php), 'url', 'description', 'admin_email', 'rss_url'
set it in the options page), 'url', 'description', 'admin_email', 'rss_url'
to display the URL of your b2rss.xml file, 'pingback_url' to display
the URL of your xmlrpc.php file<br />
(default string is 'name')</li>
@ -880,10 +881,10 @@
<p>&nbsp;</p>
<a name="postviaemail"></a> <h1>Post via Email:</h1>
<p>You can post news from an email client!<br />
But first you'll have to edit b2config.php, filling the appropriate values
But first you'll have to edit the options on the options screen, filling the appropriate values
for your POP3 email account (this interface doesn't support IMAP yet,
only POP3, sorry).</p>
<p> Once you have edited the config options, you can make your webserver
<p> Once you have edited the options, you can make your webserver
execute b2mail.php every set amount of time (depending on your host's
performance, this script can be resource intensive, so don't make it run
every minute or you'll be kicked).</p>
@ -925,8 +926,8 @@
<h2>Special cases for mobile phone email:</h2>
<p> Some mobile phone service providers may allow you to send email with
your mobile phone or PDA, but on such devices you can't always include
line breaks. In such case, you have to set <i>$use_phoneemail = 1</i>
in b2config.php, and then here's how you write the email:</p>
line breaks. In such case, you have to set <i>use_phoneemail = true</i>
in the options, and then here's how you write the email:</p>
<div class="params"> <b>To:</b> address@domain.com<br />
<b>Subject:</b> blog:the post's title <b>:::</b><br />
<b>Body:</b><br>
@ -965,7 +966,7 @@
</ul>
<p>Usually, you'll want to have a team of only level 1 users except you.
;)</p>
<p><strong>Note:</strong> you can modify a variable in b2config.php, to
<p><strong>Note:</strong> you can modify an option on the option screens, to
enable new users to post once they've registered.</p>
<p>If you don't want users to register on your blog at all, just delete
b2register.php once you've registered your user account. </p>

57
wp-config.sample.php Normal file
View File

@ -0,0 +1,57 @@
<?php
/** WordPress's config file **/
// ** MySQL settings **
define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'username'); // Your MySQL username
define('DB_PASSWORD', 'password'); // ...and password
define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
// Database tables' names
//
// Change them if you want to have multiple blogs in a single database.
// If you already have custom names leave table_prefix empty and just
// edit the names.
$table_prefix = 'wp_'; // eg 'wp_' or 'b2' or 'mylogin_'
$tableposts = $table_prefix . 'posts';
$tableusers = $table_prefix . 'users';
$tablesettings = $table_prefix . 'settings';
$tablecategories = $table_prefix . 'categories';
$tablecomments = $table_prefix . 'comments';
$tablelinks = $table_prefix . 'links';
$tablelinkcategories = $table_prefix . 'linkcategories';
$tableoptions = $table_prefix . 'options';
$tableoptiontypes = $table_prefix . 'optiontypes';
$tableoptionvalues = $table_prefix . 'optionvalues';
$tableoptiongroups = $table_prefix . 'optiongroups';
$tableoptiongroup_options = $table_prefix . 'optiongroup_options';
// This is the name of the include directory. No "/" allowed.
$b2inc = 'b2-include';
/* Stop editing */
// setup your own smilies (if not there is a set in b2vars)
if (file_exists('mysmilies.php')) {
include('mysmilies.php');
}
// pull in the day and month translations
require_once('day-month-trans.php');
$HTTP_HOST = getenv('HTTP_HOST'); /* domain name */
$REMOTE_ADDR = getenv('REMOTE_ADDR'); /* visitor's IP */
$HTTP_USER_AGENT = getenv('HTTP_USER_AGENT'); /* visitor's browser */
$server = DB_HOST;
$loginsql = DB_USER;
$passsql = DB_PASSWORD;
$base = DB_NAME;
$abspath = dirname(__FILE__).'/';
require_once($abspath.$b2inc.'/wp-db.php');
require_once($abspath.$b2inc.'/b2functions.php');
require_once($abspath.'wp-settings.php');
?>

64
wp-settings.php Normal file
View File

@ -0,0 +1,64 @@
<?php
//setup the old globals from b2config.php
//
// We should eventually migrate to either calling
// get_settings() wherever these are needed OR
// accessing a single global $all_settings var
$siteurl = get_settings('siteurl');
$blogfilename = get_settings('blogfilename');
$blogname = get_settings('blogname');
$blogdescription = get_settings('blogdescription');
$admin_email = get_settings('admin_email');
$new_users_can_blog = get_settings('new_users_can_blog');
$users_can_register = get_settings('users_can_register');
$start_of_week = get_settings('start_of_week');
$use_preview = get_settings('use_preview');
$use_bbcode = get_settings('use_bbcode');
$use_gmcode = get_settings('use_gmcode');
$use_quicktags = get_settings('use_quicktags');
$use_htmltrans = get_settings('use_htmltrans');
$use_balanceTags = get_settings('use_balanceTags');
$use_fileupload = get_settings('use_fileupload');
$fileupload_realpath = get_settings('fileupload_realpath');
$fileupload_url = get_settings('fileupload_url');
$fileupload_allowedtypes = get_settings('fileupload_allowedtypes');
$fileupload_maxk = get_settings('fileupload_maxk');
$fileupload_minlevel = get_settings('fileupload_minlevel');
$fileupload_allowedusers = get_settings('fileupload_allowedusers');
$posts_per_rss = get_settings('posts_per_rss');
$rss_language = get_settings('rss_language');
$rss_encoded_html = get_settings('rss_encoded_html');
$rss_excerpt_length = get_settings('rss_excerpt_length');
$rss_use_excerpt = get_settings('rss_use_excerpt');
$use_weblogsping = get_settings('use_weblogsping');
$use_blodotgsping = get_settings('use_blodotgsping');
$blodotgsping_url = get_settings('blodotgsping_url');
$use_trackback = get_settings('use_trackback');
$use_pingback = get_settings('use_pingback');
$require_name_email = get_settings('require_name_email');
$comment_allowed_tags = get_settings('comment_allowed_tags');
$comments_notify = get_settings('comments_notify');
$use_smilies = get_settings('use_smilies');
$smilies_directory = get_settings('smilies_directory');
$mailserver_url = get_settings('mailserver_url');
$mailserver_login = get_settings('mailserver_login');
$mailserver_pass = get_settings('mailserver_pass');
$mailserver_port = get_settings('mailserver_port');
$default_category = get_settings('default_category');
$subjectprefix = get_settings('subjectprefix');
$bodyterminator = get_settings('bodyterminator');
$emailtestonly = get_settings('emailtestonly');
$use_phoneemail = get_settings('use_phoneemail');
$phoneemail_separator = get_settings('phoneemail_separator');
if (get_settings('search_engine_friendly_urls')) {
$querystring_start = '/';
$querystring_equal = '/';
$querystring_separator = '/';
} else {
$querystring_start = '?';
$querystring_equal = '=';
$querystring_separator = '&amp;';
}
?>