mirror of
https://github.com/e107inc/e107.git
synced 2025-08-23 22:53:01 +02:00
Improved Front page detection, themes now have an option to assign layout to frontpage via spacial keyword FRONTPAGE
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -53,7 +53,7 @@
|
||||
<core name="displayname_maxlength">15</core>
|
||||
<core name="displayrendertime">0</core>
|
||||
<core name="displaysql">0</core>
|
||||
<core name="displaythemeinfo">0</core>
|
||||
<core name="displaythemeinfo">1</core>
|
||||
<core name="download_email">0</core>
|
||||
<core name="e_jslib_browser_cache">0</core>
|
||||
<core name="e_jslib_core"><![CDATA[array (
|
||||
|
Reference in New Issue
Block a user