From 70ef9777c4f06473efc39ae803467964c843b681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=99=E8=BF=B0=E3=80=81=E5=88=AB=E7=A6=BB?= <93301500+xushubieli@users.noreply.github.com> Date: Thu, 1 Dec 2022 14:24:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=AF=B7=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/templets/index_body.htm | 10 +- src/apps/rss.php | 17 - src/system/archive/partview.class.php | 54 +-- src/system/archive/rssview.class.php | 210 --------- src/system/autoload.inc.php | 9 +- src/system/autoload7.inc.php | 9 +- src/system/channelunit.class.php | 1 + src/system/channelunit.func.php | 2 +- src/system/charset.func.php | 5 +- src/system/customfields.func.php | 2 +- src/system/dedecollection.func.php | 496 ---------------------- src/system/downmix.inc.php | 3 +- src/system/helpers/cache.helper.php | 2 +- src/system/libraries/dedebiz.class.php | 26 +- src/system/libraries/statistics.class.php | 5 +- src/system/memberlogin.class.php | 4 +- src/system/userlogin.class.php | 2 +- 17 files changed, 33 insertions(+), 824 deletions(-) delete mode 100755 src/apps/rss.php delete mode 100755 src/system/archive/rssview.class.php delete mode 100755 src/system/dedecollection.func.php diff --git a/src/admin/templets/index_body.htm b/src/admin/templets/index_body.htm index 8dbc368e..27541e87 100644 --- a/src/admin/templets/index_body.htm +++ b/src/admin/templets/index_body.htm @@ -70,31 +70,31 @@
- - - - -
+

操作系统

+

WEB服务器

+

IP地址

+

PHP版本

+

数据库版本

GetVersion();?> diff --git a/src/apps/rss.php b/src/apps/rss.php deleted file mode 100755 index 054a3b21..00000000 --- a/src/apps/rss.php +++ /dev/null @@ -1,17 +0,0 @@ -Display(); -?> \ No newline at end of file diff --git a/src/system/archive/partview.class.php b/src/system/archive/partview.class.php index f9f4f6aa..4f7b1e4b 100755 --- a/src/system/archive/partview.class.php +++ b/src/system/archive/partview.class.php @@ -207,32 +207,7 @@ class PartView * @param object $ctag * @return array */ - function GetArcList( - $templets = '', - $typeid = 0, - $row = 10, - $col = 1, - $titlelen = 30, - $infolen = 160, - $imgwidth = 120, - $imgheight = 90, - $listtype = "all", - $orderby = "default", - $keyword = "", - $innertext = "", - $tablewidth = "100", - $arcid = 0, - $idlist = "", - $channelid = 0, - $limit = "", - $att = 0, - $order = 'desc', - $subday = 0, - $autopartid = -1, - $ismember = 0, - $maintable = '', - $ctag = '' - ) { + function GetArcList($templets='',$typeid = 0,$row = 10,$col = 1,$titlelen = 30,$infolen = 160,$imgwidth = 120,$imgheight = 90,$listtype = "all",$orderby = "default",$keyword = "",$innertext = "",$tablewidth = "100",$arcid = 0,$idlist = "",$channelid = 0,$limit = "",$att = 0,$order = 'desc',$subday = 0,$autopartid = -1,$ismember = 0,$maintable = '',$ctag = '') { if (empty($autopartid)) { $autopartid = -1; } @@ -248,32 +223,7 @@ class PartView if (!isset($GLOBALS['__SpGetArcList'])) { require_once(dirname(__FILE__)."/inc/inc_fun_SpGetArcList.php"); } - return SpGetArcList( - $this->dsql, - $templets, - $typeid, - $row, - $col, - $titlelen, - $infolen, - $imgwidth, - $imgheight, - $listtype, - $orderby, - $keyword, - $innertext, - $tablewidth, - $arcid, - $idlist, - $channelid, - $limit, - $att, - $order, - $subday, - $ismember, - $maintable, - $ctag - ); + return SpGetArcList($this->dsql,$templets,$typeid,$row,$col,$titlelen,$infolen,$imgwidth,$imgheight,$listtype,$orderby,$keyword,$innertext,$tablewidth,$arcid,$idlist,$channelid,$limit,$att,$order,$subday,$ismember,$maintable,$ctag); } //关闭所占用的资源 function Close() diff --git a/src/system/archive/rssview.class.php b/src/system/archive/rssview.class.php deleted file mode 100755 index 853252d3..00000000 --- a/src/system/archive/rssview.class.php +++ /dev/null @@ -1,210 +0,0 @@ -TypeID = $typeid; - $this->dtp = new DedeTagParse(); - $this->dtp->refObj = $this; - $templetfiles = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/plus/rss.htm"; - $this->dtp->LoadTemplate($templetfiles); - $this->dsql = $GLOBALS['dsql']; - $this->TypeLink = new TypeLink($typeid); - $this->TypeFields = $this->TypeLink->TypeInfos; - $this->MaxRow = $max_row; - $this->TypeFields['title'] = $this->TypeLink->GetPositionLink(false); - $this->TypeFields['title'] = preg_replace("/[<>]/", " / ", $this->TypeFields['title']); - $this->TypeFields['typelink'] = $GLOBALS['cfg_basehost'].$this->TypeLink->GetOneTypeUrl($this->TypeFields); - $this->TypeFields['powerby'] = $GLOBALS['cfg_powerby']; - $this->TypeFields['adminemail'] = $GLOBALS['cfg_adminemail']; - $this->remoteDir = ''; - foreach ($this->TypeFields as $k => $v) { - $this->TypeFields[$k] = dede_htmlspecialchars($v); - } - $this->ParseTemplet(); - } - //php4构造函数 - function RssView($typeid, $max_row = 50) - { - $this->__construct($typeid, $max_row); - } - //关闭相关资源 - function Close() - { - } - /** - * 显示列表 - * - * @access public - * @return void - */ - function Display() - { - $this->dtp->Display(); - } - /** - * 开始创建列表 - * - * @access public - * @param string $isremote 是否远程 - * @return string - */ - function MakeRss($isremote = 0) - { - $murl = $GLOBALS['cfg_cmspath']."/static/rss/".$this->TypeID.".xml"; - $mfile = $GLOBALS['cfg_basedir'].$murl; - $this->dtp->SaveTo($mfile); - return $murl; - } - /** - * 解析模板 - * - * @access public - * @return void - */ - function ParseTemplet() - { - foreach ($this->dtp->CTags as $tid => $ctag) { - if ($ctag->GetName() == "field") { - $this->dtp->Assign($tid, $this->TypeFields[$ctag->GetAtt('name')]); - } else if ($ctag->GetName() == "rssitem") { - $this->dtp->Assign( - $tid, - $this->GetArcList($ctag->GetInnerText()) - ); - } - } - } - /** - * 获得文档列表 - * - * @access public - * @param string $innertext 底层模板 - * @return string - */ - function GetArcList($innertext = "") - { - $typeid = $this->TypeID; - $innertext = trim($innertext); - if ($innertext == "") { - $innertext = GetSysTemplets("rss.htm"); - } - $orwhere = " arc.arcrank > -1 "; - $orwhere .= " AND (arc.typeid in (".GetSonIds($this->TypeID, $this->TypeFields['channeltype']).") ) "; - $ordersql = " ORDER BY arc.id desc"; - $query = "SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id WHERE $orwhere $ordersql LIMIT 0,".$this->MaxRow; - $this->dsql->SetQuery($query); - $this->dsql->Execute('al'); - $artlist = ''; - $dtp2 = new DedeTagParse(); - $dtp2->SetNameSpace('field', '[', ']'); - $dtp2->LoadSource($innertext); - while ($row = $this->dsql->GetArray('al')) { - //处理一些特殊字段 - if ($row['litpic'] == '-' || $row['litpic'] == '') { - $row['litpic'] = $GLOBALS['cfg_cmspath'].'/static/web/img/thumbnail.jpg'; - } - if (!preg_match("/^http:\/\//", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') { - $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic']; - } - $row['picname'] = $row['litpic']; - $row["arcurl"] = GetFileUrl( - $row["id"], - $row["typeid"], - $row["senddate"], - $row["title"], - $row["ismake"], - $row["arcrank"], - $row["namerule"], - $row["typedir"], - $row["money"], - $row['filename'], - $row["moresite"], - $row["siteurl"], - $row["sitepath"] - ); - $row["typeurl"] = GetTypeUrl( - $row["typeid"], - $row["typedir"], - $row["isdefault"], - $row["defaultname"], - $row["ispart"], - $row["namerule2"], - $row["moresite"], - $row["siteurl"], - $row["sitepath"] - ); - $row["info"] = $row["description"]; - $row["filename"] = $row["arcurl"]; - $row["stime"] = GetDateMK($row["pubdate"]); - $row["image"] = ""; - $row["fullurl"] = $GLOBALS["cfg_basehost"].$row["arcurl"]; - if ($GLOBALS['cfg_multi_site'] == 'Y') $row["fullurl"] = $row["arcurl"]; - $row["phpurl"] = $GLOBALS["cfg_plus_dir"]; - $row["templeturl"] = $GLOBALS["cfg_templets_dir"]; - if ($row["source"] == '') { - $row["source"] = $GLOBALS['cfg_webname']; - } - if ($row["writer"] == '') { - $row["writer"] = "张生"; - } - foreach ($row as $k => $v) { - $row[$k] = dede_htmlspecialchars($v); - } - if (is_array($dtp2->CTags)) { - foreach ($dtp2->CTags as $k => $ctag) { - if ($ctag->GetName() == 'array') { - //传递整个数组,在runphp模式中有特殊作用 - $dtp2->Assign($k, $row); - } else { - if (isset($row[$ctag->GetName()])) { - $dtp2->Assign($k, $row[$ctag->GetName()]); - } else { - $dtp2->Assign($k, ''); - } - } - } - } - $artlist .= $dtp2->GetResult()."\r\n"; - } - $this->dsql->FreeResult('al'); - return $artlist; - } -}//End Class -?> \ No newline at end of file diff --git a/src/system/autoload.inc.php b/src/system/autoload.inc.php index 414f9fd9..97808d84 100755 --- a/src/system/autoload.inc.php +++ b/src/system/autoload.inc.php @@ -11,20 +11,17 @@ function __autoload($classname) { $classname = preg_replace("/[^0-9a-z_]/i", '', $classname); $classname = strtolower($classname); - if ( class_exists ( $classname ) ) - { + if (class_exists($classname)) { return TRUE; } if (in_array($classname, array("archives","freelist","listview","partview","rssview","searchview","sglistview","sgpage","specview","taglist"))) { $classname = "archive/".$classname; } $libclassfile = $classname.'.class.php'; - if ( is_file ( DEDEINC.'/'.$libclassfile ) ) - { + if (is_file(DEDEINC.'/'.$libclassfile)) { require DEDEINC.'/'.$libclassfile; } else { - if (DEBUG_LEVEL === TRUE) - { + if (DEBUG_LEVEL === TRUE) { echo '
';
             echo $classname.'类找不到';
             echo '
'; diff --git a/src/system/autoload7.inc.php b/src/system/autoload7.inc.php index 05183838..9a9b2740 100755 --- a/src/system/autoload7.inc.php +++ b/src/system/autoload7.inc.php @@ -11,20 +11,17 @@ function dede_autoloader($classname) { $classname = preg_replace("/[^0-9a-z_]/i", '', $classname); $classname = strtolower($classname); - if ( class_exists ( $classname ) ) - { + if (class_exists($classname)) { return TRUE; } if (in_array($classname, array("archives","freelist","listview","partview","rssview","searchview","sglistview","sgpage","specview","taglist"))) { $classname = "archive/".$classname; } $libclassfile = $classname.'.class.php'; - if ( is_file ( DEDEINC.'/'.$libclassfile ) ) - { + if (is_file(DEDEINC.'/'.$libclassfile )) { require DEDEINC.'/'.$libclassfile; } else { - if (DEBUG_LEVEL === TRUE) - { + if (DEBUG_LEVEL === TRUE) { echo '
';
             echo $classname.'类找不到';
             echo '
'; diff --git a/src/system/channelunit.class.php b/src/system/channelunit.class.php index 43b4568c..6c3e86d6 100755 --- a/src/system/channelunit.class.php +++ b/src/system/channelunit.class.php @@ -2,6 +2,7 @@ if (!defined('DEDEINC')) exit('dedebiz'); /** * 栏目模型单元类 + * * @version $id:channelunit.class.php 2 17:32 2010年7月6日 tianya $ * @package DedeBIZ.Libraries * @copyright Copyright (c) 2022 DedeBIZ.COM diff --git a/src/system/channelunit.func.php b/src/system/channelunit.func.php index 57f9924e..e4b1de1b 100755 --- a/src/system/channelunit.func.php +++ b/src/system/channelunit.func.php @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/src/system/customfields.func.php b/src/system/customfields.func.php index d5cc6d50..be1ac650 100755 --- a/src/system/customfields.func.php +++ b/src/system/customfields.func.php @@ -9,7 +9,7 @@ if (!defined('DEDEINC')) exit('dedebiz'); * @link https://www.dedebiz.com */ /** - * 获得一个附加表单(发布时用) + * 获得一个附加表单发布时用 * * @access public * @param object $ctag 标签 diff --git a/src/system/dedecollection.func.php b/src/system/dedecollection.func.php deleted file mode 100755 index 7af830ff..00000000 --- a/src/system/dedecollection.func.php +++ /dev/null @@ -1,496 +0,0 @@ - 100) { - break; - } - $hkey = ""; - $hvalue = ""; - $v = 0; - for ($i = 0; $i < strlen($line); $i++) { - if ($v == 1) { - $hvalue .= $line[$i]; - } - if ($line[$i] == ":") { - $v = 1; - } - if ($v == 0) { - $hkey .= $line[$i]; - } - } - $hkey = trim($hkey); - if ($hkey != "") { - $m_httphead[strtolower($hkey)] = trim($hvalue); - } - } - //分析返回记录 - if (preg_match("/^3/", $m_httphead["http-state"])) { - if (isset($m_httphead["location"]) && $JumpCount < 3) { - $JumpCount++; - DownImageKeep($gurl, $rfurl, $filename, $gcookie, $JumpCount); - } else { - return FALSE; - } - } - if (!preg_match("/^2/", $m_httphead["http-state"])) { - return FALSE; - } - if (!isset($m_httphead)) { - return FALSE; - } - $contentLength = $m_httphead['content-length']; - //保存文件 - $fp = fopen($filename, "w") or die("写入文件:{$filename} 失败"); - $i = 0; - $okdata = ""; - $starttime = time(); - while (!feof($m_fp)) { - $okdata .= fgetc($m_fp); - $i++; - //超时结束 - if (time() - $starttime > $maxtime) { - break; - } - //到达指定大小结束 - if ($i >= $contentLength) { - break; - } - } - if ($okdata != "") { - fwrite($fp, $okdata); - } - fclose($fp); - if ($okdata == "") { - @unlink($filename); - fclose($m_fp); - return FALSE; - } - fclose($m_fp); - return TRUE; -} -/** - * 获得某页面返回的Cookie信息 - * - * @access public - * @param string $gurl 调整地址 - * @return string - */ -function RefurlCookie($gurl) -{ - global $gcookie, $lastRfurl; - $gurl = trim($gurl); - if (!empty($gcookie) && $lastRfurl == $gurl) { - return $gcookie; - } else { - $lastRfurl = $gurl; - } - if (trim($gurl) == '') { - return ''; - } - $urlinfos = GetHostInfo($gurl); - $ghost = $urlinfos['host']; - $gquery = $urlinfos['query']; - $sessionQuery = "GET $gquery HTTP/1.1\r\n"; - $sessionQuery .= "Host: $ghost\r\n"; - $sessionQuery .= "Accept: */*\r\n"; - $sessionQuery .= "User-Agent: Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)\r\n"; - $sessionQuery .= "Connection: Close\r\n\r\n"; - $errno = ""; - $errstr = ""; - $m_fp = fsockopen($ghost, 80, $errno, $errstr, 10) or die($ghost.'
'); - fwrite($m_fp, $sessionQuery); - $lnum = 0; - //获取详细应答头 - $gcookie = ""; - while (!feof($m_fp)) { - $line = trim(fgets($m_fp, 256)); - if ($line == "" || $lnum > 100) { - break; - } else { - if (preg_match("/^cookie/i", $line)) { - $gcookie = $line; - break; - } - } - } - fclose($m_fp); - return $gcookie; -} -/** - * 获得网址的host和query部份 - * - * @access public - * @param string $gurl 调整地址 - * @return string - */ -function GetHostInfo($gurl) -{ - $gurl = preg_replace("/^http:\/\//i", "", trim($gurl)); - $garr['host'] = preg_replace("/\/(.*)$/i", "", $gurl); - $garr['query'] = "/".preg_replace("/^([^\/]*)\//i", "", $gurl); - return $garr; -} - -/** - * HTML里的网址格式转换 - * - * @access public - * @param string $body 文档 - * @return string - */ -function TurnLinkTag(&$body) -{ - $ttx = ''; - $handid = '服务器'; - preg_match_all("/]+?)>(.+?)<\/a>/is", $body, $match); - if (is_array($match[1]) && count($match[1]) > 0) { - for ($i = 0; isset($match[1][$i]); $i++) { - $servername = (isset($match[3][$i]) ? str_replace("'", "`", $match[3][$i]) : $handid.($i + 1)); - if (preg_match("/[<>]/", $servername) || strlen($servername) > 40) { - $servername = $handid.($i + 1); - } - $ttx .= "{dede:link text='$servername'} {$match[1][$i]} {/dede:link}\r\n"; - } - } - return $ttx; -} -/** - * 替换XML的CDATA - * - * @access public - * @param string $str 字符串 - * @return string - */ -function RpCdata($str) -{ - $str = str_replace('', '', $str); - return $str; -} -/** - * 分析RSS里的链接 - * - * @access public - * @param string $rssurl rss地址 - * @return string - */ -function GetRssLinks($rssurl) -{ - global $cfg_soft_lang; - $dhd = new DedeHttpDown(); - $dhd->OpenUrl($rssurl); - $rsshtml = $dhd->GetHtml(); - //分析编码 - preg_match("/encoding=[\"']([^\"']*)[\"']/is", $rsshtml, $infos); - if (isset($infos[1])) { - $pcode = strtolower(trim($infos[1])); - } else { - $pcode = strtolower($cfg_soft_lang); - } - if ($cfg_soft_lang == 'gb2312') { - if ($pcode == 'utf-8') { - $rsshtml = utf82gb($rsshtml); - } else if ($pcode == 'big5') { - $rsshtml = big52gb($rsshtml); - } - } else if ($cfg_soft_lang == 'utf-8') { - if ($pcode == 'gbk' || $pcode == 'gb2312') { - $rsshtml = gb2utf8($rsshtml); - } else if ($pcode == 'big5') { - $rsshtml = gb2utf8(big52gb($rsshtml)); - } - } - $rsarr = array(); - preg_match_all("/(.*)<\/title>/isU", $rsshtml, $titles); - preg_match_all("/(.*)<\/link>/isU", $rsshtml, $links); - preg_match_all("/(.*)<\/description>/isU", $rsshtml, $descriptions); - if (!isset($links[2])) { - return ''; - } - foreach ($links[2] as $k => $v) { - $rsarr[$k]['link'] = RpCdata($v); - - if (isset($titles[2][$k])) { - $rsarr[$k]['title'] = RpCdata($titles[2][$k]); - } else { - $rsarr[$k]['title'] = preg_replace("/^(.*)\//i", "", RpCdata($titles[2][$k])); - } - if (isset($descriptions[2][$k])) { - $rsarr[$k]['image'] = GetddImgFromRss($descriptions[2][$k], $rssurl); - } else { - $rsarr[$k]['image'] = ''; - } - } - return $rsarr; -} -/** - * 从RSS摘要获取图片信息 - * - * @access public - * @param string $descriptions 描述 - * @param string $refurl 来源地址 - * @return string - */ -function GetddImgFromRss($descriptions, $refurl) -{ - if ($descriptions == '') { - return ''; - } - preg_match_all("/ \r\n\t]{1,}/isU", $descriptions, $imgs); - if (isset($imgs[2][0])) { - $imgs[2][0] = preg_replace("/[\"']/", '', $imgs[2][0]); - $imgs[2][0] = preg_replace("/\/{1,}/", '/', $imgs[2][0]); - return FillUrl($refurl, $imgs[2][0]); - } else { - return ''; - } -} -/** - * 补全网址 - * - * @access public - * @param string $refurl 来源地址 - * @param string $surl 站点地址 - * @return string - */ -function FillUrl($refurl, $surl) -{ - $i = $pathStep = 0; - $dstr = $pstr = $okurl = ''; - $refurl = trim($refurl); - $surl = trim($surl); - $urls = @parse_url($refurl); - $basehost = ((!isset($urls['port']) || $urls['port'] == '80') ? $urls['host'] : $urls['host'].':'.$urls['port']); - //$basepath = $basehost.(!isset($urls['path']) ? '' : '/'.$urls['path']); - //由于直接获得的path在处理 http://xxxx/nnn/aaa?fdsafd 这种情况时会有错误,因此用其它方式处理 - $basepath = $basehost; - $paths = explode('/', preg_replace("/^http:\/\//i", "", $refurl)); - $n = count($paths); - for ($i = 1; $i < ($n - 1); $i++) { - if (!preg_match("/[\?]/", $paths[$i])) $basepath .= '/'.$paths[$i]; - } - if (!preg_match("/[\?\.]/", $paths[$n - 1])) { - $basepath .= '/'.$paths[$n - 1]; - } - if ($surl == '') { - return $basepath; - } - $pos = strpos($surl, "#"); - if ($pos > 0) { - $surl = substr($surl, 0, $pos); - } - //用 '/' 表示网站根的网址 - if ($surl[0] == '/') { - $okurl = $basehost.$surl; - } else if ($surl[0] == '.') { - if (strlen($surl) <= 2) { - return ''; - } else if ($surl[1] == '/') { - $okurl = $basepath.preg_replace('/^./', '', $surl); - } else { - $okurl = $basepath.'/'.$surl; - } - } else { - if (strlen($surl) < 7) { - $okurl = $basepath.'/'.$surl; - } else if (preg_match("/^http:\/\//i", $surl)) { - $okurl = $surl; - } else { - $okurl = $basepath.'/'.$surl; - } - } - $okurl = preg_replace("/^http:\/\//i", '', $okurl); - $okurl = 'http://'.preg_replace("/\/{1,}/", '/', $okurl); - return $okurl; -} -/** - * 从匹配规则中获取列表网址 - * - * @access public - * @param string $regxurl 正则地址 - * @param string $handurl 操作地址 - * @param string $startid 开始id - * @param string $endid 结束id - * @param string $addv 增值 - * @param string $usemore 使用更多 - * @param string $batchrule 列表规则 - * @return string - */ -function GetUrlFromListRule($regxurl = '', $handurl = '', $startid = 0, $endid = 0, $addv = 1, $usemore = 0, $batchrule = '') -{ - global $dsql, $islisten; - $lists = array(); - $n = 0; - $islisten = (empty($islisten) ? 0 : $islisten); - if ($handurl != '') { - $handurls = explode("\n", $handurl); - foreach ($handurls as $handurl) { - $handurl = trim($handurl); - if (preg_match("/^http:\/\//i", $handurl)) { - $lists[$n][0] = $handurl; - $lists[$n][1] = 0; - $n++; - if ($islisten == 1) { - break; - } - } - } - } - if ($regxurl != '') { - //没指定(#)和(*) - if (!preg_match("/\(\*\)/i", $regxurl) && !preg_match("/\(#\)/", $regxurl)) { - $lists[$n][0] = $regxurl; - $lists[$n][1] = 0; - $n++; - } else { - if ($addv <= 0) { - $addv = 1; - } - //没指定多栏目匹配规则 - if ($usemore == 0) { - while ($startid <= $endid) { - $lists[$n][0] = str_replace("(*)", sprintf('%0'.strlen($startid).'d', $startid), $regxurl); - $lists[$n][1] = 0; - $startid = sprintf('%0'.strlen($startid).'d', $startid + $addv); - $n++; - if ($n > 2000 || $islisten == 1) { - break; - } - } - } - //匹配多个栏目 - //规则表达式 [(#)=>(#)匹配的网址; (*)=>(*)的范围,如:1-20; typeid=>栏目id; addurl=>附加的网址(用|分开多个)] - else { - $nrules = explode(']', trim($batchrule)); - foreach ($nrules as $nrule) { - $nrule = trim($nrule); - $nrule = preg_replace("/^\[|\]$/", '', $nrule); - $nrules = explode(';', $nrule); - if (count($nrules) < 3) { - continue; - } - $brtag = ''; - $startid = 0; - $endid = 0; - $typeid = 0; - $addurls = array(); - foreach ($nrules as $nrule) { - $nrule = trim($nrule); - list($k, $v) = explode('=>', $nrule); - if (trim($k) == '(#)') { - $brtag = trim($v); - } else if (trim($k) == 'typeid') { - $typeid = trim($v); - } else if (trim($k) == 'addurl') { - $addurl = trim($v); - $addurls = explode('|', $addurl); - } else if (trim($k) == '(*)') { - $v = preg_replace("/[ \r\n\t]/", '', trim($v)); - list($startid, $endid) = explode('-', $v); - } - } - //如果栏目用栏目名称 - if (preg_match('/[^0-9]/', $typeid)) { - $arr = $dsql->GetOne("SELECT id FROM `#@__arctype` WHERE typename LIKE '$typeid' "); - if (is_array($arr)) { - $typeid = $arr['id']; - } else { - $typeid = 0; - } - } - //附加网址优先 - $mjj = 0; - if (isset($addurls[0])) { - foreach ($addurls as $addurl) { - $addurl = trim($addurl); - if ($addurl == '') { - continue; - } - $lists[$n][0] = $addurl; - $lists[$n][1] = $typeid; - $n++; - $mjj++; - if ($islisten == 1) { - break; - } - } - } - //如果为非监听模式或监听模式没手工指定的附加网址 - if ($islisten != 1 || $mjj == 0) { - //匹配规则里的网址,注:(#)的网址是是允许使用(*)的 - while ($startid <= $endid) { - $lists[$n][0] = str_replace("(#)", $brtag, $regxurl); - $lists[$n][0] = str_replace("(*)", sprintf('%0'.strlen($startid).'d', $startid), $lists[$n][0]); - $lists[$n][1] = $typeid; - $startid = sprintf('%0'.strlen($startid).'d', $startid + $addv); - $n++; - if ($islisten == 1) { - break; - } - if ($n > 20000) { - break; - } - } - } - } - } //End 匹配多栏目 - } //End使用规则匹配的情况 - } - return $lists; -}//End -?> \ No newline at end of file diff --git a/src/system/downmix.inc.php b/src/system/downmix.inc.php index b9b8baeb..ee459a90 100755 --- a/src/system/downmix.inc.php +++ b/src/system/downmix.inc.php @@ -9,7 +9,6 @@ if (!defined('DEDEINC')) exit('dedebiz'); * @license https://www.dedebiz.com/license * @link https://www.dedebiz.com */ -//引入小助手 -//本版本的文件暂时仅作一个映射,今后开发直接采用helper('downmix');进行调用 +//仅作一个映射,开发直接采用helper('downmix');进行调用 helper('downmix'); ?> \ No newline at end of file diff --git a/src/system/helpers/cache.helper.php b/src/system/helpers/cache.helper.php index d0dff6de..479d1490 100755 --- a/src/system/helpers/cache.helper.php +++ b/src/system/helpers/cache.helper.php @@ -1,7 +1,7 @@ request($req); } - //缓存 - //$key:键 $val:值 $d:缓存时间 + //缓存:$key键 $val值 $d缓存时间 function CacheSet($key, $val, $duration) { $req = array( @@ -157,8 +150,7 @@ class DedeBizClient ); return $this->request($req); } - //获取缓存文档 - //$key:键 + //获取缓存文档:$key键 function CacheGet($key) { $req = array( @@ -169,8 +161,7 @@ class DedeBizClient ); return $this->request($req); } - //删除缓存文档 - //$key:键 + //删除缓存文档:$key键 function CacheDel($key) { $req = array( @@ -181,8 +172,7 @@ class DedeBizClient ); return $this->request($req); } - //获取分词结果 - //$key:键 + //获取分词结果:$key键 function Spliteword($body) { $req = array( @@ -193,8 +183,7 @@ class DedeBizClient ); return $this->request($req); } - //获取分词结果 - //$body:文档 $sep:分隔符 + //获取分词结果:$body文档 $sep分隔符 function Pinyin($body, $sep) { $req = array( @@ -238,8 +227,7 @@ class DedeBizClient return null; } } - //关闭通信接口 - //一次页面操作后一定记得要关闭连接,否则会占用系统资源 + //关闭通信接口,一次页面操作后一定记得要关闭连接,否则会占用系统资源 function Close() { //这里避免重复释放 diff --git a/src/system/libraries/statistics.class.php b/src/system/libraries/statistics.class.php index 14e8540e..fd3634b8 100644 --- a/src/system/libraries/statistics.class.php +++ b/src/system/libraries/statistics.class.php @@ -2,8 +2,7 @@ if (!defined('DEDEINC')) exit('dedebiz'); require_once(DEDEINC."/libraries/agent.class.php"); /** - * 流量统计 - * 一个轻量级流量统计功能 + * 轻量级流量统计 * * @version $id:statistics.class.php 11:42 2022年03月26日 tianya $ * @package DedeBIZ.Libraries @@ -15,7 +14,7 @@ class DedeStatistics { function __construct() { } - //获取统计JS + //获取统计js function GetStat() { global $envs,$cfg_cookie_encode; diff --git a/src/system/memberlogin.class.php b/src/system/memberlogin.class.php index 9317f748..5054ace5 100755 --- a/src/system/memberlogin.class.php +++ b/src/system/memberlogin.class.php @@ -42,7 +42,7 @@ function CheckUserID($uid, $msgtitle = '用户名', $ckhas = TRUE) if (isset($ck_uid[$i + 1]) && ord($ck_uid[$i + 1]) > 0x40) { $i++; } else { - return $msgtitle.'可能含有乱码,建议您改用英文字母和数字组合'; + return $msgtitle.'建议用英文字母和数字组合'; } } else { if (preg_match("/[^0-9a-z@\.-]/i", $ck_uid[$i])) { @@ -267,7 +267,7 @@ class MemberLogin { global $dsql; $mid = $this->M_ID; - $arr = $dsql->GetOne("Select * `#@__member_tj` WHERE mid='$mid' "); + $arr = $dsql->GetOne("SELECT * `#@__member_tj` WHERE mid='$mid' "); if (!is_array($arr)) { $arr = array('article' => 0, 'album' => 0, 'archives' => 0, 'homecount' => 0, 'pagecount' => 0, 'feedback' => 0, 'friend' => 0, 'stow' => 0); } diff --git a/src/system/userlogin.class.php b/src/system/userlogin.class.php index eef5a4e2..130577cc 100755 --- a/src/system/userlogin.class.php +++ b/src/system/userlogin.class.php @@ -11,7 +11,7 @@ if (!defined('DEDEINC')) exit('dedebiz'); */ session_start(); /** - * 检验用户是否有权使用某功能,这个函数是一个回值函数 + * 检验用户是否有权使用某功能,这个函数是一个回值函数 * CheckPurview函数只是对他回值的一个处理过程 * * @access public