
通过织梦当前文章的短标题获取相同短短标题的文章
在extend.func.php 文件添加一下代码
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 .= "{$title}";
}
return $result;
}
使用范围
通过织梦当前文章的短标题获取相同短短标题的文章
在织梦内容页调用方法:
{dede:field.shorttitle function="s_title(@me)"/}
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)