summaryrefslogtreecommitdiffstats
path: root/wp-inst/wpmu-settings.php.dist
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-07-12 11:27:54 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-07-12 11:27:54 +0000
commit4f3bce79bfb5851cef9e7bc655c91bb3093cc401 (patch)
tree10a0991fddeb0e075d7fa46e2b40e5dbc64d1e88 /wp-inst/wpmu-settings.php.dist
downloadwordpress-mu-4f3bce79bfb5851cef9e7bc655c91bb3093cc401.tar.gz
wordpress-mu-4f3bce79bfb5851cef9e7bc655c91bb3093cc401.tar.xz
wordpress-mu-4f3bce79bfb5851cef9e7bc655c91bb3093cc401.zip
Initial Import
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wpmu-settings.php.dist')
-rw-r--r--wp-inst/wpmu-settings.php.dist91
1 files changed, 91 insertions, 0 deletions
diff --git a/wp-inst/wpmu-settings.php.dist b/wp-inst/wpmu-settings.php.dist
new file mode 100644
index 0000000..2a571e9
--- /dev/null
+++ b/wp-inst/wpmu-settings.php.dist
@@ -0,0 +1,91 @@
+<?php
+
+ini_set( "safe_mode", 1 );
+
+$base="BASE";
+
+if( isset( $_REQUEST[ 'wpblog' ] ) ) $wpblog = $_REQUEST[ 'wpblog' ];
+
+if( isset( $wpblog ) == false )
+{
+ if( $base != '/' )
+ {
+ $wpblog = str_replace( $base, "", $_SERVER[ 'REQUEST_URI' ] );
+ }
+ else
+ {
+ $wpblog = substr( $_SERVER[ 'REQUEST_URI' ], 0, strrpos( $_SERVER[ 'REQUEST_URI' ], "/" ) );
+ }
+ if( strrpos( $wpblog, "/" ) > 0 )
+ {
+ $wpblog = substr( $wpblog, 0, strpos( substr( $wpblog, 1 ) , "/" )+1 );
+ }
+ $wpblog = str_replace( $base, "", $wpblog );
+}
+
+$hostname = $_SERVER[ 'HTTP_HOST' ];
+$domain = $_SERVER[ 'HTTP_HOST' ];
+if( substr_count( $domain, '.' ) > 1 ) {
+ $vhostblog = substr( $domain, 0, strpos( $domain, '.' ) );
+ $basedomain = str_replace( $vhostblog.".", "", $domain );
+ $domain = str_replace( $vhostblog.".", "", $domain );
+} else {
+ $basedomain = $domain;
+ $vhostblog = "main";
+}
+
+if( strpos( $wpblog, "?" ) ) {
+ $wpblog = substr( $wpblog, 0, strpos( $wpblog, "?" ) );
+}
+if( defined( "VHOST" ) && constant( "VHOST" ) == 'yes' ) {
+ if( $vhostblog != 'www' && $vhostblog != '' ) {
+ $wpblog = $vhostblog;
+ } else {
+ $wpblog = "main";
+ }
+} elseif( $wpblog == '' ) {
+ $wpblog = 'main';
+} elseif( $wpblog != 'main' && ( is_file( ABSPATH . $wpblog ) == true || is_dir( ABSPATH . $wpblog ) == true ) ) {
+ $wpblog = 'main';
+}
+
+require_once( ABSPATH.'wp-includes/class-smarty.php' );
+$wpmuBaseTablePrefix = $table_prefix;
+define ('WPLANG', '');
+$server = DB_HOST;
+$loginsql = DB_USER;
+$passsql = DB_PASSWORD;
+
+require_once( ABSPATH.'wp-settings.php' );
+require_once( ABSPATH.'wp-includes/wpmu-functions.php' );
+
+$plugins = glob( ABSPATH . 'wp-content/mu-plugins/*.php');
+
+if( $plugins ) {
+ foreach ( $plugins as $plugin ) {
+ include_once( $plugin );
+ }
+}
+
+
+if( $redirect )
+{
+ if( $p )
+ {
+ $url = get_permalink( $p );
+ }
+ elseif( $m )
+ {
+ $url = get_settings( 'siteurl' )."/".substr( $m, 0, 4 )."/".substr( $m, 4, 2 );
+ }
+ elseif( $cat )
+ {
+ $query = "SELECT cat_name FROM ".$wpdb->categories." WHERE cat_ID='$cat'";
+ $cat_name = $wpdb->get_var( $query );
+ $url = get_settings( 'siteurl' ). "/category/".$cat_name;
+ }
+ header("HTTP/1.0 301 Moved Permanently");
+ header( "Location: $url" );
+ exit;
+}
+?>