修改dede5.7 ask源码标签 使之如何实现--->调用相应级别的问答

我和你,或许分开才是最好的选择,那些曾经的过客,就当做最美丽的风景线,在以后的以后,我会好好坚强。

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

/include/asks.lib.php

<?php if(!defined('DEDEINC')) exit('Request Error!');
/**
* 问答调用标签
*
* @version $Id: ask.lib.php 1 9:29 2010年7月6日Z tianya $
* @package DedeCMS.Taglib
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
function lib_asks(&$ctag,&$refObj)
{
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($ctag->CAttribute->Items,$attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
if( !$dsql->IsTable("{$cfg_dbprefix}ask") ) return '没安装问答模块';
//启用二级域名
if($cfg_ask_isdomain == 'Y')
{
$weburl = $cfg_ask_domain.'/';
}else{
$weburl = $cfg_ask_directory.'/';
}
$innertext = $ctag->GetInnerText();
if(trim($innertext)=='') $innertext = GetSysTemplets("asks.htm");
if($typeid==0) {
$typeid = ( isset($refObj->TypeLink->TypeInfos['id']) ? $refObj->TypeLink->TypeInfos['id'] : $envs['typeid'] );
}
$arc=$dsql->GetOne("Select id,topid,typename From `dede_arctype` where id='$typeid' ");
$topid=$arc['topid'];
$typename=$arc['typename'];
if($topid==0){
$arcs=$dsql->GetOne("SELECT tid,tid2 FROM `dede_ask` where tidname='$typename' ");
$tid=$arcs['tid'];
}else{
$arcs=$dsql->GetOne("SELECT tid,tid2 FROM `dede_ask` where tid2name='$typename' ");
$tid=$arcs['tid2'];
}
$qtypeQuery = '';
if($tid > 0) $tid = " (tid=$tid Or tid2='$tid') AND ";
else $tid = '';
//推荐问题
if($qtype=='commend') $qtypeQuery = " $tid digest=1 ORDER BY dateline DESC ";
//新解决问题
else if($qtype=='ok') $qtypeQuery = " $tid status=1 ORDER BY solvetime DESC ";
//高分问题
else if($qtype=='high') $qtypeQuery = " $tid status=0 ORDER BY reward DESC ";
//新问题
else $qtypeQuery = " $tid status=0 ORDER BY disorder DESC, dateline DESC ";
$ctp = new DedeTagParse();
$ctp->SetNameSpace('field', '[', ']');
$solvingask = '';
$query = "SELECT id, tid, tidname, tid2, tid2name, title, content, dateline FROM `dede_ask` WHERE $qtypeQuery limit 0, $row";

本文修改dede5.7 ask源码标签 使之如何实现---&gt;调用相应级别的问答到此结束。海浪为劈风斩浪的航船饯行,为随波逐流的轻舟送葬。小编再次感谢大家对我们的支持!

您可能有感兴趣的文章
DEDE织梦文章和列表页均如何使用拼音,使之更适合于SEO的如何解决方案

修改dede5.7 ask源码标签 使之如何实现--->调用相应级别的问答

织梦后台文档列表添加复制文档功能支持所有模型

织梦无法上传ico图标格式文件的如何解决方法

dedecms如何实现任意页面调用当前会员信息的方