mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
- do not allow setting the parent to currently assigned childs [Bug #6708]
- Allow the display_on_index setting to be specified for link forums [Bug #6660] - Rank code in functions_display.php [Bug #6656] - Added some new locations for the viewonline page [Related to bug #6484] - Do not display attached images inline if user disabled image display in posts; the same with flash files [Bug #6226] git-svn-id: file:///svn/phpbb/trunk@6829 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
1c32dcaeb1
commit
46c9da77a4
8 changed files with 109 additions and 74 deletions
|
@ -256,6 +256,12 @@
|
||||||
<div id="forum_link_options">
|
<div id="forum_link_options">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{L_GENERAL_FORUM_SETTINGS}</legend>
|
<legend>{L_GENERAL_FORUM_SETTINGS}</legend>
|
||||||
|
<!-- IF S_SHOW_DISPLAY_ON_INDEX -->
|
||||||
|
<dl>
|
||||||
|
<dt><label for="link_display_on_index">{L_LIST_INDEX}:</label><br /><span>{L_LIST_INDEX_EXPLAIN}</span></dt>
|
||||||
|
<dd><input type="radio" class="radio" name="link_display_on_index" value="1"<!-- IF S_DISPLAY_ON_INDEX --> id="link_display_on_index" checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" class="radio" name="link_display_on_index" value="0"<!-- IF not S_DISPLAY_ON_INDEX --> id="link_display_on_index" checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
|
||||||
|
</dl>
|
||||||
|
<!-- ENDIF -->
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label for="forum_link">{L_FORUM_LINK}:</label><br /><span>{L_FORUM_LINK_EXPLAIN}</span></dt>
|
<dt><label for="forum_link">{L_FORUM_LINK}:</label><br /><span>{L_FORUM_LINK_EXPLAIN}</span></dt>
|
||||||
<dd><input class="medium" type="text" id="forum_link" name="forum_link" value="{FORUM_DATA_LINK}" /></dd>
|
<dd><input class="medium" type="text" id="forum_link" name="forum_link" value="{FORUM_DATA_LINK}" /></dd>
|
||||||
|
|
|
@ -133,6 +133,12 @@ class acp_forums
|
||||||
'forum_password_confirm'=> request_var('forum_password_confirm', ''),
|
'forum_password_confirm'=> request_var('forum_password_confirm', ''),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Use link_display_on_index setting if forum type is link
|
||||||
|
if ($forum_data['forum_type'] == FORUM_LINK)
|
||||||
|
{
|
||||||
|
$forum_data['display_on_index'] = request_var('link_display_on_index', false);
|
||||||
|
}
|
||||||
|
|
||||||
$forum_data['show_active'] = ($forum_data['forum_type'] == FORUM_POST) ? request_var('display_recent', false) : request_var('display_active', false);
|
$forum_data['show_active'] = ($forum_data['forum_type'] == FORUM_POST) ? request_var('display_recent', false) : request_var('display_active', false);
|
||||||
|
|
||||||
// Get data for forum rules if specified...
|
// Get data for forum rules if specified...
|
||||||
|
@ -396,18 +402,14 @@ class acp_forums
|
||||||
$forum_data['right_id'] = $row['right_id'];
|
$forum_data['right_id'] = $row['right_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure there is no forum displayed for parents_list having the current forum id as a parent...
|
// Make sure no direct child forums are able to be selected as parents.
|
||||||
$sql = 'SELECT forum_id
|
$childs = get_forum_branch($forum_id, 'children');
|
||||||
FROM ' . FORUMS_TABLE . '
|
|
||||||
WHERE parent_id = ' . $forum_id;
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
$exclude_forums = array($forum_id);
|
$exclude_forums = array();
|
||||||
while ($row = $db->sql_fetchrow($result))
|
foreach ($childs as $row)
|
||||||
{
|
{
|
||||||
$exclude_forums[] = $row['forum_id'];
|
$exclude_forums[] = $row['forum_id'];
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$parents_list = make_forum_select($forum_data['parent_id'], $exclude_forums, false, false, false);
|
$parents_list = make_forum_select($forum_data['parent_id'], $exclude_forums, false, false, false);
|
||||||
|
|
||||||
|
|
|
@ -2620,6 +2620,17 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make some descisions based on user options being set.
|
||||||
|
if (($display_cat == ATTACHMENT_CATEGORY_IMAGE || $display_cat == ATTACHMENT_CATEGORY_THUMB) && !$user->optionget('viewimg'))
|
||||||
|
{
|
||||||
|
$display_cat = ATTACHMENT_CATEGORY_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($display_cat == ATTACHMENT_CATEGORY_FLASH && !$user->optionget('viewflash'))
|
||||||
|
{
|
||||||
|
$display_cat = ATTACHMENT_CATEGORY_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
$download_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . (int) $forum_id) : $filename;
|
$download_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . (int) $forum_id) : $filename;
|
||||||
|
|
||||||
switch ($display_cat)
|
switch ($display_cat)
|
||||||
|
|
|
@ -998,4 +998,48 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $for
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get user rank title and image
|
||||||
|
*
|
||||||
|
* @param int $user_rank the current stored users rank id
|
||||||
|
* @param int $user_posts the users number of posts
|
||||||
|
* @param string &$rank_title the rank title will be stored here after execution
|
||||||
|
* @param string &$rank_img the rank image as full img tag is stored here after execution
|
||||||
|
* @param string &$rank_img_src the rank image source is stored here after execution
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
|
||||||
|
{
|
||||||
|
global $ranks, $config;
|
||||||
|
|
||||||
|
if (empty($ranks))
|
||||||
|
{
|
||||||
|
global $cache;
|
||||||
|
$ranks = $cache->obtain_ranks();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($user_rank))
|
||||||
|
{
|
||||||
|
$rank_title = (isset($ranks['special'][$user_rank]['rank_title'])) ? $ranks['special'][$user_rank]['rank_title'] : '';
|
||||||
|
$rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] . '" alt="' . $ranks['special'][$user_rank]['rank_title'] . '" title="' . $ranks['special'][$user_rank]['rank_title'] . '" />' : '';
|
||||||
|
$rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : '';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!empty($ranks['normal']))
|
||||||
|
{
|
||||||
|
foreach ($ranks['normal'] as $rank)
|
||||||
|
{
|
||||||
|
if ($user_posts >= $rank['rank_min'])
|
||||||
|
{
|
||||||
|
$rank_title = $rank['rank_title'];
|
||||||
|
$rank_img = (!empty($rank['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $rank['rank_image'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" />' : '';
|
||||||
|
$rank_img_src = (!empty($rank['rank_image'])) ? $config['ranks_path'] . '/' . $rank['rank_image'] : '';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -103,6 +103,8 @@ $lang = array_merge($lang, array(
|
||||||
'CANCEL' => 'Cancel',
|
'CANCEL' => 'Cancel',
|
||||||
'CHANGE' => 'Change',
|
'CHANGE' => 'Change',
|
||||||
'CHANGE_FONT_SIZE' => 'Change font size',
|
'CHANGE_FONT_SIZE' => 'Change font size',
|
||||||
|
'CHANGING_PREFERENCES' => 'Changing forum preferences',
|
||||||
|
'CHANGING_PROFILE' => 'Changing forum profile settings',
|
||||||
'CLICK_VIEW_PRIVMSG' => '%sGo to your inbox%s',
|
'CLICK_VIEW_PRIVMSG' => '%sGo to your inbox%s',
|
||||||
'CLOSE_WINDOW' => 'Close window',
|
'CLOSE_WINDOW' => 'Close window',
|
||||||
'COLOUR_SWATCH' => 'Colour swatch',
|
'COLOUR_SWATCH' => 'Colour swatch',
|
||||||
|
@ -367,6 +369,7 @@ $lang = array_merge($lang, array(
|
||||||
'PLAY_QUICKTIME_FILE' => 'Play Quicktime file',
|
'PLAY_QUICKTIME_FILE' => 'Play Quicktime file',
|
||||||
'PM' => 'PM',
|
'PM' => 'PM',
|
||||||
'POSTING_MESSAGE' => 'Posting message in %s',
|
'POSTING_MESSAGE' => 'Posting message in %s',
|
||||||
|
'POSTING_PRIVATE_MESSAGE' => 'Composing private message',
|
||||||
'POST' => 'Post',
|
'POST' => 'Post',
|
||||||
'POST_ANNOUNCEMENT' => 'Announce',
|
'POST_ANNOUNCEMENT' => 'Announce',
|
||||||
'POST_STICKY' => 'Sticky',
|
'POST_STICKY' => 'Sticky',
|
||||||
|
@ -397,6 +400,7 @@ $lang = array_merge($lang, array(
|
||||||
|
|
||||||
'READING_FORUM' => 'Viewing topics in %s',
|
'READING_FORUM' => 'Viewing topics in %s',
|
||||||
'READING_GLOBAL_ANNOUNCE' => 'Reading global announcement',
|
'READING_GLOBAL_ANNOUNCE' => 'Reading global announcement',
|
||||||
|
'READING_LINK' => 'Following forum link %s',
|
||||||
'READING_TOPIC' => 'Reading topic in %s',
|
'READING_TOPIC' => 'Reading topic in %s',
|
||||||
'READ_PROFILE' => 'Profile',
|
'READ_PROFILE' => 'Profile',
|
||||||
'REASON' => 'Reason',
|
'REASON' => 'Reason',
|
||||||
|
@ -579,7 +583,10 @@ $lang = array_merge($lang, array(
|
||||||
'VIEWING_FAQ' => 'Viewing FAQ',
|
'VIEWING_FAQ' => 'Viewing FAQ',
|
||||||
'VIEWING_MEMBERS' => 'Viewing member details',
|
'VIEWING_MEMBERS' => 'Viewing member details',
|
||||||
'VIEWING_ONLINE' => 'Viewing who is online',
|
'VIEWING_ONLINE' => 'Viewing who is online',
|
||||||
|
'VIEWING_MCP' => 'Viewing moderator control panel',
|
||||||
'VIEWING_MEMBER_PROFILE' => 'Viewing member profile',
|
'VIEWING_MEMBER_PROFILE' => 'Viewing member profile',
|
||||||
|
'VIEWING_PRIVATE_MESSAGES' => 'Viewing private messages',
|
||||||
|
'VIEWING_REGISTER' => 'Registering account',
|
||||||
'VIEWING_UCP' => 'Viewing user control panel',
|
'VIEWING_UCP' => 'Viewing user control panel',
|
||||||
'VIEWS' => 'Views',
|
'VIEWS' => 'Views',
|
||||||
'VIEW_BOOKMARKS' => 'View bookmarks',
|
'VIEW_BOOKMARKS' => 'View bookmarks',
|
||||||
|
|
|
@ -15,6 +15,7 @@ define('IN_PHPBB', true);
|
||||||
$phpbb_root_path = './';
|
$phpbb_root_path = './';
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||||
include($phpbb_root_path . 'common.' . $phpEx);
|
include($phpbb_root_path . 'common.' . $phpEx);
|
||||||
|
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->session_begin();
|
$user->session_begin();
|
||||||
|
@ -418,10 +419,6 @@ switch ($mode)
|
||||||
|
|
||||||
if ($config['load_user_activity'])
|
if ($config['load_user_activity'])
|
||||||
{
|
{
|
||||||
if (!function_exists('display_user_activity'))
|
|
||||||
{
|
|
||||||
include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
|
||||||
}
|
|
||||||
display_user_activity($member);
|
display_user_activity($member);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1345,37 +1342,6 @@ make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
|
||||||
|
|
||||||
page_footer();
|
page_footer();
|
||||||
|
|
||||||
/**
|
|
||||||
* Get user rank title and image
|
|
||||||
*/
|
|
||||||
function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
|
|
||||||
{
|
|
||||||
global $ranks, $config;
|
|
||||||
|
|
||||||
if (!empty($user_rank))
|
|
||||||
{
|
|
||||||
$rank_title = (isset($ranks['special'][$user_rank]['rank_title'])) ? $ranks['special'][$user_rank]['rank_title'] : '';
|
|
||||||
$rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] . '" alt="' . $ranks['special'][$user_rank]['rank_title'] . '" title="' . $ranks['special'][$user_rank]['rank_title'] . '" />' : '';
|
|
||||||
$rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : '';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (isset($ranks['normal']))
|
|
||||||
{
|
|
||||||
foreach ($ranks['normal'] as $rank)
|
|
||||||
{
|
|
||||||
if ($user_posts >= $rank['rank_min'])
|
|
||||||
{
|
|
||||||
$rank_title = $rank['rank_title'];
|
|
||||||
$rank_img = (!empty($rank['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $rank['rank_image'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" />' : '';
|
|
||||||
$rank_img_src = (!empty($rank['rank_image'])) ? $config['ranks_path'] . '/' . $rank['rank_image'] : '';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare profile data
|
* Prepare profile data
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -83,7 +83,7 @@ $result = $db->sql_query($sql, 600);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$forum_data[$row['forum_id']] = $row['forum_name'];
|
$forum_data[$row['forum_id']] = $row;
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
@ -209,6 +209,14 @@ while ($row = $db->sql_fetchrow($result))
|
||||||
if ($forum_id && $auth->acl_get('f_list', $forum_id))
|
if ($forum_id && $auth->acl_get('f_list', $forum_id))
|
||||||
{
|
{
|
||||||
$location = '';
|
$location = '';
|
||||||
|
$location_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
|
||||||
|
|
||||||
|
if ($forum_data[$forum_id]['forum_type'] == FORUM_LINK)
|
||||||
|
{
|
||||||
|
$location = sprintf($user->lang['READING_LINK'], $forum_data[$forum_id]['forum_name']);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch ($on_page[1])
|
switch ($on_page[1])
|
||||||
{
|
{
|
||||||
case 'posting':
|
case 'posting':
|
||||||
|
@ -234,8 +242,6 @@ while ($row = $db->sql_fetchrow($result))
|
||||||
$location = sprintf($user->lang['READING_FORUM'], $forum_data[$forum_id]);
|
$location = sprintf($user->lang['READING_FORUM'], $forum_data[$forum_id]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$location_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -265,16 +271,30 @@ while ($row = $db->sql_fetchrow($result))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'mcp':
|
case 'mcp':
|
||||||
|
$location = $user->lang['VIEWING_MCP'];
|
||||||
|
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
|
||||||
|
break;
|
||||||
|
|
||||||
case 'ucp':
|
case 'ucp':
|
||||||
$location = $user->lang['VIEWING_UCP'];
|
$location = $user->lang['VIEWING_UCP'];
|
||||||
|
|
||||||
/**
|
// Grab some common modules
|
||||||
* @todo getting module/mode for ucp and mcp
|
$url_params = array(
|
||||||
*/
|
'mode=register' => 'VIEWING_REGISTER',
|
||||||
/* if (strpos($row['session_page'], 'i=pm&mode=compose') !== false)
|
'i=pm&mode=compose' => 'POSTING_PRIVATE_MESSAGE',
|
||||||
|
'i=pm&' => 'VIEWING_PRIVATE_MESSAGES',
|
||||||
|
'i=profile&' => 'CHANGING_PROFILE',
|
||||||
|
'i=prefs&' => 'CHANGING_PREFERENCES',
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($url_params as $param => $lang)
|
||||||
{
|
{
|
||||||
$location = 'Composing PM';
|
if (strpos($row['session_page'], $param) !== false)
|
||||||
}*/
|
{
|
||||||
|
$location = $user->lang[$lang];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
|
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1050,28 +1050,7 @@ while ($row = $db->sql_fetchrow($result))
|
||||||
$user_cache[$poster_id]['avatar'] = '<img src="' . $avatar_img . '" width="' . $row['user_avatar_width'] . '" height="' . $row['user_avatar_height'] . '" alt="" />';
|
$user_cache[$poster_id]['avatar'] = '<img src="' . $avatar_img . '" width="' . $row['user_avatar_width'] . '" height="' . $row['user_avatar_height'] . '" alt="" />';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($row['user_rank']))
|
get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
|
||||||
{
|
|
||||||
$user_cache[$poster_id]['rank_title'] = (isset($ranks['special'][$row['user_rank']])) ? $ranks['special'][$row['user_rank']]['rank_title'] : '';
|
|
||||||
$user_cache[$poster_id]['rank_image'] = (!empty($ranks['special'][$row['user_rank']]['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $ranks['special'][$row['user_rank']]['rank_image'] . '" alt="' . $ranks['special'][$row['user_rank']]['rank_title'] . '" title="' . $ranks['special'][$row['user_rank']]['rank_title'] . '" /><br />' : '';
|
|
||||||
$user_cache[$poster_id]['rank_image_src'] = (!empty($ranks['special'][$row['user_rank']]['rank_image'])) ? $config['ranks_path'] . '/' . $ranks['special'][$row['user_rank']]['rank_image'] : '';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (isset($ranks['normal']) && sizeof($ranks['normal']))
|
|
||||||
{
|
|
||||||
foreach ($ranks['normal'] as $rank)
|
|
||||||
{
|
|
||||||
if ($row['user_posts'] >= $rank['rank_min'])
|
|
||||||
{
|
|
||||||
$user_cache[$poster_id]['rank_title'] = $rank['rank_title'];
|
|
||||||
$user_cache[$poster_id]['rank_image'] = (!empty($rank['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $rank['rank_image'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" /><br />' : '';
|
|
||||||
$user_cache[$poster_id]['rank_image_src'] = (!empty($rank['rank_image'])) ? $config['ranks_path'] . '/' . $rank['rank_image'] : '';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($row['user_allow_viewemail']) || $auth->acl_get('a_email'))
|
if (!empty($row['user_allow_viewemail']) || $auth->acl_get('a_email'))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue