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

出自六年制學程
跳轉到: 導覽搜尋
控制跨 site 的內容頁
控制跨 site 的內容頁
第 28 行: 第 28 行:
 
*在表 webContent 中
 
*在表 webContent 中
 
*: path 欄值為「/webContent.php/頁名」
 
*: path 欄值為「/webContent.php/頁名」
*: webContent 欄值含 <a href='#' onClick="webContent(URI,'content');return false;">連結提示?>/a> 。利用 theme.php 中 javascript 的 webContent 函式,秀出任何 URI 能表達的內容。
+
*: webContent 欄值含 <a href='#' onClick="webContent(URI,'content');return false;">連結提示</a> 。利用 theme.php 中 javascript 的 webContent 函式,秀出任何 URI 能表達的內容。
 
*在導航列中以「*#[[[頁名]]],頁名提示」來製作二級選項
 
*在導航列中以「*#[[[頁名]]],頁名提示」來製作二級選項
  

2022年11月11日 (五) 17:48的修訂版本

控制首頁表現

  • 網址只打 ip 或域名,不打路徑
    透過文件根目錄下的 index.php ,如 http://jendo.org/
    識別 $_SERVER['SERVER_NAME'] 即「jendo.org」。
  • 網址只打 ip 或域名+路徑,不打程式名
  • 1.透過 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;}
}
?>
  • 2.在 site 目錄下的 index.php 中不指定跳往何方,而在表 webContent 中的 path 欄指定 SITE 路徑,如「/EMEP/20220124/」。此時「域名+路徑」只能導向內容頁。 site 目錄下的 index.php ,可以簡化如下:
<?php
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;}
?>

控制跨 site 的內容頁

  • 在表 webContent 中
    path 欄值為「/webContent.php/頁名」
    webContent 欄值含 <a href='#' onClick="webContent(URI,'content');return false;">連結提示</a> 。利用 theme.php 中 javascript 的 webContent 函式,秀出任何 URI 能表達的內容。
  • 在導航列中以「*#[[[頁名]]],頁名提示」來製作二級選項



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