3

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

我试过这个,但它是错误的。

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

谁能给我一些提示?非常感谢

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

4

1 回答 1

2

尝试这个:

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

你可以在这里找到更多信息

于 2012-02-24T06:21:47.453 回答