網(wǎng)站首頁 織夢學(xué)院 正文
驗(yàn)證碼不顯示 或者驗(yàn)證碼不正確的問題
網(wǎng)站被攻擊了 如何處理和防范
關(guān)于dedecms內(nèi)容頁URL實(shí)現(xiàn)拼音偽靜態(tài)的方法,這是烈火轉(zhuǎn)自dede技術(shù)論壇的帖子,由于原文很亂,一看就知道并非原創(chuàng),所以dede58進(jìn)行了整理,大約花費(fèi)了5分鐘的時(shí)間,原文中的行號還都在,非常不利于復(fù)制,以下為原文:如果你需要可以作為參考:
可能你覺得DEDECMS本來就有這個(gè)功能,后臺設(shè)置下,點(diǎn)生成靜態(tài)頁。。
錯(cuò)了。。我的這個(gè)可是動態(tài)的,非靜態(tài)HTML,用urlwrite實(shí)現(xiàn)的偽靜態(tài)。
喜歡的頂。當(dāng)然要服務(wù)器支持urlwrite
好處:更改模板后,不用重新生成HTML,試試想10W數(shù)據(jù),重新生成一遍的難度。
百度收錄的友好度。拼音地址。
修改方法
編輯文件
include/inc_channel_unit_functi*****.php
第107行改為
if($rank!=0||$ismake==-1||$typeid==0||$money>0){ //動態(tài)文章
//return $GLOBALS['cfg_plus_dir']."/view.php?aid=$aid";
//keminar 修改
$articleDir = MfTypedir($artdir);
if($artdir=="") $articleDir = $GLOBALS['cfg_cmspath'].$GLOBALS['cfg_arcdir'];
return $articleDir."/".GetPinyin($title)."_aid_".$aid.".html";
}
第52行改為
if($rank!=0||$ismake==-1||$typeid==0||$money>0) //動態(tài)文章
{
if($GLOBALS['cfg_multi_site']=='Y')
{
$siteurl = $GLOBALS['cfg_basehost'];
}
//return $siteurl.$GLOBALS['cfg_plus_dir']."/view.php?aid=$aid";
//keminar 修改
$articleDir = MfTypedir($artdir);
if($artdir=="") $articleDir = $GLOBALS['cfg_cmspath'].$GLOBALS['cfg_arcdir'];
return $siteurl.$articleDir."/".GetPinyin($title)."_aid_".$aid.".html";
}
第146行改為
if($isdefault==-1)
{
//$reurl = $GLOBALS["cfg_plus_dir"]."/list.php?tid=".$typeid;
//keminar 修改
$reurl = $GLOBALS["cfg_cmspath"]."/".$typedir."_tid_".$typeid.".html";
}else if($ispart>0)
修改文件
include/inc_arclist_view.php
第810行改為
$purl = $this->GetCurUrl();
//keminar 修改
$t = strpos($purl,'_tid_');
$purl = substr($purl,0,$t);
$geturl = "tid_".$this->TypeID."_";
//$hidenform = "<input type='hidden' name='typeid' value='".$this->TypeID."'>\r\n";
//$hidenform .= "<input type='hidden' name='totalresult' value='".$this->totalresult."'>\r\n";
$purl .= "_".$geturl;
//獲得上一頁和下一頁的鏈接
if($this->pageno != 1){
$prepage.="<a href='".$purl."pageno_".$prepagenum.".html'>上一頁</a>\r\n";
$indexpage="<a href='".$purl."pageno_1.html'>首頁</a>\r\n";
}
else{
$indexpage="<a href='#'>首頁</a>\r\n";
}
if($this->pageno!=$totalpage && $totalpage>1){
$nextpage.="<a href='".$purl."pageno_".$nextpagenum.".html'>下一頁</a>\r\n";
$endpage="<a href='".$purl."pageno_".$totalpage.".html'>末頁</a>\r\n";
}
else{
$endpage="末頁\r\n";
}
//獲得數(shù)字鏈接
$listdd="";
$total_list = $list_len * 2 + 1;
if($this->pageno >= $total_list) {
$j = $this->pageno-$list_len;
$total_list = $this->pageno+$list_len;
if($total_list>$totalpage) $total_list=$totalpage;
}else{
$j=1;
if($total_list>$totalpage) $total_list=$totalpage;
}
for($j;$j<=$total_list;$j++){
if($j==$this->pageno) $listdd.= "<strong>$j</strong>\r\n";
else $listdd.="<a href='".$purl."pageno_".$j.".html'>".$j."</a>\n";
}
$plist = "";
//$plist .= "<form name='pagelist' action='".$this->GetCurUrl()."'>$hidenform";
$plist .= $maininfo.$indexpage.$prepage.$listdd.$nextpage.$endpage;
if($totalpage>$total_list){
$plist.="<input type='text' name='pageno' id='pageno' value='".$this->pageno."'>\r\n";
$plist.="<input type='button' id='button' name='plistgo' value='GO' onclick='plistgo();'>\r\n";
}
//$plist .= "</form>\r\n";
$plist .= "<script type='text/javascript'>\r\n
function plistgo(){
var pageno = document.getElementById(\"pageno\").value;
window.location.href='".$purl."pageno_'+pageno+'.html';
};</script>";
return $plist;
修改模板
templets/jinsuo/article_image.htm
第10行添加
var url = location.href;
var t = url.indexOf('_aid_');
var aurl = url.slice(0,t);
第42行修改
if(npage==2){
if(namehand!='') location.href = namehand+".html";
else location.href = aurl+"_aid_{dede:field name='id'/}"+".html";
}else if(displaytype=='st' && namehand!=''){
location.href = namehand+"_"+(npage-1)+".html";
}else{
location.href = aurl+"_aid_{dede:field name='id'/}_pageno_"+(npage-1)+".html";
}
}
}
//下一張
function dPlayNext(){
if(npage==totalpage){ alert("沒有了哦"); }
else{
if(displaytype=='st' && namehand!='') location.href = namehand+"_"+(npage+1)+".html";
else location.href = aurl+"_aid_{dede:field name='id'/}_pageno_"+(npage+1)+".html";
相關(guān)推薦
- 2022-04-01 LVS,Nginx,Haproxy的差異
- 2022-03-29 redis的list數(shù)據(jù)類型相關(guān)命令介紹及使用_Redis
- 2024-03-24 go 連接redis集群
- 2022-08-19 Python利用memory_profiler查看內(nèi)存占用情況_python
- 2022-08-04 Python?編程操作連載之字符串,列表,字典和集合處理_python
- 2022-12-15 Pycharm中配置Anaconda解釋器的完整步驟_python
- 2022-02-18 RuntimeError: CUDA error: invalid device ordinal
- 2022-05-06 Windows如何關(guān)閉被占用的端口
- 欄目分類
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯(cuò)誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實(shí)現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡單動態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊(duì)列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支