forked from oneeyefams/JXBD_Git
-
Notifications
You must be signed in to change notification settings - Fork 0
/
domaindefinitions.php
66 lines (60 loc) · 2.61 KB
/
domaindefinitions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
if (0) {
define("SOUNDSURL","http://jaxboards.com/Sounds/");
define("SCRIPTURL","http://support.jaxboards.com/Script/");
//this file must be required after mysql connecting
preg_match("@(.*)\.jaxboards\.com@i",$_SERVER['SERVER_NAME'],$m);
$prefix=($_SERVER['SERVER_NAME']=="127.0.0.1"||$_SERVER['SERVER_NAME']=="seanj.afraid.org")?"blueprint":$m[1];
if(!$prefix) {
if(!$DB) {
require_once "inc/classes/mysql.php";
$DB=new MySQL;
$DB->connect($CFG['sql_host'],$CFG['sql_username'],$CFG['sql_password'],$CFG['sql_db']);
}
$result = $DB->safespecial('SELECT prefix FROM jaxboards_service.domains WHERE domain=?', array(),
$DB->basicvalue($_SERVER['SERVER_NAME']));
$prefix=$DB->row($result);
$DB->disposeresult($result);
if($prefix) $prefix=$prefix['prefix'];
}
if($prefix){
define("BOARDPATH",(defined("INACP")?"../":"")."boards/".$prefix."/");
define("STHEMEPATH",(defined("INACP")?"../":"")."Service/Themes/");
$CFG['prefix']=$prefix;
if($DB) $DB->prefix($prefix.'_');
function extendconfig($configfile){
if(!@include($configfile)) return false;
foreach($CFG as $k=>$v) $GLOBALS['CFG'][$k]=$v;
return true;
}
if(!extendconfig(BOARDPATH."config.php")) $CFG=Array('noboard'=>1);
} else $CFG=Array('noboard'=>1);
define("FLAGPATH","http://jaxboards.com/flags/");
} else {
function extendconfig($configfile){
if(!@include($configfile)) return false;
foreach($CFG as $k=>$v) $GLOBALS['CFG'][$k]=$v;
return true;
}
// define("BOARDPATH",(defined("INACP")?"../":"")."boards/");
// define("STHEMEPATH",(defined("INACP")?"../":"")."Service/Themes/");
define("BOARDPATH",(defined("INACP")?"../":"./"));
define("STHEMEPATH",(defined("INACP")?"../":"")."Service/Themes/");
define("AVAPATH",(defined("INACP")?"../":"")."Service/Themes/Default/avatars/");
define("SOUNDSURL",(defined("INACP")?"../":"")."Service/Sounds/");
define("SCRIPTURL",(defined("INACP")?"../":"")."Script/");
date_default_timezone_set("America/Los_Angeles");
$DB->prefix("jaxboards_");
if (!extendconfig(BOARDPATH."config.php")) { die("Could not read config file.\n"); }
// die("USERNAME: ".$CFG['sql_username']."\n");
// die("USERNAME: ".$CFG['sql_password']."\n");
// die("USERNAME: ".$CFG['sql_db']."\n");
if(!$DB) {
require_once "inc/classes/mysql.php";
$DB=new MySQL;
$DB->connect($CFG['sql_host'],$CFG['sql_username'],$CFG['sql_password'],$CFG['sql_db']);
}
// $DB->safespecial('SELECT prefix FROM jaxboards_service.domains WHERE domain=?', $DB->basicvalue($_SERVER['SERVER_NAME']));
define("FLAGPATH",(defined("INACP")?"../":"Service/flags"));
}
?>