Browse Source

伪静态调整

tags/6.1.7
tianya 2 years ago
parent
commit
531da98c92
3 changed files with 32 additions and 18 deletions
  1. +5
    -2
      src/system/archive/archives.class.php
  2. +4
    -2
      src/system/archive/listview.class.php
  3. +23
    -14
      src/system/helpers/channelunit.helper.php

+ 5
- 2
src/system/archive/archives.class.php View File

@@ -288,7 +288,10 @@ class Archives
*/
function MakeHtml($isremote = 0)
{
global $fileFirst, $cfg_basehost;
global $fileFirst, $cfg_basehost,$cfg_rewrite;
if ($cfg_rewrite) {
return '';
}
if ($this->IsError) {
return '';
@@ -998,7 +1001,7 @@ class Archives
$karr = $kaarr = $GLOBALS['replaced'] = array();
//暂时屏蔽超链接
$body = preg_replace("#(<a(.*))(>)(.*)(<)(\/a>)#isU", '\\1-]-\\4-[-\\6', $body);
$query = "SELECT * FROM #@__keywords WHERE rpurl<>'' ORDER BY rank DESC";
$query = "SELECT * FROM `#@__keywords` WHERE rpurl<>'' ORDER BY `rank` DESC";
$this->dsql->SetQuery($query);
$this->dsql->Execute();
while ($row = $this->dsql->GetArray()) {


+ 4
- 2
src/system/archive/listview.class.php View File

@@ -823,6 +823,7 @@ class ListView
*/
function GetPageListST($list_len, $listitem = "index,end,pre,next,pageno")
{
global $cfg_rewrite,$cfg_cmspath;
$prepage = $nextpage = '';
$prepagenum = $this->PageNo - 1;
$nextpagenum = $this->PageNo + 1;
@@ -901,7 +902,7 @@ class ListView
//伪静态分页处理
if ($cfg_rewrite == 'Y')
{
$plist = str_replace('/apps/', $cfg_cmspath.'/', $plist);
$plist = str_replace('.php?tid=','-',$plist);
$plist = preg_replace("/&TotalResult=(\d+)/i","",$plist);//去掉总结果数值
//目录版
@@ -920,7 +921,7 @@ class ListView
*/
function GetPageListDM($list_len, $listitem = "index,end,pre,next,pageno")
{
global $cfg_rewrite;
global $cfg_rewrite,$cfg_cmspath;
$prepage = $nextpage = '';
$prepagenum = $this->PageNo - 1;
$nextpagenum = $this->PageNo + 1;
@@ -991,6 +992,7 @@ class ListView
if (preg_match('/option/i', $listitem)) $plist .= $optionlist;
if (preg_match('/info/i', $listitem)) $plist .= $maininfo;
if ($cfg_rewrite == 'Y') {
$plist = str_replace('/apps/', $cfg_cmspath.'/', $plist);
$plist = str_replace('.php?tid=', '-', $plist);
$plist = str_replace('&TotalResult=', '-', $plist);
$plist = preg_replace("/&PageNo=(\d+)/i", '-\\1.html', $plist);


+ 23
- 14
src/system/helpers/channelunit.helper.php View File

@@ -109,6 +109,7 @@ if (!function_exists('GetFileNewName')) {
$articlename = $articlename."index.html";
}
$slen = strlen($articlename) - 1;
$subpos = 0;
for ($i = $slen; $i >= 0; $i--) {
if ($articlename[$i] == '/') {
$subpos = $i;
@@ -144,15 +145,16 @@ if (!function_exists('GetFileName')) {
$namerule = $cfg_special.'/arc-{aid}.html';
$typeid = -1;
}
//伪静态文档,Nginx伪静态规则参考:
//rewrite ^/([0-9]+).html$ /apps/view.php?arcID=$1;
//rewrite ^/([0-9]+)-([0-9]+).html$ /apps/view.php?aid=$1&pageno=$2;
if ($cfg_rewrite == 'Y') {
//目录版return "/article/".$aid."";
//网页版
return $GLOBALS['cfg_cmspath'].'/'.$aid.".html";
}
if ($rank != 0 || $ismake == -1 || $typeid == 0 || $money > 0) {
//伪静态文档,Nginx伪静态规则参考:rewrite ^/([0-9]+).html$ /apps/view.php?arcID=$1;rewrite ^/([0-9]+)-([0-9]+).html$ /apps/view.php?aid=$1&pageno=$2;
if ($cfg_rewrite == 'Y') {
//目录版return "/article/".$aid."";
//网页版
return "/".$aid.".html";
} else {
return $GLOBALS['cfg_phpurl']."/view.php?aid=$aid";
}
return $GLOBALS['cfg_phpurl']."/view.php?aid=$aid";
} else {
$articleDir = MfTypedir($typedir);
$articleRule = strtolower($namerule);
@@ -200,14 +202,21 @@ if (!function_exists('GetFileName')) {
if (!function_exists('GetTypeUrl')) {
function GetTypeUrl($typeid, $typedir, $isdefault, $defaultname, $ispart, $namerule2, $moresite = 0, $siteurl = '', $sitepath = '')
{
global $cfg_typedir_df;
global $cfg_typedir_df,$cfg_rewrite;
$typedir = MfTypedir($typedir);
$sitepath = MfTypedir($sitepath);
//伪静态栏目,Nginx伪静态规则参考:rewrite ^/list-([0-9]+)$ /apps/list.php?tid=$1;rewrite ^/list-([0-9]+)-([0-9]+)$ /apps/list.php?tid=$1&PageNo=$2;
//伪静态栏目,Nginx伪静态规则参考:
//rewrite ^/list-([0-9]+)$ /apps/list.php?tid=$1;
//rewrite ^/list-([0-9]+)-([0-9]+)$ /apps/list.php?tid=$1&PageNo=$2;
if ($cfg_rewrite == 'Y') {
//目录版return "/article/".$aid."";
//网页版
return $GLOBALS['cfg_cmspath']."/list-".$typeid."";
}
if($isdefault==-1) {
//目录版
$reurl = "/list-".$typeid."";
//网页版$reurl = "/list".$typeid.".html";
//动态
$reurl = $GLOBALS['cfg_phpurl']."/list.php?tid=".$typeid;
} else if ($ispart == 2) {
//跳转网址
$reurl = $typedir;
@@ -400,7 +409,7 @@ function FormatScript($atme)
*/
function FillAttsDefault(&$atts, $attlist)
{
$attlists = explode(',', $attlist);
$attlists = explode(',', (string)$attlist);
for ($i = 0; isset($attlists[$i]); $i++) {
list($k, $v) = explode('|', $attlists[$i]);
if (!isset($atts[$k])) {


Loading…
Cancel
Save