diff --git a/phpBB/posting.php b/phpBB/posting.php index c6d82a71f6..61dbc349c1 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -763,7 +763,8 @@ else $msg_date = create_date($board_config['default_dateformat'], $postrow['post_time'], $board_config['board_timezone']); - $message = '[quote="' . $post_info['username'] . '"]' . $message . '[/quote]'; + $quote_username = ( !empty($post_info['post_username']) ) ? $post_info['post_username'] : $post_info['username']; + $message = '[quote="' . $quote_username . '"]' . $message . '[/quote]'; if ( !empty($orig_word) ) { diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 3934984526..db1e751a3d 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -691,6 +691,9 @@ if ( !empty($forum_row['topic_vote']) ) if ( $vote_info = $db->sql_fetchrowset($result) ) { + $db->sql_freeresult($result); + $vote_options = count($vote_info); + $vote_id = $vote_info[0]['vote_id']; $vote_title = $vote_info[0]['vote_text']; @@ -703,7 +706,8 @@ if ( !empty($forum_row['topic_vote']) ) message_die(GENERAL_ERROR, "Could not obtain user vote data for this topic", '', __LINE__, __FILE__, $sql); } - $user_voted = ( $db->sql_numrows($result) ) ? TRUE : 0; + $user_voted = ( $row = $db->sql_fetchrow($result) ) ? TRUE : 0; + $db->sql_freeresult($result); if ( isset($HTTP_GET_VARS['vote']) || isset($HTTP_POST_VARS['vote']) ) { @@ -718,7 +722,6 @@ if ( !empty($forum_row['topic_vote']) ) if ( $user_voted || $view_result || $poll_expired || !$is_auth['auth_vote'] || $forum_row['topic_status'] == TOPIC_LOCKED ) { - $template->set_filenames(array( 'pollbox' => 'viewtopic_poll_result.tpl') ); @@ -826,7 +829,7 @@ if ( !$db->sql_query($sql) ) for($i = 0; $i < $total_posts; $i++) { $poster_id = $postrow[$i]['user_id']; - $poster = $postrow[$i]['username']; + $poster = ( $poster_id == ANONYMOUS ) ? $lang['Guest'] : $postrow[$i]['username']; $post_date = create_date($board_config['default_dateformat'], $postrow[$i]['post_time'], $board_config['board_timezone']);