Jump to content

Joomla: creating module to display category from other table


Recommended Posts

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

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.