2012-11-12 63 views
1

是否可以從外部PHP文件中禁用的Joomla模塊加載參數?禁用Joomla模塊的參數

+0

什麼版本的Joomla您使用的是here

//init Joomla Framework define('_JEXEC', 1); define('DS', DIRECTORY_SEPARATOR); define('JPATH_BASE', realpath(dirname(__FILE__).DS.'..'.DS.'..'.DS.'..')); require_once (JPATH_BASE .DS.'includes'.DS.'defines.php'); require_once (JPATH_BASE .DS.'includes'.DS.'framework.php'); $mainframe = JFactory::getApplication('site'); 

查看更多信息?你試過什麼了?你做過任何研究嗎? – Lodder

+0

@Lodder在版本方面有什麼區別嗎? – alfasin

+0

@alfasin - 不確定Joomla 1.5和2.5,但如果它是Joomla 3.x,那麼是的。 'JParameter'和'$ mainframe'已被棄用。 – Lodder

回答

0
$module = &JModuleHelper::getModule('example'); //Get the module (in this case "example") 
$moduleParams = new JParameter($module->params); //Retrieve this modules parameters 
$param = $moduleParams->get('paramName', 'defaultValue'); //Get the specific parameter 

此代碼應檢索文章參數是否禁用。如果它是在被的Joomla之外,你還需要使用加載的Joomla類術語外部php文件: