diff --git a/class2.php b/class2.php
index 454661f72..155ef5c98 100644
--- a/class2.php
+++ b/class2.php
@@ -930,11 +930,18 @@ if(!defined("THEME_LAYOUT"))
if(is_array($cusPagePref) && count($cusPagePref)>0) // check if we match a page in layout custompages.
{
//e_SELF.(e_QUERY ? '?'.e_QUERY : '');
- $c_url = e_REQUEST_URL.(e_QUERY ? '?'.e_QUERY : '');// mod_rewrite support
+ $c_url = str_replace(array('&'), array('&'), e_REQUEST_URL);//.(e_QUERY ? '?'.e_QUERY : '');// mod_rewrite support
+
foreach($cusPagePref as $lyout=>$cusPageArray)
{
if(!is_array($cusPageArray)) { continue; }
-
+
+ // NEW - Front page template check - early
+ if(in_array('FRONTPAGE', $cusPageArray) && ($c_url == SITEURL || rtrim($c_url, '/') == SITEURL.'index.php'))
+ {
+ $def = $lyout;
+ break;
+ }
foreach($cusPageArray as $kpage)
{
if(substr($kpage, -1) === '!' )
diff --git a/e107_core/controllers/index/index.php b/e107_core/controllers/index/index.php
index b51209843..80725c33c 100644
--- a/e107_core/controllers/index/index.php
+++ b/e107_core/controllers/index/index.php
@@ -91,6 +91,7 @@ class core_index_index_controller extends eController
// Former Welcome Message front-page. Should be handled by current theme layout
elseif($location == 'index.php' || $location == 'url:/' || $location == 'route:/' || $location == '/')
{
+ define('e_FRONTPAGE', true);
$this->_forward('front');
return;
}
@@ -112,6 +113,7 @@ class core_index_index_controller extends eController
{
throw new eException('Infinite loop detected while dispatching front page.', 2);
}
+ define('e_FRONTPAGE', true);
$this->_forward($request->getRoute());
return;
}
@@ -132,7 +134,7 @@ class core_index_index_controller extends eController
{
throw new eException('Infinite loop detected while dispatching front page.', 2);
}
-
+ define('e_FRONTPAGE', true);
$this->_forward($request->getRoute(), $qstr);
return;
@@ -155,7 +157,7 @@ class core_index_index_controller extends eController
->setLegacyQstring($qstr);
$request->routed = true;
-
+ define('e_FRONTPAGE', true);
eFront::isLegacy('{e_BASE}'.$page);
return $this;
}
diff --git a/e107_core/shortcodes/single/wmessage.php b/e107_core/shortcodes/single/wmessage.php
index 61d6e6e0d..06074a19c 100644
--- a/e107_core/shortcodes/single/wmessage.php
+++ b/e107_core/shortcodes/single/wmessage.php
@@ -4,37 +4,41 @@
function wmessage_shortcode($parm)
{
-
- global $e107, $e107cache, $pref;
+ $e107 = e107::getInstance();
+ $e107cache = e107::getCache();
+ $pref = e107::getPref();
+
$prefwmsc = varset($pref['wmessage_sc'], FALSE);
if (($prefwmsc && $parm == 'header') || (!$prefwmsc && ($parm !='header')) )
{ // Two places it might be invoked - allow one or the other
return;
}
+
if ($parm != 'force')
- {
- $full_url = 'news.php'; // Set a default in case
- $front_qry = '';
- $uc_array = explode(',', USERCLASS_LIST);
- if(varset($pref['frontpage']))
{
- foreach ($pref['frontpage'] as $fk => $fp)
+ $full_url = 'news.php'; // Set a default in case
+ $front_qry = '';
+ $uc_array = explode(',', USERCLASS_LIST);
+ if(varset($pref['frontpage']))
{
- if (in_array($fk,$uc_array))
+ foreach ($pref['frontpage'] as $fk => $fp)
{
- $full_url = $fp;
- break;
+ if (in_array($fk,$uc_array))
+ {
+ $full_url = $fp;
+ break;
+ }
}
+ list($front_url, $front_qry) = explode('?', $full_url.'?'); // extra '?' ensure the array is filled
}
- list($front_url, $front_qry) = explode('?', $full_url.'?'); // extra '?' ensure the array is filled
}
- }
+
if (strpos($front_url, 'http') === FALSE) $front_url = SITEURL.$front_url;
- if (($parm == 'force') || ((e_SELF == $front_url) && (($parm == 'ignore_query') || (e_QUERY == $front_qry))))
+ if (deftrue('e_FRONTPAGE') || ($parm == 'force') || ((e_SELF == $front_url) && (($parm == 'ignore_query') || (e_QUERY == $front_qry))))
{
// Actually want to display a welcome message here
global $ns;
diff --git a/e107_core/xml/default_install.xml b/e107_core/xml/default_install.xml
index 711d04995..690bd4cc4 100644
--- a/e107_core/xml/default_install.xml
+++ b/e107_core/xml/default_install.xml
@@ -53,7 +53,7 @@
15
0
0
- 0
+ 1
0
0