snzyj 发表于 2006-2-24 00:32:12

[原创]关于webvod5不扣点的一些说明及修改!

<P><FONT size=5>webvod5破解版在使用过程中发现计费功能有bug,不会扣点。估计是网页代码部分有问题。经过一段时间分析后,发现确实是代码的问题。由于偶基本不懂asp,所以只能蒙着改了。经过一些小改动后,可以按点数计费了。在此给大家说明一下解决方法。</FONT></P>
<P><FONT size=5>如果有asp高手,还希望能更好的改一下,把其它计费方式也改全。</FONT></P>
<P><FONT size=2><STRONG>webvod安装好后,在\Program Files\Viewgood\WebVOD\WebMedia\oemui下有个player.asp,这个文件是计费的。</STRONG></FONT></P>
<P><FONT size=2><STRONG>下面我贴出了文件部分原代码,做一简单分析。源文件虽然比较长,但计费功能主要用到了几个函数,分别是function CheckPoint(iGameID, iCurrentPoint),function CheckMonth(iUserID, iUnitValue),function CheckFlux(iGameID, iCurrentFlux),function CheckHour(iGameID, iCurrentHour)在原文件中用其它颜色加粗显示了。</STRONG></FONT></P>
<P><FONT size=2>…………省略若干句</FONT></P>
<P><FONT color=#ff0000 size=2><STRONG>function CheckPoint(iGameID, iCurrentPoint)   <FONT color=#dd22dd>这一段是按点计费的函数,里面缺少扣点部分<br></FONT>szSQL = "SELECT Price FROM v_pro_price WHERE Prog_ID=" &amp; iGameID<br>rsData.Open szSQL,con,1,3<br>if not rsData.EOF then iGamePrice = rsData("Price")<br>rsData.Close</STRONG></FONT></P>
<P><FONT color=#ff0000 size=2><STRONG>if iGamePrice * iDiscount / 100 &gt; iCurrentPoint then<br>Response.Write "&lt;script language='JScript'&gt;alert('你的帐户上余额不足,请充值!');window.close();&lt;/script&gt;"<br>Response.End<br>end if<br>end function</STRONG></FONT></P>
<P><FONT color=#1111ee size=2><STRONG>function CheckMonth(iUserID, iUnitValue)    <FONT color=#d52bb3>这一段是按月计费函数,比较完整,包括了计费功能。</FONT><br>szSQL = "SELECT account,LastCheckDate FROM CusTomer WHERE CusTomer_ID=" &amp; iUserID<br>rsData.Open szSQL,con,1,3<br>if not rsData.EOF then<br>iAccount = rsData("account")<br>szCheckDate = rsData("LastCheckDate")<br>if DateDiff("d", szCheckDate, now) &gt;= 30 or szCheckDate = "" or IsNull(szCheckDate) then<br>   if iAccount &lt; iUnitValue then<br>    Response.Write "&lt;script language='JScript'&gt;alert('你的帐户上余额不足,请充值!');window.close();&lt;/script&gt;"<br>    Response.End<br>   else<br>    if IsNull(szCheckDate) then<br>   szCheckDate = now<br>    elseif szCheckDate = "" then<br>   szCheckDate = now<br>    else<br>   szCheckDate = DateAdd("d", 30, szCheckDate)<br>    end if</STRONG></FONT></P>
<P><FONT color=#1111ee size=2><STRONG><EM><U>    rsData("account") = iAccount - iUnitValue    <FONT color=#ee11ee>这个地方就是计费的,对,就是这个减法运算<br></FONT>    rsData("LastCheckDate") = szCheckDate<br>    rsData.Update</U></EM><br>   end if<br>end if<br>end if<br>rsData.Close<br>end function</STRONG></FONT></P>
<P><FONT color=#ff0000 size=2><STRONG>function CheckFlux(iGameID, iCurrentFlux)   <FONT color=#dd22dd>这一段是按流量计费的,里面缺少扣点部分</FONT><br>szSQL = "SELECT FileLen FROM v_proginfo WHERE Prog_ID=" &amp; iGameID<br>rsData.Open szSQL,con,1,3<br>if not rsData.EOF then iGameLen = rsData("FileLen")<br>rsData.Close</STRONG></FONT></P>
<P><FONT color=#ff0000 size=2><STRONG>szSQL = "SELECT Price FROM v_pro_price WHERE Prog_ID=" &amp; iGameID<br>rsData.Open szSQL,con,1,3<br>if not rsData.EOF then iGamePrice = rsData("Price")<br>rsData.Close</STRONG></FONT></P>
<P><FONT color=#ff0000 size=2><STRONG>if iGameLen * iGamePrice &gt; iCurrentFlux * 1024 * 1024 / 8 then<br>Response.Write "&lt;script language='JScript'&gt;alert('你的剩余流量不足,请充值!');window.close();&lt;/script&gt;"<br>Response.End<br>end if<br>end function</STRONG></FONT></P>
<P><FONT color=#3809f7 size=2><STRONG>function CheckHour(iGameID, iCurrentHour)   <FONT color=#dd22dd>这一段是按小时计费的,</FONT><FONT color=#dd22dd>里面缺少扣点部分</FONT><br>szSQL = "SELECT PlayTime FROM v_proginfo WHERE Prog_ID=" &amp; iGameID<br>rsData.Open szSQL,con,1,3<br>if not rsData.EOF then<br>szPlayTime = rsData("PlayTime")</STRONG></FONT></P>
<P><FONT color=#3809f7 size=2><STRONG>iTimeHour = Mid(szPlayTime, 1, 2)<br>iTimeMin = Mid(szPlayTime, 3, 2)<br>iTimeSec = Mid(szPlayTime, 5, 2)</STRONG></FONT></P>
<P><FONT color=#3809f7 size=2><STRONG>if rsData("PlayTime") &lt;&gt; "000000" then iGameTime = Clng(iTimeHour * 3600 + iTimeMin * 60 + iTimeSec)<br>end if<br>rsData.Close</STRONG></FONT></P>
<P><FONT color=#3809f7 size=2><STRONG>szSQL = "SELECT Price FROM v_pro_price WHERE Prog_ID=" &amp; iGameID<br>rsData.Open szSQL,con,1,3<br>if not rsData.EOF then iGamePrice = rsData("Price")<br>rsData.Close</STRONG></FONT></P>
<P><FONT color=#3809f7 size=2><STRONG>if (iGameTime / 3600) * iGamePrice &gt; iCurrentHour then<br>Response.Write "&lt;script language='JScript'&gt;alert('你的剩余时间不足,请充值!');window.close();&lt;/script&gt;"<br>Response.End<br>end if<br>end function</STRONG></FONT></P>
<P><FONT size=2>//////////////////////////////////////////////////////////////<br>iGameID= Encode(Request.QueryString("id"))<br>bRefresh = Encode(Request.QueryString("rf"))<br>iPlayerType = Encode(Request.QueryString("PlayerType")) '区分LIVE和VOD<br>iUserID= Session("CusTomer_ID")<br>iEmbedMode = Encode(Request.QueryString("EmbedMode"))<br>iSendType = Encode(Request.QueryString("SendType"))</FONT></P>
<P><FONT size=2>'if Len(iSendType) = 0 then iSendType = 1<br>if Len(iEmbedMode) = 0 then iEmbedMode = 1<br>if Len(iPlayerType) = 0 then iPlayerType = 2</FONT></P>
<P><FONT size=2>if Session("Option_RegMode") = 2 and Len(iUserID) = 0 then<br>iUserID = 2<br>szSQL = "SELECT CusTomer_ID FROM CusTomer WHERE UserName='!GUEST'"<br>rsData.Open szSQL,con,1,3<br>if not rsData.EOF then iUserID = rsData("CusTomer_ID")<br>rsData.Close<br>end if</FONT></P>
<P><FONT size=2>x = GetUserInfo(iUserID)<br>if iPurchase_Mode = 0 then<br>if iPlayerType = 1 then<br>iChannelPrice = 0<br>szSQL = "SELECT Price FROM Channel WHERE Channel_ID=" &amp; iGameID<br>rsData.Open szSQL,con,1,3<br>if not rsData.EOF then iChannelPrice = rsData("Price")<br>rsData.Close</FONT></P>
<P><FONT size=2>if iChannelPrice &gt; 0 then<br>   if iUserType = 1 then<br>    iUnitValue = Clng(Session("Option_Unit_Month"))<br>    x = CheckMonth(iUserID, iUnitValue)<br>   else<br>    if iAccount &lt;= 0 then<br>   Response.Write "&lt;script language='JScript'&gt;alert('你的余额不足,请充值!');top.history.back(-1);&lt;/script&gt;"<br>   Response.End<br>    end if<br>   end if<br>end if<br>end if</FONT></P>
<P><FONT color=#f70909 size=2><STRONG>if iPlayerType = 2 then    <FONT color=#dd22dd>这个地方是判断用户类型,然后调用那几个函数计费的。</FONT><br>if iUserType = 0 then<br>   szPayFlag = "按点次付费"<br>   iUnitValue = Clng(Session("Option_Unit_Point"))<br>   iCurrentPoint = iAccount * iUnitValue<br>   x = CheckPoint(iGameID, iCurrentPoint)<br>elseif iUserType = 1 then<br>   szPayFlag = "按整月付费"<br>   iUnitValue = Clng(Session("Option_Unit_Month"))<br>   x = CheckMonth(iUserID, iUnitValue)<br>elseif iUserType = 2 then<br>   szPayFlag = "按流量付费"<br>   iUnitValue = Clng(Session("Option_Unit_MB"))<br>   iCurrentFlux = iAccount * iUnitValue<br>   x = CheckFlux(iGameID, iCurrentFlux)<br>elseif iUserType = 3 then<br>   szPayFlag = "按时间付费"<br>   iUnitValue = Clng(Session("Option_Unit_Hour"))<br>   iCurrentHour = iAccount * iUnitValue<br>   x = CheckHour(iGameID, iCurrentHour)<br>end if<br>end if<br>end if</STRONG></FONT></P>
<P><FONT size=2>if iPlayerType = 2 then<br>x = CheckRight(iGameID) '检查节目级别</FONT></P>
<P><FONT size=2>szSQL = "SELECT ProgName,FileName,FileType,PlayTime,Type_ID FROM v_proginfo WHERE Prog_ID=" &amp; iGameID<br>rsData.Open szSQL,con,1,3<br>if not rsData.EOF then<br>szProgName = rsData("ProgName")<br>szUrl= rsData("FileName")<br>szFileType = rsData("FileType")<br>szPlayTime = rsData("PlayTime")<br>iTypeID= rsData("Type_ID")<br>end if<br>rsData.Close</FONT></P>
<P><FONT size=2>if szPlayTime &lt;&gt; "000000" or szFileType = "asf" or szFileType = "wmv" or szFileType = "wma" then<br>if bRefresh = "1" then szErrorMsg = "onLoad='window.opener.window.location.reload();'"<br>else<br>Response.Redirect "consume.asp?ProgID=" &amp; iGameID &amp; "&amp;TypeID=" &amp; iTypeID &amp; "&amp;CusTomerID=" &amp; iUserID &amp; "&amp;UserName=" &amp; szUserName &amp; "&amp;URL=" &amp; URLEncode(szUrl)<br>end if</FONT></P>
<P><FONT size=2>szProg_GUID = GetProgramGUID(iGameID)<br>szSQL = "SELECT Part_No,Prog_ID FROM v_proginfo WHERE Prog_GUID='" &amp; szProg_GUID &amp; "' ORDER BY Part_No ASC"<br>rsData.Open szSQL,con,1,3</FONT></P>
<P><FONT size=2>szParmProgName = szProgName<br>if not rsData.EOF then<br>if rsData.RecordCount = 1 then<br>   szParmProgName = szParmProgName<br>elseif rsData.RecordCount = 2 then<br>   do while not rsData.EOF<br>    if rsData("Prog_ID") = Cint(iGameID) then<br>   if rsData("Part_No") = 1 then szParmProgName = szParmProgName &amp; " - 上集"<br>   if rsData("Part_No") = 2 then szParmProgName = szParmProgName &amp; " - 下集"<br>   exit do<br>    end if<br>    rsData.MoveNext<br>   loop<br>elseif rsData.RecordCount = 3 then<br>   do while not rsData.EOF<br>    if rsData("Prog_ID") = Cint(iGameID) then<br>   if rsData("Part_No") = 1 then szParmProgName = szParmProgName &amp; " - 上集"<br>   if rsData("Part_No") = 2 then szParmProgName = szParmProgName &amp; " - 中集"<br>   if rsData("Part_No") = 3 then szParmProgName = szParmProgName &amp; " - 下集"<br>   exit do<br>    end if<br>    rsData.MoveNext<br>   loop<br>else<br>   do while not rsData.EOF<br>    if rsData("Prog_ID") = Cint(iGameID) then<br>   szParmProgName = szParmProgName &amp; " - 第 " &amp; rsData("Part_No") &amp; " 集"<br>   exit do<br>    end if<br>    rsData.MoveNext<br>   loop<br>end if<br>end if<br>rsData.Close</FONT></P>
<P><FONT size=2>szParmPlayMode= "1"<br>szParmPlayModeValue = iGameID<br>szServerAddr= "1.1.1.1"<br>end if</FONT></P>
<P><FONT size=2>………………省略若干句</FONT></P>
<P><FONT size=6>以下为修改后,增加了按点计费功能的部分,复制后在player.asp中替换掉相应部分就OK了。</FONT></P>
<P> </P>
<P>function CheckPoint(iGameID, iCurrentPoint)</P>
<P>szSQL = "SELECT Price FROM v_pro_price WHERE Prog_ID=" &amp; iGameID<br>rsData.Open szSQL,con,1,3<br>if not rsData.EOF then iGamePrice = rsData("Price")<br>      rsData.Close<br>if iGamePrice * iDiscount / 100 &gt; iCurrentPoint then<br>Response.Write "&lt;script language='JScript'&gt;alert('你的帐户上余额不足,请充值!');window.close();&lt;/script&gt;"<br>Response.End<br>else</P>
<P>szSQL = "SELECT account FROM CusTomer WHERE CusTomer_ID=" &amp; iUserID<br>rsData.Open szSQL,con,1,3<br>if not rsData.EOF then<br>iAccount = rsData("account")      <br>rsData("account") = iAccount - iGamePrice/3 * iDiscount / 100<br>rsData.Update<br>end if<br>rsData.Close</P>
<P>end if</P>
<P>end function</P>
<P><br></P>
[此贴子已经被作者于2006-2-24 0:44:30编辑过]

adsl 发表于 2006-2-24 08:14:18

<P>我好想学学</P>

鑫海 发表于 2006-2-24 08:47:40

<P>ok,</P>
<P>谢谢。</P>

peace 发表于 2006-2-24 09:16:30

<P>厉害!佩服!</P>

admin 发表于 2006-2-24 09:18:51

<P>真是不错呀.谢谢捧场!</P>

lxh 发表于 2006-2-24 09:28:42

<P>谢谢贡献.</P>

313044800 发表于 2006-2-24 11:42:54

<P>谢谢</P>

海边的企鹅 发表于 2006-2-24 11:45:03

<P>真是谢谢,辛苦了</P>

lcdj02 发表于 2006-2-24 13:20:27

<P>谢谢提供</P>

nima 发表于 2006-2-24 17:40:23

页: [1] 2 3 4 5 6 7 8 9
查看完整版本: [原创]关于webvod5不扣点的一些说明及修改!