2012-07-17 64 views
0

我已经使用Joomla创建我的网站。使用Joomla乘以索引页面

我需要一个免责声明页面出现在前端用户可以看到网站的其余部分。

我创建与免责声明信息的新“的index.php”网页,并链接到该网站 - 我改名为原来的PHP文件“index1.php

‘的index.php’的意见,但链接不想工作。 我的代码似乎正确的。

任何建议吗?

回答

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; 
} 
?>