帝国cms评论怎么做

dwz3年前帝国CMS1851

在帝国cms自带的评论和留言系统的功能上,简单修改一下它的样式就可以了。

修改内容页评论:

1、公共模板-评论js调用模板

1

2

3

4

5

6

7

8

[!--empirenews.listtemp--]

<div class="fb">

<ul>

<p class="fbtime"><span>[!--pltime--]</span> [!--username--]</p>

<p class="fbinfo">[!--pltext--]</p>

</ul>

</div>

[!--empirenews.listtemp--]

2、公共模板变量-管理公共模板-[!--temp.pl--] 找到评论表单

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

<script>

          function CheckPl(obj)

          {

          if(obj.saytext.value=="")

          {

          alert("您没什么话要说吗?");

          obj.saytext.focus();

          return false;

          }

          return true;

          }

          </script>

<form action="[!--news.url--]e/pl/doaction.php" method="post" name="saypl" id="saypl" onsubmit="return CheckPl(document.saypl)">

  <div id="plpost">

    <p class="saying"><span><a href="[!--news.url--]e/pl/?classid=[!--classid--]&amp;id=[!--id--]">共有<script type="text/javascript" src="[!--news.url--]e/public/ViewClick/?classid=[!--classid--]&id=[!--id--]&down=2"></script>条评论</a></span>来说两句吧...</p>

    <p class="yname"><span>用户名:</span>

      <input name="username" type="text" class="inputText" id="username" value="" size="16" />

    </p>

    <p class="yzm"><span>验证码:</span>

      <input name="key" type="text" class="inputText" size="16" />

      <img src="[!--news.url--]e/ShowKey/?v=pl" align="absmiddle" name="plKeyImg" id="plKeyImg" onclick="plKeyImg.src='[!--news.url--]e/ShowKey/?v=pl&t='+Math.random()" title="看不清楚,点击刷新" /> </p>

    <input name="nomember"  type="hidden" id="nomember" value="1" checked="checked" />

    <textarea name="saytext" rows="6" id="saytext"></textarea>

    <input name="imageField" type="submit" value="提交"/>

    <input name="id" type="hidden" id="id" value="[!--id--]" />

    <input name="classid" type="hidden" id="classid" value="[!--classid--]" />

    <input name="enews" type="hidden" id="enews" value="AddPl" />

    <input name="repid" type="hidden" id="repid" value="0" />

    <input type="hidden" name="ecmsfrom" value="[!--titleurl--]">

    </td>

  </div>

</form>

3、评论列表模板 -管理评论模板

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>[!--pagetitle--]</title>

<meta name="keywords" content="[!--pagekey--]" />

<meta name="description" content="[!--pagedes--]" />

<style type="text/css">

article { width: 800px; margin: auto }

<!--

body, Table { color: #222; font-size: 12px; }

a { color: #222; text-decoration: none; }

a:hover { color: #f00; text-decoration: underline; }

h1 { font-size: 32px; font-weight: bold; }

h2 { color: #1e3a9e; font-size: 25px; font-weight: bold; }

.you { color: #1f3a87; font-size: 14px; }

.text { font-size: 14px; padding-left: 5px; padding-right: 5px; line-height: 20px }

.re a { color: #1f3a87; }

.name { color: #1f3a87; }

.name a { color: #1f3a87; text-decoration: underline; }

.retext { background-color: #f3f3f3; width: 100%; float: left; padding-top: 22px; padding-bottom: 22px; border-top: 1px solid #ccc; }

.retext textarea { width: 90%; height: 130px; float: left; margin-left: 10px; border-top-style: inset; border-top-width: 2px; border-left-style: inset; border-left-width: 2px; }

.hrLine { BORDER-BOTTOM: #807d76 1px dotted; }

.ecomment { margin: 0; padding: 0; }

.ecomment { margin-bottom: 12px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px; background: #FFFFEE; padding: 3px; border: solid 1px #999; }

.ecommentauthor { float: left; color: #F96; font-weight: bold; }

.ecommenttext { clear: left; margin: 0; padding: 0; }

-->

@media only screen and (max-width: 800px) {

article { width: 100% }

}

</style>

<script src="[!--news.url--]e/data/js/ajax.js"></script>

</head>

  

<body topmargin="0">

<article>

  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">

    <tr>

      <td><h1>网友评论</h1></td>

      <td><div align="right"><a href="#tosaypl"><strong><font color="#FF0000">我也评两句</font></strong></a></div></td>

    </tr>

  </table>

  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#222">

    <tr>

      <td height="2"></td>

    </tr>

  </table>

  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">

    <tr>

      <td height="42"><h2>评论:<a href="[!--titleurl--]" target="_blank"><font color="#1e3a9e">[!--title--]</font></a></h2></td>

      <td><div align="right"><a href="[!--titleurl--]" target="_blank">查看原文</a></div></td>

    </tr>

  </table>

  <!--

<hr align="center" width="100%" size=1 class=hrline>

<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#384EA3">

  <form action="../enews/index.php" method="post" name="infopfenform">

    <input type="hidden" name="enews" value="AddInfoPfen" />

    <input type="hidden" name="classid" value="[!--classid--]" />

    <input type="hidden" name="id" value="[!--id--]" />

    <tr>

      <td width="50%" height="27" valign="middle"><font color="#FFFFFF">&nbsp;评分:

        <input type="radio" name="fen" value="1">

        1分

        <input type="radio" name="fen" value="2">

        2分

        <input name="fen" type="radio" value="3" checked>

        3分

        <input type="radio" name="fen" value="4">

        4分

        <input type="radio" name="fen" value="5">

        5分

        <input type="submit" name="Submit" value="提交">

        </font></td>

      <td width="50%" valign="middle"><div align="center"><font color="#FFFFFF">平均得分:

          <strong><span id="pfendiv">[!--pinfopfen--]</span></strong> 分,共有 <strong>[!--infopfennum--]</strong>

          人参与评分</font></div></td>

    </tr>

  </form>

</table>

-->

  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">

    <tr>

      <td height="30" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="1" cellpadding="3">

          <tr>

            <td width="37%">&nbsp;&nbsp;&nbsp;网友评论</td>

            <td width="63%"><div align="right">[!--listpage--]&nbsp;&nbsp;&nbsp;</div></td>

          </tr>

        </table></td>

    </tr>

    <tr>

      <td bgcolor="#f8fcff"> [!--empirenews.listtemp--]

        <table width="96%" border="0" align="center" cellpadding="3" cellspacing="1" style="word-break:break-all; word-wrap:break-all;">

          <tr>

            <td height="30"><span class="name">[!--username--]</span></td>

            <td><div align="right"><font color="#666666">[!--pltime--]</font></div></td>

          </tr>

          <tr valign="top">

            <td height="50" colspan="2" class="text">[!--pltext--]</td>

          </tr>

          <tr>

            <td height="30">&nbsp;</td>

            <td><div align="right" class="re"><a href="#tosaypl"[!--includelink--]>回复</a>&nbsp; <ahref="JavaScript:makeRequest('../pl/doaction.php?enews=DoForPl&plid=[!--plid--]&classid=[!--classid--]&id=[!--id--]&dopl=1&doajax=1&ajaxarea=zcpldiv[!--plid--]','EchoReturnedText','GET','');">支持</a>[<span id="zcpldiv[!--plid--]">[!--zcnum--]</span>]&nbsp; <a href="JavaScript:makeRequest('../pl/doaction.php?enews=DoForPl&plid=[!--plid--]&classid=[!--classid--]&id=[!--id--]&dopl=0&doajax=1&ajaxarea=fdpldiv[!--plid--]','EchoReturnedText','GET','');">反对</a>[<span id="fdpldiv[!--plid--]">[!--fdnum--]</span>] </div></td>

          </tr>

        </table>

        <table width="100%" border="0" cellspacing="1" cellpadding="3">

          <tr>

            <td background="[!--news.url--]skin/default/images/plhrbg.gif"></td>

          </tr>

        </table>

        [!--empirenews.listtemp--]

        <div align="right"><br />

          [!--listpage--]&nbsp;&nbsp;&nbsp;<br />

          <br />

          <font color="#FF0000">网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述&nbsp;&nbsp;&nbsp;</font><br>

          <br>

        </div></td>

    </tr>

    <script>

  function CheckPl(obj)

  {

      if(obj.saytext.value=="")

      {

          alert("错误,评论不能为空");

          obj.saytext.focus();

          return false;

      }

      return true;

  }

  </script>

    <form action="../pl/doaction.php" method="post" name=