aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_forums.php18
-rw-r--r--phpBB/includes/functions.php11
-rw-r--r--phpBB/includes/functions_display.php44
3 files changed, 65 insertions, 8 deletions
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index fe78a6252b..da60162e33 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -133,6 +133,12 @@ class acp_forums
'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);
// Get data for forum rules if specified...
@@ -396,18 +402,14 @@ class acp_forums
$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...
- $sql = 'SELECT forum_id
- FROM ' . FORUMS_TABLE . '
- WHERE parent_id = ' . $forum_id;
- $result = $db->sql_query($sql);
+ // Make sure no direct child forums are able to be selected as parents.
+ $childs = get_forum_branch($forum_id, 'children');
- $exclude_forums = array($forum_id);
- while ($row = $db->sql_fetchrow($result))
+ $exclude_forums = array();
+ foreach ($childs as $row)
{
$exclude_forums[] = $row['forum_id'];
}
- $db->sql_freeresult($result);
$parents_list = make_forum_select($forum_data['parent_id'], $exclude_forums, false, false, false);
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 8e1df45cb0..5206e51fdd 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -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;
switch ($display_cat)
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 47e7e67c17..60e35709c9 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -998,4 +998,48 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $for
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;
+ }
+ }
+ }
+ }
+}
+
?> \ No newline at end of file