<%
dim review_page_num
review_page_num=dim_num(26)

'---------------------------------------------------------------
'评论函数调用说明(HSCMS)
'参数：rtsort,rtid,rturl,rtt,ruser
'说明：所属栏目，所属ID，返回地址，是否显示IP（1为不显示），有权回复的用户（管理员即可回复又可删除）
'---------------------------------------------------------------
function review_type(rtsort,rtid,rturl,rtt,ruser)
  dim isadmin,ri,bgs,rsr,sqlr,rusername,remail,rtype,rtim,retim,reword,rrssum,tmp_review,rip
  isadmin=false
  if int(login_modep)=1 then isadmin=true
  rrssum=0
  sqlr="select count(rid) from review where rsort='"&rtsort&"' and re_id="&rtid
  set rsr=joekoe_cms.exec(sqlr,1)
  if not rsr.eof then
    rrssum=rsr(0)
  end if
  rsr.close
  tmp_review=tmp_review&"<table border=0 class=rv_table cellSpacing=1 cellPadding=4>" & _
	     vbcrlf&"<tr><td class=rv_trt height=20>" & _
	     vbcrlf&"◎ <a href='javascript:;' onclick=""javascript:open_win('"&joekoe_cms.web_path&"common/review.asp?action=list&rsort="&rtsort&"&re_id="&rtid&"','review_list',500,400,'yes');"">浏览所有评论</a>(共<font class=red>"&rrssum&"</font>条评论)"
  if isadmin then 
  tmp_review=tmp_review&"&nbsp;<a href='"&joekoe_cms.web_path&"common/review.asp?action=delete&rsort="&rtsort&"&re_id="&rtid&"&rurl="&server.urlencode(rturl)&"' onclick=""javascript:return click_return('删除相关的所有评论内容',0);"">删除所有评论</a>"
  end if
  tmp_review=tmp_review&"</td></tr>" 
	    
  sqlr="select top "&review_page_num&" rid,rusername,remail,rword,rtim,rtype,retim,reword,rip from review where rsort='"&rtsort&"' and re_id="&rtid&" order by rid desc"
  set rsr=joekoe_cms.exec(sqlr,1)
  do while not rsr.eof
    rusername=rsr("rusername")
    remail=rsr("remail")
    rtype=rsr("rtype")
    rtim=rsr("rtim")
    retim=rsr("retim")
    reword=rsr("reword")
	if rtt=1 then
	rip="*.*.*.*"
	else
	rip=rsr("rip")
	end if
    if var_null(remail)<>"" then remail="<a href='mailto:"&remail&"'><img src='"&joekoe_cms.web_dir_skin&"small/email.gif' border=0 align=absmiddle alt='"&rusername&" 的电子邮件："&remail&"'></a>"
    if rtype=1 then rusername=format_user_name(rusername,0,"")
    rtim="<font class=tims alt='"&joekoe_cms.time_type(rtim,1)&"'>"&joekoe_cms.time_type(rtim,1)&"</font>"
    
	tmp_review=tmp_review&vbcrlf&"<tr class=rv_tr><td>" & _
	vbcrlf&"<table border=0 cellspacing=1 cellpadding=1 width='100%' class=tf>" & _
	vbcrlf&"<tr><td width=70% >"&img_skin("h_review")&"&nbsp;&nbsp;"&rusername&" <font class=gray>[来访 I P："&rip&"] 认为：</font>"
    if login_username=ruser and login_mode<>"" or isadmin then
    tmp_review=tmp_review&"&nbsp;&nbsp;"&review_page(joekoe_cms.web_path&"common/review.asp?action=reply&rsort="&rtsort&"&re_id="&rtid&"&rid="&rsr("rid")&"&rurl="&server.urlencode(rturl))
    end if
    if isadmin then
    tmp_review=tmp_review&"&nbsp;&nbsp;<a href='"&joekoe_cms.web_path&"common/review.asp?action=del&rsort="&rtsort&"&re_id="&rtid&"&rid="&rsr("rid")&"&rurl="&server.urlencode(rturl)&"' onclick=""javascript:return click_return('删除这条评论内容',0);""><img src='"&joekoe_cms.web_dir_skin&"/small/del.gif' border=0 align=absmiddle alt='删除这条评论'></a>"
    end if
    tmp_review=tmp_review&"</td><td align=right>"&remail&"&nbsp;&nbsp;"&rtim&"</td></tr>" & _
    vbcrlf&"<TR><TD colSpan=2><font class=blue><b>评：</b></font>"&joekoe_cms.code_html(rsr("rword"),2,0)&"</td></tr>"
    if var_null(reword)<>"" then
    tmp_review=tmp_review&"<tr><td class=bw><font class=red2><b>回：</b></font>"&joekoe_cms.code_html(reword,2,0)&"</td></tr>"
    end if
    tmp_review=tmp_review&"</table></td></tr> <TR class=rv_trline><TD></TD></TR>"
    rsr.movenext
    ri=ri+1
  loop
  rsr.close
  set rsr=nothing
  if ri=0 then tmp_review=tmp_review&"<tr class=rv_tr><td class=gray>（没有相关评论）</td></tr><TR class=rv_trline><TD></TD></TR>"
  tmp_review=tmp_review& vbcrlf&"<tr class=rv_trb><td  height=20>" & _
	     vbcrlf&"<table border=0 cellspacing=0 cellpadding=0 width='100%'>" & _
	     vbcrlf&"<tr><td width='75%'>" & _
	     vbcrlf&"<TABLE cellSpacing=0 cellPadding=2 border=0>" & _
	     vbcrlf&"<form name=review_frm action='"&joekoe_cms.web_path&"common/review.asp?rsort="&rtsort&"&re_id="&rtid&"&ruser="&ruser&"&rurl="&server.urlencode(rturl)&"' method=post onsubmit=""javascript:frm_submitonce(this);"">" & _
	     vbcrlf&"<tr>" & _
	     vbcrlf&"<td>您的姓名：</td><td><input class=txt type=text name=rusername value='"&login_username&"' size=20 maxlength=20>&nbsp;<FONT class=red face=""Wingdings 2"">;</FONT></td></tr>" & _
		 vbcrlf&"<td>您的Email：</td><td><input class=txt type=text name=remail size=20 id=0 maxlength=50 value=''></td></tr>" & _
	     vbcrlf&"<tr valign=top>" & _
	     vbcrlf&"<td class=htd>评论内容：<br>250字内</td>" & _
	     vbcrlf&"<TD><TEXTAREA class=txtarea name=rword rows=4 cols=45></TEXTAREA></TD></TR>" & _
	     vbcrlf&"</tr>" & _
	     vbcrlf&"<tr>" & _
	     vbcrlf&"<td>发表评论：</td>" & _
	     vbcrlf&"<TD><INPUT class=btn type=submit value=发表评论>　　<INPUT class=btn type=reset value=重新填写></TD>" & _
	     vbcrlf&"</tr>" & _
	     vbcrlf&"</form>" & _
	     vbcrlf&"</table>" & _
	     vbcrlf&"</td>" & _
	     vbcrlf&"<td width='*'>" & _
	     vbcrlf&"<table border=0 cellspacing=0 cellpadding=2 width='100%'>" & _
         vbcrlf&"<TR align=middle>" & _
         vbcrlf&"<TD class=gray><B>发表评论须知</B></TD></TR>" & _
         vbcrlf&"<TR>" & _
         vbcrlf&"<TD class=gray>" & _
         vbcrlf&"<LI>尊重网上道德，遵守《全国人大常委会关于维护互联网安全的决定》及中华人民共和国其他各项有关法律法；</LI></TD></TR>" & _
         vbcrlf&"<TR>" & _
         vbcrlf&"<TD class=gray>" & _
         vbcrlf&"<LI>本站有权保留或删除您发表的任何评论内容。</LI></TD></TR>" & _
	     vbcrlf&"</table>" & _
	     vbcrlf&"</td>" & _
	     vbcrlf&"</tr>" & _
		 vbcrlf&"</table>" & _
	     vbcrlf&"</td>" & _
	     vbcrlf&"</tr>" & _
	     vbcrlf&"</table>" 

review_type=tmp_review
end function

function review_page(t1)
  dim a
  a="<a href='javascript:;' onclick=""javascript:open_win('"&t1&"','review_page',500,305,'no');""><img src='"&joekoe_cms.web_dir_skin&"/small/reply.gif' border=0 align=absmiddle alt='回复这条评论'></a>"
  review_page=a
end function

sub font_word_js()
%>
<script language=JavaScript>
<!--
  function do_color(vobject,vvar)
  { document.getElementById(vobject).style.color=vvar; }
  function do_zooms(vobject,vvar)
  { document.getElementById(vobject).style.fontsize=vvar+'px'; }
-->
</script>
<%
end sub

sub font_word_action()
%>浏览选项：
<!--
<a href="###" onclick="javascript:do_zooms('font_word',16);">大</a>
<a href="###" onclick="javascript:do_zooms('font_word',14);">中</a>
<a href="###" onclick="javascript:do_zooms('font_word',12);">小</a>&nbsp;
-->
<select name=do_color_frm size=1 onchange="if(this.options[this.selectedIndex].value!=''){do_color('font_word',this.options[this.selectedIndex].value);}">
<option value=''>颜色</option>
<option value='#000000' style="color:#000000">默认</option>
<option value='#808080' style="color:#808080">灰度</option>
<option value='#808000' style="color:#808000">橄榄色</option>
<option value='#008000' style="color:#008000">绿色</option>
<option value='#0000FF' style="color:#0000FF">蓝色</option>
<option value='#800000' style="color:#800000">褐色</option>
<option value='#FF0000' style="color:#FF0000">红色</option>
</select>&nbsp;<%
end sub
sub font_word_type(fvar)
%>
  <table border=0 cellpadding=0 cellspacing=0 width='100%'>
  <tr>
  <td width=22 height=1 background='<%=joekoe_cms.web_path%>images/main/view_line.gif'></td>
  <td bgcolor=#666666></td>
  <td width=1 rowspan=5 bgcolor=#666666></td>
  </tr>
  <tr><td width=22 height=5 background='<%=joekoe_cms.web_path%>images/main/view_b.gif'></td><td></td></tr>
  <tr>
  <td background='<%=joekoe_cms.web_path%>images/main/view_bg.gif'></td>
  <td align=center>
    <table border=0 width='98%' align=center class=tf>
    <tr><td width='100%' class=bw><font id="font_word" class=htd style="font-size:14px; font-family:宋体, Verdana, Arial, Helvetica, sans-serif;"><% response.write fvar %></font></td></tr>
    </table>
  </td>
  </tr>
  <tr><td width=22 height=5 background='<%=joekoe_cms.web_path%>images/main/view_b.gif'></td><td></td></tr>
  <tr>
  <td height=1 background='<%=joekoe_cms.web_path%>images/main/view_line.gif'></td>
  <td height=1 bgcolor=#666666></td>
  </tr>
  </table>
<%
end sub
%>