diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2004-10-13 19:30:02 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2004-10-13 19:30:02 +0000 |
commit | c941f666cf5184b508589fc151772f42f1a2d4c5 (patch) | |
tree | 88d74b4c9ac57e16682b93878885d6f809fe55a5 /phpBB/includes/functions_display.php | |
parent | 4804c05bca3e49a62a3fb91a988364024e745a5c (diff) | |
download | forums-c941f666cf5184b508589fc151772f42f1a2d4c5.tar forums-c941f666cf5184b508589fc151772f42f1a2d4c5.tar.gz forums-c941f666cf5184b508589fc151772f42f1a2d4c5.tar.bz2 forums-c941f666cf5184b508589fc151772f42f1a2d4c5.tar.xz forums-c941f666cf5184b508589fc151772f42f1a2d4c5.zip |
- ucp register/remind/activate fixes mostly regarding account activation
- general ucp fixing (profile and ucp_main)
- created three new functions (return correct topic author string, generate topic related pagination and get topic type/status...). These general bits are used on several pages (subscribed topics, bookmarks, viewforum).
- config basic schema fix
- commented out inline fix for unread topic tracking in viewforum, instead tried another method (hopefully working as well)
git-svn-id: file:///svn/phpbb/trunk@5001 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_display.php')
-rw-r--r-- | phpBB/includes/functions_display.php | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 3e6a511c62..a37b9c77be 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -340,6 +340,143 @@ function display_forums($root_data = '', $display_moderators = TRUE) return $active_forum_ary; } +function topic_topic_author(&$topic_row) +{ + global $phpEx, $SID, $phpbb_root_path, $user; + + $topic_author = ($topic_row['topic_poster'] != ANONYMOUS) ? "<a href=\"{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $topic_row['topic_poster'] . '">' : ''; + $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) ? '</a>' : ''; + + return $topic_author; +} + +function topic_generate_pagination($replies, $url) +{ + global $config, $user; + + if (($replies + 1) > $config['posts_per_page']) + { + $total_pages = ceil(($replies + 1) / $config['posts_per_page']); + $pagination = ''; + + $times = 1; + for ($j = 0; $j < $replies + 1; $j += $config['posts_per_page']) + { + $pagination .= "<a href=\"$url&start=$j\">$times</a>"; + if ($times == 1 && $total_pages > 4) + { + $pagination .= ' ... '; + $times = $total_pages - 3; + $j += ($total_pages - 4) * $config['posts_per_page']; + } + else if ($times < $total_pages) + { + $pagination .= $user->theme['primary']['pagination_sep']; + } + $times++; + } + } + else + { + $pagination = ''; + } + + return $pagination; +} + +function topic_status(&$topic_row, $replies, $mark_time_topic, $mark_time_forum, &$folder_img, &$folder_alt, &$topic_type) +{ + global $user, $config; + + $folder = $folder_new = ''; + $unread_topic = false; + + if ($topic_row['topic_status'] == ITEM_MOVED) + { + $topic_type = $user->lang['VIEW_TOPIC_MOVED']; + $folder_img = 'folder_moved'; + $folder_alt = 'VIEW_TOPIC_MOVED'; + } + else + { + switch ($topic_row['topic_type']) + { + case POST_GLOBAL: + case POST_ANNOUNCE: + $topic_type = $user->lang['VIEW_TOPIC_ANNOUNCEMENT']; + $folder = 'folder_announce'; + $folder_new = 'folder_announce_new'; + break; + + case POST_STICKY: + $topic_type = $user->lang['VIEW_TOPIC_STICKY']; + $folder = 'folder_sticky'; + $folder_new = 'folder_sticky_new'; + break; + + default: + if ($replies >= $config['hot_threshold']) + { + $folder = 'folder_hot'; + $folder_new = 'folder_hot_new'; + } + else + { + $folder = 'folder'; + $folder_new = 'folder_new'; + } + break; + } + + if ($topic_row['topic_status'] == ITEM_LOCKED) + { + $topic_type = $user->lang['VIEW_TOPIC_LOCKED']; + $folder = 'folder_locked'; + $folder_new = 'folder_locked_new'; + } + + if ($user->data['user_id'] != ANONYMOUS) + { + $unread_topic = $new_votes = true; + + if ($mark_time_topic >= $topic_row['topic_last_post_time'] || $mark_time_forum >= $topic_row['topic_last_post_time']) //|| ($topic_row['topic_last_post_time'] == $topic_row['poll_last_vote'] && $replies)) + { + $unread_topic = false; + } +/* + if ($topic_row['poll_start'] && ($mark_time_topic >= $topic_row['poll_last_vote'] || $mark_time_forum >= $topic_row['poll_last_vote'])) + { + $new_votes = false; + } +*/ + } + else + { + $unread_topic = false; + //$unread_topic = $new_votes = false; + } + +// $folder_new .= ($new_votes) ? '_vote' : ''; + + $folder_img = ($unread_topic) ? $folder_new : $folder; + $folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($topic_row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS'); + + // Posted image? + if (!empty($topic_row['mark_type'])) + { + $folder_img .= '_posted'; + } + } + + if ($topic_row['poll_start']) + { + $topic_type .= $user->lang['VIEW_TOPIC_POLL']; + } + + return $unread_topic; +} + // Display Attachments function display_attachments($forum_id, $blockname, &$attachment_data, &$update_count, $force_physical = false, $return = false) { |