diff options
author | Friendika <info@friendika.com> | 2010-12-02 17:31:48 -0800 |
---|---|---|
committer | Friendika <info@friendika.com> | 2010-12-02 17:31:48 -0800 |
commit | 2ef6ad80a4f7374e0488b8b10b8139e3392f81ff (patch) | |
tree | f66c18e83e09044e276bb256e061e361e6c6781f | |
parent | e818170c9fc4bf5c5cf11c83693e5d9a3f00260d (diff) | |
download | volse-hubzilla-2ef6ad80a4f7374e0488b8b10b8139e3392f81ff.tar.gz volse-hubzilla-2ef6ad80a4f7374e0488b8b10b8139e3392f81ff.tar.bz2 volse-hubzilla-2ef6ad80a4f7374e0488b8b10b8139e3392f81ff.zip |
fix installation into subdir of domain
-rw-r--r-- | boot.php | 5 | ||||
-rw-r--r-- | mod/install.php | 3 | ||||
-rw-r--r-- | view/en/htconfig.tpl | 2 | ||||
-rw-r--r-- | view/en/install_db.tpl | 2 |
4 files changed, 9 insertions, 3 deletions
@@ -169,6 +169,9 @@ class App { if(x($_GET,'q')) $this->cmd = trim($_GET['q'],'/'); + $path = trim(dirname($_SERVER['SCRIPT_NAME']),'/'); + if(isset($path) && strlen($path) && ($path != $this->path)) + $this->path = $path; $this->argv = explode('/',$this->cmd); $this->argc = count($this->argv); @@ -231,7 +234,7 @@ class App { function init_pagehead() { $tpl = load_view_file("view/head.tpl"); $this->page['htmlhead'] = replace_macros($tpl,array( - '$baseurl' => $this->get_baseurl() + '$baseurl' => $this->get_baseurl() . '/' )); } diff --git a/mod/install.php b/mod/install.php index 21a1b7513..9043459b8 100644 --- a/mod/install.php +++ b/mod/install.php @@ -5,6 +5,7 @@ function install_post(&$a) { global $db; + $urlpath = $a->get_path(); $dbhost = notags(trim($_POST['dbhost'])); $dbuser = notags(trim($_POST['dbuser'])); $dbpass = notags(trim($_POST['dbpass'])); @@ -40,6 +41,7 @@ function install_post(&$a) { '$dbpass' => $dbpass, '$dbdata' => $dbdata, '$timezone' => $timezone, + '$urlpath' => $urlpath, '$phpath' => $phpath )); $result = file_put_contents('.htconfig.php', $txt); @@ -102,6 +104,7 @@ function install_content(&$a) { $tpl = load_view_file('view/install_db.tpl'); $o .= replace_macros($tpl, array( + '$baseurl' => $a->get_baseurl(), '$tzselect' => ((x($_POST,'timezone')) ? select_timezone($_POST['timezone']) : select_timezone()), '$submit' => t('Submit'), '$dbhost' => ((x($_POST,'dbhost')) ? notags(trim($_POST['dbhost'])) : 'localhost'), diff --git a/view/en/htconfig.tpl b/view/en/htconfig.tpl index 6e58d593b..fda38b33a 100644 --- a/view/en/htconfig.tpl +++ b/view/en/htconfig.tpl @@ -13,7 +13,7 @@ $db_data = '$dbdata'; // For instance if your URL is 'http://example.com/directory/subdirectory', // set $a->path to 'directory/subdirectory'. -$a->path = ''; +$a->path = '$urlpath'; // Choose a legal default timezone. If you are unsure, use "America/Los_Angeles". // It can be changed later and only applies to timestamps for anonymous viewers. diff --git a/view/en/install_db.tpl b/view/en/install_db.tpl index d5f28828e..c413689c2 100644 --- a/view/en/install_db.tpl +++ b/view/en/install_db.tpl @@ -6,7 +6,7 @@ In order to install Friendika we need to know how to contact your database. Please contact your hosting provider or site administrator if you have questions about these settings. The database you specify below must already exist. If it does not, please create it before continuing. </p> -<form id="install-form" action="install" method="post"> +<form id="install-form" action="$baseurl/install" method="post"> <input type="hidden" name="phpath" value="$phpath" /> |