Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. function init_cms_vars()
  2. {
  3. global $auth, $config, $db, $mod_data, $template, $user;
  4.  
  5. $sql = 'SELECT post_edit_time
  6. FROM ' . POSTS_TABLE . '
  7. WHERE post_approved <> 0
  8. ORDER BY post_edit_time DESC';
  9. $result = $db->sql_query_limit($sql, 1);
  10. $last_edit_time = $db->sql_fetchfield('post_edit_time');
  11. $db->sql_freeresult($result);
  12.  
  13. $last_changed = $last_edit_time . '_' . $config['num_posts'];
  14. if ($last_changed != $config['cms_forum_changed'])
  15. {
  16. define('CMS_CACHE_TIME', false);
  17. define('CMS_CACHE_RESET', true);
  18. set_config('cms_forum_changed', $last_changed, true);
  19. }
  20. else
  21. {
  22. define('CMS_CACHE_TIME', 3600);
  23. define('CMS_CACHE_RESET', false);
  24. }
  25.  
  26. $mod_data['ex_topic_tags'] = array();
  27. foreach ($mod_data['cms_req_auth'] as $tag => $option)
  28. {
  29. if (!$auth->acl_get($option))
  30. {
  31. $mod_data['ex_topic_tags'][] = $tag;
  32. }
  33. }
  34.  
  35. $template->assign_var('S_CMS_ENABLED', true);
  36.  
  37. // We do this so we only do it once per page and use it in other blocks
  38. $mod_data['ex_forums'] = array_unique(array_keys($auth->acl_getf('!f_read', true)));
  39. sort($mod_data['ex_forums']);
  40. echo '['. $config['num_posts'] .'] <br>';
  41. echo '['. $last_changed .'] <br>';
  42. echo '['. $last_edit_time .'] <br>';
  43. echo '['. $config['cms_forum_changed'] .'] <br>';
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement