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"] = "'; 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("/ |