mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
r272
ajax список модераторов git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@272 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
d5e9fb2498
commit
a4714f8ed2
4 changed files with 60 additions and 40 deletions
|
@ -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;
|
||||
|
@ -411,6 +412,43 @@ class ajax_common
|
|||
$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[] = '<a href="'. PROFILE_URL . $user_id .'">'. $mod['name_users'][$user_id] .'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($mod['mod_groups'][$forum_id]))
|
||||
{
|
||||
foreach ($mod['mod_groups'][$forum_id] as $group_id)
|
||||
{
|
||||
$moderators[] = '<a href="'. "groupcp.php?". POST_GROUPS_URL ."=". $group_id .'">'. $mod['name_groups'][$group_id] .'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
$html = ': ';
|
||||
$html .= ($moderators) ? join(', ', $moderators) : $lang['NONE'];
|
||||
|
||||
$this->response['html'] = '<strong>'.$html.'</strong>';
|
||||
unset($moderators, $mod);
|
||||
$datastore->rm('moderators');
|
||||
}
|
||||
|
||||
function view_post ()
|
||||
{
|
||||
require(AJAX_DIR .'view_post.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
|
||||
|
|
|
@ -267,9 +267,27 @@ td.topic_id { cursor: pointer; }
|
|||
<tr>
|
||||
<td valign="bottom">
|
||||
<h1 class="maintitle"><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h1>
|
||||
<!-- IF MODERATORS -->
|
||||
<p class="small">{L_MODERATORS}: <b>{MODERATORS}</b></p>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<p class="small" id="moderators"><a style="text-decoration: none;" href="#">{L_MODERATORS}</a></p>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#moderators a").one('click', function(){
|
||||
$('#moderators').html($('#moderators').text());
|
||||
ajax.get_forum_mods();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
ajax.get_forum_mods = function() {
|
||||
ajax.exec({
|
||||
action : 'get_forum_mods',
|
||||
forum_id : {FORUM_ID}
|
||||
});
|
||||
};
|
||||
ajax.callback.get_forum_mods = function(data) {
|
||||
$('#moderators').append(data.html);
|
||||
};
|
||||
</script>
|
||||
|
||||
<!-- IF SHOW_ONLINE_LIST -->
|
||||
<p class="small">{LOGGED_IN_USER_LIST}</p>
|
||||
<!-- ENDIF -->
|
||||
|
@ -309,7 +327,6 @@ td.topic_id { cursor: pointer; }
|
|||
<td class="pad_4">{f.TOPIC_TYPE}
|
||||
<h4 class="forumlink"><a href="{f.U_VIEWFORUM}">{f.FORUM_NAME}</a></h4>
|
||||
<!-- IF f.FORUM_DESC --><p class="forum_desc">{f.FORUM_DESC}</p><!-- ENDIF -->
|
||||
<!-- IF f.MODERATORS --><p class="moderators"><em>{L_MODERATORS}:</em> {f.MODERATORS}</p><!-- ENDIF -->
|
||||
</td>
|
||||
<td class="med tCenter">{f.TOPICS}</td>
|
||||
<td class="med tCenter">{f.POSTS}</td>
|
||||
|
|
|
@ -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[] = '<a href="'. PROFILE_URL . $user_id .'">'. $mod['name_users'][$user_id] .'</a>';
|
||||
}
|
||||
}
|
||||
if (isset($mod['mod_groups'][$forum_id]))
|
||||
{
|
||||
foreach ($mod['mod_groups'][$forum_id] as $group_id)
|
||||
{
|
||||
$moderators[] = '<a href="'. "groupcp.php?". POST_GROUPS_URL ."=". $group_id .'">'. $mod['name_groups'][$group_id] .'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
$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'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue