Seite 1 von 1

Problem mit dem Mod "Who voted" - Nach löschen von

Verfasst: 11.10.2002 01:10
von Narcotica
Hi,
ich habe in mein Forum den "Who voted" Mod eingebaut der unter der Umfrage anzeigt wer alles gevotet hat!Mein Problem ist wenn ich eine Umfrage mit 3 Antwortmöglichkeiten erstelle un es haben z.b. für Antwort 1. 6 User abgestimmt für Antwort 2. 1 User und für Antwort 3. 0 User gevotet und ich editiere jetzt den beitrag und lösche die nicht mehr benötigte Antwort 1. dann werden die 6 User die für diese Antwort gevotet haben trotzdem noch unten angezeigt :o Kann man das irgendwie beheben?Also das die "Mitgelöscht" werden?

Gruß Narcotica

BTW: Hier mal der Mod falls nicht bekannt:

Code: Alles auswählen

############################################################## 
## MOD Title: Who Voted? 
## MOD Version: 0.0.1 
## Author: Verteron < verteron@verteron.net > http://verteron.net/efcl/ 
## Description: Show the usernames of registered users who have voted in a poll 
## 
## Installation Level: easy 
## Installation Time: 5 Minutes 
## Files To Edit: viewtopic.php, 
##      language/lang_english/lang_main.php, 
##      templates/subSilver/viewtopic_poll_result.tpl 
## 
## Included Files: n/a 
############################################################## 
## This MOD is released under the GPL License. 
## Intellectual Property is retained by the MOD Author(s) listed above 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/ 
############################################################## 
## Authors Notes: Default installation for subSilver and lang_english. Adjust 
## To your own themes and languages accordingly. Requires no extra database 
## queries. 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ OPEN ]------------------------------------------ 
# 

viewtopic.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

      $sql = "SELECT vote_id 
         FROM " . VOTE_USERS_TABLE . " 
         WHERE vote_id = $vote_id 
            AND vote_user_id = " . $userdata['user_id']; 
      if ( !($result = $db->sql_query($sql)) ) 
      { 
         message_die(GENERAL_ERROR, "Could not obtain user vote data for this topic", '', __LINE__, __FILE__, $sql); 
      } 

      $user_voted = ( $row = $db->sql_fetchrow($result) ) ? TRUE : 0; 
      $db->sql_freeresult($result); 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

      $sql = "SELECT username, user_id FROM " . VOTE_USERS_TABLE . ", " . USERS_TABLE . " WHERE vote_id = $vote_id AND vote_user_id = user_id GROUP BY username ORDER BY username"; 
      if ( !($result = $db->sql_query($sql)) ) 
      { 
         message_die(GENERAL_ERROR, "Could not obtain user vote data for this topic", '', __LINE__, __FILE__, $sql); 
      } 

      $user_voted = false; 
      $who_voted = ''; 
      $first_row = true; 

      while( $row = $db->sql_fetchrow($result) ) 
      { 
         $who_voted .= ($first_row ? '' : ', ') . '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '">' . $row['username'] . '</a>'; 
         if ( $row['user_id'] == $userdata['user_id'] ) 
         { 
            $user_voted = true; 
         } 
         $first_row = false; 
      } 

      $db->sql_freeresult($result); 

# 
#-----[ FIND ]------------------------------------------ 
# 

         $template->assign_vars(array( 
            'L_TOTAL_VOTES' => $lang['Total_votes'], 
            'TOTAL_VOTES' => $vote_results_sum) 
         ); 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

         $template->assign_vars(array( 
            'L_TOTAL_VOTES' => $lang['Total_votes'], 
            'TOTAL_VOTES' => $vote_results_sum, 
            'L_WHO_VOTED' => $lang['Who_Voted'], 
            'WHO_VOTED' => $who_voted) 
         ); 


# 
#-----[ OPEN ]------------------------------------------ 
# 

language/lang_english/lang_main.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

$lang['Total_votes'] = 'Total Votes'; 

# 
#-----[ ADD, AFTER ]------------------------------------------ 
# 

$lang['Who_Voted'] = 'Who Voted'; 

# 
#-----[ OPEN ]------------------------------------------ 
# 

templates/subSilver/viewtopic_poll_result.tpl 

# 
#-----[ FIND ]------------------------------------------ 
# 

     <tr> 
      <td colspan="4" align="center"><span class="gen"><b>{L_TOTAL_VOTES} : {TOTAL_VOTES}</b></span></td> 
     </tr> 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

   <tr> 
      <td colspan="4" align="center"><span class="gensmall"><b>{L_WHO_VOTED}</b> : {WHO_VOTED}</span></td> 
   </tr> 

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 

Verfasst: 16.03.2003 23:06
von SQRT
kann man das irgendwie so einstellen, dass nach einer bestimmten anzahl von abgegebenen stimmen die Namen angezeigt werden? oder zumindest nur die Leute die Usernamen sehen können, die auch gevotet haben? :roll:


thx in advance

SQRT