From 4553293053ba5ccdd369a181adda30e6ee0159eb Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Mon, 21 Aug 2006 15:58:48 +0000 Subject: Initial batch of colourization changes. This includes: - schema changes for first post and last post - display in viewforum, search and ucp of first post - update of database on posting Still outstanding - display of last post git-svn-id: file:///svn/phpbb/trunk@6309 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index f6b73afa0e..fdedac05ed 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -498,7 +498,7 @@ function topic_topic_author(&$topic_row) { global $phpEx, $phpbb_root_path, $user; - $topic_author = ($topic_row['topic_poster'] != ANONYMOUS) ? '' : ''; + $topic_author = ($topic_row['topic_poster'] != ANONYMOUS) ? '' : ''; $topic_author .= ($topic_row['topic_poster'] != ANONYMOUS) ? $topic_row['topic_first_poster_name'] : (($topic_row['topic_first_poster_name'] != '') ? $topic_row['topic_first_poster_name'] : $user->lang['GUEST']); $topic_author .= ($topic_row['topic_poster'] != ANONYMOUS) ? '' : ''; -- cgit v1.2.1 From b0afc8e6320598734ae20e664be9f840ca501f91 Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Tue, 22 Aug 2006 11:01:56 +0000 Subject: Phase 2 of the changes This should now be complete git-svn-id: file:///svn/phpbb/trunk@6311 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index fdedac05ed..1fc6b63996 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -183,6 +183,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $forum_rows[$parent_id]['forum_last_post_time'] = $row['forum_last_post_time']; $forum_rows[$parent_id]['forum_last_poster_id'] = $row['forum_last_poster_id']; $forum_rows[$parent_id]['forum_last_poster_name'] = $row['forum_last_poster_name']; + $forum_rows[$parent_id]['forum_last_poster_colour'] = $row['forum_last_poster_colour']; $forum_rows[$parent_id]['forum_id_last_post'] = $forum_id; } else @@ -306,6 +307,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $last_post_time = $user->format_date($row['forum_last_post_time']); $last_poster = ($row['forum_last_poster_name'] != '') ? $row['forum_last_poster_name'] : $user->lang['GUEST']; + $last_poster_colour = ($row['forum_last_poster_colour']) ? '#' . $row['forum_last_poster_colour'] : ''; $last_poster_url = ($row['forum_last_poster_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['forum_last_poster_id']); $last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id']; @@ -342,6 +344,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'SUBFORUMS' => $subforums_list, 'LAST_POST_TIME' => $last_post_time, 'LAST_POSTER' => $last_poster, + 'LAST_POSTER_COLOUR' => $last_poster_colour, 'MODERATORS' => $moderators_list, 'L_SUBFORUM_STR' => $l_subforums, @@ -491,20 +494,6 @@ function get_forum_parents(&$forum_data) return $forum_parents; } -/** -* Get topic author -*/ -function topic_topic_author(&$topic_row) -{ - global $phpEx, $phpbb_root_path, $user; - - $topic_author = ($topic_row['topic_poster'] != ANONYMOUS) ? '' : ''; - $topic_author .= ($topic_row['topic_poster'] != ANONYMOUS) ? $topic_row['topic_first_poster_name'] : (($topic_row['topic_first_poster_name'] != '') ? $topic_row['topic_first_poster_name'] : $user->lang['GUEST']); - $topic_author .= ($topic_row['topic_poster'] != ANONYMOUS) ? '' : ''; - - return $topic_author; -} - /** * Generate topic pagination */ -- cgit v1.2.1 From d64e44b8786ef0c219860838ca101bd7f44d4ece Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Wed, 30 Aug 2006 19:33:55 +0000 Subject: Error if no post in a forum git-svn-id: file:///svn/phpbb/trunk@6336 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 1fc6b63996..35c78189f4 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -314,7 +314,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod } else { - $last_post_time = $last_poster = $last_poster_url = $last_post_url = ''; + $last_post_time = $last_poster = $last_poster_colour = $last_poster_url = $last_post_url = ''; } // Output moderator listing ... if applicable -- cgit v1.2.1 From 6568ab756c636490ce74c5beb63b53a353e49fbe Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Fri, 8 Sep 2006 18:00:38 +0000 Subject: Next phase of last post changes + a few minor bugs Note: This template variable is available but will not be used by default git-svn-id: file:///svn/phpbb/trunk@6360 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 35c78189f4..f46298002c 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -180,6 +180,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod if ($row['forum_last_post_time'] > $forum_rows[$parent_id]['forum_last_post_time']) { $forum_rows[$parent_id]['forum_last_post_id'] = $row['forum_last_post_id']; + $forum_rows[$parent_id]['forum_last_post_subject'] = $row['forum_last_post_subject']; $forum_rows[$parent_id]['forum_last_post_time'] = $row['forum_last_post_time']; $forum_rows[$parent_id]['forum_last_poster_id'] = $row['forum_last_poster_id']; $forum_rows[$parent_id]['forum_last_poster_name'] = $row['forum_last_poster_name']; @@ -304,6 +305,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod // Create last post link information, if appropriate if ($row['forum_last_post_id']) { + $last_post_subject = $row['forum_last_post_subject']; $last_post_time = $user->format_date($row['forum_last_post_time']); $last_poster = ($row['forum_last_poster_name'] != '') ? $row['forum_last_poster_name'] : $user->lang['GUEST']; @@ -314,7 +316,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod } else { - $last_post_time = $last_poster = $last_poster_colour = $last_poster_url = $last_post_url = ''; + $last_post_subject = $last_post_time = $last_poster = $last_poster_colour = $last_poster_url = $last_post_url = ''; } // Output moderator listing ... if applicable @@ -342,6 +344,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'FORUM_FOLDER_IMG' => ($row['forum_image']) ? '' . $user->lang[$folder_alt] . '' : $user->img($folder_image, $folder_alt), 'FORUM_FOLDER_IMG_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : $user->img($folder_image, $folder_alt, false, '', 'src'), 'SUBFORUMS' => $subforums_list, + 'LAST_POST_SUBJECT' => $last_post_subject, 'LAST_POST_TIME' => $last_post_time, 'LAST_POSTER' => $last_poster, 'LAST_POSTER_COLOUR' => $last_poster_colour, -- cgit v1.2.1 From b76222cb6e9ed69ee8ed0c09f0196eaaafd33fad Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 13 Sep 2006 16:08:36 +0000 Subject: - fixed some bugs - changed attachment handling a bit - tried to remove target tags out of the code - do not add session ids to urls for bots as well as not creating a new session on each page view for them I bet i introduced some bugs too. ;) git-svn-id: file:///svn/phpbb/trunk@6364 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 54 +++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index f46298002c..8e7edea1e2 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -44,7 +44,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod } // Display list of active topics for this category? - $show_active = (isset($root_data['forum_flags']) && $root_data['forum_flags'] & 16) ? true : false; + $show_active = (isset($root_data['forum_flags']) && ($root_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) ? true : false; $sql_from = FORUMS_TABLE . ' f '; $lastread_select = $sql_lastread = ''; @@ -126,7 +126,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod } // Display active topics from this forum? - if ($show_active && $row['forum_type'] == FORUM_POST && $auth->acl_get('f_read', $forum_id) && ($row['forum_flags'] & 16)) + if ($show_active && $row['forum_type'] == FORUM_POST && $auth->acl_get('f_read', $forum_id) && ($row['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) { if (!isset($active_forum_ary['forum_topics'])) { @@ -328,7 +328,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod } $l_post_click_count = ($row['forum_type'] == FORUM_LINK) ? 'CLICKS' : 'POSTS'; - $post_click_count = ($row['forum_type'] != FORUM_LINK || $row['forum_flags'] & 1) ? $row['forum_posts'] : ''; + $post_click_count = ($row['forum_type'] != FORUM_LINK || $row['forum_flags'] & FORUM_FLAG_LINK_TRACK) ? $row['forum_posts'] : ''; $template->assign_block_vars('forumrow', array( 'S_IS_CAT' => false, @@ -354,7 +354,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'L_FORUM_FOLDER_ALT' => $folder_alt, 'L_MODERATOR_STR' => $l_moderator, - 'U_VIEWFORUM' => ($row['forum_type'] != FORUM_LINK || $row['forum_flags'] & 1) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : $row['forum_link'], + 'U_VIEWFORUM' => ($row['forum_type'] != FORUM_LINK || ($row['forum_flags'] & FORUM_FLAG_LINK_TRACK)) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : $row['forum_link'], 'U_LAST_POSTER' => $last_poster_url, 'U_LAST_POST' => $last_post_url) ); @@ -698,14 +698,60 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ 'attachment_tpl' => 'attachment.html') ); + if (!sizeof($attachment_data)) + { + return array(); + } + if (empty($extensions) || !is_array($extensions)) { $extensions = array(); $cache->obtain_attach_extensions($extensions); } + // Look for missing attachment informations... + $attach_ids = array(); + foreach ($attachment_data as $pos => $attachment) + { + // If is_orphan is set, we need to retrieve the attachments again... + if (!isset($attachment['extension']) && !isset($attachment['physical_filename'])) + { + $attach_ids[(int) $attachment['attach_id']] = $pos; + } + } + + if (sizeof($attach_ids)) + { + global $db; + + $attachment_data = array(); + + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('attach_id', array_keys($attach_ids)); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (!isset($attach_ids[$row['attach_id']])) + { + continue; + } + + $attachment_data[$attach_ids[$row['attach_id']]] = $row; + } + $db->sql_freeresult($result); + + ksort($attachment_data); + } + foreach ($attachment_data as $attachment) { + if (!sizeof($attachment)) + { + continue; + } + // We need to reset/empty the _file block var, because this function might be called more than once $template->destroy_block_vars('_file'); -- cgit v1.2.1 From 587ec3fa77d90819148cdeda2b490bbf82632114 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 20 Sep 2006 13:20:18 +0000 Subject: #4406 git-svn-id: file:///svn/phpbb/trunk@6382 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 8e7edea1e2..217befd5fa 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -652,7 +652,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold $folder = 'topic_read'; $folder_new = 'topic_unread'; - if ($config['hot_threshold'] && $replies >= $config['hot_threshold']) + if ($config['hot_threshold'] && $replies >= $config['hot_threshold'] && $topic_row['topic_status'] != ITEM_LOCKED) { $folder .= '_hot'; $folder_new .= '_hot'; -- cgit v1.2.1 From 1d7e3e0fd95fb5baf92937d1f911649cb1a665e9 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 22 Sep 2006 22:14:05 +0000 Subject: some tiny fixes here and there git-svn-id: file:///svn/phpbb/trunk@6383 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 78 +++++++++++------------------------- 1 file changed, 23 insertions(+), 55 deletions(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 217befd5fa..2c82fda5ed 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1018,24 +1018,11 @@ function display_user_activity(&$userdata) global $auth, $template, $db, $user; global $phpbb_root_path, $phpEx; - // Init new auth class if user is different - if ($user->data['user_id'] != $userdata['user_id']) - { - $auth2 = new auth(); - $auth2->acl($userdata); - - $post_count_ary = $auth2->acl_getf('!f_postcount'); - } - else - { - $post_count_ary = $auth->acl_getf('!f_postcount'); - } - - $forum_read_ary = $auth->acl_getf('!f_read'); - $forum_ary = array(); // Do not include those forums the user is not having read access to... + $forum_read_ary = $auth->acl_getf('!f_read'); + foreach ($forum_read_ary as $forum_id => $not_allowed) { if ($not_allowed['f_read']) @@ -1044,40 +1031,27 @@ function display_user_activity(&$userdata) } } - // Now do not include those forums where the posts do not count... - foreach ($post_count_ary as $forum_id => $not_counted) - { - if ($not_counted['f_postcount']) - { - $forum_ary[] = (int) $forum_id; - } - } - $forum_ary = array_unique($forum_ary); - $post_count_sql = (sizeof($forum_ary)) ? 'AND ' . $db->sql_in_set('f.forum_id', $forum_ary, true) : ''; + $forum_sql = (sizeof($forum_ary)) ? 'AND ' . $db->sql_in_set('forum_id', $forum_ary, true) : ''; + + // Obtain active forum + $sql = 'SELECT forum_id, COUNT(post_id) AS num_posts + FROM ' . POSTS_TABLE . ' + WHERE poster_id = ' . $userdata['user_id'] . " + AND post_postcount = 1 + $forum_sql + GROUP BY forum_id"; // Firebird does not support ORDER BY on aliased columns // MySQL does not support ORDER BY on functions switch (SQL_LAYER) { case 'firebird': - $sql = 'SELECT f.forum_id, COUNT(p.post_id) AS num_posts - FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f - WHERE p.poster_id = ' . $userdata['user_id'] . " - AND f.forum_id = p.forum_id - $post_count_sql - GROUP BY f.forum_id - ORDER BY COUNT(p.post_id) DESC"; + $sql .= ' ORDER BY COUNT(post_id) DESC'; break; default: - $sql = 'SELECT f.forum_id, COUNT(p.post_id) AS num_posts - FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f - WHERE p.poster_id = ' . $userdata['user_id'] . " - AND f.forum_id = p.forum_id - $post_count_sql - GROUP BY f.forum_id - ORDER BY num_posts DESC"; + $sql .= ' ORDER BY num_posts DESC'; break; } @@ -1095,30 +1069,24 @@ function display_user_activity(&$userdata) $db->sql_freeresult($result); } + // Obtain active topic + $sql = 'SELECT topic_id, COUNT(post_id) AS num_posts + FROM ' . POSTS_TABLE . ' + WHERE poster_id = ' . $userdata['user_id'] . " + AND post_postcount = 1 + $forum_sql + GROUP BY topic_id"; + // Firebird does not support ORDER BY on aliased columns // MySQL does not support ORDER BY on functions switch (SQL_LAYER) { case 'firebird': - $sql = 'SELECT t.topic_id, COUNT(p.post_id) AS num_posts - FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f - WHERE p.poster_id = ' . $userdata['user_id'] . " - AND t.topic_id = p.topic_id - AND f.forum_id = t.forum_id - $post_count_sql - GROUP BY t.topic_id - ORDER BY COUNT(p.post_id) DESC"; + $sql .= ' ORDER BY COUNT(post_id) DESC'; break; default: - $sql = 'SELECT t.topic_id, COUNT(p.post_id) AS num_posts - FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f - WHERE p.poster_id = ' . $userdata['user_id'] . " - AND t.topic_id = p.topic_id - AND f.forum_id = t.forum_id - $post_count_sql - GROUP BY t.topic_id - ORDER BY num_posts DESC"; + $sql .= ' ORDER BY num_posts DESC'; break; } -- cgit v1.2.1 From 734492958eaa2f193db304fd5d4cf050390eff1a Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 26 Sep 2006 19:59:41 +0000 Subject: These changes should let olympus scale a little bit better. i haven't adjusted the schemas but added the details to create_schema_files - david is able to build them then in line with his changes. :) git-svn-id: file:///svn/phpbb/trunk@6411 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 2c82fda5ed..fccefa0552 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1018,6 +1018,12 @@ function display_user_activity(&$userdata) global $auth, $template, $db, $user; global $phpbb_root_path, $phpEx; + // Do not display user activity for users having more than 5000 posts... + if ($userdata['user_posts'] > 5000) + { + return; + } + $forum_ary = array(); // Do not include those forums the user is not having read access to... @@ -1070,7 +1076,7 @@ function display_user_activity(&$userdata) } // Obtain active topic - $sql = 'SELECT topic_id, COUNT(post_id) AS num_posts + $sql = 'SELECT topic_id, COUNT(post_id) AS num_posts FROM ' . POSTS_TABLE . ' WHERE poster_id = ' . $userdata['user_id'] . " AND post_postcount = 1 @@ -1133,7 +1139,8 @@ function display_user_activity(&$userdata) 'ACTIVE_TOPIC_POSTS' => ($active_t_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_t_count), 'ACTIVE_TOPIC_PCT' => sprintf($user->lang['POST_PCT_ACTIVE'], $active_t_pct), 'U_ACTIVE_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $active_f_id), - 'U_ACTIVE_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $active_t_id)) + 'U_ACTIVE_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $active_t_id), + 'S_SHOW_ACTIVITY' => true) ); } -- cgit v1.2.1 From b08c54f35eb85d0ccd01c65e1d9460603fc1c076 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 30 Sep 2006 14:58:05 +0000 Subject: - fixing a bug i am unsure about when it occurs (but it occurs). The symptoms are broken template cache files if after removing unnecessary php opening/closing tags result in statements being syntactially incorrect. - added real syncing to forums acp (not only forum statistics rebuild) git-svn-id: file:///svn/phpbb/trunk@6419 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index fccefa0552..e241c1e83e 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -339,7 +339,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'FORUM_ID' => $row['forum_id'], 'FORUM_NAME' => $row['forum_name'], 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), - 'TOPICS' => $row['forum_topics'], + 'TOPICS' => ($auth->acl_get('m_approve', $forum_id)) ? $row['forum_topics_real'] : $row['forum_topics'], $l_post_click_count => $post_click_count, 'FORUM_FOLDER_IMG' => ($row['forum_image']) ? '' . $user->lang[$folder_alt] . '' : $user->img($folder_image, $folder_alt), 'FORUM_FOLDER_IMG_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : $user->img($folder_image, $folder_alt, false, '', 'src'), -- cgit v1.2.1 From bc15445b58403c92ebca9e23ef3d9a59fbdccc92 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 1 Oct 2006 08:48:32 +0000 Subject: - forgot to make the same change to the ODBC driver - MySQL 3.x works now - FirebirdSQL is now on the same level as MySQL and PostgreSQL, zero hacks exist inside the core code now git-svn-id: file:///svn/phpbb/trunk@6422 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index e241c1e83e..825b92cae1 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1046,21 +1046,8 @@ function display_user_activity(&$userdata) WHERE poster_id = ' . $userdata['user_id'] . " AND post_postcount = 1 $forum_sql - GROUP BY forum_id"; - - // Firebird does not support ORDER BY on aliased columns - // MySQL does not support ORDER BY on functions - switch (SQL_LAYER) - { - case 'firebird': - $sql .= ' ORDER BY COUNT(post_id) DESC'; - break; - - default: - $sql .= ' ORDER BY num_posts DESC'; - break; - } - + GROUP BY forum_id + ORDER BY num_posts DESC"; $result = $db->sql_query_limit($sql, 1); $active_f_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -1081,21 +1068,8 @@ function display_user_activity(&$userdata) WHERE poster_id = ' . $userdata['user_id'] . " AND post_postcount = 1 $forum_sql - GROUP BY topic_id"; - - // Firebird does not support ORDER BY on aliased columns - // MySQL does not support ORDER BY on functions - switch (SQL_LAYER) - { - case 'firebird': - $sql .= ' ORDER BY COUNT(post_id) DESC'; - break; - - default: - $sql .= ' ORDER BY num_posts DESC'; - break; - } - + GROUP BY topic_id + ORDER BY num_posts DESC"; $result = $db->sql_query_limit($sql, 1); $active_t_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); -- cgit v1.2.1 From 71c30b8157a41d64f60754fcb11922b53ee82235 Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 3 Oct 2006 03:59:16 +0000 Subject: #4226 git-svn-id: file:///svn/phpbb/trunk@6434 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 825b92cae1..6b8b40049f 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -971,7 +971,7 @@ function display_custom_bbcodes() 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'", 'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2), 'BBCODE_TAG' => $row['bbcode_tag'], - 'BBCODE_HELPLINE' => $row['bbcode_helpline']) + 'BBCODE_HELPLINE' => str_replace(array('&', '"', ''', '<', '>'), array('\&', '\"', '\\\'', '<', '>'), $row['bbcode_helpline'])) ); $i++; -- cgit v1.2.1 From 26aba1a1f170ac51a56fe86bbc19588e0efee3c3 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 4 Oct 2006 15:15:40 +0000 Subject: - finally removed sql_numrows - sql_fetchfield now in dbal.php - check query id correctly as well as other tiny fixes git-svn-id: file:///svn/phpbb/trunk@6439 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 6b8b40049f..a1fdabd84f 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -339,7 +339,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'FORUM_ID' => $row['forum_id'], 'FORUM_NAME' => $row['forum_name'], 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), - 'TOPICS' => ($auth->acl_get('m_approve', $forum_id)) ? $row['forum_topics_real'] : $row['forum_topics'], + 'TOPICS' => $row['forum_topics'], $l_post_click_count => $post_click_count, 'FORUM_FOLDER_IMG' => ($row['forum_image']) ? '' . $user->lang[$folder_alt] . '' : $user->img($folder_image, $folder_alt), 'FORUM_FOLDER_IMG_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : $user->img($folder_image, $folder_alt, false, '', 'src'), -- cgit v1.2.1 From 0b2aaae28bb341a38864eda320e135826a0568e4 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 8 Oct 2006 19:04:49 +0000 Subject: - forum image being an additional image instead of replacing forum indicators - reasons fixes git-svn-id: file:///svn/phpbb/trunk@6470 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index a1fdabd84f..ec5c87394e 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -237,8 +237,10 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'FORUM_ID' => $row['forum_id'], 'FORUM_NAME' => $row['forum_name'], 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), - 'FORUM_FOLDER_IMG' => ($row['forum_image']) ? '' . $user->lang['FORUM_CAT'] . '' : '', - 'FORUM_FOLDER_IMG_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', + 'FORUM_FOLDER_IMG' => '', + 'FORUM_FOLDER_IMG_SRC' => '', + 'FORUM_IMAGE' => ($row['forum_image']) ? '' . $user->lang['FORUM_CAT'] . '' : '', + 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id'])) ); @@ -341,8 +343,10 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), 'TOPICS' => $row['forum_topics'], $l_post_click_count => $post_click_count, - 'FORUM_FOLDER_IMG' => ($row['forum_image']) ? '' . $user->lang[$folder_alt] . '' : $user->img($folder_image, $folder_alt), - 'FORUM_FOLDER_IMG_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : $user->img($folder_image, $folder_alt, false, '', 'src'), + 'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt), + 'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'), + 'FORUM_IMAGE' => ($row['forum_image']) ? '' . $user->lang[$folder_alt] . '' : '', + 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', 'SUBFORUMS' => $subforums_list, 'LAST_POST_SUBJECT' => $last_post_subject, 'LAST_POST_TIME' => $last_post_time, -- cgit v1.2.1 From b6546a148792649d88b0e99d1b3422709559bb15 Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Thu, 12 Oct 2006 20:05:50 +0000 Subject: Censor last post topic [#4714] git-svn-id: file:///svn/phpbb/trunk@6490 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index ec5c87394e..a5579c40f5 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -348,7 +348,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'FORUM_IMAGE' => ($row['forum_image']) ? '' . $user->lang[$folder_alt] . '' : '', 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', 'SUBFORUMS' => $subforums_list, - 'LAST_POST_SUBJECT' => $last_post_subject, + 'LAST_POST_SUBJECT' => censor_text($last_post_subject), 'LAST_POST_TIME' => $last_post_time, 'LAST_POSTER' => $last_poster, 'LAST_POSTER_COLOUR' => $last_poster_colour, -- cgit v1.2.1 From fcd9b898f156b9b0269a2d2108b9d83660b791d0 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 19 Oct 2006 13:55:48 +0000 Subject: Revised attachment categories a bit Fixes for the following bugs: #4830 #4818 #4816 #4810 #4808 #4798 #4796 #4772 #4662 #4646 #4546 #4524 #4270 I hope not having introduced additional severe errors :) git-svn-id: file:///svn/phpbb/trunk@6511 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index a5579c40f5..dd9b1d7afa 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -837,6 +837,8 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ $download_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . $forum_id) : $filename; + $download_link_full = (!$force_physical && $attachment['attach_id']) ? generate_board_url() . append_sid("/download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . $forum_id) : generate_board_url() . $filename; + switch ($display_cat) { // Images @@ -865,53 +867,51 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ case ATTACHMENT_CATEGORY_WM: $l_downloaded_viewed = $user->lang['VIEWED']; - // The download link is slightly different, because somehow phpBB is not able to get the correct results if called - // within the wmp object (cookies are not present). - // $download_link = (!$force_physical && $attachment['attach_id']) ? generate_board_url() . append_sid("/download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . $forum_id, false, $user->session_id) : $filename; - // Giving the filename directly because within the wm object all variables are in local context making it impossible // to validate against a valid session (all params can differ) $download_link = $filename; $block_array += array( + 'U_FORUM' => generate_board_url(), 'S_WM_FILE' => true, ); - // Viewed/Heared File ... update the download count (download.php is not called here) + // Viewed/Heared File ... update the download count $update_count[] = $attachment['attach_id']; break; // Real Media Streams case ATTACHMENT_CATEGORY_RM: + case ATTACHMENT_CATEGORY_QUICKTIME: $l_downloaded_viewed = $user->lang['VIEWED']; $block_array += array( - 'S_RM_FILE' => true, - 'U_FORUM' => generate_board_url(), - 'ATTACH_ID' => $attachment['attach_id'], + 'S_RM_FILE' => ($display_cat == ATTACHMENT_CATEGORY_RM) ? true : false, + 'S_QUICKTIME_FILE' => ($display_cat == ATTACHMENT_CATEGORY_QUICKTIME) ? true : false, + 'U_FORUM' => generate_board_url(), + 'ATTACH_ID' => $attachment['attach_id'], ); - // Viewed/Heared File ... update the download count (download.php is not called here) + // Viewed/Heared File ... update the download count $update_count[] = $attachment['attach_id']; break; -/* // Macromedia Flash Files - case SWF_CAT: - list($width, $height) = swf_getdimension($filename); + // Macromedia Flash Files + case ATTACHMENT_CATEGORY_FLASH: + list($width, $height) = @getimagesize($filename); $l_downloaded_viewed = $user->lang['VIEWED']; - $download_link = $filename; $block_array += array( - 'S_SWF_FILE' => true, + 'S_FLASH_FILE' => true, 'WIDTH' => $width, 'HEIGHT' => $height, ); - // Viewed/Heared File ... update the download count (download.php is not called here) + // Viewed/Heared File ... update the download count $update_count[] = $attachment['attach_id']; break; -*/ + default: $l_downloaded_viewed = $user->lang['DOWNLOADED']; -- cgit v1.2.1 From d89f60f182afa07e28d4e58f59b90dd25555e3a6 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 12 Nov 2006 15:35:43 +0000 Subject: consistant obtain_* functions git-svn-id: file:///svn/phpbb/trunk@6572 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index dd9b1d7afa..086bd0532a 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -709,8 +709,7 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ if (empty($extensions) || !is_array($extensions)) { - $extensions = array(); - $cache->obtain_attach_extensions($extensions); + $extensions = $cache->obtain_attach_extensions(); } // Look for missing attachment informations... -- cgit v1.2.1 From d420932921bb9fecc9ea5aa66326a08364834a3c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 12 Nov 2006 19:24:30 +0000 Subject: let the user activity queries only update every 5 minutes git-svn-id: file:///svn/phpbb/trunk@6577 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 086bd0532a..cb8f963528 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1051,7 +1051,7 @@ function display_user_activity(&$userdata) $forum_sql GROUP BY forum_id ORDER BY num_posts DESC"; - $result = $db->sql_query_limit($sql, 1); + $result = $db->sql_query_limit($sql, 1, 0, 3600); $active_f_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -1073,7 +1073,7 @@ function display_user_activity(&$userdata) $forum_sql GROUP BY topic_id ORDER BY num_posts DESC"; - $result = $db->sql_query_limit($sql, 1); + $result = $db->sql_query_limit($sql, 1, 0, 3600); $active_t_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); -- cgit v1.2.1