A5下载 - 网站源码下载,免费的站长下载站

A5下载

修改dede5.7 ask网站源码标签 使之达成---调用相应级别的问答

2021-12-12 15:07分类:织梦建站 阅读:

  -->

修改dede5.7 ask网站源码标签 使之达成--->调用相应级别[一级,二级,...栏目]的问答,可依据需要修改

/include/asks.lib.php

<?php if) exit;/*** 问答调用标签** @version$Id: ask.lib.php 1 9:29 2010年7月6日Z tianya $* @package织梦CMS.Taglib* @copyright Copyright 2007 - 2010, DesDev, Inc.* @licensehttp://help.织梦CMS.com/usersguide/license.html* @linkhttp://www.织梦CMS.com*/function lib_asks{global $dsql, $envs, $cfg_dbprefix, $cfg_cmsurl,$cfg_ask_directory,$cfg_ask_isdomain,$cfg_ask_domain;//属性处置$attlist="row|6,qtype|new,titlelen|24,typeid|0";FillAttsDefault;extract; if ) return '没安装问答模块'; //启用二级域名if{$weburl = $cfg_ask_domain.'/'; }else{$weburl = $cfg_ask_directory.'/';} $innertext = $ctag->GetInnerText;if=='') $innertext = GetSysTemplets; if {$typeid = ? $refObj->TypeLink->TypeInfos['id'] : $envs['typeid'] );} $arc=$dsql->GetOne;$TOPid=$arc['TOPid'];$typename=$arc['typename']; if{$arcs=$dsql->GetOne;$tid=$arcs['tid'];}else{$arcs=$dsql->GetOne;$tid=$arcs['tid2'];} $qtypeQuery = '';if $tid = " AND ";else $tid = '';//推荐问题if $qtypeQuery = " $tid digest=1 ORDER BY dateline DESC ";//新解决问题else if $qtypeQuery = " $tid status=1 ORDER BY solvetime DESC ";//高分问题else if $qtypeQuery = " $tid status=0 ORDER BY reward DESC ";//新问题else $qtypeQuery = " $tid status=0 ORDER BY disorder DESC, dateline DESC ";$ctp = new DedeTagParse;$ctp->SetNameSpace;$solvingask = '';$query = "SELECT id, tid, tidname, tid2, tid2name, title, content, dateline FROM `dede_ask` WHERE $qtypeQuery limit 0, $row";-->$dsql->Execute; while){$rs['title'] = cn_substr;$rs['content'] = strip_tags;$ctp->LoadSource;if{$rs['tid'] = $rs['tid2'];$rs['tidname'] = $rs['tid2name'];}//$rs['url'] = $weburl."?ct=question&askaid=".$rs['id'];$rs['url'] = $weburl.$rs['id'].'.html';foreach {if)])) {$ctp->Assign]);}}$solvingask .= $ctp->GetResult;}return $solvingask;}

模板调用---->去掉了 tid='0',其他可依据需要调用

{dede:ask row='6' qtype='new' titlelen='24'}
<dd>
<span>[<a href='[field:typeurl/]'>[field:tidname/]</a>]</span>
<span><a href="[field:url/]">[field:title/]</a></span>
</dd>
{/dede:ask}


郑重声明:文章来源于网络,仅作为参考,如果网站中图片和文字侵犯了您的版权,请联系我们处理!

上一篇:织梦CMS系统TAG标签伪静态设置

下一篇:没有了

相关推荐


关注我们

    A5下载 - 网站源码下载,免费的站长下载站
返回顶部