/** *dede调取和当前文章短标题相同的文章 */ 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; }
通过当前文章的短标题获取相同短短标题的文章
{dede:field.shorttitle function="s_title(@me)"/}
版权声明:本站原创文章,于2020-09-11,由 kira 发表!
转载请注明:dede如何获取当前短标题有关的文章 - kiraer个人网站技术博客