giom Posted July 13, 2012 Share Posted July 13, 2012 I have several websites on the same db running on joomla 2.5. I would like to display the articles from a category (article +sub-category) that are from an other website but on the same db. I was thinking to use the native joomla module that displays the articles from a category and to modified its php and ask it to pickup the category from an other table (bbb_tables) Here is the helper.php of the native module (in the FTP) that displays articles of a category. (../module/display_articles_category ): it is programmed to play with the internal aaa_tables "bbb_" is the DB I want the module to use so I guess I should add that piece of code somewhere: $db = & JDatabase::getInstance($options);$options['prefix'] = 'bbb'; Somewhere around here : but how? defined('_JEXEC') or die; $com_path = JPATH_SITE.'/components/com_content/'; require_once $com_path.'router.php'; require_once $com_path.'helpers/route.php'; JModelLegacy::addIncludePath($com_path . '/models', 'ContentModel'); abstract class modArticlesCategoryHelper { public static function getList(&$params) { // Get an instance of the generic articles model $articles = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); // Set application parameters in model $app = JFactory::getApplication(); $appParams = $app->getParams(); $articles->setState('params', $appParams); Thanks Link to comment https://forums.phpfreaks.com/topic/265594-joomla-creating-module-to-display-category-from-other-table/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.