[ticket/494] Cache more queries on portal page
B3P-494
This commit is contained in:
@@ -70,32 +70,24 @@ function set_portal_config($config_name, $config_value)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get portal modules
|
||||
*/
|
||||
* Get portal modules
|
||||
*/
|
||||
function obtain_portal_modules()
|
||||
{
|
||||
global $db, $cache, $portal_modules;
|
||||
global $db;
|
||||
|
||||
if (($portal_modules = $cache->get('portal_modules')) === false || defined('DEBUG'))
|
||||
$portal_modules = array();
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . PORTAL_MODULES_TABLE . '
|
||||
ORDER BY module_order ASC';
|
||||
$result = $db->sql_query($sql, 3600);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$portal_modules = $portal_cached_modules = array();
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . PORTAL_MODULES_TABLE . '
|
||||
ORDER BY module_order ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$portal_cached_modules[] = $row;
|
||||
|
||||
$portal_modules[] = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$cache->put('portal_modules', $portal_cached_modules);
|
||||
$portal_modules[] = $row;
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
return $portal_modules;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user