diff --git a/upload/ajax.php b/upload/ajax.php index 463292f5d..753306ffa 100644 --- a/upload/ajax.php +++ b/upload/ajax.php @@ -75,6 +75,7 @@ class ajax_common 'user_register' => array('guest'), 'posts' => array('guest'), 'birthday_list' => array('guest'), + 'get_forum_mods' => array('guest'), ); var $action = null; @@ -410,6 +411,43 @@ class ajax_common $this->response['html'] = $html; $this->response['mode'] = $mode; } + + function get_forum_mods() + { + global $lang, $datastore; + + $forum_id = (int) $this->request['forum_id']; + + $datastore->enqueue(array( + 'moderators', + )); + + $moderators = array(); + $mod = $datastore->get('moderators'); + + if (isset($mod['mod_users'][$forum_id])) + { + foreach ($mod['mod_users'][$forum_id] as $user_id) + { + $moderators[] = ''. $mod['name_users'][$user_id] .''; + } + } + + if (isset($mod['mod_groups'][$forum_id])) + { + foreach ($mod['mod_groups'][$forum_id] as $group_id) + { + $moderators[] = ''. $mod['name_groups'][$group_id] .''; + } + } + + $html = ': '; + $html .= ($moderators) ? join(', ', $moderators) : $lang['NONE']; + + $this->response['html'] = ''.$html.''; + unset($moderators, $mod); + $datastore->rm('moderators'); + } function view_post () { diff --git a/upload/config.php b/upload/config.php index c0f1eda8a..970a118cb 100644 --- a/upload/config.php +++ b/upload/config.php @@ -53,7 +53,7 @@ $bb_cfg = $tr_cfg = $page_cfg = array(); // Increase number of revision after update $bb_cfg['tp_version'] = '2.1 Stable'; -$bb_cfg['tp_release_state'] = 'R271'; +$bb_cfg['tp_release_state'] = 'R272'; $bb_cfg['tp_release_date'] = '30-08-2011'; // Database diff --git a/upload/templates/default/viewforum.tpl b/upload/templates/default/viewforum.tpl index a667db373..c637ebf76 100644 --- a/upload/templates/default/viewforum.tpl +++ b/upload/templates/default/viewforum.tpl @@ -267,9 +267,27 @@ td.topic_id { cursor: pointer; }

{FORUM_NAME}

- -

{L_MODERATORS}: {MODERATORS}

- + +

{L_MODERATORS}

+ +

{LOGGED_IN_USER_LIST}

@@ -309,7 +327,6 @@ td.topic_id { cursor: pointer; } {f.TOPIC_TYPE}

{f.FORUM_DESC}

-

{L_MODERATORS}: {f.MODERATORS}

{f.TOPICS} {f.POSTS} diff --git a/upload/viewforum.php b/upload/viewforum.php index ea71b3428..854008b61 100644 --- a/upload/viewforum.php +++ b/upload/viewforum.php @@ -12,10 +12,6 @@ $last_topic_max_len = 40; $title_match_key = 'nm'; $title_match_max_len = 60; -$datastore->enqueue(array( - 'moderators', -)); - $page_cfg['load_tpl_vars'] = array( 'post_icons', 'topic_icons', @@ -206,7 +202,6 @@ if (!$forum_data['forum_parent'] && isset($forums['f'][$forum_id]['subforums']) 'TOPICS' => commify($sf_data['forum_topics']), 'POSTS' => commify($sf_data['forum_posts']), 'LAST_POST' => $last_post, - 'MODERATORS' => '', )); if ($sf_data['forum_last_post_id']) @@ -258,36 +253,6 @@ if ($is_auth['auth_mod']) } } -// Obtain list of moderators -$moderators = array(); -if (!$mod = $datastore->get('moderators')) -{ - $datastore->update('moderators'); - $mod = $datastore->get('moderators'); -} - -if (isset($mod['mod_users'][$forum_id])) -{ - foreach ($mod['mod_users'][$forum_id] as $user_id) - { - $moderators[] = ''. $mod['name_users'][$user_id] .''; - } -} -if (isset($mod['mod_groups'][$forum_id])) -{ - foreach ($mod['mod_groups'][$forum_id] as $group_id) - { - $moderators[] = ''. $mod['name_groups'][$group_id] .''; - } -} - -$template->assign_vars(array( - 'MODERATORS' => ($moderators) ? join(', ', $moderators) : $lang['NONE'], -)); - -unset($moderators, $mod); -$datastore->rm('moderators'); - // Generate a 'Show topics in previous x days' select box. $topic_days = 0; // all the time $forum_topics = $forum_data['forum_topics'];