修改dede5.7 ask源碼標簽 使之實現-調用相應級別的
導讀:織夢文章織夢文章修改dede5.7 ask源碼標簽 使之實現---調用相應級別[一級,二級,...欄目]的問答,可根據需要修改 /include/asks.lib.php ?p織夢文章模板dede免費模板。
修改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', '[', ']'); &織夢模板修改nbsp; $solvingask = ''; $query = "SELECT id, tid, tidname, tid2, tid2name, title, content, dateline FROM `dede_ask` WHERE $qtypeQuery limit 0, $row"; $dsql->Execute('me',$query); while($rs = $dsql->GetArray('me')) { $rs['title'] = cn_substr($rs['title'], $titlelen); $rs['content'] = strip_tags($rs['content']); $ctp->LoadSource($innertext); if($rs[dede下瓻模板下載'tid2name'] != '') { $rs['tid'] = $rs['tid2']; $rs['tidname'] = $rs['tid2name']; } //$rs['url'] = $weburl."?ct=question&askaid=".$rs['id']; $rs['url'] = $weburl.$rs['id'].'.html'; foreach($ctp->CTags as $tagid=>$ctag) { if(!empty($rs[strtolower($ctag->GetName())])) { $ctp->Assign($tagid,$rs[$ctag->GetName()]); } } 織夢網站模板 $solvingask .= $ctp->GetResult(); } return $solvingask; }聲明: 本文由我的SEOUC技術文章主頁發布于:2023-07-19 ,文章修改dede5.7 ask源碼標簽 使之實現-調用相應級別的主要講述標簽,使之,織夢網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_30397.html