帝国CMS列表页内容显示判断文章来源,并带连接的方法


avatar
pcwnas 2023-04-21 179

在列表内容模板里面写如下代码即可!


$userr=$empire->fetch1(“select befrom from {$dbtbpre}ecms_news_data_{$r[stb]} where id=’$r[id]'”);if(empty($userr[befrom])){ $userr[befrom]=’墨鱼部落格整理’; //没有填写来源显示}if($userr[befrom]){$userr[befrom]=ReplaceBefrom($userr[befrom]);}$listtemp='<li><h4><a href=”[!–tt.url–]”>[!–tt.name–]</a>&nbsp;&nbsp;&nbsp;<a href=”[!–titleurl–]” target=”_blank” >[!–title–]</a></h4><p>&nbsp;&nbsp;&nbsp;[!–newstime–]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;来源于: ‘.$userr[befrom].'</p><p>[!–smalltext–]… <a href=”[!–titleurl–]”>[查阅全文]</a></p> </li>’;