DEDECMS如何在首页用JS调用留言本内容

在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($ischeck,$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 dede_guestbook order by ID desc"; else $sql = "select * from dede_guestbook where ischeck=1 order by ID desc"; $dlist = 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(); ?>  

给TA打赏
共{{data.count}}人
人已打赏
网站教程

织梦标签把","逗号改成空格技巧

2019-12-10 8:00:00

网站教程

实现织梦CMS问答模块rewrite伪静态设置

2019-12-12 8:00:00

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索