aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rwxr-xr-x[-rw-r--r--]index.php39
1 files changed, 27 insertions, 12 deletions
diff --git a/index.php b/index.php
index cc6249256..640a2b6a1 100644..100755
--- a/index.php
+++ b/index.php
@@ -1,8 +1,8 @@
-<?php
+<?php /** @file */
/**
*
- * Friendica Red
+ * Red Matrix
*
*/
@@ -29,7 +29,6 @@ $install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false
$a->language = get_best_language();
-load_translation_table($a->language);
/**
*
@@ -37,11 +36,11 @@ load_translation_table($a->language);
*
*/
-require_once("dba.php");
+require_once("include/dba/dba_driver.php");
if(! $install) {
- $db = new dba($db_host, $db_user, $db_pass, $db_data, $install);
- unset($db_host, $db_user, $db_pass, $db_data);
+ $db = dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data, $install);
+ unset($db_host, $db_port, $db_user, $db_pass, $db_data);
/**
* Load configs from db. Overwrite configs from .htconfig.php
@@ -49,10 +48,17 @@ if(! $install) {
load_config('config');
load_config('system');
+ load_config('feature');
- require_once("session.php");
+ require_once("include/session.php");
load_hooks();
call_hooks('init_1');
+
+ load_translation_table($a->language);
+}
+else {
+ // load translations but do not check plugins as we have no database
+ load_translation_table($a->language,true);
}
@@ -94,7 +100,7 @@ if((x($_GET,'zid')) && (! $install)) {
}
if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module === 'login'))
- require("auth.php");
+ require("include/auth.php");
if(! x($_SESSION,'sysmsg'))
@@ -110,8 +116,11 @@ if(! x($_SESSION,'sysmsg_info'))
*/
-if($install)
- $a->module = 'setup';
+if($install) {
+ /* Allow an exception for the view module so that pcss will be interpreted during installation */
+ if($a->module != 'view')
+ $a->module = 'setup';
+}
else
check_config($a);
@@ -234,6 +243,12 @@ if (file_exists($theme_info_file)){
if(! x($a->page,'content'))
$a->page['content'] = '';
+/* set JS cookie */
+if($_COOKIE['jsAvailable'] != 1) {
+ $a->page['content'] .= '<script>document.cookie="jsAvailable=1; path=/"; location.reload();</script>';
+}
+
+
if(! $install)
call_hooks('page_content_top',$a->page['content']);
@@ -281,7 +296,7 @@ if($a->module_loaded) {
// If $aside_default is not False after the theme _aside() function, run the
// module's _aside() function too
//
- // This gives themes more control over how the left sidebar looks
+ // This gives themes more control over how the sidebar looks
$aside_default = true;
call_hooks($a->module . '_mod_aside',$placeholder);
@@ -317,7 +332,7 @@ if($a->module_loaded) {
if(x($_SESSION,'visitor_home'))
$homebase = $_SESSION['visitor_home'];
elseif(local_user())
- $homebase = $a->get_baseurl() . '/channel/' . $a->user['nickname'];
+ $homebase = $a->get_baseurl() . '/channel/' . $a->channel['channel_address'];
if(isset($homebase))
$a->page['content'] .= '<script>var homebase="' . $homebase . '" ; </script>';