mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 04:40:44 +02:00
Add files via upload
This commit is contained in:
@@ -63,8 +63,10 @@ class e_parse
|
|||||||
|
|
||||||
protected $staticUrl;
|
protected $staticUrl;
|
||||||
|
|
||||||
|
protected $staticUrlMap = [];
|
||||||
|
|
||||||
/** @var array Stored relative paths - used by replaceConstants() */
|
/** @var array Stored relative paths - used by replaceConstants() */
|
||||||
private $relativePaths = array();
|
private $relativePaths = [];
|
||||||
|
|
||||||
|
|
||||||
// BBcode that contain preformatted code.
|
// BBcode that contain preformatted code.
|
||||||
@@ -254,6 +256,8 @@ class e_parse
|
|||||||
private $bootstrap;
|
private $bootstrap;
|
||||||
private $fontawesome;
|
private $fontawesome;
|
||||||
|
|
||||||
|
private $modRewriteMedia;
|
||||||
|
|
||||||
private $removedList = array();
|
private $removedList = array();
|
||||||
private $nodesToDelete = array();
|
private $nodesToDelete = array();
|
||||||
private $nodesToConvert = array();
|
private $nodesToConvert = array();
|
||||||
@@ -2420,8 +2424,16 @@ class e_parse
|
|||||||
}
|
}
|
||||||
|
|
||||||
$staticArray = $this->staticUrl; // e_HTTP_STATIC;
|
$staticArray = $this->staticUrl; // e_HTTP_STATIC;
|
||||||
|
$path = $this->replaceConstants($path, 'abs'); // replace any {THEME} etc.
|
||||||
|
$key = ltrim(eHelper::dasherize($path), '/');
|
||||||
|
|
||||||
if (is_array($staticArray))
|
if (is_array($staticArray))
|
||||||
|
{
|
||||||
|
if(!empty($this->staticUrlMap[$key]))
|
||||||
|
{
|
||||||
|
$http = $this->staticUrlMap[$key];
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$cnt = count($staticArray);
|
$cnt = count($staticArray);
|
||||||
$staticCount = $this->staticCount();
|
$staticCount = $this->staticCount();
|
||||||
@@ -2432,14 +2444,16 @@ class e_parse
|
|||||||
}
|
}
|
||||||
|
|
||||||
$http = !empty($staticArray[$staticCount]) ? $staticArray[$staticCount] : e_HTTP;
|
$http = !empty($staticArray[$staticCount]) ? $staticArray[$staticCount] : e_HTTP;
|
||||||
|
$this->staticCount(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$http = $this->staticUrl;
|
$http = $this->staticUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->staticCount(1);
|
$this->staticUrlMap[$key] = $http;
|
||||||
|
|
||||||
|
|
||||||
if (empty($path))
|
if (empty($path))
|
||||||
{
|
{
|
||||||
@@ -2448,7 +2462,7 @@ class e_parse
|
|||||||
|
|
||||||
$base = '';
|
$base = '';
|
||||||
|
|
||||||
$path = $this->replaceConstants($path, 'abs'); // replace any {THEME} etc.
|
|
||||||
|
|
||||||
$srch = array(
|
$srch = array(
|
||||||
e_PLUGIN_ABS,
|
e_PLUGIN_ABS,
|
||||||
@@ -2476,6 +2490,8 @@ class e_parse
|
|||||||
$ret = str_replace(e_MEDIA_ABS, $http . $base . e107::getFolder('media'), $ret);
|
$ret = str_replace(e_MEDIA_ABS, $http . $base . e107::getFolder('media'), $ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2487,10 +2503,14 @@ class e_parse
|
|||||||
*/
|
*/
|
||||||
public function setStaticUrl($url)
|
public function setStaticUrl($url)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->staticUrl = $url;
|
$this->staticUrl = $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getStaticUrlMap()
|
||||||
|
{
|
||||||
|
return $this->staticUrlMap;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate an auto-sized Image URL.
|
* Generate an auto-sized Image URL.
|
||||||
*
|
*
|
||||||
@@ -2636,10 +2656,10 @@ class e_parse
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (e_MOD_REWRITE_MEDIA == true && empty($options['nosef']))// Experimental SEF URL support.
|
if ($this->modRewriteMedia && empty($options['nosef']))// SEF URL support.
|
||||||
{
|
{
|
||||||
$options['full'] = $full;
|
$options['full'] = $full;
|
||||||
$options['ext'] = substr($url, -3);
|
$options['ext'] = pathinfo($url, PATHINFO_EXTENSION);
|
||||||
$options['thurl'] = $thurl;
|
$options['thurl'] = $thurl;
|
||||||
// $options['x'] = $this->thumbEncode();
|
// $options['x'] = $this->thumbEncode();
|
||||||
|
|
||||||
@@ -3606,9 +3626,10 @@ class e_parse
|
|||||||
if (defined('BOOTSTRAP'))
|
if (defined('BOOTSTRAP'))
|
||||||
{
|
{
|
||||||
$this->bootstrap = (int) BOOTSTRAP;
|
$this->bootstrap = (int) BOOTSTRAP;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->modRewriteMedia = deftrue('e_MOD_REWRITE_MEDIA');
|
||||||
|
|
||||||
if (defined('e_HTTP_STATIC'))
|
if (defined('e_HTTP_STATIC'))
|
||||||
{
|
{
|
||||||
$this->staticUrl = e_HTTP_STATIC;
|
$this->staticUrl = e_HTTP_STATIC;
|
||||||
@@ -3781,7 +3802,6 @@ class e_parse
|
|||||||
*/
|
*/
|
||||||
public function setFontAwesome($version)
|
public function setFontAwesome($version)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->fontawesome = (int) $version;
|
$this->fontawesome = (int) $version;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3790,10 +3810,13 @@ class e_parse
|
|||||||
*/
|
*/
|
||||||
public function setBootstrap($version)
|
public function setBootstrap($version)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->bootstrap = (int) $version;
|
$this->bootstrap = (int) $version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setmodRewriteMedia($bool)
|
||||||
|
{
|
||||||
|
$this->modRewriteMedia = (bool) $bool;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add leading zeros to a number. eg. 3 might become 000003
|
* Add leading zeros to a number. eg. 3 might become 000003
|
||||||
|
Reference in New Issue
Block a user