n $r; } // 版块版主权限判断: allowtop, allowmove, allowupdate, allowdelete, allowbanuser, allowviewip, allowdeleteuser function forum_access_mod($fid, $gid, $access) { global $grouplist, $forumlist, $uid; // 结果缓存,加速判断! static $result = array(); $k = $fid . '-' . $gid . '-' . $access; if (isset($result[$k])) return $result[$k]; if (1 == $gid || 2 == $gid) return TRUE; // 管理员有所有权限 if (3 == $gid || 4 == $gid) { $group = $grouplist[$gid]; $forum = $forumlist[$fid]; $r = !empty($group[$access]) && in_string($uid, $forum['moduids']); } else { $r = FALSE; } $result[$k] = $r; return $r; } function forum_is_mod($fid, $gid, $uid) { global $grouplist, $forumlist; if (1 == $gid || 2 == $gid) return TRUE; // 管理员有所有权限 if (3 == $gid || 4 == $gid) { if (0 == $fid) return TRUE; // 此处不严谨! $group = $grouplist[$gid]; $forum = $forumlist[$fid]; return in_string($uid, $forum['moduids']); } return FALSE; } // ------------> 其他方法 function forum_access_format(&$access) { if (empty($access)) return; } function forum_access_count($cond = array()) { $n = db_count('forum_access', $cond); return $n; } ?> !empty($attach) and attach_big_insert($attach); $attachlist = $imagelist = $filelist = ''; $images = 0; $files = 0; // 处理不在 message 中的图片,删除掉没有插入的附件 if ($message) { // 只有评论会传pid list($attachlist, $imagelist, $filelist) = $pid ? well_attach_find_by_pid($pid) : well_attach_find_by_tid($tid); if (!empty($imagelist)) { $aids = array(); foreach ($imagelist as $key => $attach) { $image_url = $conf['upload_url'] . 'website_attach/' . $attach['filename']; if (FALSE === strpos($message, $image_url)) { unset($attachlist[$attach['aid']], $imagelist[$attach['aid']]); $aids[] = $attach['aid']; $path = $conf['upload_path'] . 'website_attach/' . $attach['filename']; is_file($path) and unlink($path); // 删除云储存文件 } } !empty($aids) and well_attach__delete($aids); } $images = count($imagelist); $files = count($filelist); } $return += array('tid' => $tid, 'pid' => $pid, 'icon' => $icon, 'message' => $message, 'images' => $images, 'files' => $files); return $return; } // 关联内容中的文件,逐渐放弃使用该函数,使用 well_attach_assoc_handle() function well_attach_assoc_file($arr = array()) { global $conf, $time; $uid = array_value($arr, 'uid', 0); $tid = array_value($arr, 'tid', 0); $post_create = array_value($arr, 'post_create', 0); // 创建回复 $pid = array_value($arr, 'pid', 0); $images = array_value($arr, 'images', 0); $files = array_value($arr, 'files', 0); $message = array_value($arr, 'message'); if (!$tid && !$pid) return $message; $attach_dir_save_rule = array_value($conf, 'attach_dir_save_rule', 'Ym'); $day = date($attach_dir_save_rule, $time); $path = $conf['upload_path'] . 'website_attach/' . $day; $url = $conf['upload_url'] . 'website_attach/' . $day; is_dir($path) || mkdir($path, 0777, TRUE); if (!empty($arr['sess_tmp_files'])) { $message = urldecode($message); preg_match_all('#]+src="(.*?)"#i', $message, $match); $localurlarr = array( 'http://' . $_SERVER['SERVER_NAME'] . '/', 'https://' . $_SERVER['SERVER_NAME'] . '/', ); // 跳过云储存 $conf['cloud_url'] and $localurlarr[] = $conf['cloud_url']; /*$match[1] Array ( [0] => https://nimg.ws.126.net/?url=http://dingyue.ws.126.net/2021/1109/d3321a58j00r29xq20013c000hk00h4g.jpg&thumbnail=650x2147483647&quality=80&type=jpg [1] => https://nimg.ws.126.net/?url=http://dingyue.ws.126.net/2021/1109/e4974b87j00r29xq30013c000fi00i3g.jpg&thumbnail=650x2147483647&quality=80&type=jpg [2] => upload/tmp/1_KAUXKFMJHFTUMNS.jpg [3] => https://nimg.ws.126.net/?url=http://dingyue.ws.126.net/2021/1109/5a7be552j00r29xq3001qc000hs00hvg.jpg&thumbnail=650x2147483647&quality=80&type=jpg )*/ $upload_arr = array(); $http_arr = array(); if (!empty($match[1])) { foreach ($match[1] as $_url) { foreach ($localurlarr as $localurl) { if ($localurl == substr($_url, 0, strlen($localurl))) continue 2; } if (substr($_url, 0, 7) == 'http://' || substr($_url, 0, 8) == 'https://') { $http_arr[] = $_url; } elseif (substr($_url, 0, 11) == 'upload/tmp/' || substr($_url, 0, 12) == '/upload/tmp/' || substr($_url, 0, 14) == '../upload/tmp/') { $upload_arr[] = $_url; } } } $attach = array(); foreach ($arr['sess_tmp_files'] as $file) { // 过滤非内容图,不包括附件 if (!in_array($file['url'], $upload_arr) && 0 != $file['isimage']) { unlink($file['path']); continue; } // 后台提交的内容需要替换掉../ $file['url'] = $file['backstage'] ? str_replace('../upload/', 'upload/', $file['url']) : str_replace('/upload/', 'upload/', $file['url']); // 内容附件 将文件移动到 upload/website_attach 目录 $filename = file_name($file['url']); // 绝对路径 $destfile = $path . '/' . $filename; // 相对路径 $desturl = $url . '/' . $filename; // 复制 xn_copy($file['path'], $destfile) || xn_log("xn_copy($file[path]), $destfile) failed, tid:$tid, pid:$pid", 'php_error'); if (is_file($destfile) && filesize($destfile) == filesize($file['path'])) unlink($file['path']); // 按照$destfile文件路径,上传至云储存或图床,返回数据.附件分离,最优方案是redis队列,单独写上传云储存php文件,nohup后台运行,将队列数据上传云储存,然后根据aid更新附件表attach_on、image_url自动,根据tid更新主题表attach_on。关联附件上传云储存,有可能导致超时。 $attacharr = array( /*'tid' => $tid, 'pid' => $pid,*/ 'uid' => $uid, 'filesize' => $file['filesize'], 'width' => $file['width'], 'height' => $file['height'], 'filename' => $day . '/' . $filename, 'orgfilename' => $file['orgfilename'], //'image_url' => '', // 图床文件完整网址 'filetype' => $file['filetype'], 'create_date' => $time, 'isimage' => $file['isimage'] ); $tid and $attacharr += $pid ? array('pid' => $pid) : array('tid' => $tid); $attach[] = $attacharr; // 关联内容再入库 //$aid = well_attach_create($attach); $file['backstage'] and $message = str_replace('../upload/', 'upload/', $message); $message = str_replace($file['url'], $desturl, $message); } !empty($attach) and attach_big_insert($attach); // 清空 session $_SESSION['tmp_website_files'] = array(); } // 更新附件数 $update = array(); $_images = 0; $_files = 0; // 处理不在 message 中的图片,删除掉没有插入的图片附件 if ($message) { // 只有评论会传pid list($attachlist, $imagelist, $filelist) = $pid ? well_attach_find_by_pid($pid) : well_attach_find_by_tid($tid); if (!empty($imagelist)) { $aids = array(); foreach ($imagelist as $key => $attach) { $url = $conf['upload_url'] . 'website_attach/' . $attach['filename']; if (FALSE === strpos($message, $url)) { unset($attachlist[$attach['aid']], $imagelist[$attach['aid']]); $aids[] = $attach['aid']; $path = $conf['upload_path'] . 'website_attach/' . $attach['filename']; is_file($path) and unlink($path); // 删除云储存文件 } } !empty($aids) and well_attach__delete($aids); } $_images = count($imagelist); $images != $_images and $update['images'] = $_images; $_files = count($filelist); $files != $_files and $update['files'] = $_files; } if (empty($update)) return $pid ? array($message, $_images, $_files) : $message; if ($pid) { if ($post_create) { $update['message'] = $message; comment__update($pid, $update); } else { // 编辑回复返回的数据 return array($message, $_images, $_files); } } else { well_thread_update($tid, $update); } return $message; } // thumbnail:主题主图 post:内容图片或附件 function well_attach_assoc_type($type) { switch ($type) { case 'thumbnail': $k = 'tmp_thumbnail'; break; case 'post': $k = 'tmp_website_files'; break; default: return NULL; break; } $sess_tmp_files = _SESSION($k); // 如果session中没有,从数据库中获取储存的session //if (empty($sess_tmp_files) && preg_match('#' . $k . '\|(a\:1\:\{.*\})#', _SESSION('data'), $matches)) $sess_tmp_files = unserialize(str_replace(array('+', '='), array('_', '.'), $matches['1'])); return $sess_tmp_files; } // Create thumbnail function well_attach_create_thumbnail($arr) { global $conf, $time, $forumlist, $config; $uid = array_value($arr, 'uid', 0); $tid = array_value($arr, 'tid', 0); $fid = array_value($arr, 'fid', 0); $forum = array_value($forumlist, $fid); $picture = $config['picture_size']; $picture = isset($forum['thumbnail']) ? $forum['thumbnail'] : $picture['picture_size']; $pic_width = $picture['width']; $pic_height = $picture['height']; $attachlist = well_attach_assoc_type('post'); if (empty($attachlist)) return; $attach_dir_save_rule = array_value($conf, 'attach_dir_save_rule', 'Ym'); $day = date($attach_dir_save_rule, $time); $path = $conf['upload_path'] . 'thumbnail/' . $day; is_dir($path) || mkdir($path, 0777, TRUE); $tmp_file = $conf['upload_path'] . 'tmp/' . $uid . '_' . $tid . '_' . $time . '.jpeg'; $i = 0; foreach ($attachlist as $val) { ++$i; if (1 == $val['isimage'] && 1 == $i) { 'clip' == array_value($conf, 'upload_resize', 'clip') ? well_image_clip_thumb($val['path'], $tmp_file, $pic_width, $pic_height) : well_image_thumb($val['path'], $tmp_file, $pic_width, $pic_height); break; } } $destfile = $path . '/' . $uid . '_' . $tid . '_' . $time . '.jpeg'; xn_copy($tmp_file, $destfile) || xn_log("xn_copy($tmp_file), $destfile) failed, tid:$tid", 'php_error'); } function well_save_remote_image($arr) { global $conf, $time, $forumlist, $config; $message = array_value($arr, 'message'); $tid = array_value($arr, 'tid', 0); $fid = array_value($arr, 'fid', 0); $uid = array_value($arr, 'uid', 0); $thumbnail = array_value($arr, 'thumbnail', 0); $save_image = array_value($arr, 'save_image', 0); $attach_dir_save_rule = array_value($conf, 'attach_dir_save_rule', 'Ym'); $day = date($attach_dir_save_rule, $time); $attach_dir = $conf['upload_path'] . 'website_attach/' . $day . '/'; $attach_url = $conf['upload_url'] . 'website_attach/' . $day . '/'; is_dir($attach_dir) || mkdir($attach_dir, 0777, TRUE); if ($thumbnail) { $picture = $config['picture_size']; $forum = array_value($forumlist, $fid); $picture = isset($forum['thumbnail']) ? $forum['thumbnail'] : $picture['picture_size']; $pic_width = $picture['width']; $pic_height = $picture['height']; $thumbnail_path = $conf['upload_path'] . 'thumbnail/' . $day . '/'; is_dir($thumbnail_path) || mkdir($thumbnail_path, 0777, TRUE); $tmp_file = $thumbnail_path . $uid . '_' . $tid . '_' . $time . '.jpeg'; } $localurlarr = array( 'http://' . $_SERVER['SERVER_NAME'] . '/', 'https://' . $_SERVER['SERVER_NAME'] . '/', ); // 跳过云储存 $conf['cloud_url'] and $localurlarr[] = $conf['cloud_url']; //$save_image_quality = array_value($conf, 'save_image_quality', 0); $save_image_quality = 0; $message = urldecode($message); //$message = str_replace('&', '&', $message); //$message = htmlspecialchars_decode($message); preg_match_all('#]+src="(http.*?)"#i', $message, $match); if (!empty($match[1])) { $n = 0; $i = 0; foreach ($match[1] as $url) { foreach ($localurlarr as $localurl) { if ($localurl == substr($url, 0, strlen($localurl))) continue 2; } $full_url = htmlspecialchars_decode($url); $message = str_replace($url, $full_url, $message); $getimgsize = getimagesize($full_url); if (FALSE === $getimgsize) continue; // 非图片跳出 $filename = $uid . '_' . xn_rand(16); if (1 == $getimgsize[2]) { $filename .= '.gif'; $destpath = $attach_dir . $filename; } elseif (in_array($getimgsize[2], array(2, 3, 15, 18))) { $filename .= '.jpeg'; $destpath = $attach_dir . $filename; } else { continue; // 非常见图片格式跳出 } $desturl = $attach_url . $filename; $_message = str_replace($full_url, $desturl, $message); if ($message != $_message) { if ($save_image) { if (0 == $save_image_quality) { $imgdata = https_request($full_url); //$destpath = $attach_dir . $filename; file_put_contents_try($destpath, $imgdata); } else { // 图片压缩 GD 库效率低下 ImageMagick 需要额外安装扩展 switch ($getimgsize[2]) { case 1: // GIF $imgdata = imagecreatefromgif($full_url); break; case 2: // JPG $imgdata = imagecreatefromjpeg($full_url); break; case 3: // PNG $imgdata = imagecreatefrompng($full_url); break; case 15: // WBMP $imgdata = imagecreatefromwbmp($full_url); break; case 18: // WEBP $imgdata = imagecreatefromwebp($full_url); break; } imagejpeg($imgdata, $destpath, $save_image_quality); imagedestroy($imgdata); } } // 创建缩略图 if ($thumbnail) { if (1 == ++$i) { if (empty($save_image)) { $imgdata = https_request($full_url); file_put_contents_try($destpath, $imgdata); } // 裁切保存到缩略图目录 'clip' == array_value($conf, 'upload_resize', 'clip') ? well_image_clip_thumb($destpath, $tmp_file, $pic_width, $pic_height, $getimgsize) : well_image_thumb($destpath, $tmp_file, $pic_width, $pic_height, $getimgsize); well_thread_update($tid, array('icon' => $time)); } if (empty($save_image)) { is_file($destpath) and unlink($destpath); continue; } } $filesize = strlen($imgdata); $attach = array('tid' => $tid, 'uid' => $uid, 'filesize' => $filesize, 'width' => $getimgsize[0], 'height' => $getimgsize[1], 'filename' => "$day/$filename", 'orgfilename' => $filename, 'filetype' => 'image', 'create_date' => $time, 'downloads' => 0, 'isimage' => 1); $aid = well_attach_create($attach); $n++; } $message = preg_replace('#( $n)); } return $message; } function well_get_image_url($url) { if ($n = strpos($url, '.jpg')) { $_n = $n + 4; } elseif ($n = strpos($url, '.jpeg')) { $_n = $n + 5; } elseif ($n = strpos($url, '.png')) { $_n = $n + 4; } elseif ($n = strpos($url, '.gif')) { $_n = $n + 4; } elseif ($n = strpos($url, '.bmp')) { $_n = $n + 4; } $url = $n ? mb_substr($url, 0, $_n, 'UTF-8') : NULL; return $url; } ?> // 频道和全局置顶主题 foreach ($arrlist as $val) { if (in_array($val['fid'], $fids) && 2 == $val['sticky']) { $sticky2[$val['tid']] = $val; } elseif (3 == $val['sticky']) { $sticky3[$val['tid']] = $val; } } } else { // 栏目/上级频道/全局置顶 foreach ($arrlist as $val) { if ($forum['fid'] == $val['fid'] && 1 == $val['sticky']) { $sticky1[$val['tid']] = $val; } elseif (in_array($val['fid'], $fids) && 2 == $val['sticky']) { $sticky2[$val['tid']] = $val; } elseif (3 == $val['sticky']) { $sticky3[$val['tid']] = $val; } } } $sticky3 = empty($sticky3) ? array() : array_multisort_key($sticky3, 'create_date', FALSE, 'tid'); $sticky2 = empty($sticky2) ? array() : array_multisort_key($sticky2, 'create_date', FALSE, 'tid'); $sticky1 = empty($sticky1) ? array() : array_multisort_key($sticky1, 'create_date', FALSE, 'tid'); $arr = $sticky3 + $sticky2 + $sticky1; return $arr; } // 全部置顶缓存 function sticky_thread_find_cache() { global $conf; $key = 'sticky_thread_list'; static $cache = array(); // 用静态变量只能在当前 request 生命周期缓存,跨进程需要再加一层缓存:redis/memcached/xcache/apc if (isset($cache[$key])) return $cache[$key]; if ('mysql' == $conf['cache']['type']) { $arr = sticky_thread__find(array(), array('tid' => -1), 1, 2000); } else { $arr = cache_get($key); if (NULL === $arr) { $arr = sticky_thread__find(array(), array('tid' => -1), 1, 2000); $arr AND cache_set($key, $arr, 1800); } } $cache[$key] = $arr ? $arr : NULL; return $cache[$key]; } ?>H3C-S5500端口镜像配置编程频道|福州电脑网 首页编程之家系统教程数码周边电脑 首页 > 系统教程H3C-S5500端口镜像配置H3C-S5500端口镜像配置系统教程520 更新时间:2026-04-06 12:47:072024年4月17日发(作者:)本文发布于:2024-04-17,感谢您对本站的认可!本文链接:https://www.fzithome.com/xitong/1713354342a468984.html版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。本文标签:镜像配置端口发布评论 取消回复评论列表(有0条评论)最近发表MFC与Access(一)C++读.mdb文件zktime5.0考勤软件常见问题处理办法Access斯维尔三维算量、安装算量疑难问题分享华为破解C#实现CAD数据转shape或mdb(转)瑞星杀毒软件网络版客户端最新XP.GHO文件,2013年XP镜像文件下载彻底删除2345主页的方法教育热点资讯:全面推进中小学思政课教师队伍建设2018年app项目背景介绍怎么写新闻20条摘抄大全新媒体选题如何紧扣热点?∣选题必备工具箱一键还原的使用一键还原精灵使用方法系统盘重装系统教程电脑光盘重装系统教程如何删除联想lenovo硬盘的隐藏分区+收藏服务器故障应急方案电脑显示器一直黑屏重启怎么办CPU风扇转速太慢怎么办CPU风扇转速多少才算正常福州电脑网_福州电脑维修_福州电脑之家_福州iThome福州电脑维修网(fzithome.com)专业的电脑维修,笔记本维修,上门维修各种电脑,笔记本,平板等,快速上门.电脑知识频道内容覆盖:计算机资讯,电脑基础应用知识,各种电脑故障维修学习,电脑外设产品维修维护,病毒,软件,硬件,常识.相关推荐揭秘OpenWrt:如何让你的路由器焕然一新揭秘在Win7中完美集成Windows8的操作技巧衔接POM XML与application.yml:Profile名称不兼容问题解析新手必看:Linux内核升级失败后的正确步骤路由器配置秘籍:让你成为家庭网络的小专家自制Win7原版系统光盘镜像,一盘在手,万事无忧解锁DNF与NFS共享服务,提升游戏与数据管理效率Linux内核升级,启动不了?快来解救我!YimMenu终极攻略:初学者快速上手,5分钟掌握GTA5辅助技巧H3C路由器配置大揭秘:轻松玩转网络掌握H3C网络设备:轻松应对网络挑战H3C路由器VLAN配置实战:打造企业级网络空间H3C华三路由器:一学就会的基础配置秘籍Windows 7 DNS重置与LSP修复教程理解网络与端口的基础概念网工学习笔记-华为路由配置_华为路由器端口配置ip命令华为路由器设置指南Centos镜像文件介绍与方式详解Linux中封闭多余端口的方法:以111端口为例的操作步骤从零开始:借助SecureCRT实现eNSP路由器的密码安全设置标签列表文件夾下技术下的不了微信电脑用得背后文本一大但是开了飞翔在已开启端口的进如何测防止真实作日卸载完成手机来帮应用大扫单击选中该网站的的性能的点
2024年4月17日发(作者:)
福州电脑网_福州电脑维修_福州电脑之家_福州iThome
福州电脑维修网(fzithome.com)专业的电脑维修,笔记本维修,上门维修各种电脑,笔记本,平板等,快速上门.电脑知识频道内容覆盖:计算机资讯,电脑基础应用知识,各种电脑故障维修学习,电脑外设产品维修维护,病毒,软件,硬件,常识.
发布评论