function elxLoadModule($name='', $style=-1 ) { global $mainframe, $database, $my, $lang, $Itemid; $tp = intval(mosGetParam($_GET, 'tp', 0)); if ($tp) { echo '<div style="height:50px;background-color:#eeeeee;margin:2px;padding:10px;border:1px solid #f00;color:#700;">'.$name.'</div>'._LEND; return; } $style = intval( $style ); $cache = mosCache::getCache('com_content'); require_once($mainframe->getCfg('absolute_path').'/includes/frontend.html.php' ); $query = "SELECT id, title, module, position, content, showtitle, params, language FROM #__modules" ."\n WHERE module='".$name."' AND published='1' AND access IN (".$my->allowed.") AND client_id='0'" ."\n AND ((language IS NULL) OR (language LIKE '%".$lang."%'))"; $database->setQuery($query, '#__', 1, 0); if (!$database->loadObject($module)) { return; } $module = elxTransModTitle($module); $params = new mosParameters( $module->params ); if ((substr($module->module,0,4))=='mod_') { if (($params->get('cache') == 1) && ($mainframe->getCfg('caching') == 1)) { $cache->call('modules_html::module2', $module, $params, $Itemid, $style ); } else { modules_html::module2( $module, $params, $Itemid, $style, '1' ); } } else { if (($params->get('cache') == 1) && ($mainframe->getCfg('caching') == 1)) { $cache->call('modules_html::module', $module, $params, $Itemid, $style ); } else { modules_html::module( $module, $params, $Itemid, $style ); } }}
function elxLoadModuleByID( $id='', $style=-1 ) { global $mainframe, $database, $my, $lang, $Itemid; $tp = intval(mosGetParam($_GET, 'tp', 0)); if ($tp) { echo '<div style="height:50px;background-color:#eeeeee;margin:2px;padding:10px;border:1px solid #f00;color:#700;">'.$name.'</div>'._LEND; return; } $style = intval( $style ); $cache = mosCache::getCache('com_content'); require_once($mainframe->getCfg('absolute_path').'/includes/frontend.html.php' ); $query = "SELECT id, title, module, position, content, showtitle, params, language FROM #__modules" ."\n WHERE id='".$id."' AND published='1' AND access IN (".$my->allowed.") AND client_id='0'" ."\n AND ((language IS NULL) OR (language LIKE '%".$lang."%'))"; $database->setQuery($query, '#__', 1, 0); if (!$database->loadObject($module)) { return; } $module = elxTransModTitle($module); $params = new mosParameters( $module->params ); if ((substr($module->module,0,4))=='mod_') { if (($params->get('cache') == 1) && ($mainframe->getCfg('caching') == 1)) { $cache->call('modules_html::module2', $module, $params, $Itemid, $style ); } else { modules_html::module2( $module, $params, $Itemid, $style, '1' ); } } else { if (($params->get('cache') == 1) && ($mainframe->getCfg('caching') == 1)) { $cache->call('modules_html::module', $module, $params, $Itemid, $style ); } else { modules_html::module( $module, $params, $Itemid, $style ); } }}