From 49d56f90e5cd5b21192949bd34dd0b2f10aa2921 Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Sun, 20 Aug 2006 17:47:47 +0000 Subject: [PATCH] Poll ended at.... git-svn-id: file:///svn/phpbb/trunk@6307 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/viewtopic.php | 1 + phpBB/viewtopic.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/phpBB/language/en/viewtopic.php b/phpBB/language/en/viewtopic.php index 0c50afb689..c82ea44678 100644 --- a/phpBB/language/en/viewtopic.php +++ b/phpBB/language/en/viewtopic.php @@ -71,6 +71,7 @@ $lang = array_merge($lang, array( 'NO_UNREAD_POSTS' => 'There are no new unread posts for this topic.', 'NO_VOTE_OPTION' => 'You must specify an option when voting.', + 'POLL_ENDED_AT' => 'Poll ended at %s', 'POLL_RUN_TILL' => 'Poll runs till %s', 'POLL_VOTED_OPTION' => 'You voted for this option', 'POST_ENCODING' => 'This post by %1$s was made in a character set different to yours. %2$sView this post in its proper encoding%3$s.', diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index e296f80438..9a8b893e59 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -755,6 +755,8 @@ if (!empty($topic_data['poll_start'])) ); } + $poll_end = $topic_data['poll_length'] + $topic_data['poll_start']; + $template->assign_vars(array( 'POLL_QUESTION' => $topic_data['poll_title'], 'TOTAL_VOTES' => $poll_total, @@ -762,7 +764,7 @@ if (!empty($topic_data['poll_start'])) 'POLL_RIGHT_CAP_IMG'=> $user->img('poll_right'), 'L_MAX_VOTES' => ($topic_data['poll_max_options'] == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $topic_data['poll_max_options']), - 'L_POLL_LENGTH' => ($topic_data['poll_length']) ? sprintf($user->lang['POLL_RUN_TILL'], $user->format_date($topic_data['poll_length'] + $topic_data['poll_start'])) : '', + 'L_POLL_LENGTH' => ($topic_data['poll_length']) ? sprintf($user->lang[($poll_end > time()) ? 'POLL_RUN_TILL' : 'POLL_ENDED_AT'], $user->format_date($poll_end)) : '', 'S_HAS_POLL' => true, 'S_CAN_VOTE' => $s_can_vote, @@ -773,7 +775,7 @@ if (!empty($topic_data['poll_start'])) 'U_VIEW_RESULTS' => $viewtopic_url . '&view=viewpoll') ); - unset($poll_info, $voted_id); + unset($poll_end, $poll_info, $voted_id); } // If the user is trying to reach the second half of the topic, fetch it starting from the end