我正在文章页面中查找 php 代码以检查该文章是否已发布。
我试过这个,但它是错误的。
if($listing['Listing']['published']==1){ }
谁能给我一些提示?非常感谢
PS: Joomla 1.7.3, JReviews 2.3(使用Joomla默认内容结构)
最佳答案
试试这个:
jimport('joomla.database.table');
$article_id = [place here the article Id];
$article =& JTable::getInstance("content");
$article->load($article_id);
echo $article->get("state");
您可以找到更多信息 here
关于php - Joomla 文章页面 : code to check published or not,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8777915/