0
A
回答
0
尝试下面的查询和调整您的需求:
public function getMyArticles($catid){
$result = null;
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('id, title, alias') // add other fields that might interest you
->from('#__content')
->where('catid='.$db->quote($catid))
->order('RAND() LIMIT 4'); // just an example for the ordering clause
try {
$db->setQuery($query);
$result = $db->loadObjectList();
}
catch(RuntimeException $e){
echo $e->getMessage();
}
return $result;
}
希望它帮助;)
相关问题
- 1. Joomla插件:如何获得文章标题和文章ID
- 2. Joomla 3显示子类别的文章
- 3. K2 Joomla:如何从单个文章页面获取类别ID?
- 4. 如何获得joomala中id = 8类别的文章标题
- 5. 获取类别和文章列表joomla
- 6. 更改特定文章类别的Joomla 3.x中的编辑表格
- 7. Joomla 3 - 如何获得全局文章管理器选项
- 8. 如何获取Joomla中的文章类别?
- 9. Joomla - 如何获得URL中的类别ID
- 10. 使用Joomla功能获取特定内容类别的文章数量
- 11. 获取Joomla父类别ID
- 12. 得到URL摆脱ID(类别和文章)的(的Joomla 3.3/3.4/3.5)
- 13. 的Joomla 3获得用户ID
- 14. Joomla菜单与类别的文章
- 15. Joomla 3 - 隐藏某些类别/页面的文章信息
- 16. 显示特定类别的特色文章在Joomla中使用模块
- 17. Wordpress通过类别获得文章
- 18. joomla 3:获得'最高'级别的用户组ID'
- 19. Joomla获得文章很好的网址
- 20. Joomla 3分类博客文章覆盖
- 21. Joomla 3类别RSS提要揭示仅限注册文章
- 22. Joomla 3 - 在单个文章下方显示类别博客
- 23. Joomla 3“提交文章”页面 - 如何删除“访问级别”
- 24. 如何通过joomla中的ID获取文章的完整url?
- 25. 如何使用类别ID获取wordpress文章?
- 26. Joomla 3文章类别模块覆盖类别图像和说明
- 27. 从joomla的名字获取类别ID?
- 28. Joomla 2.5 - 如何隐藏博客类别布局中的特色文章?
- 29. 获取关于特定类别文章建议的API
- 30. Mediawiki API:从特定类别的文章中获取图像