From 68fe01f54cac8b002554e8a8d55e0876999da38f Mon Sep 17 00:00:00 2001 From: tianya Date: Thu, 24 Sep 2020 12:18:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=88=86=E7=B1=BB=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/include/arc.archives.class.php | 1 + src/include/arc.listview.class.php | 1 + src/include/arc.sglistview.class.php | 45 +-- src/plus/count.php | 8 +- src/plus/digg_ajax.php | 24 +- src/templets/default/article_infos.htm | 274 ++++++++----------- src/templets/default/article_shop.htm | 2 +- src/templets/default/list_infos.htm | 268 +++++++++--------- src/templets/default/widget_article_digg.htm | 8 +- src/templets/default/widget_hot_sg.htm | 13 + src/templets/default/widget_recommend_sg.htm | 13 + 11 files changed, 331 insertions(+), 326 deletions(-) create mode 100644 src/templets/default/widget_hot_sg.htm create mode 100644 src/templets/default/widget_recommend_sg.htm diff --git a/src/include/arc.archives.class.php b/src/include/arc.archives.class.php index 1a033b28..e24d74b3 100755 --- a/src/include/arc.archives.class.php +++ b/src/include/arc.archives.class.php @@ -6,6 +6,7 @@ if(!defined('DEDEINC')) exit("Request Error!"); * @version $Id: arc.archives.class.php 4 15:13 2010年7月7日Z tianya $ * @package DedeCMS.Libraries * @copyright Copyright (c) 2007 - 2020, DesDev, Inc. + * @copyright Copyright (c) 2020, DedeBIZ.COM * @license http://help.dedecms.com/usersguide/license.html * @link http://www.dedecms.com */ diff --git a/src/include/arc.listview.class.php b/src/include/arc.listview.class.php index 8bd085bf..480369af 100755 --- a/src/include/arc.listview.class.php +++ b/src/include/arc.listview.class.php @@ -5,6 +5,7 @@ * @version $Id: arc.listview.class.php 2 15:15 2010年7月7日Z tianya $ * @package DedeCMS.Libraries * @copyright Copyright (c) 2007 - 2020, DesDev, Inc. + * @copyright Copyright (c) 2020, DedeBIZ.COM * @license http://help.dedecms.com/usersguide/license.html * @link http://www.dedecms.com */ diff --git a/src/include/arc.sglistview.class.php b/src/include/arc.sglistview.class.php index 58723c41..961d261d 100755 --- a/src/include/arc.sglistview.class.php +++ b/src/include/arc.sglistview.class.php @@ -5,6 +5,7 @@ * @version $Id: arc.sglistview.class.php 1 15:48 2010年7月7日Z tianya $ * @package DedeCMS.Libraries * @copyright Copyright (c) 2007 - 2020, DesDev, Inc. + * @copyright Copyright (c) 2020, DedeBIZ.COM * @license http://help.dedecms.com/usersguide/license.html * @link http://www.dedecms.com */ @@ -523,7 +524,7 @@ class SgListView */ function GetTrueUrl($nurl) { - if(preg_match("/^http:\/\//", $nurl)) return $nurl; + if(preg_match("/^http[s]?:\/\//", $nurl)) return $nurl; if($this->Fields['moresite']==1) { if($this->Fields['sitepath']!='') @@ -890,37 +891,37 @@ class SgListView $totalpage = ceil($this->TotalResult / $this->PageSize); if($totalpage <= 1 && $this->TotalResult > 0) { - return "1".$this->TotalResult."条记录"; + return "
  • 共 1 页".$this->TotalResult."条记录
  • "; } if($this->TotalResult == 0) { - return "0".$this->TotalResult."条记录"; + return "
  • 共 0 页".$this->TotalResult."条记录
  • "; } $purl = $this->GetCurUrl(); - $maininfo = "{$totalpage}".$this->TotalResult.""; + $maininfo = "
  • 共 {$totalpage} 页".$this->TotalResult."条
  • "; $tnamerule = $this->GetMakeFileRule($this->Fields['id'], "list", $this->Fields['typedir'], $this->Fields['defaultname'], $this->Fields['namerule2']); $tnamerule = preg_replace("/^(.*)\//", '', $tnamerule); //获得上一页和主页的链接 if($this->PageNo != 1) { - $prepage.="
  • 上一页
  • \r\n"; - $indexpage="
  • 首页
  • \r\n"; + $prepage.="
  • 上一页
  • \r\n"; + $indexpage="
  • 首页
  • \r\n"; } else { - $indexpage="
  • 首页
  • \r\n"; + $indexpage="
  • 首页
  • \r\n"; } //下一页,未页的链接 if($this->PageNo != $totalpage && $totalpage>1) { - $nextpage.="
  • 下一页
  • \r\n"; - $endpage="
  • 末页
  • \r\n"; + $nextpage.="
  • 下一页
  • \r\n"; + $endpage="
  • 末页
  • \r\n"; } else { - $endpage="
  • 末页
  • "; + $endpage="
  • 末页
  • "; } //option链接 @@ -967,11 +968,11 @@ class SgListView { if($j == $this->PageNo) { - $listdd.= "
  • $j
  • \r\n"; + $listdd.= "
  • $j
  • \r\n"; } else { - $listdd.="
  • ".$j."
  • \r\n"; + $listdd.="
  • ".$j."
  • \r\n"; } } $plist = ""; @@ -1030,11 +1031,11 @@ class SgListView $totalpage = ceil($this->TotalResult / $this->PageSize); if($totalpage<=1 && $this->TotalResult>0) { - return "共1页/".$this->TotalResult."条记录"; + return "
  • 共1页/".$this->TotalResult."条记录
  • "; } if($this->TotalResult == 0) { - return "共0页/".$this->TotalResult."条记录"; + return "
  • 共0页/".$this->TotalResult."条记录
  • "; } $purl = $this->GetCurUrl(); $geturl = "tid=".$this->TypeID."&TotalResult=".$this->TotalResult."&nativeplace=$nativeplace&infotype=$infotype&keyword=".urlencode($keyword)."&"; @@ -1048,21 +1049,21 @@ class SgListView //获得上一页和下一页的链接 if($this->PageNo != 1) { - $prepage.="
  • 上一页
  • \r\n"; - $indexpage="
  • 首页
  • \r\n"; + $prepage.="
  • 上一页
  • \r\n"; + $indexpage="
  • 首页
  • \r\n"; } else { - $indexpage="
  • 首页
  • \r\n"; + $indexpage="
  • 首页
  • \r\n"; } if($this->PageNo!=$totalpage && $totalpage>1) { - $nextpage.="
  • 下一页
  • \r\n"; - $endpage="
  • 末页
  • \r\n"; + $nextpage.="
  • 下一页
  • \r\n"; + $endpage="
  • 末页
  • \r\n"; } else { - $endpage="
  • 末页
  • "; + $endpage="
  • 末页
  • "; } //获得数字链接 @@ -1089,11 +1090,11 @@ class SgListView { if($j == $this->PageNo) { - $listdd.= "
  • $j
  • \r\n"; + $listdd.= "
  • $j
  • \r\n"; } else { - $listdd.="
  • ".$j."
  • \r\n"; + $listdd.="
  • ".$j."
  • \r\n"; } } diff --git a/src/plus/count.php b/src/plus/count.php index 3d236b9c..2bacb6fb 100755 --- a/src/plus/count.php +++ b/src/plus/count.php @@ -11,17 +11,19 @@ * @version $Id: count.php 1 20:43 2010年7月8日Z tianya $ * @package DedeCMS.Site * @copyright Copyright (c) 2007 - 2020, DesDev, Inc. + * @copyright Copyright (c) 2020, DedeBIZ.COM * @license http://help.dedecms.com/usersguide/license.html * @link http://www.dedecms.com */ require_once(dirname(__FILE__)."/../include/common.inc.php"); if(isset($aid)) $arcID = $aid; -$cid = empty($cid)? 1 : intval(preg_replace("/[^-\d]+[^\d]/",'', $cid)); -$arcID = $aid = empty($arcID)? 0 : intval(preg_replace("/[^\d]/",'', $arcID)); +$cid = empty($cid)? 1 : intval($cid); +$arcID = $aid = empty($arcID)? 0 : intval($arcID); $format = isset($format)? $format : ""; -$maintable = '#@__archives';$idtype='id'; +$maintable = '#@__archives'; +$idtype='id'; if($aid==0) exit(); //获得频道模型ID diff --git a/src/plus/digg_ajax.php b/src/plus/digg_ajax.php index 64d5a634..02b8227f 100755 --- a/src/plus/digg_ajax.php +++ b/src/plus/digg_ajax.php @@ -6,6 +6,7 @@ * @version $Id: digg_ajax.php 2 13:00 2011/11/25 tianya $ * @package DedeCMS.Plus * @copyright Copyright (c) 2007 - 2020, DesDev, Inc. + * @copyright Copyright (c) 2020, DedeBIZ.COM * @license http://help.dedecms.com/usersguide/license.html * @link http://www.dedecms.com */ @@ -13,6 +14,9 @@ require_once(dirname(__FILE__)."/../include/common.inc.php"); $action = isset($action) ? trim($action) : ''; $format = isset($format)? $format : ''; $id = empty($id)? 0 : intval($id); +$cid = empty($cid)? 1 : intval($cid); + + helper('cache'); @@ -20,8 +24,15 @@ if($id < 1) { exit(); } - +$idtype='id'; $maintable = '#@__archives'; +//获得频道模型ID +if($cid < 0) +{ + $row = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$cid' AND issystem='-1';"); + $maintable = empty($row['addtable'])? '' : $row['addtable']; + $idtype='aid'; +} $prefix = 'diggCache'; $key = 'aid-'.$id; @@ -29,18 +40,18 @@ $row = GetCache($prefix, $key); if(!is_array($row) || $cfg_digg_update==0) { - $row = $dsql->GetOne("SELECT goodpost,badpost,scores FROM `$maintable` WHERE id='$id' "); + $row = $dsql->GetOne("SELECT goodpost,badpost,scores FROM `$maintable` WHERE $idtype='$id' "); if($cfg_digg_update == 0) { if($action == 'good') { $row['goodpost'] = $row['goodpost'] + 1; - $dsql->ExecuteNoneQuery("UPDATE `$maintable` SET scores = scores + {$cfg_caicai_add},goodpost=goodpost+1,lastpost=".time()." WHERE id='$id'"); + $dsql->ExecuteNoneQuery("UPDATE `$maintable` SET scores = scores + {$cfg_caicai_add},goodpost=goodpost+1,lastpost=".time()." WHERE $idtype='$id'"); } else if($action=='bad') { $row['badpost'] = $row['badpost'] + 1; - $dsql->ExecuteNoneQuery("UPDATE `$maintable` SET scores = scores - {$cfg_caicai_sub},badpost=badpost+1,lastpost=".time()." WHERE id='$id'"); + $dsql->ExecuteNoneQuery("UPDATE `$maintable` SET scores = scores - {$cfg_caicai_sub},badpost=badpost+1,lastpost=".time()." WHERE $idtype='$id'"); } DelCache($prefix, $key); } @@ -53,7 +64,7 @@ if(!is_array($row) || $cfg_digg_update==0) if($row['goodpost'] % $cfg_digg_update == 0) { $add_caicai_sub = $cfg_digg_update * $cfg_caicai_sub; - $dsql->ExecuteNoneQuery("UPDATE `$maintable` SET scores = scores + {$add_caicai_sub},goodpost=goodpost+{$cfg_digg_update} WHERE id='$id'"); + $dsql->ExecuteNoneQuery("UPDATE `$maintable` SET scores = scores + {$add_caicai_sub},goodpost=goodpost+{$cfg_digg_update} WHERE $idtype='$id'"); DelCache($prefix, $key); } } else if($action == 'bad') @@ -63,13 +74,14 @@ if(!is_array($row) || $cfg_digg_update==0) if($row['badpost'] % $cfg_digg_update == 0) { $add_caicai_sub = $cfg_digg_update * $cfg_caicai_sub; - $dsql->ExecuteNoneQuery("UPDATE `$maintable` SET scores = scores - {$add_caicai_sub},badpost=badpost+{$cfg_digg_update} WHERE id='$id'"); + $dsql->ExecuteNoneQuery("UPDATE `$maintable` SET scores = scores - {$add_caicai_sub},badpost=badpost+{$cfg_digg_update} WHERE $idtype='$id'"); DelCache($prefix, $key); } } SetCache($prefix, $key, $row, 0); } + $digg = ''; if(!is_array($row)) exit(); diff --git a/src/templets/default/article_infos.htm b/src/templets/default/article_infos.htm index e7f820b7..7aa53412 100755 --- a/src/templets/default/article_infos.htm +++ b/src/templets/default/article_infos.htm @@ -1,168 +1,120 @@ - - + + + - -{dede:field.title/}_{dede:global.cfg_webname/} - - - - - - - + + + + + + + + + {dede:field.title/}_{dede:global.cfg_webname/} + + - -{dede:include filename="head2.htm"/} - -
    -
    -
    - 当前位置: {dede:field name='position'/} -
    -
    -
    -

    {dede:field.title/}

    -
    -
    - 所属区域:{dede:field.nativeplace /} - 信息类型:{dede:field.infotype /} - 点击数: - 发布时间:{dede:field.pubdate function="MyDate('y-m-d H:i',@me)"/} - 截止日期:{dede:field.endtime function="MyDate('Y-m-d H:m',@me)" /} - 联系人:{dede:field.linkman /} - 联系电话:{dede:field.tel /} - 电子邮箱:{dede:field.email/} - 地址:{dede:field.address /} -
    -
    - {dede:field name='image'/} -
    -
    - 信息描述 -
    -
    -
    {dede:myad name='contentMidPicAD'/}
    -   {dede:field.body /} -
    -
    - ------分隔线---------------------------- -
    -
    -
    - -
    -
    -
    - - - -{dede:include file='ajaxfeedback.htm' /} - -
    - -
    -
    -
    -
    栏目列表
    -
    - -
    -
    -
    -
    - {dede:memberinfos} -
    -
    发布者资料
    -
    - - [field:uname/] - - 查看详细资料 - 发送留言 - 加为好友 - - 用户等级:[field:rankname /] - 注册时间:[field:jointime function="MyDate('Y-m-d H:m',@me)"/] - 最后登录:[field:logintime function="MyDate('Y-m-d H:m',@me)"/] -
    -
    - {/dede:memberinfos} -
    - -
    -
    -
    最新信息
    -
    -
      - {dede:arclistsg orderby='id' titlelen='60' row='20'} -
    • [field:title/]
    • - {/dede:arclistsg} -
    -
    -
    + + + {dede:include filename="top.htm"/} + + {dede:include filename="header.htm"/} + + {dede:include filename="navbar.htm"/} + +
    +
    +
    -
    + +
    + +
    +
    +
    +

    {dede:field.title/}

    +
    +
    {dede:field name='image'/}
    +

    所属区域:{dede:field.nativeplace/}

    +

    信息类型:{dede:field.infotype/}

    +

    点击数:...

    +

    发布时间:{dede:field.pubdate function="MyDate('y-m-d H:i',@me)"/}

    +

    截止日期:{dede:field.endtime function="MyDate('Y-m-d H:m',@me)" /}

    +

    联系人:{dede:field.linkman /}

    +

    联系电话:{dede:field.tel /}

    +

    电子邮箱:{dede:field.email/}

    +

    地址:{dede:field.address /}

    +

    信息描述

    +
    + {dede:field.body/} +
    +
    + + +
    + + {dede:include comment='文档顶踩模块' filename="widget_article_digg.htm"/} -
    -{dede:include filename="footer.htm"/} - +
    +
    +
    {dede:prenext get='pre'/}
    +
    {dede:prenext get='next'/}
    +
    +
    +
    + +
    +
    +
    + {dede:include comment='文档评论模块' file='widget_article_feedback.htm' /} + +
    + + + + + +
    + + + + {dede:include filename="footer.htm"/} + + diff --git a/src/templets/default/article_shop.htm b/src/templets/default/article_shop.htm index 69ec0d78..375c574e 100755 --- a/src/templets/default/article_shop.htm +++ b/src/templets/default/article_shop.htm @@ -46,7 +46,7 @@

    优惠价格:{dede:field.trueprice/}

    品牌:{dede:field.brand/}

    上架日期:{dede:field.pubdate function="MyDate('y-m-d H:i',@me)"/}

    -

    人气:

    +

    人气:...

    diff --git a/src/templets/default/list_infos.htm b/src/templets/default/list_infos.htm index 5365dc1e..d7599242 100755 --- a/src/templets/default/list_infos.htm +++ b/src/templets/default/list_infos.htm @@ -1,137 +1,147 @@ - - + + + - -{dede:field.title/}_{dede:global.cfg_webname/} - - - - - + + + + + + + + {dede:field.title/}_{dede:global.cfg_webname/} - {dede:global.cfg_welcome/} + + + - -{dede:include filename="head.htm"/} - - -
    -
    - -
    - 当前位置: {dede:field name='position'/} -
    - - -{dede:infolink} - - - - - - - - - - - - - - - - - -{/dede:infolink} - -
    -
      - {dede:list pagesize='20'} -
    • [field:title/][field:pubdate function="GetDateTimeMK(@me)"/]
    • - {/dede:list} -
    -
    - - -
    -
      - {dede:pagelist listitem="info,index,end,pre,next,pageno" listsize="5"/} -
    + + + {dede:include filename="top.htm"/} + + {dede:include filename="header.htm"/} + + {dede:include filename="navbar.htm"/} + +
    +
    +
    - +
    - - -
    -
    -
    -
    栏目列表
    -
    - -
    -
    -
    - - -
    -
    -
    最新信息
    -
    -
      - {dede:arclistsg orderby='id' titlelen='60' row='10'} -
    • [field:typename/][field:title/]
    • - {/dede:arclistsg} -
    -
    -
    -
    -
    -
    -
    热门信息
    -
    -
      - {dede:arclistsg sort='click' titlelen='30' row='10'} -
    • [field:typename/][field:title/]
    • - {/dede:arclistsg} + +
      +
      +
      + {dede:infolink} + + + + + + + + + + + + + + + + {/dede:infolink} + + +
    -
    -
    + + +
    + + +
    - -
    -{dede:include filename="footer.htm"/} - + {dede:include comment='推荐内容' filename="widget_recommend_sg.htm"/} + {dede:include comment='热点内容' filename="widget_hot_sg.htm"/} + + + + +
    + + + + {dede:include filename="footer.htm"/} - + + \ No newline at end of file diff --git a/src/templets/default/widget_article_digg.htm b/src/templets/default/widget_article_digg.htm index a65d224e..a05cfe56 100644 --- a/src/templets/default/widget_article_digg.htm +++ b/src/templets/default/widget_article_digg.htm @@ -24,8 +24,8 @@ \ No newline at end of file diff --git a/src/templets/default/widget_hot_sg.htm b/src/templets/default/widget_hot_sg.htm new file mode 100644 index 00000000..ca24424c --- /dev/null +++ b/src/templets/default/widget_hot_sg.htm @@ -0,0 +1,13 @@ +
    +
    +
    +
    热点内容
    +
    +
    +
      + {dede:arclistsg orderby=click titlelen=42 row=10} +
    • [field:title/]
    • + {/dede:arclistsg} +
    +
    + \ No newline at end of file diff --git a/src/templets/default/widget_recommend_sg.htm b/src/templets/default/widget_recommend_sg.htm new file mode 100644 index 00000000..65e0a586 --- /dev/null +++ b/src/templets/default/widget_recommend_sg.htm @@ -0,0 +1,13 @@ +
    +
    +
    +
    推荐内容
    +
    +
    +
      + {dede:arclistsg flag='c' titlelen=42 row=10} +
    • [field:title/]
    • + {/dede:arclistsg} +
    +
    + \ No newline at end of file