各位大侠,请教一个问题,关于学习平台的
最近我遇到一个问题,咨询了很多人都没有解答出来。想在此请教一下各位大侠。有一个学习平台,里面有视频观看功能,并自动为学员积分。可问题是只要是一打开这个网页,系统就自动积分了。所以想把它设置成学员观看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> </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> </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> </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
%>