标题:各位大侠,请教一个问题,关于学习平台的
只看楼主
欣然影像
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2011-3-30
结帖率:0
已结贴  问题点数:20 回复次数:3 
各位大侠,请教一个问题,关于学习平台的
最近我遇到一个问题,咨询了很多人都没有解答出来。想在此请教一下各位大侠。
有一个学习平台,里面有视频观看功能,并自动为学员积分。可问题是只要是一打开这个网页,系统就自动积分了。所以想把它设置成学员观看1小时后,才能积分,我不知道给怎样添加相关条件语句,才能实现这个功能。所以请教各位。
%
call hacker()
if session("superlogin")<>yecao then
response.Write "<script>alert('您还没有登陆!');this.location.href='default.asp';</script>"
Response.End
end if
%>

   
   
   
    <%         
    dim id
id=trim(request("id"))

set rs=server.CreateObject("adodb.recordset")
sql="select * from YC_class where id="&id
rs.open sql,conn,1,3
rs("click")=rs("click")+1
rs.update

%>




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0096)http://www.wfstudy.因公出境.wmv&title= -->
<HTML><HEAD><TITLE>《<%=rs("title")%>》</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE>
A:link {
    COLOR: #000000; TEXT-DECORATION: none
}
A:hover {
    COLOR: rgb(0,147,43); TEXT-DECORATION: none
}
A:active {
    COLOR: #000000; TEXT-DECORATION: none
}
A:visited {
    COLOR: #000000; TEXT-DECORATION: none
}
A {
    FONT-SIZE: 9pt
}
TD {
    FONT-SIZE: 9pt
}
BODY {
    BACKGROUND-IMAGE: url(images/bg_7.gif)
}
.style1 {
    FONT-WEIGHT: bold;
    FONT-SIZE: 18pt;
    background-color: #FFFF00;
}
.style4 {
    FONT-WEIGHT: bold; FONT-SIZE: 14px
}
.STYLE6 {FONT-WEIGHT: bold; FONT-SIZE: 14px; color: #FF0000; }
.STYLE8 {color: #FF0000}
.STYLE10 {FONT-WEIGHT: bold; FONT-SIZE: 30px; color: #FF0000; }
</STYLE>

<META content="MSHTML 6.00.2900.3640" name=GENERATOR></HEAD>
<BODY leftMargin=0 topMargin=0 MARGINWIDTH="0" MARGINHEIGHT="0">
<TABLE cellSpacing=0 cellPadding=0 width=1016 align=center border=0>
  <TBODY>
  
  <TR>
    <TD vAlign=top background=wf11/playvideo.files/p2.jpg height=500>
      <p>&nbsp;</p>
      <TABLE width=460 border=0 align=center cellPadding=0 cellSpacing=0>
        <TBODY>
        <TR>
          <TD width="460" height=55 align=middle><div align="center" class="STYLE10">《<%=rs("title")%>》</div></TD>
        </TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=980 align=center border=0>
        <TBODY>
        <TR>
          <TD colSpan=3 height=12></TD></TR>
        <TR>
          <TD vAlign=top width=267>&nbsp;</TD>
          <TD vAlign=top width=469>
            <TABLE cellSpacing=0 cellPadding=0 border=0>
              <TBODY>
              <TR>
                <TD align=middle>
                  <OBJECT id=MPlayer1        style="BORDER-RIGHT: 1px; BORDER-TOP: 1px; BORDER-LEFT: 1px; BORDER-BOTTOM: 1px"
                  type=application/x-oleobject height=409 width=446
                  classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95>
                    <PARAM NAME="FileName" VALUE=<%=rs("pic")%>>
                    <PARAM NAME="AutoStart" VALUE="-1"><PARAM NAME="currentPosition" VALUE="0">
                    <PARAM NAME="AnimationAtStart" VALUE="-1">
                    <PARAM NAME="ShowControls" VALUE="-1">
                    <PARAM NAME="ClickToPlay" VALUE="0">
                    <PARAM NAME="EnableContextMenu" VALUE="-1">
                    <PARAM NAME="autorewind" VALUE="-1">
                    <PARAM NAME="ShowStatusBar" VALUE="-1">
                    <param name="AudioStream" value="-1">
                    <param name="AutoSize" value="0">
                    <param name="AllowScan" value="-1">
                    <param name="AllowChangeDisplaySize" value="-1">
                    <param name="Balance" value="0">
                    <param name="BaseURL" value>
                    <param name="BufferingTime" value="5">
                    <param name="CaptioningID" value>
                    <param name="CursorType" value="0">
                    <param name="CurrentMarker" value="0">
                    <param name="DefaultFrame" value>
                    <param name="DisplayBackColor" value="0">
                    <param name="DisplayForeColor" value="16777215">
                    <param name="DisplayMode" value="0">
                    <param name="DisplaySize" value="4">
                    <param name="Enabled" value="-1">
                    <param name="EnablePositionControls" value="-1">
                    <param name="EnableFullScreenControls" value="0">
                    <param name="EnableTracker" value="-1">
                    <param name="InvokeURLs" value="-1">
                    <param name="Language" value="-1">
                    <param name="Mute" value="0">
                    <param name="PlayCount" value="1">
                    <param name="PreviewMode" value="0">
                    <param name="Rate" value="1">
                    <param name="SAMILang" value>
                    <param name="SAMIStyle" value>
                    <param name="SAMIFileName" value>
                    <param name="SelectionStart" value="-1">
                    <param name="SelectionEnd" value="-1">
                    <param name="SendOpenStateChangeEvents" value="-1">
                    <param name="SendWarningEvents" value="-1">
                    <param name="SendErrorEvents" value="-1">
                    <param name="SendKeyboardEvents" value="0">
                    <param name="SendMouseClickEvents" value="0">
                    <param name="SendMouseMoveEvents" value="0">
                    <param name="SendPlayStateChangeEvents" value="-1">
                    <param name="ShowCaptioning" value="0">
                    <param name="ShowAudioControls" value="-1">
                    <param name="ShowDisplay" value="0">
                    <param name="ShowGotoBar" value="0">
                    <param name="ShowPositionControls" value="-1">
                    <param name="ShowTracker" value="-1">
                    <param name="TransparentAtStart" value="0">
                    <param name="VideoBorderWidth" value="0">
                    <param name="VideoBorderColor" value="0">
                    <param name="VideoBorder3D" value="0">
                    <param name="Volume" value="-600">
                    <param name="WindowlessVideo" value="0">
                    </OBJECT></TD></TR></TBODY></TABLE>
            <TABLE width=199
              border=0 align=center cellPadding=0 cellSpacing=0 bordercolor="#FFFF33">
              <TBODY>
              <TR>
                <TD width=199 height=15>&nbsp;</TD>
              </TR>
              <TR>
                <TD height=25 align=middle bgcolor="#FFFF33"><B>类型:</B><%=MPlayer1.newMedia("/up/video/20100308.avi").duration%><%=rs("lb")%> <B>总时长:</B><%=rs("classtime")%>
              分钟</TD>
              </TR></TBODY></TABLE></TD>
          <TD vAlign=top width=244>
        <DIV id=a1
            style="WIDTH: 100; LINE-HEIGHT: 150%; POSITION: absolute; HEIGHT: 452px;">
          <p><SPAN
            class=STYLE6>课程简介:</SPAN></p>
          <p class="STYLE8"> <%=rs("content")%>        </p>
        </DIV></TD></TR></TBODY></TABLE><BR><BR><BR><BR></TD></TR></TBODY></TABLE>
<SCRIPT src="wf11/playvideo.files/server.js"></SCRIPT>

<SCRIPT>
var sc = 0;
function test() { //测试视频是否在播放,并累加
    if (document.getElementById('MPlayer1').PlayState == 2) {
        sc += 1;
    }
    setTimeout("test()",1000);
}
setTimeout("test()",hctime); //留出hctime秒的缓冲时间

function subSc() {
    form6.sc.value = sc;
    form6.submit();
    setTimeout("subSc()",updatetime); //每隔updatetime秒更新数据库
    sc = 0;
}
setTimeout("subSc()",updatetimeks); //开始第一次更新数据库

tp = 0;
var syg = document.getElementById('tit');
function cg(vido,tit) {
    document.getElementById('MPlayer1').FileName = "mms://" + serverip + "/zzb/" + vido;
    if (tit != "") {
        document.getElementById('tit').innerHTML = " -- " + tit;
    } else {
        document.getElementById('tit').innerHTML = " ";
    }
   
    if (tp == 1) {
        var e=e||event;
        dq=e.target||e.srcElement;
        dq.style.color="#ff0000";
        if (dq!=syg) {
            syg.style.color="#000000";
            syg=dq;
        }
    }
}

        //cg('beijing/因公出境.wmv',''); //默认播放
        
tp = 1;

</SCRIPT>
<%
admin_user=session("admin_user")
set rsxf=server.CreateObject("adodb.recordset")
sqlxf="select * from YC_admin where admin_user='"&admin_user&"'"
rsxf.open sqlxf,conn,1,3
totalcs=rsxf.recordcount




  set rsstudy=server.CreateObject("adodb.recordset")
sql="select * from YC_studyclass where admin_user='"&admin_user&"' and class_id='"&rs("id")&"'"
rsstudy.open sql,conn,1,3

if  rsstudy.bof and rsstudy.eof then

rsstudy.addnew
rsstudy("admin_user")=rsxf("admin_user")
rsstudy("admin_user")=rsxf("admin_user")
rsstudy("class_id")=rs("id")
rsstudy("class_title")=rs("title")
rsstudy("class_xf")=rs("xf")
rsstudy("class_time")=rs("classtime")
rsstudy("study_time")=now()

rsstudy("sfks")=rs("sfks")
rsstudy("study_state")=1
rsstudy("study_jd")=0
rsstudy("kscj")=0
rsstudy("lw")=0
rsstudy("lwcj")=0
rsstudy.update
rsxf("user_xf")=cdbl(rsxf("user_xf"))+cdbl((rs("xf")))
rsxf.update
else

rsstudy("study_state")=1
rsstudy("study_jd")=0
rsstudy("kscj")=1
rsstudy("lw")=0
rsstudy("lwcj")=0
rsstudy.update


end if

%>
<SCRIPT language=JavaScript>
function loadingBar(){

jd= MPlayer1.controls.currentPosition

id=setTimeout(loadingBar,200)
}
loadingBar();
</SCRIPT>

<%

rsstudy.close
rsxf.close
set rsstudy=nothing
set rsxf=nothing
%>
<FORM id=form6 name=form6 action=subScVideo.jsp method=post target=zt><INPUT
type=hidden value=0 name=sc> </FORM><IFRAME id=zt name=zt
src="playvideo.files/subScVideo.htm" frameBorder=0 width=1 scrolling=no
height=1></IFRAME></BODY></HTML>



<%
  rs.close
  set rs=nothing
%>
搜索更多相关主题的帖子: 网页 
2011-03-30 17:07
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
得分:10 
你这个功能只能用Ajax来实现。
2011-03-30 22:33
欣然影像
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2011-3-30
得分:0 
如果设置成播放完,再计分,如果写语句?
2011-03-31 06:29
hams
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:18
帖 子:912
专家分:3670
注 册:2008-7-30
得分:10 
参考一下在线人数统计的做法,也就是在浏览器一小时之后才关闭的才计算。

俺不高手,俺也是来学习的。
俺的意见不一定就对,当你不认同时请点忽视按钮。
当走到十字路口不知该如何走时,可在论坛问下路,但你若希望别人能一路把你送到目的地,显然是不现实的,因为别人也有自己要走的路。
2011-03-31 07:59



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-335212-1-1.html




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

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