LiteSite/導航列:修訂版本之間的差異

出自六年制學程
跳轉到: 導覽搜尋
控制首頁表現
控制首頁表現
第 5 行: 第 5 行:
 
*網址只打 ip 或域名+路徑,不打程式名<br/>透過 site 目錄下的 index.php ,如 http://urclass.net/EMEP
 
*網址只打 ip 或域名+路徑,不打程式名<br/>透過 site 目錄下的 index.php ,如 http://urclass.net/EMEP
 
<pre>&lt;?php
 
<pre>&lt;?php
if(substr(urldecode($_SERVER['SCRIPT_NAME']),strlen(urldecode($_SERVER['REQUEST_URI'])))=='index.php')
+
if(substr(urldecode($_SERVER['SCRIPT_NAME']),strlen(urldecode($_SERVER['REQUEST_URI'])))=='index.php'){
{header("Location: site首頁要前往的 URI");}
+
header("Location: site首頁要前往的 URI");
else{
+
}else{
 
include_once '/文件根目錄/constant.php';
 
include_once '/文件根目錄/constant.php';
 
include_once 'theme.php';
 
include_once 'theme.php';

2022年11月11日 (五) 15:05的修訂版本

控制首頁表現

  • 網址只打 ip 或域名,不打路徑
    透過文件根目錄下的 index.php ,如 http://jendo.org/
    識別 $_SERVER['SERVER_NAME'] 即「jendo.org」。
  • 網址只打 ip 或域名+路徑,不打程式名
    透過 site 目錄下的 index.php ,如 http://urclass.net/EMEP
<?php
if(substr(urldecode($_SERVER['SCRIPT_NAME']),strlen(urldecode($_SERVER['REQUEST_URI'])))=='index.php'){
	header("Location: site首頁要前往的 URI");
}else{
	include_once '/文件根目錄/constant.php';
	include_once 'theme.php';
	if(!isset($_REQUEST['ajax'])){echo $html1;}
	echo webContent(urldecode($_SERVER['REQUEST_URI']));
	if(!isset($_REQUEST['ajax'])){echo $html2;}
}
?>


theme.php 會去找 webContent.webContent 資料表,其中 path 為「"/".SITE."/導航列"」的筆,如找不到會提示網站編輯者去建立此筆。