Recent Topics

1 Jun 06, 2015 22:28    

$basepath gives = "/home/user/public_html/blog_subfolder/"

is there a global that holds the root ""/home/user/public_html/" ?

PS: As a workaround , to get my own $rootpath, what i did was, removing the preceeding / from $basesubpath, and removing it from $basepath to get my own $rootpath.
Alternatively, I could simply remove "/conf" str from $conf_path i guess.

global $basepath,$basesubpath;
 $subdr = $basesubpath = substr($basesubpath, 1);
	 (strpos($basepath,$subdr) !== false) ?  $rootpath = str_replace($subdr,"",$basepath) :  $rootpath = $basepath;

2 Jun 10, 2015 03:43

`$basepath` gives the path that matches `$baseurl`.

b2evolution doesn't try to play outside that folder.

3 Jun 10, 2015 12:24

I see thanks. I guess doing

$rootpath = str_replace("conf/","",$conf_path);


would be fail-safe and easiest way to get it ? (assuming /conf folder has never changed and never will :P) or maybe use a default php method

4 Jun 10, 2015 22:26

That is $basepath !!

It's defined like this:

$basepath = preg_replace( '#/'.$conf_subdir.'$#i', '', $conf_path ).'/';

On a normal install, the conf folder is INSIDE of $basepath/$baseurl

You should really look into /conf/_advanced.php

5 Jun 10, 2015 23:18

back to square 1 :D

$basepath gives = "home/user/mydmn_user/mydomain.com/public_html/blog/" if b2 resides in subfolder

whereas I need "/mydomain.com/public_html/" only, without the "blog/" subfolder part, even if b2 resides in blog subfolder.

@fplanque wrote earlier:

That is `$basepath` !!

It's defined like this:

$basepath = preg_replace( '#/'.$conf_subdir.'$#i', '', $conf_path ).'/';

On a normal install, the `conf` folder is INSIDE of `$basepath`/`$baseurl`

You should really look into `/conf/_advanced.php`

6 Jun 13, 2015 04:20

If you put b2evolution in a subfolder, you know what subfolder you put it into, don't you?

Otherwise, maybe there's a webserver $GLOBALS that can tell you.

But b2evolution doesn't care about how far it is from he webserver root.

7 Jun 14, 2015 04:58

I see. yeah I can always work with good old $_SERVER. I was just wondering if there was one stored like $baespath.


Form is loading...