最新活动:电脑PC端+手机端+微网站+自适应网页多模板选择-建站388元起价!!!
当前位置:主页 > 网站建设 > dedecms会员中心空间中,spacenewart标签功能的拓展

dedecms会员中心空间中,spacenewart标签功能的拓展

时间:2023-07-18 08:07:18 阅读: 文章分类: 网站建设 作者: 织梦编辑员

导读:dedecmsdedecms在dede的博客空间中,spacenewart标签只能调用频道的内容,不能调用特定栏目的文章,不能调用附加表字段,功能有限。 现修改spacenewart标签的织梦后台模板dede模板堂。

织梦后台模板dede模板堂在dede的博客空间中,spacenewart标签只能调用频道的内容,不能调用特定栏目的文章,不能调用附加表字段,功能有限。    现修改spacenewart标签的文件include\tpllib\plus_spacenewart.php    以实现如下功能:可以调用特定栏目的文章,可以调用附加表的字段。   include\tpllib\plus_spacenewart.php 修改后的代码如下: <?php if(!defined('DEDEINC')) exit('Request Error!'); /** * 动态dedecms模板spacenewart标签 * * @version $Id: plus_spacenewart.php 1 13:58 2010年7月5日Z tianya $ * @package DedeCMS.Tpllib * @copyright Copyright (c) 2007 - 2010, DesDev, Inc. * @license http://help.dedecms.com/usersguide/license.html * @link http://www.dedecms.com */ function plus_spacenewart(&$atts,&$refObj,&$fields) { global $dsql,$_vars; $attlist = "channel=1,titlelen=40,infolen=200,row=8,imgwidth=120,imgheight=90"; FillAtts($atts,$attlist); FillFields($atts,$fields,$refObj); extract($atts, EXTR_OVERWRITE); //获取附加表信息 //$addfield ='fengge'; $addfield =trim($addfields); //echo $addfield; $addfieldsSql = ''; $addfieldsSqlJoin = ''; if($addfield != '' && !empty($channel)) { $row2 = $dsql->GetOne("SELECT addtable FROM `dede_channeltype` WHERE id='$channel' "); if(isset($row2['addtable']) && trim($row2['addtable']) != '') { $addtable = trim($row2['addtable']); 织梦网站模板 $addfields = explode(',', $addfield); $row2['addtable'] = trim($row2['addtable']); $addfieldsSql = ",addf.".join(',addf.', $addfields); $addfieldsSqlJoin = " LEFT JOIN `$addtable` addf ON addf.aid = arc.id "; } } $query = "Select arc.*,mt.mtypename,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule, tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath $addfieldsSql from `dede_archives` arc left join `dede_arctype` tp on arc.typeid=tp.id left join `dede_mtypes` mt on mt.mtypeid=arc.mtype $addfieldsSqlJoin where arc.mid='{$_vars['mid']}' and arc.channel=$channel and arc.ismake='1' and arc.typeid in ($typeid) order by id desc limit 0,$row"; //echo $query; $dsql->SetQuery($query); $dsql->Execute("al"); $artlist = ''; $rearr = array(); $i=1; while($row = $dsql->GetArray("al")) { //处理一些特殊字段 $row['i']=$i; $i=$i+1; $row['infos'] = cn_substr($row['description'],$infolen); $row['id'] = $row['id']; $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']); if($row['litpic']=='') { $row['litpic'] = '/images/defaultpic.gif'; } if(!preg_match("#^http:\/\/#i", $row['litpic'])) { $row['picname'] = $row['litpic'] = $GLOBALS['cfg_cmsurl'].$row['litpic']; } else { $row['picname'] = $row['litpic'] = $row['litpic']; } $row['stime'] = GetDateMK($row['pubdate']); $row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>"; $row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".preg_replace("#['><]#", "", $row['title'])."'>"; $row['imglink'] = "<a href='".$row['filename']."'>".$row['image']."</a>"; $row['fulltitle'] = $row['title']; $row['title'] = cn_substr($row['title'],$titlelen); if($row['color']!='') { $row['title'] = "<font color='".$row['color']."'>".$row['title']."</font>"; } if(preg_match('#b#', $row['flag'])) { $ro织梦模板修改w['title'] = "<strong>".$row['title']."</strong>"; } //$row['title'] = "<b>".$row['title']."</b>"; $row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>"; $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl']; $row['memberurl'] = $GLOBALS['cfg_memberurl']; $row['templeturl'] = $GLOBALS['cfg_templeturl']; //$row['fengge'] = $row['fengge']; 织梦模板 $rearr[] = $row; }//loop line $dsql->FreeResult("al"); return $rearr; }

关键词标签: 标签 dedecms 会员中心

声明: 本文由我的SEOUC技术文章主页发布于:2023-07-18 ,文章dedecms会员中心空间中,spacenewart标签功能的拓展主要讲述标签,会员中心,dedecms网站建设源码以及服务器配置搭建相关技术文章。转载请保留链接: https://www.seouc.com/article/web_29084.html

我的IDC 网站建设技术SEOUC.COM
专注网站建设,SEO优化,小程序设计制作搭建开发定制网站等,数千家网站定制开发案例,网站推广技术服务。
  • 5000+合作客服
  • 8年从业经验
  • 150+覆盖行业
  • 最新热门源码技术文章