2012-07-17 63 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; 
} 
?>