From 2d5bbafa74566dd79dbd47b37d542fce2814dd79 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: Wed, 1 Mar 2023 18:12:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/inc/inc_admin_channel.php | 63 +++++++----------------- src/admin/inc/inc_archives_functions.php | 4 +- src/system/archive/freelist.class.php | 4 +- src/system/archive/listview.class.php | 2 +- src/system/archive/sglistview.class.php | 2 +- src/system/taglib/arclist.lib.php | 4 +- src/system/taglib/arclistsg.lib.php | 7 ++- src/user/inc/inc_archives_functions.php | 4 +- 8 files changed, 29 insertions(+), 61 deletions(-) diff --git a/src/admin/inc/inc_admin_channel.php b/src/admin/inc/inc_admin_channel.php index 7e9aab9b..0d6097d3 100644 --- a/src/admin/inc/inc_admin_channel.php +++ b/src/admin/inc/inc_admin_channel.php @@ -12,88 +12,63 @@ function GetFieldMake($dtype, $fieldname, $dfvalue, $mxlen) { $fields = array(); - if ($dtype == "int" || $dtype == "datetime") - { - if ($dfvalue == "" || preg_match("#[^0-9-]#", $dfvalue)) - { + if ($dtype == "int" || $dtype == "datetime") { + if ($dfvalue == "" || preg_match("#[^0-9-]#", $dfvalue)) { $dfvalue = 0; } $fields[0] = " `$fieldname` int(11) NOT NULL default '$dfvalue';"; $fields[1] = "int(11)"; - } - else if ($dtype == "stepselect") - { - if ($dfvalue == "" || preg_match("#[^0-9\.-]#", $dfvalue)) - { + } else if ($dtype == "stepselect") { + if ($dfvalue == "" || preg_match("#[^0-9\.-]#", $dfvalue)) { $dfvalue = 0; } $fields[0] = " `$fieldname` char(20) NOT NULL default '$dfvalue';"; $fields[1] = "char(20)"; - } - else if ($dtype == "float") - { - if ($dfvalue == "" || preg_match("#[^0-9\.-]#", $dfvalue)) - { + } else if ($dtype == "float") { + if ($dfvalue == "" || preg_match("#[^0-9\.-]#", $dfvalue)) { $dfvalue = 0; } $fields[0] = " `$fieldname` float NOT NULL default '$dfvalue';"; $fields[1] = "float"; - } - else if ($dtype == "img" || $dtype == "media" || $dtype == "addon" || $dtype == "imgfile") - { + } else if ($dtype == "img" || $dtype == "media" || $dtype == "addon" || $dtype == "imgfile") { if (empty($dfvalue)) $dfvalue = ''; if ($mxlen=="") $mxlen = 200; if ($mxlen > 255) $mxlen = 100; - $fields[0] = " `$fieldname` varchar($mxlen) NOT NULL default '$dfvalue';"; $fields[1] = "varchar($mxlen)"; - } - else if ($dtype == "multitext" || $dtype == "htmltext") - { + } else if ($dtype == "multitext" || $dtype == "htmltext") { $fields[0] = " `$fieldname` mediumtext;"; $fields[1] = "mediumtext"; - } - else if ($dtype=="textdata") - { + } else if ($dtype=="textdata") { if (empty($dfvalue)) $dfvalue = ''; $fields[0] = " `$fieldname` varchar(100) NOT NULL default '';"; $fields[1] = "varchar(100)"; - } - else if ($dtype=="relation") { + } else if ($dtype=="relation") { if (empty($dfvalue)) $dfvalue = ''; $fields[0] = " `$fieldname` TEXT NOT NULL default '$dfvalue';"; $fields[1] = "TEXT"; - } - else if ($dtype=="textchar") - { + } else if ($dtype=="textchar") { if (empty($dfvalue)) $dfvalue = ''; $fields[0] = " `$fieldname` char(100) NOT NULL default '$dfvalue';"; $fields[1] = "char(100)"; - } - else if ($dtype=="checkbox") - { + } else if ($dtype=="checkbox") { $dfvalue = str_replace(',',"','",$dfvalue); $dfvalue = "'".$dfvalue."'"; $fields[0] = " `$fieldname` SET($dfvalue) NULL;"; $fields[1] = "SET($dfvalue)"; - } - else if ($dtype=="select" || $dtype=="radio") - { + } else if ($dtype=="select" || $dtype=="radio") { $dfvalue = str_replace(',', "','", $dfvalue); $dfvalue = "'".$dfvalue."'"; $fields[0] = " `$fieldname` enum($dfvalue) NULL;"; $fields[1] = "enum($dfvalue)"; } else { - if (empty($dfvalue)) - { + if (empty($dfvalue)) { $dfvalue = ''; } - if (empty($mxlen)) - { + if (empty($mxlen)) { $mxlen = 100; } - if ($mxlen > 255) - { + if ($mxlen > 255) { $mxlen = 250; } $fields[0] = " `$fieldname` varchar($mxlen) NOT NULL default '$dfvalue';"; @@ -114,12 +89,10 @@ function GetAddFieldList(&$dtp,&$oksetting) $oklist = ''; $dtp->SetNameSpace("field","<",">"); $dtp->LoadSource($oksetting); - if (is_array($dtp->CTags)) - { + if (is_array($dtp->CTags)) { foreach($dtp->CTags as $tagid=>$ctag) { - if ($ctag->GetAtt('islist')==1) - { + if ($ctag->GetAtt('islist')==1) { $oklist .= ($oklist=='' ? strtolower($ctag->GetName()) : ','.strtolower($ctag->GetName()) ); } } diff --git a/src/admin/inc/inc_archives_functions.php b/src/admin/inc/inc_archives_functions.php index fbe88802..7906b509 100644 --- a/src/admin/inc/inc_archives_functions.php +++ b/src/admin/inc/inc_archives_functions.php @@ -47,9 +47,7 @@ function GetCurContentAlbum($body, $rfurl, &$firstdd) foreach ($img_array as $key => $value) { $value = trim($value); if ( - preg_match("#".$basehost."#i", $value) || !preg_match("#^http:\/\/#i", $value) - || ($cfg_basehost != $basehost && preg_match("#".$cfg_basehost."#i", $value)) - ) { + preg_match("#".$basehost."#i", $value) || !preg_match("#^http:\/\/#i", $value) || ($cfg_basehost != $basehost && preg_match("#".$cfg_basehost."#i", $value))) { continue; } $itype = substr($value, -4, 4); diff --git a/src/system/archive/freelist.class.php b/src/system/archive/freelist.class.php index b71322de..5398dfb3 100755 --- a/src/system/archive/freelist.class.php +++ b/src/system/archive/freelist.class.php @@ -136,7 +136,7 @@ class FreeList $addSql .= " AND FIND_IN_SET('c',flag) > 0 "; } if (preg_match("#image#i", $listtype)) { - $addSql .= " AND litpic <> '' "; + $addSql .= " AND litpic <> '' "; } if (preg_match("#spec#i", $listtype) || $channelid == -1) { $addSql .= " AND channel = -1 "; @@ -417,7 +417,7 @@ class FreeList $orwhere .= " AND FIND_IN_SET('c',flag) > 0 "; } if (preg_match("#image#i", $listtype)) { - $orwhere .= " AND arc.litpic <> '' "; + $orwhere .= " AND arc.litpic <> '' "; } if (preg_match("#spec#i", $listtype) || $channelid == -1) { $orwhere .= " AND arc.channel = -1 "; diff --git a/src/system/archive/listview.class.php b/src/system/archive/listview.class.php index e9bbce0d..514ccf83 100755 --- a/src/system/archive/listview.class.php +++ b/src/system/archive/listview.class.php @@ -86,7 +86,7 @@ class ListView if ($this->TypeLink->TypeInfos['cross'] > 0 && $this->TypeLink->TypeInfos['ispart'] == 0) { $selquery = ''; if ($this->TypeLink->TypeInfos['cross'] == 1) { - $selquery = "SELECT id,topid FROM `#@__arctype` WHERE typename LIKE '{$this->Fields['typename']}' AND id<>'{$this->TypeID}' AND topid<>'{$this->TypeID}' "; + $selquery = "SELECT id,topid FROM `#@__arctype` WHERE typename LIKE '{$this->Fields['typename']}' AND id<>'{$this->TypeID}' AND topid<>'{$this->TypeID}' "; } else { $this->Fields['crossid'] = preg_replace('/[^0-9,]/', '', trim($this->Fields['crossid'])); if ($this->Fields['crossid'] != '') { diff --git a/src/system/archive/sglistview.class.php b/src/system/archive/sglistview.class.php index 1091cd00..fbfec793 100755 --- a/src/system/archive/sglistview.class.php +++ b/src/system/archive/sglistview.class.php @@ -82,7 +82,7 @@ class SgListView if ($this->TypeLink->TypeInfos['cross'] > 0 && $this->TypeLink->TypeInfos['ispart'] == 0) { $selquery = ''; if ($this->TypeLink->TypeInfos['cross'] == 1) { - $selquery = "SELECT id,topid FROM `#@__arctype` WHERE typename LIKE '{$this->Fields['typename']}' AND id<>'{$this->TypeID}' AND topid<>'{$this->TypeID}' "; + $selquery = "SELECT id,topid FROM `#@__arctype` WHERE typename LIKE '{$this->Fields['typename']}' AND id<>'{$this->TypeID}' AND topid<>'{$this->TypeID}' "; } else { $this->Fields['crossid'] = preg_replace("/[^0-9,]/", '', trim($this->Fields['crossid'])); if ($this->Fields['crossid'] != '') { diff --git a/src/system/taglib/arclist.lib.php b/src/system/taglib/arclist.lib.php index 52d70c50..3b21feb7 100755 --- a/src/system/taglib/arclist.lib.php +++ b/src/system/taglib/arclist.lib.php @@ -192,10 +192,10 @@ function lib_arclistDone (&$refObj, &$ctag, $typeid=0, $row=10, $col=1, $titlele } else { $selquery = ''; if ($arr['cross'] == 1) { - $selquery = "SELECT id,topid FROM `#@__arctype` WHERE typename LIKE '{$arr['typename']}' AND id<>'{$typeid}' AND topid<>'{$typeid}' "; + $selquery = "SELECT id,topid FROM `#@__arctype` WHERE typename LIKE '{$arr['typename']}' AND id<>'{$typeid}' AND topid<>'{$typeid}' "; } else { $arr['crossid'] = preg_replace('#[^0-9,]#', '', trim($arr['crossid'])); - if ($arr['crossid'] != '') $selquery = "SELECT id,topid FROM `#@__arctype` WHERE id IN('{$arr['crossid']}') AND id<>'{$typeid}' AND topid<>'{$typeid}' "; + if ($arr['crossid'] != '') $selquery = "SELECT id,topid FROM `#@__arctype` WHERE id IN('{$arr['crossid']}') AND id<>'{$typeid}' AND topid<>'{$typeid}' "; } if ($selquery != '') { $dsql->SetQuery($selquery); diff --git a/src/system/taglib/arclistsg.lib.php b/src/system/taglib/arclistsg.lib.php index 31552e7f..f34b7e86 100755 --- a/src/system/taglib/arclistsg.lib.php +++ b/src/system/taglib/arclistsg.lib.php @@ -82,15 +82,14 @@ function lib_arclistsg(&$ctag, &$refObj) $CrossID = ''; if ((isset($envs['cross']) || $ctag->GetAtt('cross') == '1') && $ctag->GetAtt('nocross') != '1') { $arr = $dsql->GetOne("SELECT `id`,`topid`,`cross`,`crossid`,`ispart`,`typename` FROM `#@__arctype` WHERE id='$typeid' "); - if ($arr['cross'] == 0 || ($arr['cross'] == 2 && trim($arr['crossid'] == ''))) - $orwheres[] = ' typeid IN ('.GetSonIds($typeid).')'; + if ($arr['cross'] == 0 || ($arr['cross'] == 2 && trim($arr['crossid'] == ''))) $orwheres[] = ' typeid IN ('.GetSonIds($typeid).')'; else { $selquery = ''; if ($arr['cross'] == 1) { - $selquery = "SELECT id,topid FROM `#@__arctype` WHERE typename like '{$arr['typename']}' AND id<>'{$typeid}' AND topid<>'{$typeid}' "; + $selquery = "SELECT id,topid FROM `#@__arctype` WHERE typename like '{$arr['typename']}' AND id<>'{$typeid}' AND topid<>'{$typeid}' "; } else { $arr['crossid'] = preg_replace('#[^0-9,]#', '', trim($arr['crossid'])); - if ($arr['crossid'] != '') $selquery = "SELECT id,topid FROM `#@__arctype` WHERE id IN('{$arr['crossid']}') AND id<>'{$typeid}' AND topid<>'{$typeid}' "; + if ($arr['crossid'] != '') $selquery = "SELECT id,topid FROM `#@__arctype` WHERE id IN('{$arr['crossid']}') AND id<>'{$typeid}' AND topid<>'{$typeid}' "; } if ($selquery != '') { $dsql->SetQuery($selquery); diff --git a/src/user/inc/inc_archives_functions.php b/src/user/inc/inc_archives_functions.php index e26d5524..75b10132 100755 --- a/src/user/inc/inc_archives_functions.php +++ b/src/user/inc/inc_archives_functions.php @@ -218,9 +218,7 @@ function PrintAutoFieldsEdit(&$fieldset, &$fieldValues, $loadtype = 'all') if (is_array($dtp->CTags)) { foreach ($dtp->CTags as $tid => $ctag) { if ( - $loadtype != 'autofield' - || ($loadtype == 'autofield' && $ctag->GetAtt('autofield') == 1) - ) { + $loadtype != 'autofield' || ($loadtype == 'autofield' && $ctag->GetAtt('autofield') == 1)) { $dede_addonfields .= ($dede_addonfields == '' ? $ctag->GetName().",".$ctag->GetAtt('type') : ";".$ctag->GetName().",".$ctag->GetAtt('type')); echo GetFormItemValueA($ctag, $fieldValues[$ctag->GetName()]); }