Joomla を使用して Web サイトを作成しました。
フロント エンド ユーザーが Web サイトの残りの部分を表示する前に、免責事項のページを表示する必要があります。
サイトへのリンクを含む免責事項情報を含む新しい「index.php」ページを作成しました - 元のphpファイルの名前を「index1.php」に変更しました
「Index.php」は表示されますが、リンクが機能しません。私のコードはすべて正しいようです。
アドバイスをお願いします。
index.php
joomlaで名前を変更することはできません。これはWebサイトへのエントリポイントであり、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;
}
?>
Web サイトをハッキングして更新を適用することを問題にするのではなく、プラグインとして作成することを検討しましたか?
別の方法として、 Joomla!を見たことがありますか? 拡張ディレクトリ? ユーザー管理セクションがあり、その最初のページに Joomla! が表示されます。2.5 プラグインは利用規約と呼ばれ、ニーズに合うかもしれません。