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

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

  /include/asks.lib.php

  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”;

☉免责声明:本站所有模板均来自用户分享和网络收集,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服,我们核实后会立即删除。
☉本站提供的源码、模板、软件工具等其他资源,都不包含技术服务,请大家谅解!
pbootcms模板网 » 修改dede5.7 ask源码标签 使之实现—>调用相应级别的问答

Pbootcms模板网 提供优质的模板集合

立即查看 了解详情