comments_frame.htm
7.8 KB
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={dede:global.cfg_soft_lang/}" />
<title>comment</title>
<link href="{dede:global.cfg_templets_skin/}/style/dedecms.css" rel="stylesheet" media="screen" type="text/css" />
<script language="javascript" type="text/javascript" src="{dede:global.cfg_cmsurl/}/include/dedeajax2.js"></script>
<script>
function CheckLogin(){
var taget_obj = document.getElementById('_ajax_feedback');
myajax = new DedeAjax(taget_obj,false,false,'','','');
myajax.SendGet2("{dede:global.cfg_cmsurl/}/member/ajax_feedback.php");
DedeXHTTP = null;
}
function checkSubmit(){
if(document.feedback.msg.value!='') document.feedback.submit();
else alert("评论内容不能为空!");
}
function postBadGood(ftype,fid)
{
var taget_obj = document.getElementById(ftype+fid);
var saveid = GetCookie('badgoodid');
if(saveid != null)
{
var saveids = saveid.split(',');
var hasid = false;
saveid = '';
j = 1;
for(i=saveids.length-1;i>=0;i--)
{
if(saveids[i]==fid && hasid) continue;
else {
if(saveids[i]==fid && !hasid) hasid = true;
saveid += (saveid=='' ? saveids[i] : ','+saveids[i]);
j++;
if(j==10 && hasid) break;
if(j==9 && !hasid) break;
}
}
if(hasid) { alert('您刚才已表决过了喔!'); return false;}
else saveid += ','+fid;
SetCookie('badgoodid',saveid,1);
}
else
{
SetCookie('badgoodid',fid,1);
}
myajax = new DedeAjax(taget_obj,false,false,'','','');
myajax.SendGet2("{dede:global.cfg_phpurl/}/feedback.php?aid="+fid+"&action="+ftype+"&fid="+fid);
DedeXHTTP = null;
}
</script>
</head>
<body>
<div class="pleft mt1">
<dl class="tbox">
<dt>
<strong>最新评论</strong>
<span class="more"><a href="{dede:global.cfg_phpurl/}/feedback.php?aid=<?php echo $id;?>" target="_blank">查看所有评论</a></span>
</dt>
<dd>
<div class="dede_comment">
{dede:datalist}
<?php
if($fields['userid']!='') $spaceurl = $cfg_basehost.'/member/index.php?uid='.$fields['userid']."' target='_blank'";
else $spaceurl = "#";
if($fields['username']=='匿名') $spaceurl = "#";
$fields['bgimg'] = 'cmt-neu.gif';
$fields['ftypetitle'] = '该用户表示中立';
if($fields['ftype']=='bad') {
$fields['bgimg'] = 'cmt-bad.gif';
$fields['ftypetitle'] = '该用户表示差评';
}
else if($fields['ftype']=='good') {
$fields['bgimg'] = 'cmt-good.gif';
$fields['ftypetitle'] = '该用户表示好评';
}
?>
<div class='decmt-box'>
<div class='decmt-title'>
<span class='moodico'><img src='{dede:global.cfg_templeturl/}/images/mood/ico-mood-<?php if($fields['face']>0) echo $fields['face'];?>.gif'/></span>
<span class='username'><a href='<?php echo $spaceurl;?>'>{dede:field.username/}</a></span>
<span class='date'>{dede:field.dtime function=GetDateMk(@me)/}</span>
<span>发表</span>
</div>
<div class='decmt-act'>
<span id='goodfb{dede:field.id/}'><a href=#goodfb{dede:field.id/} onclick=postBadGood('goodfb',{dede:field.id/})>支持</a>[{dede:field.good/}]</span>
<span id='badfb{dede:field.id/}'><a href=#badfb{dede:field.id/} onclick=postBadGood('badfb',{dede:field.id/})>反对</a>[{dede:field.bad/}]</span>
<span><a href='{dede:global.cfg_phpurl/}/feedback.php?fid={dede:field.id/}&action=quote' target="_blank">引用</a></span>
</div>
<div class='decmt-content'>{dede:field.msg function='jstrim(@me,100)'/}<img src='{dede:global.cfg_templeturl/}/images/{dede:field.bgimg/}' alt='{dede:field.ftypetitle/}' />
</div>
</div>
{/dede:datalist}
</div><!-- /dede_comment -->
</dd>
</dl>
</div><!-- /comment -->
<div class="mt1 pleft">
<dl class="tbox">
<dt>
<strong>发表评论</strong>
<span class="more"><a href="{dede:global.cfg_phpurl/}/feedback.php?aid=<?php echo $id;?>" target="_blank">查看所有评论</a></span>
</dt>
<dd>
<div class="dede_comment_post">
<form action="{dede:global.cfg_phpurl/}/feedback.php" method="post" name="feedback" target="_blank">
<input type="hidden" name="action" value="send" />
<input type="hidden" name="comtype" value="comments">
<input type="hidden" name="aid" value="<?php echo $id;?>" />
<input type="hidden" name="isconfirm" value="yes" />
<div class="dcmp-title">
<small>请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。</small>
</div><!-- /dcmp-title -->
<div class="dcmp-stand">
<strong>评价:</strong>
<input type="radio" name="feedbacktype" checked="1" value="feedback" id="dcmp-stand-neu" /><label for="dcmp-stand-neu"><img src="{dede:global.cfg_templeturl/}/images/cmt-neu.gif" />中立</label>
<input type="radio" name="feedbacktype" value="good" id="dcmp-stand-good" /><label for="dcmp-stand-good"><img src="{dede:global.cfg_templeturl/}/images/cmt-good.gif" />好评</label>
<input type="radio" name="feedbacktype" value="bad" id="dcmp-stand-bad" /><label for="dcmp-stand-bad"><img src="{dede:global.cfg_templeturl/}/images/cmt-bad.gif" />差评</label>
</div><!-- /dcmp-stand -->
<div class="dcmp-content">
<textarea cols="60" name="msg" rows="5" class="ipt-txt"></textarea>
</div><!-- /dcmp-content -->
<div class="dcmp-mood">
<strong>表情:</strong>
<ul>
<li><input type="radio" name='face' value='6' checked="1" /><img src="{dede:global.cfg_templeturl/}/images/mood/ico-mood-6.gif" /></li>
<li><input type="radio" name='face' value='4'/><img src="{dede:global.cfg_templeturl/}/images/mood/ico-mood-4.gif" /></li>
<li><input type="radio" name='face' value='3'/><img src="{dede:global.cfg_templeturl/}/images/mood/ico-mood-3.gif" /></li>
<li><input type="radio" name='face' value='5'/><img src="{dede:global.cfg_templeturl/}/images/mood/ico-mood-5.gif" /></li>
<li><input type="radio" name='face' value='2'/><img src="{dede:global.cfg_templeturl/}/images/mood/ico-mood-2.gif" /></li>
<li><input type="radio" name='face' value='1'/><img src="{dede:global.cfg_templeturl/}/images/mood/ico-mood-1.gif" /></li>
<li><input type="radio" name='face' value='7'/><img src="{dede:global.cfg_templeturl/}/images/mood/ico-mood-7.gif" /></li>
</ul>
</div><!-- /dcmp-mood -->
<div class="dcmp-post"><!--未登陆-->
<div class="dcmp-userinfo" id="_ajax_feedback">
用户名:<input type="text" name="username" size="16" class="ipt-txt" />
密码:<input name="pwd" type="password" size="16" class="ipt-txt" />
验证码:<input type="text" name="validate" size="4" class="ipt-txt" style="text-transform: uppercase;"/><img src="{dede:global.cfg_cmsurl/}/include/vdimgck.php" />
<input type="checkbox" name="notuser" id="dcmp-submit-guest" /><label for="dcmp-submit-guest"> 匿名? </label>
</div>
<script language="javascript" type="text/javascript">CheckLogin();</script>
<div class="dcmp-submit">
<button type="button" onClick='checkSubmit()'>发表评论</button>
</div>
</div>
</form>
</div><!-- /dede_comment_post -->
</dd>
</dl>
</div>
<script type="text/javascript">
function adjust()
{
var h = document.documentElement.scrollHeight || document.body.scrollHeight;
if (document.getElementById('xclient'))
{
var divEl = document.getElementById('xclient').parentNode;
console.log(document.getElementById('xclient').parentNode);
divEl.parentNode.removeChild(divEl);
}
var el = document.createElement('div');
el.innerHTML = '<iframe src="<?php echo $GLOBALS['siteurl'];?>/xclient.html#' + h + '" name="xclient" id="xclient" width="0" height="0" style="display:none;"></iframe>';
document.body.appendChild(el);
}
window.onload = adjust;
</script>
</body>
</html>