微信平台能用的视频播放器源码:CuPlayer

Pop:经常有设计网页的朋友现在肯定为多平台的兼容代码而头痛,特别是多媒体的代码,如视频、音乐的控制,往往在电脑的IE、Chrome等都可以,但是到了手机上如微信、UC上就不行了。

这里给大家分享一个可以用于多平台的网页视频播放器源码:CuPlayer 酷播播放器

CuPlayer效果如下:


Continue reading "微信平台能用的视频播放器源码:CuPlayer"

FM927楚天交通广播在线试听源码

武汉FM927楚天交通广播在火凤网提供了在线试听的地址(http://927.hbtv.com.cn/),经过Pop的分析采用的是浪弯融科(TVie) 的流媒体分享系统

浪弯融科(TVie) http://www.tvie.com.cn/为国内不少地方电视台提供的技术支持。网络解析速度和反映都很不错的


FM927楚天交通广播在线试听 精简源码 截图

经过Pop的精简,把源代码提出来了,主要结构

927.htm
common.js
jquery.js
tvieplayer.js

通过html调 Continue reading "FM927楚天交通广播在线试听源码"

两款开源在线编辑器:FCKEditor和TinyMCE

FCKEditor和TinyMCE这两款在线WEB编辑器,最早接触的时候实在动易的平台,使用的是FCK,现在换到PHP平台之后在WordPress上使用的是TinyMCE,两款都比较不错的。

1、CKEditor
CKEditor

FCKEditor 现在已经重新开发,并改名为 CKEditor。

CKeditor是一个专门使用在网页上属于开放源代码的所见即所得文字编辑器。它志于轻量化,不需要太复杂的安装步骤即可使用。它可和PHP、JavaScript、ASP、ASP.NET、ColdFusion、Java、以及ABAP等不同的编程语言相结合。“FCKeditor”名称中的“FCK” 是这个编辑器 Continue reading "两款开源在线编辑器:FCKEditor和TinyMCE"

免费查询IP地址归属地的PHP源码(QQWry.Dat纯真数据库版)

Pop:网上确实有不少这样的查询代码,找了一个多少小时终于找到了一个好用点的。

经过Pop的简单清理,代码简洁明了,适合于自己用。

主要是调用纯真数据库,功能上与ip138一样的。

而且支持.tk、.ru、.nl这样的域名查询。

截图:

演示地址:
http://ip.429006.com/

使用说明:

1、基于php 5.x环境(7.0以上版本会有读取数据不正确的问题)

2、请下载纯真IP数据库“QQWry.Dat”放到“data”目录下

有网友说我的版本有所更新,确实Pop是后来做了一下精简,以及支持手机屏幕等优化,这个是我直接从FTP中下载下来的源文件,免费提供给大家

查询IP地址归属地的PHP源码 2015修改版 下载地址:
http://pan.baidu.com/s/1mh0j4Qc

ASP过滤特殊字符的模块源码

实现效果:通过对特殊字符的转换,可以保证数据的安全。

代码如下:

<%
Function FormatHTML(fString)
    If fString<>"" Then
        fString = trim(fString)
        fString = replace(fString, ";", ";")     ''分号过滤

>        fString = replace(fString, "--", "——") ''--过滤
        fString = replace(fString, "%20", "")    ''特殊字符过滤

p;    fString = replace(fString, "==", "")     ''==过滤
        fString = replace(fString, ">", ">")
        fString = replace(fString,

"<", "<")
        fString = Replace(fString, CHR(32), " ")   '' 
        fString = Replace(fString, CHR(9

: #000000; BACKGROUND-COLOR: #f5f5f5">), " ")    '' 
        fString = Replace(fString, CHR(34), """)
        fString = Replace(fString, CHR(39), "'

KGROUND-COLOR: #f5f5f5">") ''单引号过滤
        fString = Replace(fString, CHR(13), "")
        fString = Replace(fString, CHR(10) & CHR(10), "</P><P>

pan>")
        fString = Replace(fString, CHR(10), "<BR> ")
        FormatHTML = fString
    End If
End Function
%>

第二种代码:
<%
Function ChkInvaildWord(Words)
Const InvaildWords="select|update|delete|insert|@|--|,"   '需要过滤得字符以“|”隔开,最后结束的字符必须是|
ChkInvaildWord=True
InvaildWord=Split(InvaildWords,"|")
inWords=LCase(Trim(Words))

For i=LBound(InvaildWord) To UBound(InvaildWord)
If Instr(inWords,InvaildWord(i))>0 Then
  ChkInvaildWord=True
  Exit Function
End If
Next
ChkInvaildWord=False
End Function
%>

vbs实现定时自动关机及源码

pop:其实实现自动关机的核心就是shutdown的命令,at 21:00 shutdown -s 就是在21:00自动关机,会有30秒的提示;要是没有提示直接关机就是:at 21:00 shutdown -s -t 0 (注意:要开启“计划任务”的服务。)

将下面的代码保存为 *.vbs 后缀的文件,如shutdown.vbs

在输入时间或者秒数之后自动关机,代码如下:

Dim mytime,myout1,myout2
mytime=null
mytime=InputBox("请输入定时时间(格式23:10:00)"&vblf&"如果想倒计时关机,请输入倒计时时间"&vblf&"(单位/分钟)"&vblf&"输入“pop”可以马上关机"&vblf&"退出点“取消”","定时关机","23:10:00")
Set wshshell=wscript.createobject("wscript.shell")
If IsNumeric(mytime)=False Then
If IsDate(mytime)=True Then
wshshell.run "at "&mytime&" shutdown -s -t 0" '定时关机在任务列表中
myout1=MsgBox("定时成功!电脑将在"&mytime&"关机!放弃关机请点“取消”!",vbokcancel,"定时关机")
If myout1=vbcancel Then
wshshell.run "at /delete /y"
MsgBox "关机已取消!",64,"定时关机"
End If
Else
If mytime="pop" Then
wshshell.run "shutdown -s -t 0"
End If
MsgBox "输入错误!请重新输入!",64,"定时关机"
End If
Else
If mytime>600 or mytime<=0 Then
MsgBox "输入错误!倒计时不能多于10小时(600分钟)!",64,"定时关机"
wscript.quit
End If
wshshell.run "shutdown -s -t "&mytime*60
myout2=MsgBox("设置成功!电脑将在"&mytime&"分钟后关机!放弃关机请点“取消”!",vbokcancel,"定时关机")
If myout2=vbcancel Then
wshshell.run "shutdown -a"
MsgBox "关机已取消!",64,"定时关机"
End If
End If

这个比较简单,就是实现倒计时关机的VBS脚本代码:

set diaolei=createobject("wscript.shell")
dim shijian,guanji,hua
shijian=time
hua=inputbox("请输入你要用什么单位关机 1 代表分钟 2 代表小时 3 代表天")
if hua=1 then
guanji=inputbox("请输入你要几分钟后关机")
if datediff("m",shijian,time)>=guanji then
diaolei.run "rundll32.exe user.exe,exitwindows"
diaolei.run "shutdown -s -t 0"
elseif hua=2 then
guanji=inputbox("请输入你要几小时后关机")
if datediff("h",shijian,time)>=guanji then
diaolei.run "rundll32.exe user.exe,exitwindows"
diaolei.run "shutdown -s -t 0"
elseif hua=3 then
guanji=inputbox("请输入你要几天后关机")
if datediff("d",shijian,time)>=guanji then
diaolei.run "rundll32.exe user.exe,exitwindows"
diaolei.run "shutdown -s -t 0"
endif

ip138查询ASP源码

pop:在网上搜集到的,随便修改了一下。要正常使用的话,下载一个最新的纯真IP数据库到目录下就可以查询了。

代码如下:

<%
IP = request("IP")
If IP = "" then
IP = Request.ServerVariables("REMOTE_ADDR")
%>
<style type="text/css">
<!--
.search {
    height: auto;
    width: 200px;
}
.STYLE1 {
    font-size: 12px;
    font-weight: bold;
}
-->
</style>
<title>ip138ASP查询程序</title><table width="400" align="center">
  <tr>
    <td><span class="STYLE1">您的IP是:</span><%=IP%> &nbsp;<span class="STYLE1">来自:</span><%=Disp_IPAddressData(IP,2)%><%=Disp_IPAddressData(IP,3)%>
  <%End if%></td>
  </tr>
</table>

<br />
<table width="400" border="0" align="center">
  <tr>
    <td><span class="STYLE1">请输入您需要查询的IP地址:</span>
      <input name="IP" type="text" id="IP">
        <input type="submit" name="Submit" value="查询">
      </td>
  </tr>
</table>
<p align="center"><br />
<%
' ============================================
' 返回IP信息 Disp_IPAddressData(IP,0)
' ============================================
Function Look_Ip(IP)
        Dim Wry, IPType, QQWryVersion, IpCounter
        ' 设置类对象
        Set Wry = New TQQWry
        ' 开始搜索,并返回搜索结果
        ' 您可以根据 QQWry(IP) 返回值来判断该IP地址在数据库中是否存在,如果不存在可以执行其他的一些操作
        ' 比如您自建一个数据库作为追捕等,这里我就不详细说明了
        IPType = Wry.QQWry(IP)
        ' Country:国家地区字段
        ' LocalStr:省市及其他信息字段
        Look_Ip =Wry.Country & "" & Wry.LocalStr
        '''''Look_Ip = Wry.Country & ""
End Function
' ============================================
' 返回IP信息 JS调用
' ============================================
Function Disp_IPAddressData(IP, sType)
        Dim Wry, IPType
        Set Wry = New TQQWry
        IPType = Wry.QQWry(IP)
        Select Case sType
                Case 1 Disp_IPAddressData = IP
                Case 2 Disp_IPAddressData = Wry.Country
                Case 3 Disp_IPAddressData = Wry.LocalStr
                'Case Else Disp_IPAddressData = Wry.Country & "" & Wry.LocalStr
                Case Else Disp_IPAddressData = Wry.Country
        End Select
End Function
' ============================================
' 返回QQWry信息
' ============================================
Function WryInfo()
        Dim Wry, IPType, QQWry_tem(0), QQWry_tem1(1)
        ' 设置类对象
        Set Wry = New TQQWry
        IPType = Wry.QQWry("255.255.255.254")
        ' 读取数据库版本信息
        QQWry_tem(0) = Wry.Country & " " & Wry.LocalStr
        ' 读取数据库IP地址数目
        QQWry_tem1(1) = Wry.RecordCount + 1
        WryInfo = QQWry_tem(0)& " " & QQWry_tem1(1)
End Function

Class TQQWry
        ' ============================================
        ' 变量声名
        ' ============================================
        Dim Country, LocalStr, Buf, OffSet
        Private StartIP, EndIP, CountryFlag
        Public QQWryFile
        Public FirstStartIP, LastStartIP, RecordCount
        Private Stream, EndIPOff
        ' ============================================
        ' 类模块初始化
        ' ============================================
        Private Sub Class_Initialize
                Country                 = ""
                LocalStr                 = ""
                StartIP                 = 0
                EndIP                         = 0
                CountryFlag         = 0
                FirstStartIP         = 0
                LastStartIP         = 0
                EndIPOff                 = 0
                QQWryFile = Server.MapPath("QQWry.Dat")
        End Sub
        ' ============================================
        ' IP地址转换成整数
        ' ============================================
        Function IPToInt(IP)
                Dim IPArray, i
                IPArray = Split(IP, ".", -1)
                FOr i = 0 to 3
                        If Not IsNumeric(IPArray(i)) Then IPArray(i) = 0
                        If CInt(IPArray(i)) < 0 Then IPArray(i) = Abs(CInt(IPArray(i)))
                        If CInt(IPArray(i)) > 255 Then IPArray(i) = 255
                Next
                IPToInt = (CInt(IPArray(0))*256*256*256) + (CInt(IPArray(1))*256*256) + (CInt(IPArray(2))*256) + CInt(IPArray(3))
        End Function
        ' ============================================
        ' 整数逆转IP地址
        ' ============================================
        Function IntToIP(IntValue)
                p4 = IntValue - Fix(IntValue/256)*256
                IntValue = (IntValue-p4)/256
                p3 = IntValue - Fix(IntValue/256)*256
                IntValue = (IntValue-p3)/256
                p2 = IntValue - Fix(IntValue/256)*256
                IntValue = (IntValue - p2)/256
                p1 = IntValue
                IntToIP = Cstr(p1) & "." & Cstr(p2) & "." & Cstr(p3) & "." & Cstr(p4)
        End Function
        ' ============================================
        ' 获取开始IP位置
        ' ============================================
        Private Function GetStartIP(RecNo)
                OffSet = FirstStartIP + RecNo * 7
                Stream.Position = OffSet
                Buf = Stream.Read(7)
                EndIPOff = AscB(MidB(Buf, 5, 1)) + (AscB(MidB(Buf, 6, 1))*256) + (AscB(MidB(Buf, 7, 1))*256*256)
                StartIP = AscB(MidB(Buf, 1, 1)) + (AscB(MidB(Buf, 2, 1))*256) + (AscB(MidB(Buf, 3, 1))*256*256) + (AscB(MidB(Buf, 4, 1))*256*256*256)
                GetStartIP = StartIP
        End Function
        ' ============================================
        ' 获取结束IP位置
        ' ============================================
        Private Function GetEndIP()
                Stream.Position = EndIPOff
                Buf = Stream.Read(5)
                EndIP = AscB(MidB(Buf, 1, 1)) + (AscB(MidB(Buf, 2, 1))*256) + (AscB(MidB(Buf, 3, 1))*256*256) + (AscB(MidB(Buf, 4, 1))*256*256*256)
                CountryFlag = AscB(MidB(Buf, 5, 1))
                GetEndIP = EndIP
        End Function
        ' ============================================
        ' 获取地域信息,包含国家和和省市
        ' ============================================
        Private Sub GetCountry(IP)
                If (CountryFlag = 1 or CountryFlag = 2) Then
                        Country = GetFlagStr(EndIPOff + 4)
                        If CountryFlag = 1 Then
                                LocalStr = GetFlagStr(Stream.Position)
                                ' 以下用来获取数据库版本信息
                                If IP >= IPToInt("255.255.255.0") And IP <= IPToInt("255.255.255.255") Then
                                        LocalStr = GetFlagStr(EndIPOff + 21)
                                        Country = GetFlagStr(EndIPOff + 12)
                                End If
                        Else
                                LocalStr = GetFlagStr(EndIPOff + 8)
                        End If
                Else
                        Country = GetFlagStr(EndIPOff + 4)
                        LocalStr = GetFlagStr(Stream.Position)
                End If
                ' 过滤数据库中的无用信息
                Country = Trim(Country)
                LocalStr = Trim(LocalStr)
                If InStr(Country, "CZ88.NET") Then Country = ""
                If InStr(LocalStr, "CZ88.NET") Then LocalStr = ""
        End Sub
        ' ============================================
        ' 获取IP地址标识符
        ' ============================================
        Private Function GetFlagStr(OffSet)
                Dim Flag
                Flag = 0
                Do While (True)
                        Stream.Position = OffSet
                        Flag = AscB(Stream.Read(1))
                        If(Flag = 1 or Flag = 2 ) Then
                                Buf = Stream.Read(3)
                                If (Flag = 2 ) Then
                                        CountryFlag = 2
                                        EndIPOff = OffSet - 4
                                End If
                                OffSet = AscB(MidB(Buf, 1, 1)) + (AscB(MidB(Buf, 2, 1))*256) + (AscB(MidB(Buf, 3, 1))*256*256)
                        Else
                                Exit Do
                        End If
                Loop
                If (OffSet < 12 ) Then
                        GetFlagStr = ""
                Else
                        Stream.Position = OffSet
                        GetFlagStr = GetStr()
                End If
        End Function
        ' ============================================
        ' 获取字串信息
        ' ============================================
        Private Function GetStr()
                Dim c
                GetStr = ""
                Do While (True)
                        c = AscB(Stream.Read(1))
                        If (c = 0) Then Exit Do
                        '如果是双字节,就进行高字节在结合低字节合成一个字符
                        If c > 127 Then
                                If Stream.EOS Then Exit Do
                                GetStr = GetStr & Chr(AscW(ChrB(AscB(Stream.Read(1))) & ChrB(C)))
                        Else
                                GetStr = GetStr & Chr(c)
                        End If
                Loop
        End Function
        ' ============================================
        ' 核心函数,执行IP搜索
        ' ============================================
        Public Function QQWry(DotIP)
                Dim IP, nRet
                Dim RangB, RangE, RecNo
                IP = IPToInt (DotIP)
                Set Stream = CreateObject("ADodb.Stream")
                Stream.Mode = 3
                Stream.Type = 1
                Stream.Open
                Stream.LoadFromFile QQWryFile
                Stream.Position = 0
                Buf = Stream.Read(8)
                FirstStartIP = AscB(MidB(Buf, 1, 1)) + (AscB(MidB(Buf, 2, 1))*256) + (AscB(MidB(Buf, 3, 1))*256*256) + (AscB(MidB(Buf, 4, 1))*256*256*256)
                LastStartIP = AscB(MidB(Buf, 5, 1)) + (AscB(MidB(Buf, 6, 1))*256) + (AscB(MidB(Buf, 7, 1))*256*256) + (AscB(MidB(Buf, 8, 1))*256*256*256)
                RecordCount = Int((LastStartIP - FirstStartIP)/7)
                ' 在数据库中找不到任何IP地址
                If (RecordCount <= 1) Then
                        Country = "未知"
                        QQWry = 2
                        Exit Function
                End If
                RangB = 0
                RangE = RecordCount
                Do While (RangB < (RangE - 1))
                        RecNo = Int((RangB + RangE)/2)
                        Call GetStartIP (RecNo)
                        If (IP = StartIP) Then
                                RangB = RecNo
                                Exit Do
                        End If
                        If (IP > StartIP) Then
                                RangB = RecNo
                        Else
                                RangE = RecNo
                        End If
                Loop
                Call GetStartIP(RangB)
                Call GetEndIP()

                If (StartIP <= IP) And ( EndIP >= IP) Then
                        ' 没有找到
                        nRet = 0
                Else
                        ' 正常
                        nRet = 3
                End If
                Call GetCountry(IP)

                QQWry = nRet
        End Function
        ' ============================================
        ' 类终结
        ' ============================================
        Private Sub Class_Terminate
                On ErrOr Resume Next
                Stream.Close
                If Err Then Err.Clear
                Set Stream = Nothing
        End Sub
End Class
%>
<br />
Copyright (c) pop 2008 Allright Reserved.