dedecms用JS方式在首頁實(shí)現(xiàn)留言本內(nèi)容調(diào)用,織夢文
導(dǎo)讀:織夢文章織夢文章在plus/guestbook目錄新建文件js.php?phprequire_once(dirname(__FILE__)./config.php);requi織夢的模板。
在plus/guestbook目錄新建文件 js.php
<?php require_once(dirname(__FILE__)."/config.php"); require_once(dirname(__FILE__)."/../../include/pub_datalist_dm.php"); setcookie("GUEST_BOOK_MOVE",GetCurUrl(),time()+3600,"/");
if($gotopagerank=="admin"){ $userrank = $cuserLogin->getUserRank(); } else{ $userrank = -1; }
function GetIsCheck($ische模板織夢ck,$id) { if($ischeck==0) return "<br><a href=’edit.php?job=check&ID=$id’ style=’color:red’>[審核]</a>"; else return ""; }
if($userrank>0) $sql = "select * from 2d30_guestbook order by ID desc"; else $sql = "select * from 2d30_guestbook where ischeck=1 order by ID desc";
$dli織夢首頁模板st = new DataList(); $dlist->Init(); $dlist->pageSize =7; $dlist->SetParameter("gotopagerank",$gotopagerank); $dlist->SetSource($sql);
$mylist = $dlist->GetDataList(); while($row = $mylist->GetArray(‘dm’)) { $xingming=$row['uname']; $neirong=strip_tags($row['msg']); $neirong=str_replace(" ","",$neirong); $neirong=cn_substr($neirong,45); $neirong=str_replace(" ","",$neirong); $neirong=rawurldecode($neirong); $link=$row['ID']; echo "document.write(\"·<a href=’./plus/guestbook/index.php#$link’ target=’_blank’> <font color=red>$xingming – </font> $neirong</A><br>\");"; } $dlist->Close(); ?>
在\templets\plus\guestbook.htm文件中加上命名錨記 找到
<?php $mylist = $dlist->GetDataList(); while($row = $mylist->GetArray(‘dm’)) { ?>
在后邊加入
<a name="<?echo $row['ID']?>"></a>
在首頁需要調(diào)用留言本內(nèi)容的地方加入
<script language="javascript" src="./plus/guestbook/js.php" ></script>
相關(guān)織夢的模板。
聲明: 本文由我的SEOUC技術(shù)文章主頁發(fā)布于:2023-07-22 ,文章dedecms用JS方式在首頁實(shí)現(xiàn)留言本內(nèi)容調(diào)用,織夢文主要講述留言本,首頁,織夢網(wǎng)站建設(shè)源碼以及服務(wù)器配置搭建相關(guān)技術(shù)文章。轉(zhuǎn)載請保留鏈接: http://www.bifwcx.com/article/web_33972.html
為你推薦與dedecms用JS方式在首頁實(shí)現(xiàn)留言本內(nèi)容調(diào)用,織夢文相關(guān)的文章
-
通王TWCMS 2.0.3網(wǎng)站模板程序下載
(126)人喜歡 2024-01-15 -
Windows官方原版在哪里下載
(175)人喜歡 2024-01-15 -
WordPress網(wǎng)站模板發(fā)帖標(biāo)題顏色設(shè)置
(131)人喜歡 2024-01-07 -
修改discuz論壇帖子標(biāo)題80字符的長度限制
(249)人喜歡 2024-01-07 -
wordpress程序調(diào)用不帶超鏈接的Tag標(biāo)簽
(234)人喜歡 2024-01-05 -
網(wǎng)站在不同時(shí)期需調(diào)整內(nèi)容更新的方向
(112)人喜歡 2023-08-12