Joomla文章页面:检查发布的代码与否

时间:2012-01-08 13:26:38

标签: php mysql joomla joomla1.7

我正在文章页面中查找php代码以检查文章是否已发布。

我尝试了这个,但它是假的。

  

if($ listing ['Listing'] ['published'] == 1){}

有人能给我一些提示吗?非常感谢

PS:Joomla 1.7.3,JReviews 2.3(使用Joomla默认内容结构)

1 个答案:

答案 0 :(得分:2)

试试这个:

jimport('joomla.database.table');
$article_id = [place here the article Id];
$article =& JTable::getInstance("content");
$article->load($article_id);
echo $article->get("state");

您可以找到更多信息here