f (!empty($uidarr)) {
$uids = array();
$update = array();
foreach ($uidarr as $_uid => $n) {
$uids[] = $_uid;
$update[$_uid] = array('articles-' => $n);
'mysql' != $conf['cache']['type'] and cache_delete('user-' . $_uid);
}
user_big_update(array('uid' => $uids), $update);
}
!empty($operate_create) && function_exists('operate_big_insert') and operate_big_insert($operate_create);
return TRUE;
}
// 大数据量容易超时 删除用户时使用,删除主题 回复 栏目统计 附件 全站统计
function well_thread_delete_all_by_uid($uid)
{
// 用户主题数
$user = user_read_cache($uid);
set_time_limit(0);
// 删除所有回复
if ($user['comments']) {
$postist = comment_pid_find_by_uid($uid, 1, $user['comments'], FALSE);
$pidarr = array();
foreach ($postist as $val) {
$pidarr[] = $val['pid'];
}
unset($postist);
!empty($pidarr) and comment_delete_by_pids($pidarr);
}
if ($user['articles']) {
// 如果主题、附件和回复数量太大会超时
$tidlist = thread_tid_find_by_uid($uid, 1, $user['articles'], FALSE, 'tid', array('tid'));
$tidarr = array();
foreach ($tidlist as $val) {
$tidarr[] = $val['tid'];
}
unset($tidlist);
!empty($tidarr) and well_thread_delete_all($tidarr);
}
return TRUE;
}
// 搜索标题
function well_thread_find_by_keyword($keyword, $d = NULL)
{
if (empty($keyword)) return NULL;
$db = $_SERVER['db'];
$d = $d ? $d : $db;
if (!$d) return FALSE;
$threadlist = db_sql_find("SELECT * FROM `{$d->tablepre}website_thread` WHERE subject LIKE '%$keyword%' LIMIT 60;", 'tid', $d);
if ($threadlist) {
$threadlist = arrlist_multisort($threadlist, 'tid', FALSE);
foreach ($threadlist as &$thread) {
well_thread_format($thread);
// 关键词标色
//$thread['subject'] = comment_highlight_keyword($thread['subject'], $keyword);
}
}
return $threadlist;
}
// 查找 最后评论 lastpid
function well_thread_find_lastpid($tid)
{
$arr = comment_pid_read(array('tid' => $tid), array('pid' => -1), array('pid'));
$lastpid = empty($arr) ? 0 : $arr['pid'];
return $lastpid;
}
// 更新最后的 uid
function well_thread_update_last($tid)
{
if (empty($tid)) return FALSE;
$lastpid = well_thread_find_lastpid($tid);
if (empty($lastpid)) return FALSE;
$lastpost = comment_read($lastpid);
if (empty($lastpost)) return FALSE;
$r = well_thread_update($tid, array('lastuid' => $lastpost['uid']));
return $r;
}
function well_thread_maxid()
{
$n = db_maxid('website_thread', 'tid');
return $n;
}
// 主题状态 0:通过 1~9 审核:1待审核 10~19:10退稿 11逻辑删除
function well_thread_format(&$thread)
{
global $gid, $uid, $forumlist;
$conf = _SERVER('conf');
if (empty($thread)) return;
$thread['create_date_fmt'] = humandate($thread['create_date']);
$thread['last_date_fmt'] = humandate($thread['last_date']);
$thread['create_date_fmt_ymd'] = date('Y-m-d', $thread['create_date']);
$thread['last_date_fmt_ymd'] = date('Y-m-d', $thread['last_date']);
$user = user_read_cache($thread['uid']);
$onlinelist = online_user_list_cache();
$user['online_status'] = isset($onlinelist[$user['uid']]) ? 1 : 0;
$thread['username'] = $user['username'];
$thread['user_avatar_url'] = array_value($user, 'avatar_url');
$thread['user'] = user_safe_info($user);
unset($user);
$forum = array_value($forumlist, $thread['fid']);
$thread['forum_name'] = array_value($forum, 'name');
$thread['forum_url'] = array_value($forum, 'url');
if ($thread['last_date'] == $thread['create_date']) {
$thread['last_date_fmt'] = '';
$thread['lastuid'] = 0;
$thread['lastusername'] = '';
} else {
$lastuser = $thread['lastuid'] ? user_read_cache($thread['lastuid']) : array();
$thread['lastusername'] = $thread['lastuid'] ? $lastuser['username'] : lang('guest');
$thread['lastuser'] = $thread['lastuid'] ? user_safe_info($lastuser) : array();
unset($lastuser);
}
$thread['url'] = url('read-' . $thread['tid'], '', FALSE);
if ($conf['url_rewrite_on'] > 1) {
!empty($forum['well_alias']) and $thread['url'] = url(urlencode($forum['well_alias'])."-$thread[create_date]a$thread[tid]", '', FALSE);
} else {
$thread['url'] = url("read-$thread[create_date]a$thread[tid]", '', FALSE);
}
$thread['user_url'] = url('user-' . $thread['uid']);
$thread['sticky_class'] = '';
if ($thread['sticky'] > 0) {
if (1 == $thread['sticky']) {
$thread['sticky_class'] = 'success';
} elseif (2 == $thread['sticky']) {
$thread['sticky_class'] = 'warning';
} elseif (3 == $thread['sticky']) {
$thread['sticky_class'] = 'danger';
}
}
$nopic = view_path() . 'img/nopic.png';
if ($thread['icon']) {
$attach_dir_save_rule = array_value($conf, 'attach_dir_save_rule', 'Ym');
$day = date($attach_dir_save_rule, $thread['icon']);
$thread_format_icon_default = 1;
if (1 == $thread_format_icon_default) {
// 本地文件绝对路径
$destfile = $conf['upload_path'] . 'thumbnail/' . $day . '/' . $thread['uid'] . '_' . $thread['tid'] . '_' . $thread['icon'] . '.jpeg';
// 本地
$thread['icon_fmt'] = is_file($destfile) ? file_path($thread['attach_on']) . 'thumbnail/' . $day . '/' . $thread['uid'] . '_' . $thread['tid'] . '_' . $thread['icon'] . '.jpeg' : $nopic;
if (1 == $conf['attach_on'] && 1 == $thread['attach_on']) {
// 云储存
$thread['icon_fmt'] = file_path($thread['attach_on']) . 'thumbnail/' . $day . '/' . $thread['uid'] . '_' . $thread['tid'] . '_' . $thread['icon'] . '.jpeg';
} elseif (2 == $conf['attach_on'] && 2 == $thread['attach_on']) {
// 图床 未上传成功 本地图片在的话使用本地,不在则默认
$thread['icon_fmt'] = $thread['image_url'] ? $thread['image_url'] : $thread['icon_fmt'];
}
}
} else {
$thread['icon_fmt'] = $nopic;
}
// 回复页面
$thread['pages'] = ceil($thread['posts'] / $conf['comment_pagesize']);
$thread['tag_fmt'] = $thread['tag'] ? xn_json_decode($thread['tag']) : '';
// 权限判断
$thread['allowupdate'] = ($uid == $thread['uid']) || forum_access_mod($thread['fid'], $gid, 'allowupdate');
$thread['allowdelete'] = (group_access($gid, 'allowuserdelete') and $uid == $thread['uid']) || forum_access_mod($thread['fid'], $gid, 'allowdelete');
$thread['allowtop'] = forum_access_mod($thread['fid'], $gid, 'allowtop');
$thread = well_thread_safe_info($thread);
}
function well_thread_format_last_date(&$thread)
{
if ($thread['last_date'] != $thread['create_date']) {
$thread['last_date_fmt'] = humandate($thread['last_date']);
} else {
$thread['create_date_fmt'] = humandate($thread['create_date']);
}
}
// 对 $threadlist 权限过滤
function well_thread_list_access_filter(&$threadlist, $gid)
{
global $forumlist;
if (empty($threadlist)) return NULL;
foreach ($threadlist as $tid => $thread) {
if (empty($forumlist[$thread['fid']]['accesson'])) continue;
if ($thread['sticky'] > 0) continue;
if (!forum_access_user($thread['fid'], $gid, 'allowread')) {
unset($threadlist[$tid]);
}
}
}
function well_thread_safe_info($thread)
{
unset($thread['userip'], $thread['user']['threads'], $thread['user']['posts'], $thread['user']['credits'], $thread['user']['golds'], $thread['user']['money']);
empty($thread['user']) || $thread['user'] = user_safe_info($thread['user']);
return $thread;
}
// 过滤安全数据
function well_thread_filter(&$val)
{
unset($val['userip'], $val['fid'], $val['flagid'], $val['type'], $val['user'], $val['create_date']);
}
//------------------------ 其他方法 ------------------------
// 集合主题tid,统一拉取,避免多次查询thread表
function thread_unified_pull($arr)
{
global $gid, $fid;
$stickylist = array_value($arr, 'stickylist', array());
$tidlist = array_value($arr, 'tidlist', array());
//$fid = array_value($arr, 'fid');
// 合并过滤空数组
//$tidlist = array_filter($stickylist + $tidlist);
$tidarrlist = $tidlist = $stickylist + $tidlist;
// 版块自定义
list($flaglist, $flagtids) = flag_thread_by_fid($fid);
empty($flagtids) || $tidarrlist += $flagtids;
unset($flagtids);
// 在这之前合并所有二维数组 tid值为键/array('tid值' => tid值)
$tidarr = empty($tidarrlist) ? array() : arrlist_values($tidarrlist, 'tid');
// 在这之前使用array_merge()前合并所有一维数组 tid/array(1,2,3)
if (empty($tidarr)) return NULL;
$tidarr = array_unique($tidarr);
// 主题相关统一遍历后再归类
$arrlist = well_thread_find($tidarr, count($tidarr));
// 过滤没有权限访问的主题 / filter no permission thread
well_thread_list_access_filter($arrlist, $gid);
$threadlist = array();
foreach ($arrlist as $_tid => &$_thread) {
$_thread = well_thread_safe_info($_thread);
// 归类列表数据
isset($tidlist[$_thread['tid']]) and $threadlist[$_tid] = $_thread;
// flag thread
if (!empty($flaglist)) {
foreach ($flaglist as $key => $val) {
if (isset($val['tids']) && in_array($_thread['tid'], $val['tids'])) {
$flaglist[$key]['list'][array_search($_thread['tid'], $val['tids'])] = $_thread;
ksort($flaglist[$key]['list']);
}
}
}
}
// 按之前tidlist排序
$threadlist = array2_sort_key($threadlist, $tidlist, 'tid');
unset($arrlist, $tidlist);
$arr = array('threadlist' => $threadlist, 'flaglist' => $flaglist);
return $arr;
}
// read.php 详情页其他主题调用,集合tid统一拉取数据,最后归类
function thread_other_pull($thread)
{
global $forumlist, $gid;
$fid = array_value($thread, 'fid');
$forum = array_value($forumlist, $fid);
if (empty($forum)) return NULL;
//$tid = array_value($thread, 'tid');
//$tag_fmt = array_value($thread, 'tag_fmt');
$arrlist = array();
$tidlist = array();
// 版块自定义
list($flaglist, $flagtids) = flag_thread_by_fid($fid);
empty($flagtids) || $tidlist += $flagtids;
unset($flagtids);
// 在这之前合并所有二维数组 tid值为键/array('tid值' => tid值)
$tidarr = empty($tidlist) ? array() : arrlist_values($tidlist, 'tid');
// 在这之前使用array_merge()前合并所有一维数组 tid/array(1,2,3)
if (empty($tidarr)) return NULL;
$tidarr = array_unique($tidarr);
// 主题相关统一遍历后再归类
$threadlist = well_thread_find($tidarr, count($tidarr));
// 过滤没有权限访问的主题 / filter no permission thread
well_thread_list_access_filter($threadlist, $gid);
foreach ($threadlist as &$_thread) {
$_thread = well_thread_safe_info($_thread);
// flag thread
if (!empty($flaglist)) {
foreach ($flaglist as $key => $val) {
if (isset($val['tids']) && in_array($_thread['tid'], $val['tids'])) {
$flaglist[$key]['list'][array_search($_thread['tid'], $val['tids'])] = $_thread;
ksort($flaglist[$key]['list']);
}
}
}
}
unset($threadlist);
if (!empty($flaglist)) {
foreach ($flaglist as &$val) {
$i = 0;
if (!isset($val['list'])) continue;
foreach ($val['list'] as &$v) {
++$i;
$v['i'] = $i;
}
}
$arrlist['flaglist'] = $flaglist;
unset($flaglist);
}
return $arrlist;
}
//--------------------------cache--------------------------
// 已格式化 从缓存中读取,避免重复从数据库取数据
function well_thread_read_cache($tid)
{
global $conf;
$key = 'website_thread_' . $tid;
static $cache = array(); // 用静态变量只能在当前 request 生命周期缓存,跨进程需要再加一层缓存:redis/memcached/xcache/apc
if (isset($cache[$key])) return $cache[$key];
if ('mysql' == $conf['cache']['type']) {
$r = well_thread_read($tid);
} else {
$r = cache_get($key);
if (NULL === $r) {
$r = well_thread_read($tid);
$r and cache_set($key, $r, 1800);
}
}
$cache[$key] = $r ? $r : NULL;
return $cache[$key];
}
?>
电脑运行速度变慢的十大原因编程频道|福州电脑网
电脑运行速度变慢的十大原因
系统教程560
更新时间:2026-04-10 02:37:27 2024年1月27日发(作者:)
百度文库
电脑运行速度变慢的十大原因
1、在开机时加载太多程序
2、桌面上开启桌布
3、没有定期清理硬磁盘和重组硬磁盘
以下的,我就会很详细地说明一下如何加速计算机和令计算机慢的病征!解决七大常见影响计算机表现的原凶当计算机忽然慢下来时,你可能会怀疑自己是否做错了甚么而引致损害了计算机?其实不必太介怀,因为一个小小改变,都可能会影响到计算机运作表现,而且在使用计算机的过程中,无可避免地都会引起各种些微的改变。任何问题总有方法可以解决的,就让我细细道出七大常见影响计算机表现的原因,解决了它们之后,便可以安心享用计算机的高性能。
4、删除常驻程序
何谓常驻程序呢?常驻程序就是在开机时加载的程序,而那些程序就叫做常驻程序。常驻程序不但拖慢开机时的速度,而且更快地消耗计算机资源以及内存,但你可能会问:那些程序全都有用的耶!那我可以答你的就是:你想要那些有用的程序来牺牲速度,还是不要那些程序来回复速度呢?自己想一想吧!一般来说,如果想删除常驻程序,可去"启动"清单中删除,但如果想详细些,例如是icq、popkiller 之类的软件,是不能在"启动"清单中删除的,要去"附属应用程序",然后去 "系统工具",再去"系统信息",进去后,按上方工具列的"工具",再按"系统组态编辑程序",进去后,在"启动"的对话框中,就会详细列出在启动电脑时加载的常驻程序了!
5、桌面上不要摆放桌布和关闭activedesktop
不知大家有否留意到,我们平时一直摆放在桌面的桌布,其实是很浪费计算机资源的!不但如此,而且还拖慢计算机在执行应用程序时的速度!本想美化桌面,但又拖慢计算机的速度,在这时,你是否会有一种"不知怎样"的感觉呢?还有一点,不知大家有否试过,就是当开启桌布时,每逢关闭一个放到最大的窗口时,窗口总是会由上而下、慢慢、慢慢地落,如果有这种情况出现,你必须关闭桌布!方法是:在桌面上按鼠标右键,再按内容,然后在"背景"的对话框中,选"无",建议在"外观"的对话框中,在桌面预设的青绿色,改为黑色......至于关闭activedesktop,即是叫你关闭从桌面上的web画面,例如在桌面上按鼠标右键,再按内容,然后在"背景"的对话框中,有一幅桌布,名为windows98,那副就是web画面了!所以千万不要开启。依我所说,布只可拿四个字来形容,就是"红颜祸水"!
6、删除一些不必要的字型
系统运行得慢的其中一个原因,就是字型多少的关系!安装的字型愈多,就占用愈多的内存,从而拖慢计算机的速度!所以我们要删除一些不必要的字型。要删除一些不必要的字型,你可到控制台,再进去一个叫"字型"的数据夹,便可删除字型,但,要怎样才知道,那些字有用,那些字没用呢?例如:如果你不常到
ms_dos模式的话,就删除dos 字型!因为各个人都可能喜爱某种字型,所以我也不能确定要删除那些 字型,不过我在此,有个秘决教你,如果你有华康粗黑字型,且又有新 细明体的字型,建议你删除华康粗黑字型,如果你有新细明体,且又有细明体,就删除细明体吧!
1
百度文库
7、定期重组硬磁盘
计算机硬盘中最细小的单位是扇区,一个档案通常会占用若干扇区,每当硬盘用久了,无数次的新增、更改和删除档案后,就会造成很多断断续续的扇区,因而非连续性的档案便会愈来愈多,硬盘磁头便需要花更多时间跳来跳去来读取数据,这就导致硬盘速度减慢。有见及此,windows才会有"重组磁盘"出现。只要执行"重组磁盘",所有非连续性的档案都会被重新编排得整整齐齐,至于执行时间,大约一星期左右执行一次便可了。
8、设定虚拟内存
硬盘中有一个很宠大的数据交换文件,它是系统预留给虚拟内存作暂存的地方,很多应用程序都经常会使用到,所以系统需要经常对主存储器作大量的数据存取,因此存取这个档案的速度便构成影响计算机快慢的非常重要因素!一般win98预设的是由系统自行管理虚拟内存,它会因应不同程序所需而自 动调校交换档的大小,但这样的变大缩小会给系统带来额外的负担 ,令系统运作变慢!有见及此,用家最好自定虚拟内存的最小值和最大值,避免经常变换大小。要设定虚拟内存,在"我的计算机"中按右键,再按内容,到"效能"的对话框中,按"虚拟内存",然后选择"让自已设定虚拟内存设定值",设定"最小值"为64,因为我的计算机是32mbram,所以我就设定为64,即是说,如果你的内存是64mbram,那在"最小值"中,就设为128。顺带一提,在"效能"的对话框中,选择"档案",将原先设定的" 桌上型计算机",改为"网络服务器",是会加快系统运作的;还有,在"磁盘"的对话框中,不要选"每次开机都搜寻新的磁盘驱动器",是会加快开机速度的!
9、更改开机时的设定
虽然你已知道了如何新增和移除一些常驻程序,但你又知不知道,在开机至到进入win98的那段时间,计算机在做着什么呢?又或者是,执行着什么程序呢?那些程序,必定要全部载完才开始进入win98,你有否想过,如果可删除一些不必要的开机时的程序,开机时的速度会否加快呢?答案是会的!想要修改,可按"开始",选"执行",然后键入,开启后,可以把以下各段落的内容删除,是删内容,千万不要连标题也删除!它们包括:[compatibility]、[compatibility32]、[imecompatibility]、[compatibility95]、[modulecompatibility]和。
10、彻底删除程序
大家都知道,如果想移除某些程序,可到"新增/移除程序"中移除,但大家又知不知道,它只会帮你移除程序,而不会帮你移除该程序的注册码和一些登录项目呢?这不是win98蠢,而是它在这方面不够专业,要彻底删除程序,要找回些"专业"删除软件来移除才成事!先前symantec公司出品的nortonuninstall(以下简称为nud),因为有某部份破坏了某些删除软件的版权,故此全世界已停止出售,正因如此,symantec才出了cleansweep(以下简称为cs),不过论功能上,还是nud更胜一寿!言归正传,其实除了这两个软件外,还有很多同类软件都能有效地移除程序,既然nud已绝版,那我就说cs吧。下载并安装后,如果你想移除程序,只要用cs来移除,它便会一拼移除该程序的登录项目和注册码!我在此帮"新增/移除程序"改了个别名,就是"新增垃圾、移除程序"!垃圾是指被遗弃的登录项目和注册码,程序就是程序啰!
2
本文发布于:2024-01-27,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:程序计算机速度删除系统
发布评论