| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 563 人关注过本帖
标题:(太麻烦)大题二:给网站添加文章评论模块-jiazehua
只看楼主 加入收藏
jiazehua
Rank: 1
来 自:大连
等 级:新手上路
帖 子:77
专家分:0
注 册:2010-8-15
结帖率:58.82%
收藏
已结贴  问题点数:20 回复次数:5 
(太麻烦)大题二:给网站添加文章评论模块-jiazehua

书归正传:
网站ASP生成HTML页的酒店预订网站
是每次生成都是按照模板页生成的
我想要在模板页的底部合适位置增加一个酒店点评模块

1/就是类似于youku等网站的评论模式
2/并且需要通过审核后才显示
3/前台和后台都需要写……后台主要是修改、审核、删除留言
4/登陆后才能评论
-----------------
我的思路是,
1、在数据库新建一个表,然后建两个字段,前台建立表格,递交字段到后台
2、后台审核通过了直接递交到数据库的表里
3、主要是模板页的写法,要写进去评论按钮,以往审核通过的评论表格
4、然后登陆的问题就是在评论的位置加一个checklogin这样的代码
---------------
这个应该很费时间,希望大家能百忙中抽出点时间指点我具体的代码要怎么写


[ 本帖最后由 jiazehua 于 2010-8-17 22:37 编辑 ]
搜索更多相关主题的帖子: youku 模板 审核 新建 
2010-08-17 15:57
jiazehua
Rank: 1
来 自:大连
等 级:新手上路
帖 子:77
专家分:0
注 册:2010-8-15
收藏
得分:0 
模板文件PART 1
程序代码:
<!--#include file = "inc/conn.asp"-->
<%
Dim getID
    getID=request("ID")
    if not isnumeric(getID) then
        response.Write("<script>alert('操作有误');location.href='/index.html';</script>")
        response.End()
    end if
   
    set rs=conn.execute("select * from DB_Hotel where ID="&getID&" and Is_Show=True")
    if rs.bof and rs.eof then
        response.write "数据无效"
        getID=0
    else
        HotelName=rs("HotelName")
        EnHotelName=rs("EnHotelName")
        Star=rs("Star")
            if Star="五星级" then
                S=5
            elseif Star="四星级" then
                S=4
            elseif Star="三星级" then
                S=3
            elseif Star="二星级" then
                S=2
            end if
        Position=rs("Position")
        Hotel_Pic=rs("Hotel_Pic")
        Content=rs("Content")
        Info_Jbxx=rs("Info_Jbxx")
        Info_Fjss=rs("Info_Fjss")
        Info_Hyss=rs("Info_Hyss")
        Info_Cyss=rs("Info_Cyss")
        Info_Ylss=rs("Info_Ylss")
        Info_Dlwz=rs("Info_Dlwz")
        Info_Ccxl=rs("Info_Ccxl")
        Info_Gyjz=rs("Info_Gyjz")
        Info_Tbtx=rs("Info_Tbtx")
        Hotel_Map=rs("Hotel_Map")
        Map_Url=rs("Map_Url")
        FileName=rs("FileName")
        Title=rs("Title")
        Keywords=rs("Keywords")
        txtDescription=rs("Description")
    end if
    rs.close
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.>
<html xmlns="http://www.>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="/css/style.css" rel="stylesheet" type="text/css" />
<title><%=Title%></title>
<meta name="keywords" content="<%=Keywords%>" />
<meta name="description" content="<%=txtDescription%>" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<script type="text/javascript" src="/Hotel_hits.asp?ID=<%=getID%>"></script>
<script language="javascript" src="/js/msclass.js"></script>
</head>

<body>
<center>
<!--#include file="top.asp"-->
<table width="980" height="24" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td style="text-align:left; color:#000000;">当前位置:<a href="/">首页</a>&gt;&gt;<%=HotelName%> <font color="#FF6633"><b></b></font></td>
  </tr>
</table>
<table width="980" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="750" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:10px;">
     
      <tr>
        <td height="317" align="left" valign="top" class="Hotel_Content"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="45%" height="24" align="left" style="color:#FF3300"><h4>酒店名称:<%=HotelName%></h4></td>
            <td width="32%" align="left"><span class="hotel">酒店星级:</span><%for i=1 to s%><img src="/images/star.gif" width="9" height="8" /><%next%>(<%=Star%>)</td>
            <td width="23%" rowspan="4" align="center">
            <table width="150" height="120" border="0" cellpadding="2" cellspacing="2" style="border:#dddddd 1px solid;">
              <tr bgcolor="#FFFFFF">
                <td align="center"><img src="/<%=Hotel_Pic%>" alt="<%=HotelName%>" width="150" height="120" /></td>
              </tr>
            </table>            </td>
          </tr>
          <tr>
            <td height="24" align="left"><span class="hotel">英文名称:</span><a href="/dalianjiudian/<%=FileName%>" title="<%=EnHotelName%>"><font color="#FF6600"><%=EnHotelName%></font></a></td>
            <td align="left" class="hotel">预订电话1:0411-88888888</td>
            </tr>
          <tr>
            <td height="24" align="left" class="hotel">酒店地址:<%=Position%></td>
            <td align="left"><span class="hotel">预订电话2:0411-88888888</span></td>
            </tr>
          <tr>
            <td height="24" align="left" class="hotel">酒店介绍:</td>
            <td align="left">&nbsp;</td>
            </tr>
          <tr>
            <td height="24" colspan="3" align="left" style="line-height:150%; border-bottom:#FF6600 1px dashed; padding-bottom:5px;"><%=changeCHR(Content)%></td>
            </tr>
        </table>
        <table width="100%" height="100" border="0" cellpadding="0" cellspacing="0" style="border-bottom:#FF6600 1px dashed;">
          <tr>
            <td align="left">
            <div id="marqueediv" style="width:730px;height:85px;">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                <%
                set rs=conn.execute("select Name,Pic from DB_HotelPic where Hotel_ID="&getID&" order by SortIndex,ID Desc")
                if rs.bof and rs.eof then
                    response.write "暂无酒店相关图片"
                else
                    do while not rs.eof
                %>
                <td align="left">
                <table width="124" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td height="85"><a href="/<%=rs("Pic")%>" target="_blank"><img src="/<%=rs("Pic")%>" alt="<%=rs("Name")%>" width="120" height="85" border="0" /></a></td>
                  </tr>
                </table>
                </td>
                <%
                    rs.movenext
                    loop
                end if
                rs.close
                %>
                </tr>
            </table>
            </div>
<script defer>
    var marquee1=new Marquee("marqueediv");
    marquee1.Direction = "left"
    marquee1.Step = 1;
    marquee1.Width = 730;
    marquee1.Height = 85;
    marquee1.Timer = 50;
    marquee1.DelayTime = 0;
    marquee1.WaitTime =0;
    marquee1.Start();
</script>
            </td>
          </tr>
        </table>
        <table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td style="text-align:left; font-weight:bold; color:#CC3300">温馨提示:您可以直接点击预定或者致电0411-88888888由我们的预定专员为您提供预定服务。</td>
          </tr>
        </table>


巫术时代-个人博客-[url]www.[/url]
2010-08-17 16:00
jiazehua
Rank: 1
来 自:大连
等 级:新手上路
帖 子:77
专家分:0
注 册:2010-8-15
收藏
得分:0 
模板文件PART 2
程序代码:
<table width="100%" height="40" border="0" cellpadding="0" cellspacing="1">
          <tr bgcolor="#FFA800">
            <td width="25%" rowspan="2" class="hotel_1">房间类型</td>
            <td width="12%" rowspan="2" class="hotel_1">前台价格</td>
            <td colspan="2" bgcolor="#FF6600" class="hotel_1">网络价格</td>
            <td width="12%" rowspan="2" class="hotel_1">早餐情况</td>
            <td width="18%" rowspan="2" class="hotel_1">备注</td>
            <td width="9%" rowspan="2" class="hotel_1">预订</td>
          </tr>
          <tr bgcolor="#FFA800">
            <td width="12%" bgcolor="#FF6600" class="hotel_1">今日价格</td>
            <td width="12%" bgcolor="#FF6600" class="hotel_1">周末价格</td>
          </tr>
        </table>
       
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <%
        set rs=conn.execute("select ID,Name,Price_Front,Price_Net_N,Price_Net_W,Breakfast,Room_Note from DB_HotelRoom where Hotel_ID="&getID&" and Is_Show=True order by Price_Net_W,ID Desc")
        if rs.bof and rs.eof then
            response.write "暂无酒店房间数据"
        else
            i=0
            do while not rs.eof
            i=i+1
            if (i mod 2)=0 then txtcolor="#FFF1D9" else txtcolor="#FFFFFF"
        %>
          <tr bgcolor="<%=txtcolor%>" onMouseOver="javaScript:this.bgColor='#FFDEA2';" onMouseOut="javaScript:this.bgColor='<%=txtcolor%>';">
            <td width="25%" height="26" style="text-align:left; padding-left:5px;"><%=rs("Name")%></td>
            <td width="12%" align="center"><b><s><%=rs("Price_Front")%></s></b></td>
            <td width="12%" align="center" style="color:#FF6600;"><b><%=rs("Price_Net_N")%></b></td>
            <td width="12%" align="center" style="color:#FF6600;"><b><%=rs("Price_Net_W")%></b></td>
            <td width="12%" align="center"><%=cutstring(rs("Breakfast"),12)%></td>
            <td width="18%" align="center"><%=cutstring(rs("Room_Note"),20)%></td>
            <td width="9%" align="center"><form name="B<%=rs("ID")%>" method="post" action="/hotel-booking.asp"><input type="hidden" name="Hotel_ID" value="<%=getID%>" /><input type="hidden" name="Room_ID" value="<%=rs("ID")%>" /><input type="image" src="/images/yuding.gif" name="Submit" alt="预订<%=HotelName%>" onClick="javascript:B<%=rs("ID")%>.submit();" /></form></td>
          </tr>
        <%
            rs.movenext
            loop
        end if
        rs.close
        %> 
        </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="2" bgcolor="#FFA800"></td>
          </tr>
        </table>
        <script type="text/javascript" src="/js/tbtx.asp"></script>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:10px;">
        <%if Info_Jbxx<>"" then%>
          <tr>
            <td width="9%" nowrap="nowrap" class="hotel_2">基本信息:</td>
            <td width="91%" class="hotel_3"> <%=changeCHR(Info_Jbxx)%></td>
          </tr>
        <%end if%>
        <%if Info_Fjss<>"" then%>
          <tr>
            <td nowrap="nowrap" class="hotel_2">房间设施:</td>
            <td class="hotel_3"><%=changeCHR(Info_Fjss)%></td>
          </tr>
        <%end if%>
        <%if Info_Cyss<>"" then%>
          <tr>
            <td nowrap="nowrap" class="hotel_2">餐饮设施:</td>
            <td class="hotel_3"><%=changeCHR(Info_Cyss)%></td>
          </tr>
        <%end if%>
        <%if Info_Ylss<>"" then%>
          <tr>
            <td nowrap="nowrap" class="hotel_2">娱乐设施:</td>
            <td class="hotel_3"><%=changeCHR(Info_Ylss)%></td>
          </tr>
        <%end if%>
        <%if Info_Hyss<>"" then%>
          <tr>
            <td nowrap="nowrap" class="hotel_2">会议设施:</td>
            <td class="hotel_3"><%=changeCHR(Info_Hyss)%></td>
          </tr>
        <%end if%>
        <%if Info_Dlwz<>"" then%>
          <tr>
            <td nowrap="nowrap" class="hotel_2">地理位置:</td>
            <td class="hotel_3"><%=changeCHR(Info_Dlwz)%></td>
          </tr>
        <%end if%>
        <%if Info_Ccxl<>"" then%>
          <tr>
            <td nowrap="nowrap" class="hotel_2">乘车线路:</td>
            <td class="hotel_3"><%=changeCHR(Info_Ccxl)%></td>
          </tr>
        <%end if%>
        <%if Info_Gyjz<>"" then%>
          <tr>
            <td nowrap="nowrap" class="hotel_2">关于结帐:</td>
            <td class="hotel_3"><%=changeCHR(Info_Gyjz)%></td>
          </tr>
        <%end if%>
        <%if Hotel_Map<>"" then%>
          <tr>
            <td nowrap="nowrap" class="hotel_2">电子地图:</td>
            <td align="left" style="padding:0 3px 5px 3px;"><a href="<%=Map_Url%>" target="_blank"><img src="/<%=Hotel_Map%>" alt="点击放大查看<%=HotelName%>的详细位置及公交线路" border="0"/></a></td>
          </tr>
        <%end if%>
        <%if Info_Tbtx<>"" then%>
          <tr>
            <td height="24" colspan="2" class="hotel_4"><%=changeCHR(Info_Tbtx)%></td>
            </tr>
        <%end if%>
        </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border:#FF7E00 1px dashed;">
          <tr>
            <td width="50%" height="22" style="padding-left:5px;">&nbsp;</td>
            <td width="50%">&nbsp;</td>
          </tr>
        </table>
        </td>
      </tr>
    </table>
      </td>
    <td width="10">&nbsp;</td>
    <td width="220" valign="top">
    <!--#include file="left_top.asp"-->
    <!--#include file="left_contact.asp"-->   
    <!--#include file="left_tour.asp"-->
    <!--#include file="left_service.asp"-->
    </td>
  </tr>
</table>
<!--#include file="bottom.asp"-->
</center>
</body>
</html>


巫术时代-个人博客-[url]www.[/url]
2010-08-17 16:00
gupiao175
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:40
帖 子:1787
专家分:7527
注 册:2007-6-27
收藏
得分:20 
要实现你的功能,具体代码确实非常庞大,绝对不是一两个好的思路就能把代码写出来的!不过你可以参考一下无刷新留言的思路去写,也就是HTML纯静态的留言!
我的思路是,
1、在数据库新建一个表,然后建两个字段,前台建立表格,递交字段到后台
2、后台审核通过了直接递交到数据库的表里
3、主要是模板页的写法,要写进去评论按钮,以往审核通过的评论表格
4、然后登陆的问题就是在评论的位置加一个checklogin这样的代码
第二条的问题:
后台审核通过了直接提交数据库?其实不管怎么样,客户端提交了数据就已经进数据库了。后台只能审核或删除了。不然那些数据没地方放,html里也不能保存任何数据!
这里仅给你提个建议吧!把无刷新留言的思路搞清楚了,你的问题也就不是很难了,因为那些代码确实忒多!

Q:1428196631,百度:开发地 即可找到我,有事请留言!
2010-08-17 17:27
gupiao175
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:40
帖 子:1787
专家分:7527
注 册:2007-6-27
收藏
得分:0 
不过不管怎么样,我想你都可以先把问题简单化,先把纯静态部分做出来!也就留言的外型框架先写出来。然后再考虑在摸板里的哪些部分添加动态变量!

Q:1428196631,百度:开发地 即可找到我,有事请留言!
2010-08-17 17:30
jiazehua
Rank: 1
来 自:大连
等 级:新手上路
帖 子:77
专家分:0
注 册:2010-8-15
收藏
得分:0 
回复 4楼 gupiao175
额……
我是修改的源码
基本上都好了,静态页面也是已经可以正常生成了
就是缺少个酒店评论功能……我想给加上……不用无刷新的~
我想,也应该非常麻烦……
你说得对!
我先研究一下把留言的框架做出来~

[ 本帖最后由 jiazehua 于 2010-8-17 18:05 编辑 ]

巫术时代-个人博客-[url]www.[/url]
2010-08-17 18:04
快速回复:(太麻烦)大题二:给网站添加文章评论模块-jiazehua
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.036350 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved