If you want to use the Joomla Framework within Question2Answer I think you will want to add something like this to your Q2A code.
Please note that this is not my code, so I probably won't be able to answer any questions about it.
I believe the code below was intended for external PHP that would be used with Joomla 1.5.
<?
php
define( '_JEXEC', 1 );
// real path depending on the type of server
// change the number of returns/level needed in your path relative to the position of your script in your directory
if (stristr( $_SERVER['SERVER_SOFTWARE'], 'win32' )) {
define( 'JPATH_BASE', realpath(dirname(__FILE__).'\..\..\..\..' ));
} else define( 'JPATH_BASE', realpath(dirname(__FILE__).'/../../../..' ));
define( 'DS', DIRECTORY_SEPARATOR );
// loading framework of Joomla!
require_once ( JPATH_BASE.DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE.DS.'includes'.DS.'framework.php' );
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
// if need a specific language component, you can load it here
jimport( 'joomla.plugin.plugin' );
JPlugin::loadLanguage( 'com_xxxxxxxxx' );
// original code here or your code continue here ...
2
?>