Commit cc379da3 by Scott

Cache category widget

parent f2b48d31
......@@ -213,6 +213,7 @@
'avatar_q_page_q_size' => 50,
'avatar_store_size' => 400,
'avatar_users_size' => 30,
'caching_catwidget_time' => 30,
'caching_enabled' => 0,
'caching_q_time' => 5,
'caching_qlist_time' => 5,
......
......@@ -45,6 +45,7 @@
'avatar_users_size' => 'Avatar size on top users page:',
'block_bad_words' => 'Censored words - separate by spaces or commas:',
'block_ips_write' => 'Blocked IP addresses - separate by spaces or commas:',
'caching_catwidget_time' => 'Cache category widget for:',
'caching_enabled' => 'Enable caching:',
'caching_q_time' => 'Cache question pages for:',
'caching_qlist_time' => 'Cache question lists for:',
......
......@@ -73,6 +73,7 @@
'avatar_q_page_q_size' => 'number',
'avatar_store_size' => 'number',
'avatar_users_size' => 'number',
'caching_catwidget_time' => 'number',
'caching_q_time' => 'number',
'caching_qlist_time' => 'number',
'columns_tags' => 'number',
......@@ -645,11 +646,12 @@
$subtitle = 'admin/caching_title';
$formstyle = 'wide';
$showoptions = array('caching_enabled', 'caching_q_time', 'caching_qlist_time');
$showoptions = array('caching_enabled', 'caching_q_time', 'caching_qlist_time', 'caching_catwidget_time');
$checkboxtodisplay = array(
'caching_q_time' => 'option_caching_enabled',
'caching_qlist_time' => 'option_caching_enabled',
'caching_catwidget_time' => 'option_caching_enabled',
);
break;
......@@ -1551,6 +1553,7 @@
case 'caching_q_time':
case 'caching_qlist_time':
case 'caching_catwidget_time':
$optionfield['note'] = qa_lang_html_sub('main/x_minutes', '');
break;
}
......
......@@ -42,7 +42,12 @@ class qa_category_list
$nav = $qa_content['navigation']['cat'];
}
else {
$navcategories = qa_db_single_select(qa_db_category_nav_selectspec(null, true, false, true));
$selectspec = qa_db_category_nav_selectspec(null, true, false, true);
$selectspec['caching'] = array(
'key' => 'qa_db_category_nav_selectspec:default:full',
'ttl' => qa_opt('caching_catwidget_time'),
);
$navcategories = qa_db_single_select($selectspec);
$nav = qa_category_navigation($navcategories);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment