]> git.mxchange.org Git - friendica.git/commitdiff
fix installation into subdir of domain
authorFriendika <info@friendika.com>
Fri, 3 Dec 2010 01:31:48 +0000 (17:31 -0800)
committerFriendika <info@friendika.com>
Fri, 3 Dec 2010 01:31:48 +0000 (17:31 -0800)
boot.php
mod/install.php
view/en/htconfig.tpl
view/en/install_db.tpl

index 66236f39d6be68e95e87ba976cdf2be433002d08..abc4c04e44576304ed3ae275371644db7ecbb22b 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -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() . '/'
                ));
        }
 
index 21a1b75138a0b99cf40260060030898f3c9d0542..9043459b8625ac02ca9aeca6257167d687d00e29 100644 (file)
@@ -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'),
index 6e58d593b7ef61b2a475c7c3d3727109c86a911c..fda38b33adc458a275d3ef588d134b536eac0ada 100644 (file)
@@ -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.
index d5f28828e52ab687e06f6ac71eeec75527e858bb..c413689c25e5bc410f07efe4e3aba1b82673e4d5 100644 (file)
@@ -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" />