mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 12:48:24 +01:00
New constant: e_VERSION for the currently installed version of e107. Prevents the need for further loading of ver.php and useful to detect when an upgrade of core files has been performed.
This commit is contained in:
parent
2724127ba2
commit
4650aa8d91
@ -749,6 +749,8 @@ define('SITECONTACTINFO', $tp->toHTML($pref['sitecontactinfo'], true, 'emotes_of
|
||||
define('SITEEMAIL', vartrue($pref['replyto_email'],$pref['siteadminemail']));
|
||||
define('USER_REGISTRATION', vartrue($pref['user_reg'],false)); // User Registration System Active or Not.
|
||||
define('e_DEVELOPER', $developerMode);
|
||||
define('e_VERSION', varset($pref['version'],''));
|
||||
|
||||
unset($developerMode);
|
||||
|
||||
if(!empty($pref['xurl']) && is_array($pref['xurl']))
|
||||
|
@ -144,11 +144,11 @@ class admin_start
|
||||
e_PLUGIN."pm/sendpm.sc",
|
||||
e_PLUGIN."pm/shortcodes/",
|
||||
e_PLUGIN."social/e_header.php",
|
||||
e_PLUGIN."download/url/url.php",
|
||||
e_PLUGIN."download/url/sef_url.php",
|
||||
// e_PLUGIN."download/url/url.php",
|
||||
// e_PLUGIN."download/url/sef_url.php",
|
||||
);
|
||||
|
||||
|
||||
$this->checkCoreVersion();
|
||||
|
||||
if(!empty($_POST['delete-deprecated']))
|
||||
{
|
||||
@ -253,6 +253,28 @@ class admin_start
|
||||
}
|
||||
|
||||
|
||||
private function checkCoreVersion()
|
||||
{
|
||||
|
||||
$e107info = array();
|
||||
|
||||
require(e_ADMIN."ver.php");
|
||||
|
||||
if(!empty($e107info['e107_version']) && (e_VERSION !== $e107info['e107_version']))
|
||||
{
|
||||
e107::getConfig()->set('version', $e107info['e107_version'])->save(false,true,false);
|
||||
|
||||
// When version has changed, clear plugin/theme version cache.
|
||||
e107::getPlug()->clearCache();
|
||||
e107::getTheme()->clearCache();
|
||||
|
||||
e107::getDebug()->log("Updating core version pref");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function checkCoreUpdate()
|
||||
{
|
||||
// auto db update
|
||||
|
@ -469,8 +469,8 @@ class eurl_admin_ui extends e_admin_controller_ui
|
||||
if(!empty($_POST['eurl_profile']))
|
||||
{
|
||||
e107::getConfig()->set('url_profiles', $_POST['eurl_profile']);
|
||||
unset($locations['download']);
|
||||
unset($config['download']);
|
||||
// unset($locations['download']);
|
||||
// unset($config['download']);
|
||||
}
|
||||
|
||||
e107::getConfig()
|
||||
|
@ -654,11 +654,11 @@ class lancheck
|
||||
|
||||
if(is_readable(e_ADMIN."ver.php"))
|
||||
{
|
||||
include(e_ADMIN."ver.php");
|
||||
// include(e_ADMIN."ver.php");
|
||||
}
|
||||
|
||||
require_once(e_HANDLER.'pclzip.lib.php');
|
||||
list($ver, $tmp) = explode(" ", $e107info['e107_version']);
|
||||
list($ver, $tmp) = explode(" ", e_VERSION);
|
||||
if(!$locale = $this->findLocale($language))
|
||||
{
|
||||
$ret['error'] = TRUE;
|
||||
|
@ -254,10 +254,10 @@ if(!empty($_GET['iframe']))
|
||||
$ns = e107::getRender();
|
||||
$tp = e107::getParser();
|
||||
|
||||
if(is_readable(e_ADMIN."ver.php"))
|
||||
// if(is_readable(e_ADMIN."ver.php"))
|
||||
{
|
||||
include(e_ADMIN."ver.php");
|
||||
list($ver, $tmp) = explode(" ", $e107info['e107_version']);
|
||||
// include(e_ADMIN."ver.php");
|
||||
list($ver, $tmp) = explode(" ", e_VERSION);
|
||||
}
|
||||
|
||||
$lck = e107::getSingleton('lancheck', e_ADMIN."lancheck.php");
|
||||
|
@ -1022,14 +1022,14 @@ class admin_shortcodes
|
||||
{
|
||||
global $ns, $pref, $themename, $themeversion, $themeauthor, $themedate, $themeinfo, $mySQLdefaultdb;
|
||||
|
||||
if (file_exists(e_ADMIN.'ver.php'))
|
||||
// if (file_exists(e_ADMIN.'ver.php'))
|
||||
{
|
||||
include(e_ADMIN.'ver.php');
|
||||
// include(e_ADMIN.'ver.php');
|
||||
}
|
||||
|
||||
if($parm == "version")
|
||||
{
|
||||
return $e107info['e107_version'];
|
||||
return e_VERSION;
|
||||
}
|
||||
|
||||
$obj = e107::getDateConvert();
|
||||
|
@ -396,6 +396,7 @@ City, State, Country
|
||||
<core name="user_reg_secureveri">1</core>
|
||||
<core name="user_reg_veri">1</core>
|
||||
<core name="user_tracking">cookie</core>
|
||||
<core name="version">2.1.6</core>
|
||||
<core name="wm_enclose">1</core>
|
||||
<core name="wmessage_sc">0</core>
|
||||
<core name="wysiwyg">1</core>
|
||||
|
@ -875,11 +875,11 @@ class xmlClass
|
||||
public function e107Export($xmlprefs, $tables, $plugPrefs, $options = array())
|
||||
{
|
||||
// error_reporting(0);
|
||||
$e107info = array();
|
||||
require_once(e_ADMIN."ver.php");
|
||||
// $e107info = array();
|
||||
// require_once(e_ADMIN."ver.php");
|
||||
|
||||
$text = "<?xml version='1.0' encoding='utf-8' ?".">\n";
|
||||
$text .= "<e107Export version=\"".$e107info['e107_version']."\" timestamp=\"".time()."\" >\n";
|
||||
$text .= "<e107Export version=\"".e_VERSION."\" timestamp=\"".time()."\" >\n";
|
||||
|
||||
$default = array();
|
||||
$excludes = array();
|
||||
|
@ -666,13 +666,13 @@ class rssCreate
|
||||
<link rel='self' href='".$tp->toRss(e107::url('rss_menu','atom', array('rss_url'=>$this->contentType, 'rss_topicid'=>$this->topicid),'full'))."' />\n";
|
||||
|
||||
// Optional
|
||||
include(e_ADMIN."ver.php");
|
||||
// include(e_ADMIN."ver.php");
|
||||
echo "
|
||||
<category term='e107'/>\n
|
||||
<contributor>\n
|
||||
<name>e107</name>\n
|
||||
</contributor>\n
|
||||
<generator uri='http://e107.org/' version='".$e107info['e107_version']."'>e107</generator>\n";
|
||||
<generator uri='http://e107.org/' version='".e_VERSION."'>e107</generator>\n";
|
||||
//<icon>/icon.jpg</icon>\n
|
||||
echo "
|
||||
<logo>".(strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL.str_replace("../", "", SITEBUTTON))."</logo>\n
|
||||
|
Loading…
x
Reference in New Issue
Block a user