我已經使用Joomla創建我的網站。使用Joomla乘以索引頁面
我需要一個免責聲明頁面出現在前端用戶可以看到網站的其餘部分。
我創建與免責聲明信息的新「的index.php」網頁,並鏈接到該網站 - 我改名爲原來的PHP文件「index1.php
‘的index.php’的意見,但鏈接不想工作。 我的代碼似乎正確的。
任何建議嗎?
我已經使用Joomla創建我的網站。使用Joomla乘以索引頁面
我需要一個免責聲明頁面出現在前端用戶可以看到網站的其餘部分。
我創建與免責聲明信息的新「的index.php」網頁,並鏈接到該網站 - 我改名爲原來的PHP文件「index1.php
‘的index.php’的意見,但鏈接不想工作。 我的代碼似乎正確的。
任何建議嗎?
你不能只重命名的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;
}
?>
而不是黑客攻擊你的網站,使應用更新你有沒有考慮建立它作爲一個插件有問題嗎?
作爲替代方法,您是否查看了Joomla! Extension Directory?它有一個User Management section和第一頁上,我可以看到一個Joomla! 2.5插件名爲Terms of Service,可能適合您的需求。