通過織夢當前文章的短標題獲取相同短短標題的文章
在extend.func.php 文件添加一下代碼
/***dede調(diào)取和當前文章短標題相同的文章*/function s_title($shorttitle){$sql = "SELECT a.shorttitle, b.* FROM dede_archives AS a INNER JOIN dede_archives as b ON a.id = b.id WHERE a.shorttitle='$shorttitle';" $dsql->SetQuery($sql); $dsql->Execute('t'); $result = ''; while($row = $dsql->GetArray('t')) { $arcrow = GetOneArchive($row['id']); $row['arcurl'] = $arcrow['arcurl']; $title = cn_substr($row['title'],8);$result .= "<a href=/"{$row['arcurl']}/">{$title}</a>"; } return $result;} 使用范圍
通過織夢當前文章的短標題獲取相同短短標題的文章
在織夢內(nèi)容頁調(diào)用方法:
{dede:field.shorttitle function="s_title(@me)"/}
新聞熱點
疑難解答
圖片精選