Hallo,
gefunden werden soll dieser Part:
Code: Alles auswählen
$template->assign_vars(array(
'L_TOTAL_VOTES' => $lang['Total_votes'],
'TOTAL_VOTES' => $vote_results_sum)
);
Ich habe nur diesen Part in meiner viewtopic.php Datei:
Code: Alles auswählen
$voted_vote_nb = $voted_vote;
$template->assign_vars(array(
'VOTED_SHOW' => $lang['Voted_show'],
'L_TOTAL_VOTES' => $total_votes_1,
'L_RESULTS_AFTER' => $poll_expires_c,
'L_POLL_EXPIRES' => $poll_expires_d,
'POLL_EXPIRES' => ($poll_expire_6.$poll_expire_7.$poll_expire_8),
'TOTAL_VOTES' => $total_votes_2)
);
Muss dazu schreiben, dass ich Multivote und Color Poll Vote installiert habe. Und ich glaube nicht,
dass es so gut ist, meinen Code einfach so zu ersetzen, oder?
Gruß Stöbi
EDIT:
Ich habe das jetzt so gemacht, bitte um Bestätigung:
Diese Codeteil von Modbo:
Code: Alles auswählen
$sql = "SELECT topic_id, vote_start FROM " . VOTE_DESC_TABLE . " WHERE topic_id = $topic_id";
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, "Could not read poll data!", '', __LINE__, __FILE__, $sql);
if ( $row = $db->sql_fetchrow($result) ) $vote_started = intval($row['vote_start']);
$poll_option_close = (($forum_topic_data['topic_poster'] == $userdata['user_id'] || $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD) && !$poll_expired && $user_voted) ? '<input type="submit" name="poll_close" value="' . $lang['poll_close'] . '" class="liteoption">' : '';
$poll_option_delete = ($forum_topic_data['topic_poster'] == $userdata['user_id'] || $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD) ? '<input type="submit" name="poll_delete" value="'.$lang['Delete_poll'].'" class="liteoption"/><input type="hidden" name="mode" value="editpost">' : '';
if ($poll_option_close != '' || $poll_option_delete != '')
{
$first_post_id = $forum_topic_data['topic_first_post_id'];
$template->assign_block_vars('close_delete_poll', array(
'U_CLOSE_POLL' => append_sid("viewtopic.$phpEx?t=$topic_id"),
'U_DELETE_POLL' => append_sid("posting.$phpEx?p=$first_post_id"),
));
}
$poll_close_order = (isset ($_POST['poll_close']) ? 1 : 0);
if ($poll_close_order == 1)
{
$vote_length = time() - $vote_started;
$sql = "UPDATE " . VOTE_DESC_TABLE . "
SET vote_length = $vote_length
WHERE topic_id = $topic_id";
if ( !$db->sql_query($sql) ) message_die(GENERAL_ERROR, 'Could not update poll data!', '', __LINE__, __FILE__, $sql);
$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">')
);
$message = $lang['Poll_is_closed'] . '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
Habe ich vor diesem hier gesetzt:
Code: Alles auswählen
$voted_vote_nb = $voted_vote;
$template->assign_vars(array(
'VOTED_SHOW' => $lang['Voted_show'],
'L_TOTAL_VOTES' => $total_votes_1,
'L_RESULTS_AFTER' => $poll_expires_c,
'L_POLL_EXPIRES' => $poll_expires_d,
'POLL_EXPIRES' => ($poll_expire_6.$poll_expire_7.$poll_expire_8),
'TOTAL_VOTES' => $total_votes_2)
);
Gruß Stöbi
Edit2:
Gequarke ~gelöscht~
Entschuldigt, ich bin ein wenig erkältet, mein Sohn hat mich angesteckt. Ging mal wieder reihum.
Erst mein Sohn, dann meine Frau, dann doch auch mal ich ;-)
Ich hab nur noch eine Änderung vergessen gehabt. Tut mir leid.
Und zwar vergass ich, noch diesen beiden Zeilen einzubinden.
POLL_OPTION_CLOSE' => $poll_option_close,
'POLL_OPTION_DELETE' => $poll_option_delete,
Es sieht jetzt so aus:
Code: Alles auswählen
$voted_vote_nb = $voted_vote;
$template->assign_vars(array(
'VOTED_SHOW' => $lang['Voted_show'],
'L_TOTAL_VOTES' => $total_votes_1,
'L_RESULTS_AFTER' => $poll_expires_c,
'L_POLL_EXPIRES' => $poll_expires_d,
'POLL_EXPIRES' => ($poll_expire_6.$poll_expire_7.$poll_expire_8),
'POLL_OPTION_CLOSE' => $poll_option_close,
'POLL_OPTION_DELETE' => $poll_option_delete,
'TOTAL_VOTES' => $total_votes_2)
);
Insgesamt dann so, ist das so richtig?
Code: Alles auswählen
$sql = "SELECT topic_id, vote_start FROM " . VOTE_DESC_TABLE . " WHERE topic_id = $topic_id";
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, "Could not read poll data!", '', __LINE__, __FILE__, $sql);
if ( $row = $db->sql_fetchrow($result) ) $vote_started = intval($row['vote_start']);
$poll_option_close = (($forum_topic_data['topic_poster'] == $userdata['user_id'] || $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD) && !$poll_expired && $user_voted) ? '<input type="submit" name="poll_close" value="' . $lang['poll_close'] . '" class="liteoption">' : '';
$poll_option_delete = ($forum_topic_data['topic_poster'] == $userdata['user_id'] || $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD) ? '<input type="submit" name="poll_delete" value="'.$lang['Delete_poll'].'" class="liteoption"/><input type="hidden" name="mode" value="editpost">' : '';
if ($poll_option_close != '' || $poll_option_delete != '')
{
$first_post_id = $forum_topic_data['topic_first_post_id'];
$template->assign_block_vars('close_delete_poll', array(
'U_CLOSE_POLL' => append_sid("viewtopic.$phpEx?t=$topic_id"),
'U_DELETE_POLL' => append_sid("posting.$phpEx?p=$first_post_id"),
));
}
$poll_close_order = (isset ($_POST['poll_close']) ? 1 : 0);
if ($poll_close_order == 1)
{
$vote_length = time() - $vote_started;
$sql = "UPDATE " . VOTE_DESC_TABLE . "
SET vote_length = $vote_length
WHERE topic_id = $topic_id";
if ( !$db->sql_query($sql) ) message_die(GENERAL_ERROR, 'Could not update poll data!', '', __LINE__, __FILE__, $sql);
$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">')
);
$message = $lang['Poll_is_closed'] . '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
$voted_vote_nb = $voted_vote;
$template->assign_vars(array(
'VOTED_SHOW' => $lang['Voted_show'],
'L_TOTAL_VOTES' => $total_votes_1,
'L_RESULTS_AFTER' => $poll_expires_c,
'L_POLL_EXPIRES' => $poll_expires_d,
'POLL_EXPIRES' => ($poll_expire_6.$poll_expire_7.$poll_expire_8),
'POLL_OPTION_CLOSE' => $poll_option_close,
'POLL_OPTION_DELETE' => $poll_option_delete,
'TOTAL_VOTES' => $total_votes_2)
);
Gruß Stöbi