mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Display poll results after voting even if you can change said vote
git-svn-id: file:///svn/phpbb/trunk@5078 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
c8b0cdc0e8
commit
3f88d08672
1 changed files with 14 additions and 9 deletions
|
@ -274,14 +274,16 @@ if ($forum_password)
|
||||||
// Redirect to login or to the correct post upon emailed notification links
|
// Redirect to login or to the correct post upon emailed notification links
|
||||||
if (isset($_GET['e']))
|
if (isset($_GET['e']))
|
||||||
{
|
{
|
||||||
$jump_to = (int) $_GET['e'];
|
$jump_to = request_var('e', 0);
|
||||||
|
|
||||||
$redirect_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id";
|
$redirect_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id";
|
||||||
|
|
||||||
if ($user->data['user_id'] == ANONYMOUS)
|
if ($user->data['user_id'] == ANONYMOUS)
|
||||||
{
|
{
|
||||||
login_box($redirect_url . "&p=$post_id&e=$jump_to", $user->lang['LOGIN_NOTIFY_TOPIC']);
|
login_box($redirect_url . "&p=$post_id&e=$jump_to", $user->lang['LOGIN_NOTIFY_TOPIC']);
|
||||||
}
|
}
|
||||||
else if ($jump_to > 0)
|
|
||||||
|
if ($jump_to > 0)
|
||||||
{
|
{
|
||||||
// We direct the already logged in user to the correct post...
|
// We direct the already logged in user to the correct post...
|
||||||
redirect($redirect_url . ((!$post_id) ? "&p=$jump_to" : "&p=$post_id") . "#$jump_to");
|
redirect($redirect_url . ((!$post_id) ? "&p=$jump_to" : "&p=$post_id") . "#$jump_to");
|
||||||
|
@ -390,6 +392,7 @@ if ($config['allow_bookmarks'] && $user->data['user_id'] != ANONYMOUS && request
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
meta_refresh(3, $viewtopic_url);
|
meta_refresh(3, $viewtopic_url);
|
||||||
|
|
||||||
$message = (($bookmarked) ? $user->lang['BOOKMARK_REMOVED'] : $user->lang['BOOKMARK_ADDED']) . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $viewtopic_url . '">', '</a>');
|
$message = (($bookmarked) ? $user->lang['BOOKMARK_REMOVED'] : $user->lang['BOOKMARK_ADDED']) . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $viewtopic_url . '">', '</a>');
|
||||||
trigger_error($message);
|
trigger_error($message);
|
||||||
}
|
}
|
||||||
|
@ -559,7 +562,9 @@ if (!empty($poll_start))
|
||||||
(($poll_length != 0 && $poll_start + $poll_length > time()) || $poll_length == 0) &&
|
(($poll_length != 0 && $poll_start + $poll_length > time()) || $poll_length == 0) &&
|
||||||
$topic_status != ITEM_LOCKED &&
|
$topic_status != ITEM_LOCKED &&
|
||||||
$forum_status != ITEM_LOCKED) ? true : false;
|
$forum_status != ITEM_LOCKED) ? true : false;
|
||||||
$s_display_results = (!$s_can_vote || ($s_can_vote && $voted_id) || $view == 'viewpoll') ? true : false;
|
$s_display_results = (!$s_can_vote || ($s_can_vote && sizeof($cur_voted_id)) || $view == 'viewpoll') ? true : false;
|
||||||
|
|
||||||
|
echo ">$s_can_vote :: >$s_display_results :: >$voted_id";
|
||||||
|
|
||||||
if ($update && $s_can_vote)
|
if ($update && $s_can_vote)
|
||||||
{
|
{
|
||||||
|
@ -619,10 +624,10 @@ if (!empty($poll_start))
|
||||||
$user->set_cookie('poll_' . $topic_id, implode(',', $voted_id), time() + 31536000);
|
$user->set_cookie('poll_' . $topic_id, implode(',', $voted_id), time() + 31536000);
|
||||||
}
|
}
|
||||||
|
|
||||||
//, topic_last_post_time = ' . time() . "
|
|
||||||
$sql = 'UPDATE ' . TOPICS_TABLE . '
|
$sql = 'UPDATE ' . TOPICS_TABLE . '
|
||||||
SET poll_last_vote = ' . time() . "
|
SET poll_last_vote = ' . time() . "
|
||||||
WHERE topic_id = $topic_id";
|
WHERE topic_id = $topic_id";
|
||||||
|
//, topic_last_post_time = ' . time() . " -- for bumping topics with new votes, ignore for now
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
meta_refresh(5, "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id");
|
meta_refresh(5, "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id");
|
||||||
|
|
Loading…
Add table
Reference in a new issue