解决方案:PHPcms建站系统-个人建站必不可少的工具
优采云 发布时间: 2022-12-15 05:53解决方案:PHPcms建站系统-个人建站必不可少的工具
关键词说明:建站工具必备系统个人网站cms管理系统站长
cms系统已经成为个人站长在建站过程中必不可少的工具。现在几乎不可能看到有多少网站管理员还在手工编写 HTML 页面。原因不外乎cms具有简单、维护方便等诸多优点。
cms 的成长带来了巨大的个人 网站 成长!形形色色的网站让网络世界更加丰富精彩。今天就简单介绍一下主流的cms及其代表人物网站。
PHP 中的主流 cms
PHP 正变得越来越流行,并被各种 网站 网站管理员使用。这得益于PHP、MYSQL的完美结合,具有安全、高效、资源少、负载能力强等特点。.
1.phpcms网站管理系统()
基于PHP MYSQL的网站管理系统软件发展势头强劲。最新3.0版,免费版可永久使用,提供文章、下载、图片三大功能模块,模板编辑也比较好用。没有内置采集系统,但是第三方提供了很好的支持,比如:优采云、小蜜蜂等采集程序。个人感觉是比较完善的网站管理系统。
2.dedecms织梦网站管理系统()
强人“IT柏拉图”独自完成了所有功能的编写,完全开源的系统,受到众多站长的热烈追捧。最新版Dedecms V3.1 Lit对之前的2.X进行了全面的结构升级,已经趋于成熟,目前在网站中大量使用。因为它是完全开源的,所以可以很方便的自由扩展,模板的制作也比较简单,稍微研究一下就可以制作成自己喜欢的样子。唯一不足的是程序更新速度太慢,可能是IT柏拉图太忙了。另外,系统自带的模板确实比较难接受。总的来说,这是一个值得使用的系统。
解决方案:pbdigg 3.0正式版文章模型支持评论标准接口
发布接口
说明发布接口代码“、”
“、””
', '
', '“、”
“、”“);$str = str_replace($search, $replace, $str);$reg_search = array(“#\[align=([^\[\caching = TRUE; if ($show) {$showdir = ''; $cacheid = (string)$cacheid; $tidlen = strlen($cacheid); $ctid = 0; while ($ctid < $tidlen){$showdir 。= '/'。$cacheid{$ctid};$ctid++;}$TPL->cache_dir = $cache_dir。$dir。$showdir; } $TPL->clear_cache($tplmark。'。html', $cacheid);}}function ckgdcode($postcode){ $ckcode = gCookie('pb_ckcode'); if (!$postcode || !$ckcode) 返回 FALSE; list($t, $n) = explode(“\t”, $ckcode); return md5($postcode。
$t) == $n;}function ckqa($answer){ return $answer == $GLOBALS['pb_checkanswer']; }函数 getTagStyle(){//自定义字体大小 $sizearray = array('8','9','10','11','12','20'); $key = array_rand($sizearray); 返回 'font-size:'。$sizearray[$key]。'pt;颜色:#'。Dechex(rand(0,255))。Dechex(rand(0,196))。德切克斯(兰德(0,255));}function getPostVerify($pre, $actionurl, $end){ $params = ''; if (($pos = strpos($actionurl, '?')) !== FALSE) { $queryString = substr($actionurl, $pos + 1); if ($queryString) {$params = explode('&', str_replace('&', '&', $queryString)); foreach ($params as $k => $v){if (substr($v, 0, 6) == 'verify'){unset($params[$k]); }}$params = implode('&', str_replace(array('“', ”'“, ''), array('%22', '%27', '%3C', '%3E'), $params))。
“和”; } $actionurl = substr($actionurl, 0, $pos);} 返回 '';}function urlHash($querystring){ global $db_hash, $customer, $_PBENV; $urlhash = ''; if ($querystring) { $querystring = str_replace('&', '&', $querystring); $querystring{strlen($querystring)-1} == '&' && $querystring = substr($querystring, 0, -1); $querystring = 爆炸('&', str_replace('=','&',$querystring)); foreach ($querystring as $p) {$urlhash 。= $p; } $urlhash = md5($urlhash);} return substr(md5($urlhash。$db_哈希。
ipFragment($_PBENV['PB_IP'])。$customer['uid']),8,8);}function checkurlHash($verify){ global $db_hash, $customer, $_PBENV; $urlhash = ''; if ($_GET) { foreach ($_GET as $k => $v) {$k != 'verify' && $urlhash 。= $k。$v; } $urlhash = md5($urlhash);} return substr(md5($urlhash。$db_哈希。ipFragment($_PBENV['PB_IP'])。$customer['uid']),8, 8) == $verify;}function checkPostHash($verify){ return $verify == $GLOBALS['verifyhash']; }function intConvert($params){ is_array($params) && settype($params, 'array'); foreach ($params as $v) { $GLOBALS[$v] = isset($_GET[$v]) ?(int)$_GET[$v] : (isset($_POST[$v]) ?(国际)$_POST[$v] : 0);}}function charConvert($params, $trim = true){ is_array($params) && settype($params, 'array'); foreach ($params as $v) { $GLOBALS[$v] = isset($_GET[$v]) ?HConvert($_GET[$v]) : (isset($_POST[$v]) ?HConvert($_POST[$v]) : ''); $trim &&$GLOBALS[$v] = trim($GLOBALS[$v]);}}function sqlLimit($page, $pagesize = 30){ $page = (int)$page; $page 127 && ++$i; $tnum ++; } 返回$tnum;}}function location($url, $type = 's'){ $url = preg_match('~^https?:/ /~i', $url) ? $url : $GLOBALS['_PBENV']['PB_URL']。
$url; ob_end_clean(); if ($type == 's') { header ('Location: '。$url); 退出;} else { exit(''); }}function forward(){ global $_PBENV; if (isset($_SERVER['HTTP_REFERER'])) { $parseurl = parse_url($_SERVER['HTTP_REFERER']); if (isset($parseurl['host']) && strpos($_PBENV['PB_URL'], $parseurl['host']) !== FALSE && strpos($parseurl['path'], 'login') === FALSE && strpos($parseurl['path'], 'register') === FALSE) {$forward = $_SERVER['HTTP_REFERER']; } } !isset($forward) && $forward = $_PBENV['PB_URL'];返回 HConvert($forward);}function urlconj($url){ return strpos($url, '?') === FALSE ?'?' : ($url{strlen(str_replace('&', '&', $url)) - 1} == '&' ?'' : '&');}/** * 过滤器函数 * @param 字符串$dotag过滤器 ID * @param $var过滤器内容 * $_actions = array( 'reg' => array('myoutput1' => '2','myoutput2' => '2',);*/function filter_do($dotag, $content = ''){ global $_filterhook; $args = func_get_args(); unset($args[0]); if (isset($_filterhook['all'])) { $content = call_all_filter($args); $args[1] = $content;}if (isset($_filterhook[$dotag])) { $currentFilter = &$_filterhook[$dotag]; foreach ($currentFilter as $hookFunc => $hookArgs) {if (function_exists($hookFunc)){$content = call_user_func_array($hookFunc, array_slice($args, 0, (int)$hookArgs)); $args[1] = $content; } } unset($GLOBALS['_filterhook'][$dotag]);} 返回$content;}function call_all_filter($args){ global $_filterhook; $content = $args[1]; foreach ($_filterhook['all'] as $hookFunc => $hookArgs) { function_exists($hookFunc) && $content = call_user_func_array($hookFunc, $args); } return $content; }/** * 操作挂钩 * @param 字符串$dotag过滤器 ID * $_actionshook = array( 'reg' => array('functionname' => '传递的参数数',), );*/function action_do($dotag){ global $_actionhook; $args = func_get_args(); unset($args[0]); if (isset($_actionhook['all'])) { call_all_action($args); }if (isset($_actionhook[$dotag])) { $currentActions = &$_actionhook[$dotag]; foreach ($currentActions as $hookFunc => $hookArgs) {function_exists($hookFunc) && call_user_func_array($hookFunc, array_slice($args, 0, (int)$hookArgs)); } }unset($GLOBALS['_actionhook'][$dotag]);}function call_all_action($args){ global $_actionhook; foreach ($_actionhook['all'] as $hookFunc => $hookArgs) { function_exists($hookFunc) && call_user_func_array($hookFunc, $args); }}function cutSpilthHtml($html){ $len = strlen($html); while ($len >= 0) { $char = substr($html, --$len, 1); 如果 ($char == '>') 中断; 如果 ($char == ' $_v) { ($_k{0} == '_' || $_k == 'GLOBALS') && exit; $_k = _v 美元;}}require_once PBDIGG_CROOT。
'cache_config。”php';$tpl_dir = $pb_style;//current template$pb_timecorrect && $timestamp += $pb_timecorrect;if (!$pb_Siteurl){ //Get Current PB Access Address $sHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : (isset($_SERVER['SERVER_NAME']) ?(int)$_SERVER['SERVER_NAME'] : (int)getenv('SERVER_NAME'));$sPort = isset($_SERVER['SERVER_PORT']) ?(int)$_SERVER['SERVER_PORT'] : (int)getenv('SERVER_PORT');$sPort == '80' && $sPort = '';$sSecure = (isset($_SERVER['HTTPS']) || $sPort == 433) ?1 : 0;$sDir = trim(dirname($_PBENV['PHP_SELF']));$pb_siteurl = 'http'。
(isset($_SERVER['HTTPS']) || $sPort == 433 ?'s' : '')。'://'。preg_replace('~[\\\\/]{2,}~i', '/', $sHost。($sPort && (!$sSecure && $sPort != 80 || $sSecure &&$sPort != 433) && strpos($sHost, ':') === FALSE ?':'。$sPort : '')。$sDir。'/');}$_PBENV['PB_URL'] = HConvert($pb_siteurl);if (isset($_SERVER['HTTP_CLIENT_IP'])){ $currentIP = $_SERVER['HTTP_CLIENT_IP']; }elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])){ $currentIP = $_SERVER['HTTP_X_FORWARDED_FOR']; }else{ $currentIP = $_SERVER['REMOTE_ADDR']; }$_PBENV['PB_IP'] = preg_match('~^[\d\。
]{7,15}$~', $currentIP, $match) ?$match[0] : “不知道”;未设置($match);if ($_DS == '/' && $pb_loadavg){ if((function_exists('sys_getloadavg') && $loadavg = sys_getloadavg()) ||($loadavg = explode(' ', @file_get_contents('/proc/loadavg')))){ (($loadavg[0] > $pb_loadavg) ||(!$_COOKIE && !$_SERVER['HTTP_USER_AGENT']))&& 退出(“服务不可用!”);}}$userAgent = userAgent();$pb_robots &&&$userAgent[2] &&logRobots($userAgent[1]);obStart();//Variable initialization $_categories = $_siteFounder = array();$logStatus = $ucHeader = $jsmore = $cssmore = $gtype = $grouptitle = $uplower = $uphigher = $allowvisit = $allowsort = $allowread = $allowpost = $allowcomment = $allowdigg = $allowbury = $ allowbsearch = $allowasearch = $searchmax = $allowreport = $allowhtml = $allowmsg = $msgmax = $allowfavors = $favorsmax = $allowavatar = $allowaupload = $uploadmax = $uploadtype = $ allowadmincp = $alloweditatc = $allowdelatc = $allowcheckatc = $allowlockatc = $allowmoveatc = $allowcopyatc = $allowtopatc = $allowcommend = $allowshield = $allowedip = $allowtitlestyle = ' ';require_once PBDIGG_ROOT。
'data/sql。公司。php';PB_PAGE != 'AJAX' &&PB_PAGE != 'WAP' && header('Content-Type: text/html; charset='。$db_字符集);$common_message = loadLang('common');require_once PBDIGG_ROOT。'收录/模板。函数。php';if ($pb_lastvisit = gCookie('pb_lastvisit')){ list($lastVisit, $lastPath) = explode(“\t”, $pb_lastvisit); $pb_refreshtime && ($timestamp - $lastVisit < $pb_refreshtime) && ($lastPath == $_PBENV['REQUEST_URI']) && showMsg('refresh_limit'); }ipControl($_PBENV['PB_IP']);require_once PBDIGG_ROOT。'include/MySQL。 .class.php'; $DB = new MySQL($db_host, $db_username, $db_password, $db_name, $db_pconnect); unset($db_password); $customer = array('uid'=>0,'username'=>$common_message['anonymity'],'adminid'=>0,'groupid'=>5,'realgroup'=>0,'currency'=>0,'ucuid'=>0,'avatar'=>'');//$pb_auth = gCookie(' pb_auth'); $pb_auth = gCookie('pb_auth') ? gCookie('pb_auth') : (isset($pb_auth
) ? $pb_auth : '');if ($pb_auth){ list($p_uid, $p_pw) = explode(“\t”, PDecode($pb_auth, $pb_sitehash)); if (is_numeric($p_uid) && strlen($p_pw) == 32) { $customer = $DB->fetch_one(“SELECT m。
UID,M。用户名,m。密码,m。电子邮件,m。管理员,M。组ID, m。公共电子邮件,M。性别,m。Regip, M。注册日期,M。Realgroup, M。Postnum, M。评论,M。迪格南,M。伯里纳姆,M。货币,m。拉斯蒂普,M。上次访问,M。最后一篇文章,m。最后评论,M。最后上传,m。最后搜索, m。上传数字,m。新味,M。朋友,M。集合,M。访问纳姆,M。ucuid, m。阿凡达,MX。QQ,MX。MSN, MX。网站,MX。位置,墨西哥。生日,墨西哥。签名,MX。显示标志,MX。ctsig FROM {$db_prefix}members m LEFT JOIN {$db_prefix}memberexp mx USING (uid) WHERE m。
uid = ”。(int)$p_uid); if (!$customer || pbNewPW($customer['password']) != $p_pw) {sCookie('pb_auth', '', -1); unset($customer, $pb_auth); showMsg('auth_error'); } $customer['uid'] = $customer['safeuid'] = (int)$customer['uid']; $customer['groupid'] = (int)$customer['groupid']; $customer['adminid'] = (int)$customer['adminid']; $customer['newmsg'] && $customer['newmsg'] = ''。$customer['newmsg']。''; $customer['groupid'] == -1 && $customer['groupid'] = (int)$customer['realgroup']; $logStatus = 1;}}if ($pb_ucenable){ require_once PBDIGG_ROOT。
'包括/UC。公司。php';$customer['safeuid'] = (int)$customer['ucuid'];}require_once PBDIGG_ROOT。'data/cache/cache_usergroup_'。$customer['组 ID']。'。php';if ($customer['adminid'] && ($customer['adminid'] == 1 || $customer['adminid'] == 2)){ require_once PBDIGG_CROOT。“cache_admingroup_”。$customer['管理员']。'。php';if (in_array($customer['uid'], $_siteFounder)) { define('SUPERMANAGER', TRUE); $alloweditatc = $allowdelatc = $allowcheckatc = $allowlockatc = $allowmoveatc = $allowcopyatc = $allowtopatc = $allowcommend = $allowshield = $allowedip = $allowtitlestyle = 1; }}!defined('SUPERMANAGER') && define('SUPERMANAGER', FALSE);if (!$pb_ifopen && !SUPERMANAGER){ clearcookie(); showMsg($pb_whyclosed); }if (!$allowvisit && PB_PAGE != 'login'){ clearcookie(); showMsg('member_visit_denied', 'login。
php');}$tid = (int)$tid;$cid = (整数)$cid;$p = (整数)$p;if ($pb_passport && $pb_passporttype == 'client'){ $loginurl = $pb_pclienturl。$pb_pclientlogin;$logouturl = $pb_pclienturl。$pb_pclientlogout;$regurl = $pb_pclienturl。$pb_pclientregister;}else{ $loginurl = $_PBENV['PB_URL']。'登录。php';$logouturl = _PBENV 美元['PB_URL']。'登录。php?action=logout&verify='。urlHash('action=logout');$regurl = _PBENV 美元['PB_URL']。'注册。php';}$rewrite_ext = array('html','htm','shtml','php','asp','jsp','cgi');$pb_rewriteext = $rewrite_ext[$pb_rewriteext];$diggbury = $pb_ifdigg ||$pb_伊夫伯里;$customer['avatar'] = userFace($customer['avatar'], $customer['ucuid']);$customer['uurl'] = userSpace($customer['uid'], $customer['ucuid']);//$style= gCookie('style') ?gCookie('style') : (isset($_GET['style']) ? $_GET['style'] : (isset($_POST['style']) ? $_POST['style'] : $pb_style));$styleid= isset($_GET['styleid']) ?$_GET['styleid'] : (gCookie('styleid') ? gCookie('styleid') : '');if ($styleid && !preg_replace('~[-_a-Z0-9]~i', '', $styleid) && 'admin' != strtolower($styleid) && @is_dir(PBDIGG_ROOT。'
模板/'。$styleid)){ $tpl_dir = $pb_style = $styleid; sCookie('styleid', $styleid, 1); }require_once PBDIGG_CROOT。'cache_categories。php';require_once PBDIGG_ROOT。“包括/菜单。 .class.php”;require_once PBDIGG_ROOT。“收录/模块”。 .class.php“;require_once PBDIGG_ROOT。“收录/转移。 .class.php”;require_once PBDIGG_ROOT。“收录/缓存”。 .class.php“;$menu = 新菜单();$module = 新模块();$transfer = 新传输();$Cache = 新的缓存();sCookie('pb_lastvisit', $timestamp。“\t”。$_PBENV[“REQUEST_URI”]);$verifyhash = getUserHash($customer['uid']);//action_do('common');//filter_do('common');//common。
公司。PHP 结束于 require_once PBDIGG_ROOT。'收录/验证。函数。php';require_once PBDIGG_ROOT。'include/ubb。函数。php';@include_once PBDIGG_CROOT。'cache_specialtpl。”php';//zzcity addif ($vercode!=$vercode 2){ echo('[err]invalid vercode[/err]'); exit(); }$post_message = loadLang('post');$common_message += $post_message;//!$pb_ifpost && !SUPERMANAGER && showMsg('post_thread_closed');//!$allowpost && redirect('post_newthread_nopermission', $customer['groupid'] == '6' ?'会员。php' : '登录。php?forward=post。php');//!in_array($action, array('add', 'edit')) && $action = 'add';$action = “添加”;zzcity add/*if ($pb_reposttime){ $pb_lastpost = $customer['uid'] ? $customer['lastpost'] : gCookie('pb_lastpost');$action != 'edit' && !$customer['adminid'] && $pb_lastpost && ($timestamp - $pb_lastpost < $pb_reposttime) && showMsg('post_flood_ctrl');}*/list($title_min, $title_max) = explode(“\t”, $pb_titlelen);list($content_min, $content_max) = explode(“\t”, $pb_contentlen);$uploadattachment = $allowaupload &&$pb_allowupload;$uploadtopicimg = $uploadattachment &&$pb_uploadtopicimg;$rssurl = '';//header('Cache-control: private, must-revalidate');$currentCateData = $currentModuleData = $currentModuleObj = $postcontent = $moduleIdentifier = '';//$moduleid = (int)$moduleid;$moduleid = 1;if ($cid && isset($_categories[$cid])){ $currentCateData = &$_categories[$cid]; !$allowsort && !$currentCateData['status'] && showMsg('post_cate_newthread_nopermission'); !$logStatus && !$currentCateData['anonymity'] && showMsg('post_cate_contribute_nopermission'); if (count($currentCateData['ttype']) == 1) $moduleid = $currentCateData['ttype'][0]; if ($currentModuleData = checkModuleID($moduleid)) { //article。
.class。PHP 开始require_once PBDIGG_ROOT。'模块/文章/收录/article_function。php';类文章 {var $DB = 空; var $db_前缀;函数 article() {$this->__construct(); }function __construct() {global $DB, $db_prefix; $this->DB = $DB; $this->db_prefix = $db_prefix; } /*** 添加主题** @param数组$article提交参数信息*/ 函数 add(&$post) {global $pb_watertype, $pb_tftopicimg, $customer, $pb_reposttime, $action, $timestamp, $_PBENV, $pb_uploadfiletype, $ uploadtype, $allowaupload, $pb_allowupload, $pb_uploadtopicimg, $pb_uploadmaxsize, $uploadmax,$pb_titlelen, $pb_contentlen, $verifyhash, $logStatus, $pb_gdcheck, $pb_attachnum, $ pb_style, $allowurl, $allowtimestamp, $allowinitstatus,$allowhtml, $currentCateData, $cid, $moduleid, $pb_tcheck, $pb_anonnews, $pb_urlsaveimg, $pb_creditdb, $initdigg, $initbury , $inithit;$pb_lastpost = $logStatus ?$customer['lastpost'] : gCookie('pb_lastpost');//if (!$customer['adminid'] && $pb_reposttime && ($timestamp - $pb_lastpost < $pb_reposttime)) showMsg('post_flood_ctrl');//if (checkPost())//{$attachment_pattern = $attachment_replace = $attachments = array(); $uid = (int)$customer['uid']; $timesession = (int)$_POST['timesession'];/*if (($pb_gdcheck & 4) && !ckgdcode($_POST['captcha'])){showMsg('checkcode_error'); }if ($timesession){$fsession = $this->DB->fetch_one(“SELECT * FROM {$this->db_prefix}fsession WHERE uid = '$uid' AND timesession = '$timesession'”); $fsession && $fsession['attachment'] && $attachments = unserialize($fsession['attachment']); } */$title = checkTitle(HConvert(trim($_POST['title'])));$content = checkContent(trim(stripslashes($_POST['content'])));$tag = checkTag(HConvert(trim($_POST['tag'])));$summary = traceHtml(cutSpilthHtml(PBSubstr(preg_replace(array('~\[\/?[ ^\]]*\]~im','~(\r\n|\n\r|\r|\n){1,}~im'), '', (strip_tags($_POST['summary']) ? trim(stripslashes($_POST['summary'])) : $content));安全转换($summary);$author = $logStatus ?addslashes($customer['username']) : HConvert(trim($_POST['author']));$anonsite = (!$logStatus && substr($anonsite, 0, 7) == 'http://') ?HConvert($_POST['anonsite']) : '';if (strpos($content, 'embed') !== FALSE){$content = ubb_deparse($content); }!$allowhtml &&&safeConvert($content);$ifconvert = $content == conentUBB($content, 't', true) ?0 : 1;$source = ($_POST['source'] && checkURL($_POST['source'])) ?HConvert($_POST['source']) : '';$linkhost = ($source && preg_match('~^(https?| ftp|gopher|news|telnet|mms|rtsp):\/\/([^\/]*)~i', $source, $linkhost)) ?addslashes(HConvert($linkhost[2])) : '';$ifcheck = (($pb_tcheck && !超级经理) ||($pb_匿名新闻&&!$uid))?'0' : '1';$tptime = intval(pStrToTime($_POST['postdate']));$postdate = ($allowtimestamp && $_POST['postdate'] && $tptime && ($tptime = 0 && $_POST['digg'] = 0 && $_POST['bury'] = 0 && $_POST['views'] $uploadmax) ? $uploadmax : $pb_uploadmaxsize; $topicdata = $Upload->moveFile('topic', '', array('gif','jpg','jpeg','bmp','png'), $attasize); if ($topicdata){$topicimg = gdate($timestamp, 'ym')。'
/'。$topicdata[0][1]。'。'。$topicdata[0][2]。'|'。$topicdata[0][7][1]。'|'。$topicdata[0][7][2]。“|0”;}}if ($attachments){$uploaddir = getUploadDir(); $filepath = PBDIGG_ATTACHMENT。$uploaddir。'/';foreach ($attachments as $k => $v){PMove(PBDIGG_ATTACHMENT。'temp/'。$v[3]。'。'。$v[4], $filepath。$v[3]。'。'。$v[4]);$v[5] && PMove(PBDIGG_ATTACHMENT。“温度/thumb_”。$v[3]。'。'。$v[4], $filepath。'thumb_'。$v[3]。'。'。$v[4]);if ($pb_uploadtopicimg && $pb_tftopicimg && $v[6] && !$topicimg){$topicimg = makeTopicImg($filepath。
$v[3]。'。'。$v[4]);}$this->DB->db_exec(“插入到 {$this->db_prefix}附件 (cid,tid,uid,文件名,文件类型,文件大小,描述,文件路径,isimg,uploaddate,thumb) 值 ('$cid',0,'$uid' ,'”。添加斜杠($v[0])。"','"。添加斜杠($v[1])。"',"。intval($v[2])。",'','"。添加斜杠($uploaddir。'/'。$v[3]。'。'。$v[4])。"',"。$v[6]。“,$timestamp,。”$v[5]。")");$aid = $this->DB->db_insert_id();$attachment_pattern[] = '[file='。$k。']';$attachment_replace[] = '[attachment='。$aid。']';$attatid 。= $aid。',';$ainfo[$aid] = array('aid'=>$aid,'filename'=>$v[0],'filesize'=>$v[2],'filepath'=>$uploaddir。'
/'。$v[3]。'。'。$v[4],'文件类型'=>$v[1],'isimg'=>$v[6],'Thumbpath'=>($v[5] ? $uploaddir。'/thumb_'。$v[3]。'。'。$v[4] : “”));++$attanum;}$this->DB->db_exec(“DELETE from {$this->db_prefix}fsession WHERE uid = '$uid' AND timesession = '$timesession'”);}}$this->DB->db_exec(“插入到 {$this->db_prefix}threads (tid, cid, author, uid, subject, contentlink, linkhost, topicimg, ifcheck, ifshield, iflock, topped, postdate, postip, digg , diggdate, bury, burydate, views, comments, commentdate, keywords, pbrank, comcomend, commendpic, first, module, realurl, ishtml, summary, titlecolor, titlestyle) 值(空, '$cid', '$ author', '$uid', '$title', '$source', '$linkhost', '$topicimg', '$ifcheck', 0, 0, 0, '$postdate', '"。
$_PBENV['PB_IP']。“, '$digg', '$postdate', '$bury', '$postdate', '$views', 0, '$postdate', '', '$pbrank', 0, '', 0, '$moduleid', '$realurl', '$ishtml', '”。添加斜杠($summary)。"', '', 0)");$tid = $this->DB->db_insert_id();$ainfo = $ainfo ?addslashes(serialize($ainfo)) : '';$this->DB->db_exec(“INSERT INTO {$this->db_prefix}article (tid, content, ainfo, ifconvert, anonsite) VALUES ('$tid', '', '$ainfo', '$ifconvert', '$anonsite')”);//attachmentsif ($ attatid){$content = str_replace($attachment_pattern, $attachment_replace, $content); $this->DB->db_exec(“UPDATE {$this->db_prefix}attachments set tid = '$tid' where aid in (”)
substr($attatid, 0, -1)。")");}//tagsif ($tag){$tag = explode(',', $tag); $i = 1; foreach ($tag as $key => $value){$rs = $this->DB->fetch_one(“SELECT tagid, usenum, ifopen, ifsys, tagpic FROM {$this->db_prefix}tags WHERE tagname = '$value'”); if ($rs){if ($rs['ifopen']){$this->DB->db_exec(“UPDATE {$this->db_prefix}tags SET usenum = usenum + 1 WHERE tagid = ”。$rs['塔吉德']);$tagid = $rs['tagid'];if (!$topicimg &&$rs['tagpic']){$topicimgsql = “, topicimg = '”。addslashes($rs['tagpic'])。“|1'”;$topicimg = 真;}}else{unset($tag[$key]); continue; }}else{$this->DB->db_exec(“INSERT INTO {$this->db_prefix}tags (tagname, usenum, hits, ifopen, ifsys, tagpic) VALUES ('$value', 1, 0, 1, 0, '')”); $tagid = $this->DB->db_insert_id(); }$this->DB->db_exec(“INSERT INTO {$this->db_prefix}tagcache (tagid, tid) VALUES ($tagid, $tid)”);$keywords 。
= ($keywords ?',' : '')。$value;如果 ($i++ >= 5) 中断;}}$this->DB->db_exec(“UPDATE {$this->db_prefix}threads SET keywords = '$keywords' $topicimgsql WHERE tid = '$tid'”);$this->DB->db_exec(“UPDATE {$this->db_prefix}article SET content = '”。添加斜杠($content)。“' 其中 tid = '$tid'”);$this->DB->db_exec(“UPDATE {$this->db_prefix}category SET tnum = tnum + 1 WHERE cid = '$cid'”);if ($uid){$pb_creditdb = explode(“\t”, $pb_creditdb); $this->DB->db_exec(“UPDATE {$this->db_prefix}members SET uploadnum = uploadnum + ”。
(int)$attanum。“, postnum = postnum + 1, currency = currency + ”。$pb_creditdb[0]。“, lastpost = '$timestamp' 其中 uid = '$uid'”);}else{sCookie('pb_lastpost', $timestamp); }$this->DB->db_exec(“UPDATE {$this->db_prefix}sitestat SET artnum = artnum + 1 WHERE id = 1”);echo('[reply]tid='。$tid。“[/回复]”);zzcity add//redirect(($ifcheck ?“post_newthread_succeed”: “post_newthread_unchecked”), “显示”。php?tid='。$tid);/*}else{$post['attaexts'] = implode(',', $this->getUploadExts()); $post['attanum'] = $this->getUploadNums(); $post['attasize'] = ceil($this->getUploadSize() / 1024); $post['editor'] = getEditor(array(array('id'=>'content','type'=>'PBDigg','content'=>'','width'=>600,'height'=>300),array('id'=>'summary','type'=>'Basic','content'=>''','width'=>400,'height'=>200))); }*/ } /*** 删除 文章** @param数组 $tid 文章ID 数组*/ 函数 del($tid) {if (empty($tid)) return;!is_array($tid) && $tid = (array)$tid;$this->DB->db_exec(“从 {$this->db_prefix}article 中删除,其中 TID IN (”。
内爆(',', $tid)。")"); } /*** Edit Theme** @param int $tid Theme Tid*/ function edit(&$post, $tid) {global $pb_watertype, $pb_tftopicimg, $pb_topicstylesize, $pb_reeditlimit, $customer, $timestamp, $_PBENV, $pb_ uploadfiletype, $uploadtype, $allowaupload, $pb_allowupload, $pb_uploadtopicimg, $pb_uploadmaxsize, $uploadmax,$pb_titlelen, $pb_contentlen, $verifyhash, $logStatus, $pb_ gdcheck, $pb_attachnum, $pb_style, $allowurl, $allowtimestamp, $allowinitstatus,$allowhtml, $currentCateData, $cid, $moduleid, $pb_tcheck, $pb_anonnews, $pb_urlsaveimg, $pb_ creditdb, $_attdir, $action, $initdigg, $initbury, $inithit, $timesession;$tid = (整数)$tid;$uid = (int)$customer['uid'];$post = $this->DB->fetch_one(“SELECT t。
*一个。* FROM {$this->db_prefix}threads t LEFT JOIN {$this->db_prefix}article a USING (tid) WHERE t。tid = '$tid'“);如果 (!$post) 显示Msg('post_thread_nonexistence');如果(!$uid ||(!$customer['adminid'] && $post['uid'] != $uid))showMsg('post_edit_nopermission');if (!$customer['adminid'] && $pb_reeditlimit && $timestamp - $post['postdate'] > $pb_reeditlimit * 60) showMsg('post_edit_timelimit');if (checkPost()){if (($pb_gdcheck & 4) && !ckgdcode($_POST['captcha'])){showMsg('checkcode_error'); }$updatesql = $updateinfosql = $keywords = '';$ainfo = $attachments = 数组();添加S($post);$timesession = (int)$_POST['timesession'];if ($timesession){$fsession = $this->DB->fetch_one(“SELECT * FROM {$this->db_prefix}fsession WHERE UID = '$uid' AND timesession = '$timesession'”); $fsession && $fsession['attachment'] && $attachments = unserialize($fsession['attachment']); }$title = checkTitle(HConvert(trim($_POST['title'])));$post['title'] != $title && $updatesql 。= “ 主题 = '$title',”; $content = checkContent(trim(stripslashes($_POST['content']))); $tag = checkTag(HConvert(trim($_POST['tag']))); $summary = traceHtml(cutSpilthHtml(PBSubstr(preg_replace(array('~\[\/?[ ^\]]*\]~im','~(\r\n|\n\
r|\r|\n){1,}~im'), '', (strip_tags($_POST['summary']) ? trim(stripslashes($_POST['summary'])) : $content)), 500)));安全转换($summary);$summary != $post['summary'] && $updatesql 。=“ 摘要 = '”。添加斜杠($summary)。"',";$anonsite = ($customer['adminid'] && substr($anonsite, 0, 7) == 'http://') ?HConvert($_POST['anonsite']) : '';$anonsite != $post['anonsite'] && $updateinfosql 。=
“ anonsite = '$anonsite',”; if (strpos($content, 'embed') !== FALSE){$content = ubb_deparse($content); }!$allowhtml &&&safeConvert($content);$ifconvert = $content == conentUBB($content, 't', true) ?0 : 1;$source = ($_POST['source'] && checkURL($_POST['source'])) ?HConvert($_POST['source']) : '';if ($post['source'] != $source){$linkhost = ($source && preg_match('~^(https?| ftp|gopher|news|telnet|mms|rtsp):\/\/([^\/]*)~i', $source, $linkhost)) ? addslashes(HConvert($linkhost[2])) : ''; $updatesql 。=
“ contentlink = '$source', linkhost = '$linkhost',”; }$ifcheck = (($pb_tcheck && !超级经理) ||($pb_anonnews && !$customer['uid']))?'0' : '1';$tptime = intval(pStrToTime($_POST['postdate']));$allowtimestamp && $_POST['postdate'] && $tptime && ($tptime = 0 && $_POST['digg'] = 0 && $_POST['bury'] = 0 && $_POST['views'] DB->db_query(“SELECT tg。tagname FROM {$this->db_prefix}tags tg, {$this->db_prefix}tagcache tc WHERE tg。塔吉德 = TC。塔吉德和 TC。tid = '$tid'“);while ($rs = $this->DB->fetch_all($query)){$oldtag[] = $rs['tagname']; }if ($tag != $oldtag){$deltags = $addtags = $rs = $t_tags = array(); $tagid = $tagname = ''; $deltags = array_diff($oldtag, $tag); $addtags = array_diff($tag, $oldtag); if ($deltags){foreach ($deltags as $value){$tagname 。
= “'”。$value。"',";}$query = $this->DB->db_query(“SELECT tagid FROM {$this->db_prefix}tags WHERE tagname IN (”)substr($tagname, 0, -1)。")");而 ($rs = $this->DB->fetch_all($query)){$tagid 。= $rs['tagid']。',';}$tagid = substr($tagid, 0, -1);$this->DB->db_exec(“DELETE from {$this->db_prefix}tagcache where tagid in ($tagid) and tid = $tid”);$this->DB->db_exec(“UPDATE {$this->db_prefix}tags SET usenum = usenum - 1 WHERE tagid IN ($tagid)”);}$t_tags = array_diff($oldtag, $deltags);$i = count($t_tags);$tagid = '';foreach ($addtags as $key => $value){$rs = $this->DB->fetch_one(“SELECT tagid, usenum, ifopen FROM {$this->db_prefix}tags WHERE tagname = '$value'”); if ($rs){if ($rs['ifopen']){$this->DB->db_exec(“UPDATE {$this->db_prefix}tags SET usenum = usenum + 1 WHERE tagid = ”。
$rs['塔吉德']);$tagid = $rs['tagid'];}else{unset($addtags[$key]); continue; }}else{$this->DB->db_exec(“INSERT INTO {$this->db_prefix}tags (tagname, usenum, hits, ifopen, ifsys, tagpic) VALUES ('$value', 1, 0, 1, 0, '')”); $tagid = $this->DB->db_insert_id(); }$this->DB->db_exec(“INSERT INTO {$this->db_prefix}tagcache (tagid, tid) VALUES ($tagid, $tid)”);如果 ($i++ >= 5) 中断;}$updatesql 。=“ 关键字 = '”。HConvert(addslashes(implode(',', array_merge($t_tags, $addtags))))。"',";}}if ($pb_urlsaveimg && preg_match('~
]*?>~i', $content)){require_once PBDIGG_ROOT。'include/remotefile。函数。php';$content = get_remote_files($content);}$post['content'] != $content && $updateinfosql 。=“ 内容 = '”。添加斜杠($content)。"',";$topicimg = $topicdata = $attanum = $topicimgpath = $tmph = $tmpw = $topictype = $attatid = '';$deltopicimg = 假;if ($allowaupload &&$pb_allowupload){if ($post['topicimg']){list($topicimgpath,$tmph,$tmpw,$topictype) = explode('|', $post['topicimg']); }if ($pb_uploadtopicimg && isset($_FILES['topicimg'])){require_once PBDIGG_ROOT。'收录/上传。 .class.php'; $Upload = new Upload(); $attasize = ($pb_uploadmaxsize
> $uploadmax) ? $uploadmax : $pb_uploadmaxsize; $topicdata = $Upload->moveFile('topic', '', array('gif','jpg','jpeg','bmp','png'), $attasize); if ($topicdata){$topicimg = gdate($timestamp, 'ym')。'/'。$topicdata[0][1]。'。'。$topicdata[0][2]。'|'。$topicdata[0][7][1]。'|'。$topicdata[0][7][2]。“|0”;$updatesql 。= “ topicimg = '$topicimg',”;}else{$updatesql 。= “ topicimg = '',”;$deltopicimg = 真;}$post['topicimg'] && $topictype == '0' && PDel(PBDIGG_ATTACHMENT。'
主题/'。$topicimgpath);}if ($attachments){$uploaddir = getUploadDir(); $filepath = PBDIGG_ATTACHMENT。$uploaddir。'/';foreach ($attachments as $k => $v){PMove(PBDIGG_ATTACHMENT。'temp/'。$v[3]。'。'。$v[4], $filepath。$v[3]。'。'。$v[4]);$v[5] && PMove(PBDIGG_ATTACHMENT。“温度/thumb_”。$v[3]。'。'。$v[4], $filepath。'thumb_'。$v[3]。'。'。$v[4]);if ($pb_uploadtopicimg && $pb_tftopicimg && $v[6] && !$topicimg && !$deltopicimg){$topicimg = makeTopicImg($filepath。$v[3]。'。'。$v[4]);$post['topicimg'] && $topictype == '0' && PDel(PBDIGG_ATTACHMENT。'
主题/'。$topicimgpath);$updatesql 。= “ topicimg = '$topicimg',”;}$this->DB->db_exec(“插入到 {$this->db_prefix}附件 (cid,tid,uid,文件名,文件类型,文件大小,描述,文件路径,isimg,uploaddate,thumb) 值 ('$cid','$tid','$ uid','”。添加斜杠($v[0])。"','"。添加斜杠($v[1])。"',"。intval($v[2])。",'','"。添加斜杠($uploaddir。'/'。$v[3]。'。'。$v[4])。"',"。$v[6]。“,$timestamp,。”$v[5]。")");$aid = $this->DB->db_insert_id();$attachment_pattern[] = '[file='。$k。']';$attachment_replace[] = '[attachment='。
$aid。']';$attatid 。= $aid。',';$ainfo[$aid] = array('aid'=>$aid,'filename'=>$v[0],'filesize'=>$v[2],'filepath'=>$uploaddir。'/'。$v[3]。'。'。$v[4],'文件类型'=>$v[1],'isimg'=>$v[6],'Thumbpath'=>($v[5] ? $uploaddir。'/thumb_'。$v[3]。'。'。$v[4] : “”));++$attanum;}if ($ainfo){$post['ainfo'] && $ainfo = $ainfo + unserialize(stripslashes($post['ainfo'])); $updateinfosql 。= “ ainfo = '”。addslashes(serialize($ainfo))。"',";$updateinfosql = str_replace($attachment_pattern, $attachment_replace, $updateinfosql);$this->DB->db_exec(“UPDATE {$this->db_prefix}members SET uploadnum = uploadnum + $attanum WHERE uid = '$uid'”);}$this->DB->db_exec(“DELETE from {$this->db_prefix}fsession WHERE uid = '$uid' AND timesession = '$timesession'”);}}$this->DB->db_exec(“UPDATE {$this->db_prefix}threads SET $updatesql ifcheck = $ifcheck WHERE tid = '$tid'”);$this->DB->db_exec(“UPDATE {$this->db_prefix}article SET $updateinfosql ifconvert = '$ifconvert' WHERE tid = '$tid'”);重定向(($ifcheck ?“post_newthread_succeed”: “post_newthread_unchecked”), “显示”。
php?tid='。$tid);}else{global $common_message; $attachments = ''; $post['attaexts'] = implode(',', $this->getUploadExts()); $post['attanum'] = $this->getUploadNums(); $post['attasize'] = ceil($this->getUploadSize() / 1024); if ($post['ifconvert']){$post['content'] = ubb_parse($post['content']); }$post['editor'] = getEditor(array(array('id'=>'content','type'=>'PBDigg','content'=>$post['content'],'width'=>600,'height'=>300),array('id'=>'summary','type'=>'Basic', 'content'=>$post['summary'],'width'=>400,'height'=>200)));$post['postdate'] = gdate($post['postdate'], 'Y-m-d H:i:s');if ($post['ainfo']){$post['ainfo'] = unserialize($post['ainfo']); foreach ($post['ainfo'] as $k => $v){$attachments 。= '
|
'; }}$post[“附件”] = &$attachments;if ($post['topicimg']){list($topicimg,,,) = explode('|', $post['topicimg']); $post['topicimg'] = $_PBENV['PB_URL']。$_attdir。'/主题/'。$topicimg;}} }function copy($oldtid, $newtid, $targetcid, $replace_atta) {$data = $this->DB->fetch_one(“SELECT content, ainfo, ifconvert, anonsite FROM {$this->db_prefix}article WHERE tid = '$ oldtid'”); $newainfo = array(); if ($data){if ($data['ainfo'] && $replace_atta){$ainfo = unserialize($data['ainfo']); foreach ($replace_atta as $k => $v){$ainfo[$k]['aid'] = $v; $newainfo[$v] = $ainfo[$k]; }}$replace_atta && $data['content'] = preg_replace('~\[attachment=(\d+?) \]~ie', “replace_atta(\\1, \$replace_atta)”, $data['content']);$newainfo = $newainfo ?addslashes(serialize($newainfo)) : '';$this->DB->db_exec(“INSERT INTO {$this->db_prefix}article (tid, content, ainfo, ifconvert, anonsite) VALUES ('$newtid', '”。
addslashes($data['content'])。“', '$newainfo', '”。$data['ifconvert']。"', '"。addslashes($data['anonsite'])。"')");} }function move($tid, $oldcid, $targetcid) {return; }/*** 显示列表** @param int $cid category ID*/ 函数 category($cid, &$article) {//文章 模型不需要实现该方法 } /*** 显示主题** @param int $tid theme tid*/ function show($tid, &$article) {global $common_message, $pb_ copyctrl, $pb_taglink, $pb_sitedir, $pb_previewsize, $pb_attoutput, $pb_outputmaxsize, $_attdir, $pb_autoshield, $customer; $tinfo = $this->DB->fetch_one(“从 {$this->db_prefix}article 中选择 * 其中 tid = '$tid'”); 如果 (!$tinfo) 返回; $article += $tinfo;未设置($tinfo);$contentShield = $shieldNotice = '';if ($article['ifshield'] || $article['groupid'] == 3 && $pb_autoshield){if ($customer['adminid']){$shieldNotice = articleShield('show_admin_shield'); }else{$article['content'] = articleShield($article['groupid'] == 3 ?“show_auto_shield” : “show_content_shield”); $article['主题'] = articleShield('show_title_shield');$article['altsubject'] = strip_tags($article['subject']);$contentShield = 真;}}if (!$contentShield){$article['content'] = $shieldNotice。
$article['content'];//ubb$article['ifconvert'] && $article['content'] = conentUBB($article['content']); if($pb_taglink && $article['keywords']){global $_tagkeywords; $_tagkeywords = $article['keywords']; $article['content'] = preg_replace('~(^|>)([^'”。$pb_previeww。“')这。宽度='”。$pb_previeww。"';";$pb_previewh && $onload 。=“如果(这个。高度>'”。$pb_预览。“')这。高度='”。$pb_预览。"';";$onload 。= '"'; }require_once PBDIGG_ROOT。'收录/附件。函数。php';$article['内容'] = 附件($article['内容']);foreach ($ainfo as $v){$extension = strtolower(Fext($v['filename'])); $isimg = ($v['isimg'] && in_array($extension, array('jpg', 'jpeg', 'gif', 'png', 'bmp'))) ? true : false; $url = $pb_sitedir。(
($isimg || $pb_attoutput ||($pb_outputmaxsize && $v['filesize'] > $pb_outputmaxsize))?$_attdir。'/'。$v['文件路径'] : '附件。php?aid='。$v[“援助”]);$thumburl = $v[“拇指路径”] ?$pb_sitedir。$_attdir。'/'。$v[“拇指路径”]:$url;if ($isimg){$article['attach_image'][] = array('thumburl'=>$thumburl,'url'=>$url,'filename'=>htmlspecialchars($v['filename']),'onload'=>$onload); }else{$article['attach_other'][] = array('url'=>$url,'filename'=>htmlspecialchars($v['filename']),'icon'=>attachtype($extension)); }}}} /*** 删除分类主题** @param数组$cid分类 cid 数组*/ 函数 delCateArticle($cid) {if (empty($cid)) return;!is_array($cid) && $cid = (array)$cid;$query = $this->DB->db_query(“SELECT TID FROM {$this->db_prefix}threads WHERE cid IN (”)
内爆(',', $cid)。")");$tids = '';而 ($rs = $this->DB->fetch_all($query)){$tids 。= ($tids ?',' : '')。$rs['tid'];}$tids && $this->DB->db_exec(“DELETE FROM {$this->db_prefix}article where tid in ($tids)”); }function delattachment($tid, $aid) {$article = $this->DB->fetch_one(“SELECT ainfo FROM {$this->db_prefix}article WHERE TID = '$tid'”); if ($article && $article['ainfo']){$ainfo = unserialize($article['ainfo']); unset($ainfo[$aid]); $ainfo = $ainfo ? addslashes(serialize($ainfo)) : ''; $this->DB->db_exec(“UPDATE {$this->db_prefix}article SET ainfo = '$ainfo' WHERE tid = '$tid'”); } }/*** 返回允许上传的附件类型* @return 数组附件后缀数组*/ 函数 getUploadExts($type = 'attachment') {global $pb_uploadfiletype, $uploadtype; $exts = array(); if ($type == 'commend') $uploadtype = 'jpg,jpeg,gif,png,bmp'; if ($pb_uploadfiletype && $uploadtype){$haystack = ','。
strtolower($pb_uploadfiletype)。',';$exts = 爆炸(',', strtolower($uploadtype));foreach ($exts as $key => $ext){if (strpos($haystack, ',')。$ext。',') === FALSE){unset($exts[$key]); }}}返回$exts; } /*** 允许上传的最大附件大小*/ 函数 getUploadSize() {global $pb_uploadmaxsize, $uploadmax; return ($pb_uploadmaxsize > $uploadmax) ? $uploadmax : $pb_uploadmaxsize; } /*** 单个上传中上传的附件数*/ 函数 getUploadNums($type = 'attachment') {global $pb_attachnum; return $type == 'attachment' ? intval($pb_attachnum) : '1'; }/*** 模型变量调用接口* @param 字符串$field字段名称* @param字符串$table表名* @param rel $var引用参数*/ 函数传输($field、$table &$var) { // $this->${'transfer_'.
$field}($var); } } //article。 .class.php end $post = array();// $currentModuleObj = $module->getModuleObject($moduleid);// !$currentModuleObj && showMsg('illegal_request');// $moduleIdentifier = $currentModuleData[' identifier'];// $currentModuleObj->$action($post, $tid);$currentModuleObj= 新文章; $moduleIdentifier =“文章”; $currentModuleObj->添加($post);} else { /* $moduleList = array(); $modules = $module->getSingleModuleData(); foreach ($modules as $k => $v) {in_array($k, $currentCateData['ttype']) && $v[$v['标识符']。
'_status'] && $moduleList[] = $v; } empty($moduleList) && showMsg('post_module_error'); */ showMsg('post_module_error');//zzcity add }}else{ /* $cid = $moduleid = ''; $chosecate = ''; unlimitBlockMenu($chosecate); */ echo('[err]invalid cid[/err]'); zzcity add exit(); }function unlimitBlockMenu(&$menu, $start = 0){ $child = getChild($start); $menu 。= '';}function getChild($cid){ global $_categories; $child = array(); foreach($_categories as $k => $v) { $v['cup'] == $cid && $child[$k] = $v; } return $child; }function checkModuleID($moduleid){ global $module, $currentCateData, $currentModuleData; if ($moduleid && $module->checkModuleID($moduleid) && in_array($moduleid, $currentCateData['ttype'])) { $currentModuleData = $module->getSingleModuleData($moduleid); if ($currentModuleData[$currentModuleData['标识符']。“_status”]) 返回$currentModuleData;}}//$pb_seotitle = $post_message['post_'。$action。'_title'];//require_once pt_fetch('post');//PBOutPut();?>