[英]Multiply Index pages using Joomla
I have used Joomla to create my website. 我已经使用Joomla创建了我的网站。
I need a disclaimer page to come up before the front end user can see the rest of the website. 我需要一个免责声明页面,前端用户才能看到网站的其余部分。
I created a new "index.php" page with the disclaimer information, with a link to the site - I renamed the original php file to "index1.php 我创建了一个新的“ index.php”页面,其中包含免责声明信息以及指向该站点的链接-我将原始php文件重命名为“ index1.php”
"Index.php" views but the link doesn't want to work. “ Index.php”视图,但该链接不起作用。 My code does seem all correct. 我的代码似乎确实正确。
Any advise please? 有什么建议吗?
You cannot just rename index.php
in joomla. 您不能只在joomla中重命名index.php
。 It's entry point to your website and it initializes/routes/runs your joomla app. 它是您网站的入口,它会初始化/路由/运行您的joomla应用程序。 So instead you should modify your index.php
so that it recognizes 1st time visits and redirects users to correct page. 因此,相反,您应该修改index.php
,使其能够识别第一次访问并将用户重定向到正确的页面。
Name your terms page as first-time.php
and modify index.php
as follows: 将您的条款页面命名为first-time.php
并按如下所示修改index.php
:
<?php
if (!isset($_COOKIE['firsttime']))
{
setcookie("firsttime", "no", /* EXPIRE */);
header('Location: first-time.php');
exit();
}
else
{
// Set flag that this is a parent file.
define('_JEXEC', 1);
define('DS', DIRECTORY_SEPARATOR);
if (file_exists(dirname(__FILE__) . '/defines.php')) {
include_once dirname(__FILE__) . '/defines.php';
}
if (!defined('_JDEFINES')) {
define('JPATH_BASE', dirname(__FILE__));
require_once JPATH_BASE.'/includes/defines.php';
}
require_once JPATH_BASE.'/includes/framework.php';
// Mark afterLoad in the profiler.
JDEBUG ? $_PROFILER->mark('afterLoad') : null;
// Instantiate the application.
$app = JFactory::getApplication('site');
// Initialise the application.
$app->initialise();
// Mark afterIntialise in the profiler.
JDEBUG ? $_PROFILER->mark('afterInitialise') : null;
// Route the application.
$app->route();
// Mark afterRoute in the profiler.
JDEBUG ? $_PROFILER->mark('afterRoute') : null;
// Dispatch the application.
$app->dispatch();
// Mark afterDispatch in the profiler.
JDEBUG ? $_PROFILER->mark('afterDispatch') : null;
// Render the application.
$app->render();
// Mark afterRender in the profiler.
JDEBUG ? $_PROFILER->mark('afterRender') : null;
// Return the response.
echo $app;
}
?>
Rather than hacking your website and making applying updates a problem have you considered creating it as a plugin? 您是否考虑过将其创建为插件,而不是黑客入侵您的网站并使应用更新成为问题?
As an alternative have you looked in the Joomla! 您也可以选择Joomla! Extension Directory ? 扩展目录 ? It has a User Management section and on the first page of that I can see a Joomla! 它有一个“ 用户管理”部分 ,在该页面的第一页上,我可以看到一个Joomla! 2.5 plugin called Terms of Service that might fit your needs. 2.5个称为服务条款的插件可能符合您的需求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.