Modifying native module to work with other tables

I want to modify a native joomla module that display articles of a category. I want it to display articles of an other prefix tables (both joomla website are on the same server).

Notice that I already looked at available extension but none of them would fit.

I tried to modify the helper.php of the native joomla module tables, by changing the

$com_path = but i am getting aFatal error.

Native code: $com_path = JPATH_SITE.'/components/com_content/';

My try : $com_path = '/homez.420/kmxsiksf/rsc/components/com_content/helpers/route.php

Answers


To use an external database (even if it's on your server) in Joomla extensions, the proper way would be to set some options before retrieving the JDatabase-object.

Create a helperclass to handle your external db, and in every method that uses the DB-object you simply set the options of your external db before retrieving the object:

$option = array(); 
$option['driver']   = 'mysql';
$option['host']     = 'localhost';    // In your case probably localhost 
$option['user']     = 'dbusername';       // User for database authentication $option['password'] = 'badpass12345';   // Password for database authentication $option['database'] = 'bigdatabase';      // Database name 
$option['prefix']   = 'abc_';             // Database prefix (may be empty)  
$db = & JDatabase::getInstance( $option );

You are now able to use your external database the same way as you would with your regular db.


Need Your Help

Android app facebook https urls not loading

android facebook ssl https android-2.2-froyo

Trying to develop an android app that integrates social networking, and the first one i am testing out is Facebook. When doing the authorize function i have it using the WebView instead of calling ...

How to I keep my entire box from turning white on hover

css twitter-bootstrap responsive-design

I'm hoping someone can take a minute and look at my responsive web page and let me know what CSS rule I need to write to keep the boxes in the collapsed state of the menu from turning completely wh...