<?php
if (!defined('ROOT'))
exit('Access Denied');
function upcache($type = '', $f = '', $where = '')
{
if ($type == 'table')
{
@unlink('./cache/data/' . md5($f . $where) . '.php');
} else
if ($type == 'user')
{
@unlink('./cache/users/uid_' . floor($f / 10000) . '/' . $f . '.php');
} else
if ($type == 'users')
{
delete_files('./cache/users',true);
write_file('./cache/users/index.html',0);
} else
if ($type == 'data')
{
delete_files('./cache/data');
write_file('./cache/data/index.html',0);
}else
if ($type == 'file')
{
@unlink('./cache/data/' . md5($f) . '.php');
} else
if ($type == 'tpl')
{
delete_files('./cache/templates');
write_file('./cache/templates/index.html',0);
} else
if ($type == 'line')
{
delete_files('./cache/onlines');
write_file('./cache/onlines/index.html',0);
} else
{
@unlink('./cache/data/Fighting!');
@unlink('./cache/data/' . md5('center_config') . '.php');
}
}
function getuser($uu, $pw = '', $line = false)
{
$uu == '' && $uu = 0;
if (!preg_match("/^[0-9]+$/is", $uu))
{
$db = db::getinstance();
$row = $db->fetch_first("select * from " . PF . "center_users where name='$uu'");
$uid = $row ? $row['uid'] : 0;
} else
$uid = $uu;
$user = array();
$data = $uid == 0 ? false : (isset($row) ? $row : read_user($uid, $pw == '' ? 0 :
15));
if ($data === false || ($pw <> '' && md5($_SERVER['HTTP_USER_AGENT'] . $data['password']) !=
$pw))
{
$user['uid'] = 0;
$user['level'] = -1;
$user['captcha'] = true;
$user['name'] = 'Guest';
} else
{
$user = $data;
$user['level'] = level($user);
$user['captcha'] = (empty($GLOBALS['conf']['center'][11]) || $GLOBALS['conf']['center'][11] >
$user['postnum']) ? true : false;
}
$user['ip'] = ip();
if ($user['blank'] > 1 && $user['blank'] < SYSTIME)
{
$db = db::getinstance();
$db->query("update " . PF . "center_users set blank=0 where uid='$user[uid]'");
$user['blank'] = 0;
upcache('user', $user['uid']);
}
if ($line)
{
$db = db::getinstance();
if ($user['uid'] > 0)
{
(SYSTIME - $user['lasttime']) > 300 && $db->query("update " . PF .
"center_users set lasttime='" . SYSTIME . "',lastip='" . $user['ip'] .
"' where uid='$user[uid]'");
} else
{
gline(substr(md5($_SERVER['HTTP_USER_AGENT'] . $user['ip']), 0, 5), $user['ip']);
}
}
return $user;
}
function gline($gid, $ip, $e = 15)
{
$file = './cache/onlines/' . $gid . '.php';
$filemtime = @filemtime($file);
if (false == $filemtime || $filemtime < CACHETIME || ($filemtime + $e) <
FILETIME)
{
$db = db::getinstance();
if (false === ($row = $db->fetch_first("select * from " . PF .
"center_gonline where gid='$gid'")))
{
$db->query("insert into " . PF . "center_gonline (gid,ip,lasttime) values('$gid','$ip','" .
SYSTIME . "')");
} else
{
$db->query("update " . PF . "center_gonline set ip='$ip',lasttime='" . SYSTIME .
"' where gid='$gid'");
}
write_file($file, 0);
}
}
function getadmin($uid, $pw)
{
$db = db::getinstance();
$uid = (int)$uid;
$user = array();
$row = $db->fetch_first("select * from " . PF . "admin_users where uid='$uid'");
if ($row && md5($_SERVER['HTTP_USER_AGENT'] . $row['password']) == $pw)
{
$user = $row;
$user['level'] = 0;
} else
{
$user['uid'] = 0;
$user['level'] = -1;
$user['name'] = 'Guest';
}
return $user;
}
function level($user)
{
$data = read_table('center_level');
$al = maxlevel($data['a'], $user['a']);
$bl = maxlevel($data['b'], $user['b']);
$cl = maxlevel($data['c'], $user['c']);
$dl = maxlevel($data['d'], $user['d']);
$pl = maxlevel($data['p'], $user['postnum']);
return min($al, $bl, $cl, $dl, $pl);
}
function maxlevel($array, $cval)
{
$max = count($array);
for ($j = $max; $j > 0 && $cval < $array['v' . $j]; $j--)
;
return $j;
}
function template($mod, $file)
{
$_file = './cache/templates/' . $mod . '_' . TPL . '_' . $file . '.php';
if (false === ($filemtime = @filemtime($_file)) || $filemtime < CACHETIME ||
DEBUG)
{
//exit;
call_func('tpl');
tpl($mod, $file);
}
return file_exists($_file) ? $_file : exit;
}
function call_class($name, $public = false)
{
static $f = array();
if (isset($f[$name]))
return true;
if ($leng = strpos($name, '_'))
{
$path = './' . substr($name, 0, $leng) . '/include/class_' . $name . '.php';
} else
{
$path = './include/class_' . $name . '.php';
}
if (file_exists($path))
{
$f[$name] = true;
include $path;
} else
return false;
}
function call_func($name)
{
static $f = array();
if (isset($f[$name]))
return true;
if ($leng = strpos($name, '_'))
{
$path = './' . substr($name, 0, $leng) . '/include/func_' . $name . '.php';
} else
{
$path = './include/func_' . $name . '.php';
}
if (file_exists($path))
{
$f[$name] = true;
include $path;
return true;
} else
return false;
}
function read_user($uid, $e = 0)
{
$dir = './cache/users/uid_' . floor($uid / 10000);
$file = $dir . '/' . $uid . '.php';
if (false == ($filemtime = @filemtime($file)) || (defined('CACHETIME') && $filemtime <
CACHETIME) || ($e > 0 && ($filemtime + $e) < FILETIME))
{
$db = db::getinstance();
if (false === ($row = $db->fetch_first("select * from " . PF .
"center_users where uid='$uid'")))
return false;
if (!is_dir($dir))
{
if (@mkdir($dir, 0777) == false)
e('无法创建缓存目录');
write_file($dir . '/index.html', '0');
}
write_file($file, serialize($row));
return $row;
}
return unserialize(read_file($file));
}
function read_config($table)
{
$file = './cache/data/' . md5($table) . '.php';
$filemtime = @filemtime($file);
if (false == $filemtime || (defined('CACHETIME') && $filemtime < CACHETIME))
{
$db = db::getinstance();
$_a = array();
$result = $db->query('select * from ' . PF . $table);
while ($data = $db->fetch_array($result))
{
$_a[$data['id']] = $data['value'];
}
$_a = count($_a) > 0 ? $_a : false;
write_file($file, serialize($_a));
return $_a;
}
return unserialize(read_file($file));
}
function read_table($table, $where = '', $e = 0)
{
$file = './cache/data/' . md5($table . $where) . '.php';
$filemtime = @filemtime($file);
if (false == $filemtime || $filemtime < CACHETIME || ($e > 0 && ($filemtime + $e) <
FILETIME))
{
$db = db::getinstance();
$data = $db->result_cache('select * from ' . PF . $table . ' ' . $where);
write_file($file, serialize($data));
return $data;
}
return unserialize(read_file($file));
}
functi
没有合适的资源?快使用搜索试试~ 我知道了~
PHP实例开发源码-hutula2 php 个人建站系统.zip
共657个文件
php:298个
gif:172个
html:89个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 4 浏览量
2022-11-21
09:33:15
上传
评论
收藏 1.34MB ZIP 举报
温馨提示
PHP实例开发源码—hutula2 php 个人建站系统.zip PHP实例开发源码—hutula2 php 个人建站系统.zip PHP实例开发源码—hutula2 php 个人建站系统.zip
资源推荐
资源详情
资源评论
收起资源包目录
PHP实例开发源码-hutula2 php 个人建站系统.zip (657个子文件)
screen.css 26KB
editor.css 5KB
thickbox.css 3KB
jquery.tabs.css 3KB
ie.css 3KB
jquery.jgrowl.ie6.css 2KB
jquery.jgrowl.css 1KB
print.css 1KB
ubbeditor.css 1KB
jquery.tabs-ie.css 541B
box_screen.css 87B
box_frame.dwt 2KB
frame.dwt 1KB
4.gif 80KB
2.gif 28KB
3.gif 28KB
1.gif 28KB
5.gif 28KB
0.gif 28KB
em30.gif 13KB
em38.gif 13KB
em36.gif 10KB
em11.gif 8KB
em12.gif 8KB
em4.gif 8KB
em27.gif 7KB
em45.gif 6KB
loadingAnimation.gif 6KB
em23.gif 6KB
bg_syndicate.gif 5KB
em26.gif 5KB
em42.gif 5KB
em41.gif 5KB
em55.gif 5KB
editor-icon.gif 4KB
em39.gif 4KB
em28.gif 4KB
em20.gif 4KB
em7.gif 4KB
em53.gif 4KB
em48.gif 4KB
em3.gif 4KB
em43.gif 4KB
em52.gif 3KB
web-4.gif 3KB
web-4.gif 3KB
web-4.gif 3KB
em60.gif 3KB
em37.gif 3KB
em10.gif 3KB
em66.gif 3KB
em22.gif 3KB
bg_profile.gif 3KB
web-5.gif 3KB
web-5.gif 3KB
web-5.gif 3KB
em47.gif 3KB
em16.gif 3KB
em21.gif 3KB
web-3.gif 3KB
web-3.gif 3KB
web-3.gif 3KB
web-8.gif 3KB
web-8.gif 3KB
web-8.gif 3KB
web-6.gif 3KB
web-6.gif 3KB
web-6.gif 3KB
loading.gif 2KB
em19.gif 2KB
em51.gif 2KB
em18.gif 2KB
em5.gif 2KB
em29.gif 2KB
em64.gif 2KB
em50.gif 2KB
em35.gif 2KB
em17.gif 2KB
em46.gif 2KB
em15.gif 2KB
em24.gif 2KB
em1.gif 2KB
em14.gif 2KB
em13.gif 2KB
em34.gif 2KB
em25.gif 2KB
em44.gif 2KB
em6.gif 2KB
em33.gif 2KB
bg_foot_ul.gif 2KB
em59.gif 2KB
em57.gif 2KB
em2.gif 2KB
em61.gif 2KB
bg_blockquote2.gif 2KB
em40.gif 2KB
em8.gif 2KB
em63.gif 2KB
em58.gif 2KB
em56.gif 2KB
共 657 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
毕业_设计
- 粉丝: 1935
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- keil2 + proteus + 8051.exe
- 1961ee27df03bd4595d28e24b00dde4e_744c805f7e4fb4d40fa3f695bfbab035_8(1).c
- mediapipe-0.9.0.1-cp37-cp37m-win-amd64.whl.zip
- windows注册表编辑工具
- mediapipe-0.9.0.1-cp37-cp37m-win-amd64.whl.zip
- 校园通行码预约管理系统20240522075502
- 车类型数据集6250张VOC+YOLO格式.zip
- The PyTorch implementation of STGCN.STGCN-main.zip
- 092300108.cpp
- 车类型数据集6000张VOC+YOLO格式.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功