Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function init_cms_vars()
- {
- global $auth, $config, $db, $mod_data, $template, $user;
- $sql = 'SELECT post_edit_time
- FROM ' . POSTS_TABLE . '
- WHERE post_approved <> 0
- ORDER BY post_edit_time DESC';
- $result = $db->sql_query_limit($sql, 1);
- $last_edit_time = $db->sql_fetchfield('post_edit_time');
- $db->sql_freeresult($result);
- $last_changed = $last_edit_time . '_' . $config['num_posts'];
- if ($last_changed != $config['cms_forum_changed'])
- {
- define('CMS_CACHE_TIME', false);
- define('CMS_CACHE_RESET', true);
- set_config('cms_forum_changed', $last_changed, true);
- }
- else
- {
- define('CMS_CACHE_TIME', 3600);
- define('CMS_CACHE_RESET', false);
- }
- $mod_data['ex_topic_tags'] = array();
- foreach ($mod_data['cms_req_auth'] as $tag => $option)
- {
- if (!$auth->acl_get($option))
- {
- $mod_data['ex_topic_tags'][] = $tag;
- }
- }
- $template->assign_var('S_CMS_ENABLED', true);
- // We do this so we only do it once per page and use it in other blocks
- $mod_data['ex_forums'] = array_unique(array_keys($auth->acl_getf('!f_read', true)));
- sort($mod_data['ex_forums']);
- echo '['. $config['num_posts'] .'] <br>';
- echo '['. $last_changed .'] <br>';
- echo '['. $last_edit_time .'] <br>';
- echo '['. $config['cms_forum_changed'] .'] <br>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement