我使用Joomla创建我的网站。
在前端用户可以看到网站的其他部分之前,我需要一个免责声明页面。
我创建了一个新的“index.php”页面,其中包含免责声明信息,以及指向该网站的链接 - 我将原始的php文件重命名为“index1.php
“Index.php”视图,但链接不想工作。 我的代码似乎都是正确的。
有什么建议吗?
答案 0 :(得分:0)
您不能只在joomla中重命名index.php
。它是您网站的入口点,它初始化/路由/运行您的joomla应用程序。因此,您应该修改index.php
,以便它识别第一次访问并将用户重定向到正确的页面。
将您的术语页面命名为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;
}
?>
答案 1 :(得分:0)
您是否考虑将其创建为插件,而不是攻击您的网站并将更新应用于某个问题?
作为替代方案,你看过Joomla! Extension Directory吗?它有User Management section,在第一页上我可以看到Joomla! 2.5插件名为Terms of Service,可能符合您的需求。