<?php
if(!defined('IN_BZPHP')) {
exit('Access Denied');
}
/**
*页面跳转函数
**/
function refreshto($url,$msg,$time=1){
if($time==0){
header("location:$url");
}else{
require(BZPHP_ROOT."/template/default/refreshto.htm");
}
exit;
}
function set_cookie($name,$value,$cktime=0){
global $cookiepre;
if($cktime!=0){
$cktime=time()+$cktime;
}
if($value==''){
$cktime=time()-31536000;
}
$domain=$weburl;
setcookie($name,$value,$cktime);
}
function clear_cookie($name){
global $cookiepre;
setcookie($cookiepre . $name,$value,time() - 60);
}
/**
* 将指定内容写入文件
*
* @param string $filename 文件名
* @param string $data 要写入的数据
* @param string $method 操作方法
* @param boolean $iflock 是否锁定
*/
function writeover($filename,$data,$method="rb+",$iflock=1,$check=1,$chmod=1){
$check && strpos($filename,'..')!==false && showinfo('试图修改或者创建文件 <b>' . $filename . '</b>失败! 该文件权限有问题!<br><font color=#ff0000>请将该文件所属目录和文件权限设为777!</font>', 'back');
if (!@touch($filename)) showinfo('试图修改或者创建文件 <b>' . $filename . '</b>失败! 该文件权限有问题!<br><font color=#ff0000>请将该文件所属目录和文件权限设为777!</font>' , 'back');
$handle=fopen($filename,$method);
$iflock && flock($handle,LOCK_EX);
if(fwrite($handle,$data)=== FALSE){
fclose($handle);
return false;
}
if($method=="rb+") ftruncate($handle,strlen($data));
fclose($handle);
$chmod && @chmod($filename,0777);
return true;
}
/**
* 读取文件内容
*
* @param string $filename
* @param string $method
* @return string
*/
function readover($filename,$method="rb"){
strpos($filename,'..')!==false && exit('Forbidden');
if($handle=@fopen($filename,$method)){
flock($handle,LOCK_SH);
$filedata=fread($handle,filesize($filename));
fclose($handle);
}
return $filedata;
}
/****************************
*文件名:function.php
* 函数列表
//****************************
/*显示消息*/
//****************************
function alert($msg,$url)
{
$str = " <script language=javascript>\n";
if ($msg!=''){
$str .= "alert('$msg')\n";
}
if ($url!='none' && $url!='back')
{
$str .= "\n location.href='$url';";
} elseif ($url == 'back') {
$str .= "\n history.back();";
} elseif ($url == 'none' ){
$str .= "\n //none";
}
$str .= "\n </script>";
die($str);
}
function changeconfig($postvar,$datavar,$data,$str,$type = 0 , $back = 'jsback', $canbezero = false){
if ($type === 0) { //数字
$postvar = intval($postvar);
if (!$canbezero) {
if ($postvar <= 0) showinfo("{$str}不能为0或者为空或者小于0!" , $back);
} else {
if ($postvar < 0) showinfo("{$str}不能为空或者小于0!" , $back);
}
$data = preg_replace("/" . $datavar . "(\s*)=(\s*)(.*);/" ,$datavar . " = " . $postvar .";" ,$data);
return $data;
}
if ($type > 0) {//字符
if (empty($postvar)) showinfo("{$str}不能为空!" ,$back);
$data = preg_replace("/" . $datavar . "(\s*)=(\s*)(['|\"])(.*)([\"|']);/" , $datavar . " = \"" . $postvar . "\";" , $data);
return $data;
}
}
function checkstr($str){
$S_key=array('|',' ','',"'",'"','/','*',',','~',';','<','>','$',"\\","\r","\t","\n","`","!","?","%","^","&",'-','+','{','}');
foreach($S_key as $value){
$str = str_replace($value,'',$str);
}
return $str;
}
/*
检查IP
*/
function outip($outip,$listip){
if (strpos($listip,$outip) === false) {
$arr = explode('.',$outip);
if (count($arr) <> 4) return false;
//是否是IP段
if (strpos($listip,$arr[0] . '.' . $arr[1] . '.' . $arr[2] . '.*') === false) {
return false;
} else {
return true;
}
} else {
return true;
}
}
//截取中文字符
function msubstr($str, $start, $len) {
$tmpstr = "";
$strlen = $start + $len;
for($i = 0; $i < $strlen; $i++) {
if(ord(substr($str, $i, 1)) > 0xa0) {
$tmpstr .= substr($str, $i, 2);
$i++;
} else
$tmpstr .= substr($str, $i, 1);
}
return $tmpstr;
}
//获取文件扩展名
function getext($file_name){
$retval = "";
$pt=strrpos($file_name, ".");
if ( $pt ) $retval=substr($file_name, $pt+1, strlen($file_name) - $pt);
return ($retval);
}
/*
掷出信息
*/
function showinfo($info,$url,$sc = 3,$inchead=true,$title = "提示信息"){
global $installdir,$tplpath,$webname;
if ($inchead){
if (defined('IN_ADMIN')){
require showtemp('admin_head');
} else{
require showtemp("head");
}
} else {
require $inchead;
}
$restr = '';
if ($sc !== 0 && $url != 'back' && $url != 'none'){
$burl = ($url == 'jsback' ? "history.back();" : "location.href=url");
$restr = "<script language='javascript'>
i = 1;
function infun_reurl(url){
i++;
if ( i == 2 ) {$burl};
}
setInterval(\"infun_reurl('{$url}');\",{$sc}000);
</script>";
}
$restr .= '<div style="position:absolute;top:25%; width:99%;" align="center">
<table width="760" border="0" align="center" cellpadding="0" class="tableborder" cellspacing="1" style=" border:1px #9DB3C5 solid">
<tr>
<td height="26" colspan="2" align="center" style="background:#3F7DBA;color:#fff;font-weight:bold; "><center>提示信息</center></td>
</tr>
<tr class="altbg1" style="line-height:25px;">
<td width="100%" height="30" colspan="2" align="left" style="padding:10px;line-height:20px">';
$restr .= $info;
if ( $url == 'back' ){
$restr .= "<br><div align=center style='text-align:center;height:25px;line-height:25px;'><a href='javascript:history.back();'>返回</a></div>";
} elseif ( $url == 'jsback' && $sc !== 0) {
$restr .= "<br><div style='text-align:left;line-height:25px;'><a href='javascript:history.back();'>系统将自动返回当上一页,如果浏览器没有反应请点击此处.</a></div>";
} elseif ( $url == 'none') {
$restr .='<br><br>';
} else {
$restr .= "<br><div style='text-align:left;line-height:25px;'><a href='{$url}'>{$sc}秒将自动转向系统指定页,如果浏览器没有反应请点击此处.</a></div>";
}
$restr .=' </td>
</tr>
</table></div>';
die($restr);
}
/*
1 = y -m
2 = y - m - d
3 = m - d
4 = y - m - d h : i : s
*/
function mydate($str,$type){
if (preg_match("/([0-9]+)\-([0-9]+)\-([0-9]+)\s([0-9]+)\:([0-9]+)\:([0-9]+)/", $str , $reg)) {
if ($type == 1 ) {
return $reg[1] . '-' . $reg[2];
}
if ($type == 2 ) {
return $reg[1] . '-' . $reg[2] . '-' . $reg[3];
}
if ($type == 3 ) {
return $reg[2] . '-' . $reg[3];
}
if ($type == 4 ) {
return $str;
}
}
}
/**
* 时间差计算
*
* @param Timestamp $time
* @return String Time Elapsed
* @author Shelley Shyan
* @copyright http://phparch.cn (Professional PHP Architecture)
*/
function time2Units($time)
{
$year = floor($time / 60 / 60 / 24 / 365);
$time -= $year * 60 * 60 * 24 * 365;
$month = floor($time / 60 / 60 / 24 / 30);
$time -= $month * 60 * 60 * 24 * 30;
$week = floor($time / 60 / 60 / 24 / 7);
$time -= $week * 60 * 60 * 24 * 7;
$day = floor($time / 60 / 60 / 24);
$time -= $day * 60 * 60 * 24;
$hour = floor($time / 60 / 60);
$time -= $hour * 60 * 60;
$minute = floor($time / 60);
$time -= $minute * 60;
$second = $time;
$elapse = '';
$unitArr = array('年' =>'year', '个月'=>'month', '周'=>'week', '天'=>'day',
'小时'=>'hour', '分钟'=>'minute', '秒'=>'second'
);
foreach ( $unitArr as $cn => $u )
{
if ( $$u > 0 )
{
$elapse = $$u . $cn;
break;
}
}
return $elapse;
}
function nohtag($str){
$re = $str;
$re = str_replace('"','“',$re);
$re = str_replace('"','“',$re);
$re = str_replace("'",'‘',$re);
没有合适的资源?快使用搜索试试~ 我知道了~
[影音娱乐]522QQ在线电视直播程序 v1.1_idcfree.zip源码PHP项目源代码下载
共145个文件
jpg:33个
php:32个
js:28个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 186 浏览量
2022-03-16
04:07:30
上传
评论
收藏 372KB ZIP 举报
温馨提示
[影音娱乐]522QQ在线电视直播程序 v1.1_idcfree.zip源码PHP项目源代码下载[影音娱乐]522QQ在线电视直播程序 v1.1_idcfree.zip源码PHP项目源代码下载 1.适合个人搭建网站项目参考 2.适合学生毕业设计搭建网站参考 3.适合小公司搭建网站项目参考
资源推荐
资源详情
资源评论
收起资源包目录
[影音娱乐]522QQ在线电视直播程序 v1.1_idcfree.zip源码PHP项目源代码下载 (145个子文件)
css.css 3KB
css.css 3KB
css.css 3KB
Thumbs.db 98KB
Thumbs.db 19KB
ajax.gif 5KB
tlist.gif 898B
tv.gif 395B
tv.gif 395B
bz.gif 380B
bz.gif 380B
menu_add.gif 79B
j.gif 79B
j.gif 79B
menu_reduce.gif 74B
ja.gif 74B
t_.gif 66B
t_.gif 66B
admin_img.htm 14KB
admin_addzhai.htm 6KB
admin_base_upload.htm 6KB
admin_class.htm 5KB
admin_channel.htm 5KB
admin_doajax.htm 5KB
admin_filter.htm 4KB
admin_menu.htm 3KB
admin_base.htm 3KB
admin_school.htm 3KB
admin_main.htm 3KB
show.htm 2KB
admin_tv.htm 2KB
index.htm 2KB
admin_login.htm 2KB
admin_chtml.htm 2KB
admin_admin.htm 1KB
admin_top.htm 1KB
admin_user.htm 1KB
admin_index.htm 1KB
admin_comment.htm 1KB
admin_gurl.htm 926B
admin_config.htm 741B
head.htm 367B
admin_head.htm 316B
main.html 593B
index.html 38B
sql.html 30B
logo.jpg 7KB
logo.jpg 7KB
bottom.jpg 2KB
bodytbg.jpg 2KB
topbg.jpg 1KB
menuoff.jpg 1KB
hm.jpg 1KB
hm.jpg 1KB
menuon.jpg 905B
m_r1_c1.jpg 441B
m_r1_c1.jpg 441B
bodybg.jpg 430B
ml.jpg 420B
ml.jpg 420B
top_r_r1_c2.jpg 384B
m_r1_c6.jpg 381B
bg.jpg 381B
m_r2_c6.jpg 381B
m_r2_c6.jpg 381B
m_r1_c6.jpg 381B
bg.jpg 381B
top_l_r1_c1.jpg 376B
m_r1_c3.jpg 347B
mt2.jpg 347B
mt2.jpg 347B
m_r1_c3.jpg 347B
top_r_r1_c1.jpg 343B
top_l_r1_c2.jpg 342B
li.jpg 333B
l_m_t.jpg 325B
mt1.jpg 321B
mt1.jpg 321B
topbgt.jpg 313B
prototype_15.js 70KB
prototype_15.js 70KB
prototype_15.js 70KB
day.js 24KB
day.js 24KB
day.js 24KB
imgmain.js 13KB
imgmain.js 13KB
imgmain.js 13KB
pro_city.js 4KB
pro_city.js 4KB
jshelper.js 4KB
jshelper.js 4KB
ajax.js 2KB
ajax.js 2KB
ajax.js 2KB
sys.js 2KB
year.js 1KB
year.js 1KB
sys.js 1KB
sys.js 1KB
共 145 条
- 1
- 2
资源评论
yxkfw
- 粉丝: 76
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功