mirror of
https://github.com/phpbb/phpbb.git
synced 2025-01-31 13:48:04 +01:00
Various updates
git-svn-id: file:///svn/phpbb/trunk@3530 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
46267dce88
commit
02bcd7e2e1
@ -112,10 +112,10 @@ function generate_forum_nav(&$forum_data)
|
||||
if (empty($forum_data['forum_parents']))
|
||||
{
|
||||
$sql = 'SELECT forum_id, forum_name
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE left_id < ' . $forum_data['left_id'] . '
|
||||
AND right_id > ' . $forum_data['right_id'] . '
|
||||
ORDER BY left_id ASC';
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE left_id < ' . $forum_data['left_id'] . '
|
||||
AND right_id > ' . $forum_data['right_id'] . '
|
||||
ORDER BY left_id ASC';
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
@ -124,8 +124,8 @@ function generate_forum_nav(&$forum_data)
|
||||
}
|
||||
|
||||
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
||||
SET forum_parents = '" . $db->sql_escape(serialize($forum_parents)) . "'
|
||||
WHERE parent_id = " . $forum_data['parent_id'];
|
||||
SET forum_parents = '" . $db->sql_escape(serialize($forum_parents)) . "'
|
||||
WHERE parent_id = " . $forum_data['parent_id'];
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
else
|
||||
@ -150,7 +150,7 @@ function generate_forum_nav(&$forum_data)
|
||||
$template->assign_vars(array(
|
||||
'FORUM_ID' => $forum_data['forum_id'],
|
||||
'FORUM_NAME' => $forum_data['forum_name'],
|
||||
'FORUM_DESC' => strip_tags($forum_data['forum_desc'])
|
||||
'FORUM_DESC' => $forum_data['forum_desc']
|
||||
));
|
||||
|
||||
return;
|
||||
@ -186,15 +186,51 @@ function get_moderators(&$forum_moderators, $forum_id = false)
|
||||
}
|
||||
|
||||
// User authorisation levels output
|
||||
function get_forum_rules($mode, &$rules, &$forum_id)
|
||||
function gen_forum_rules($mode, &$forum_id)
|
||||
{
|
||||
global $SID, $auth, $user;
|
||||
global $SID, $template, $auth, $user;
|
||||
|
||||
$rules .= (($auth->acl_gets('f_post', 'm_', 'a_', $forum_id)) ? $user->lang['Rules_post_can'] : $user->lang['Rules_post_cannot']) . '<br />';
|
||||
$rules .= (($auth->acl_gets('f_reply', 'm_', 'a_', $forum_id)) ? $user->lang['Rules_reply_can'] : $user->lang['Rules_reply_cannot']) . '<br />';
|
||||
$rules .= (($auth->acl_gets('f_edit', 'm_', 'a_', $forum_id)) ? $user->lang['Rules_edit_can'] : $user->lang['Rules_edit_cannot']) . '<br />';
|
||||
$rules .= (($auth->acl_gets('f_delete', 'm_', 'a_', $forum_id) || $auth->acl_get('m_delete', $forum_id)) ? $user->lang['Rules_delete_can'] : $user->lang['Rules_delete_cannot']) . '<br />';
|
||||
$rules .= (($auth->acl_gets('f_attach', 'm_', 'a_', $forum_id)) ? $user->lang['Rules_attach_can'] : $user->lang['Rules_attach_cannot']) . '<br />';
|
||||
$rules = array('post', 'reply', 'edit', 'delete', 'attach');
|
||||
|
||||
foreach ($rules as $rule)
|
||||
{
|
||||
$template->assign_block_vars('rules', array(
|
||||
'RULE' => ($auth->acl_gets('f_' . $rule, 'm_', 'a_', $forum_id)) ? $user->lang['RULES_' . strtoupper($rule) . '_CAN'] : $user->lang['RULES_' . strtoupper($rule) . '_CANNOT'])
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
function gen_sort_selects(&$limit_days, &$sort_by_text, &$s_limit_days, &$s_sort_key, &$s_sort_dir)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
|
||||
|
||||
$s_limit_days = '<select name="sort_days">';
|
||||
foreach ($limit_days as $day => $text)
|
||||
{
|
||||
$selected = ($sort_days == $day) ? ' selected="selected"' : '';
|
||||
$s_limit_days .= '<option value="' . $day . '"' . $selected . '>' . $text . '</option>';
|
||||
}
|
||||
$s_limit_days .= '</select>';
|
||||
|
||||
$s_sort_key = '<select name="sort_key">';
|
||||
foreach ($sort_by_text as $key => $text)
|
||||
{
|
||||
$selected = ($sort_key == $key) ? ' selected="selected"' : '';
|
||||
$s_sort_key .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>';
|
||||
}
|
||||
$s_sort_key .= '</select>';
|
||||
|
||||
$s_sort_dir = '<select name="sort_dir">';
|
||||
foreach ($sort_dir_text as $key => $value)
|
||||
{
|
||||
$selected = ($sort_dir == $key) ? ' selected="selected"' : '';
|
||||
$s_sort_dir .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
|
||||
}
|
||||
$s_sort_dir .= '</select>';
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -269,17 +269,17 @@ $template->assign_vars(array(
|
||||
'SITENAME' => $config['sitename'],
|
||||
'SITE_DESCRIPTION' => $config['site_desc'],
|
||||
'PAGE_TITLE' => $page_title,
|
||||
'LAST_VISIT_DATE' => sprintf($user->lang['You_last_visit'], $s_last_visit),
|
||||
'CURRENT_TIME' => sprintf($user->lang['Current_time'], $user->format_date(time())),
|
||||
'LAST_VISIT_DATE' => sprintf($user->lang['YOU_LAST_VISIT'], $s_last_visit),
|
||||
'CURRENT_TIME' => sprintf($user->lang['CURRENT_TIME'], $user->format_date(time())),
|
||||
'TOTAL_USERS_ONLINE' => $l_online_users,
|
||||
'LOGGED_IN_USER_LIST' => $online_userlist,
|
||||
'RECORD_USERS' => sprintf($user->lang['Record_online_users'], $config['record_online_users'], $user->format_date($config['record_online_date'])),
|
||||
'RECORD_USERS' => sprintf($user->lang['RECORD_ONLINE_USERS'], $config['record_online_users'], $user->format_date($config['record_online_date'])),
|
||||
'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text,
|
||||
'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new,
|
||||
'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread,
|
||||
|
||||
'L_LOGIN_LOGOUT' => $l_login_logout,
|
||||
'L_INDEX' => $user->lang['Forum_Index'],
|
||||
'L_INDEX' => $user->lang['FORUM_INDEX'],
|
||||
|
||||
'U_PRIVATEMSGS' => 'privmsg.'.$phpEx.$SID.'&folder=inbox',
|
||||
'U_MEMBERLIST' => 'memberlist.'.$phpEx.$SID,
|
||||
|
@ -72,7 +72,7 @@ class session
|
||||
|
||||
if ($this->load > doubleval($config['limit_load']))
|
||||
{
|
||||
trigger_error('Board_unavailable');
|
||||
trigger_error('BOARD_UNAVAILABLE');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -150,7 +150,7 @@ class session
|
||||
|
||||
if (intval($row['sessions']) > intval($config['active_sessions']))
|
||||
{
|
||||
trigger_error('Board_unavailable');
|
||||
trigger_error('BOARD_UNAVAILABLE');
|
||||
}
|
||||
}
|
||||
|
||||
@ -215,7 +215,10 @@ class session
|
||||
|
||||
if ($banned)
|
||||
{
|
||||
trigger_error('You_been_banned');
|
||||
// TODO
|
||||
// Note that at present this doesn't surround the administrator
|
||||
// text with an appropriate URL
|
||||
trigger_error('BOARD_BANNED');
|
||||
}
|
||||
}
|
||||
|
||||
@ -449,8 +452,7 @@ class user extends session
|
||||
AND t.template_id = s.template_id
|
||||
AND c.theme_id = s.style_id
|
||||
AND i.imageset_id = s.imageset_id";
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
$result = $db->sql_query($sql, 600);
|
||||
|
||||
if (!($this->theme = $db->sql_fetchrow($result)))
|
||||
{
|
||||
@ -488,7 +490,7 @@ class user extends session
|
||||
$alt = (!empty($this->lang[$alt])) ? $this->lang[$alt] : '';
|
||||
|
||||
$width = ($width) ? 'width="' . $width . '" ' : '';
|
||||
$imgs[$img] = '<img src=' . str_replace('{LANG}', $this->img_lang, $this->theme[$img]) . '" ' . $width . 'alt="' . $alt . '" title="' . $alt . '" />';
|
||||
$imgs[$img] = '<img src=' . str_replace('{LANG}', $this->img_lang, $this->theme[$img]) . ' ' . $width . 'alt="' . $alt . '" title="' . $alt . '" />';
|
||||
}
|
||||
return $imgs[$img];
|
||||
}
|
||||
|
@ -724,6 +724,10 @@ class Template {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function compile_cache_clear($mode, &$dir, &$template)
|
||||
{
|
||||
$template_list = array();
|
||||
@ -795,8 +799,6 @@ class Template {
|
||||
'#\' \. \(\(isset\(\$this\->_tpldata\[\'([a-z0-9_\.]+?)\'\].*?[\'([a-z0-9_\.]+?)\'\].*?\[\'([A-Z0-9_]+?)\'\]\)\).*?\'\'\) \. \'#s',
|
||||
);
|
||||
|
||||
//' . ((isset($this->_tpldata['faq_block_link.'][$_faq_block_link_i]['faq_row_link.'][$_faq_row_link_i]['U_FAQ_LINK'])) ? $this->_tpldata['faq_block_link.'][$_faq_block_link_i]['faq_row_link.'][$_faq_row_link_i]['U_FAQ_LINK'] : '') . '
|
||||
|
||||
$replace_tags = array(
|
||||
'\1',
|
||||
'\1',
|
||||
|
Loading…
x
Reference in New Issue
Block a user