[ABD] Show poll voters for phpBB3

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [BETA] Show poll voters for phpBB3

Post by IPB_Refugee » Thu Mar 11, 2010 8:24 am

This was a bug in 3.0.5 and has nothing to do with this MOD.

Solution : Upgrade to 3.0.7-PL1.

Regards
Wolfgang

Nusha
Registered User
Posts: 2
Joined: Wed Dec 30, 2009 1:45 am

Re: [BETA] Show poll voters for phpBB3

Post by Nusha » Sat May 29, 2010 8:56 pm

I've tried different people's fixes and codes throughout the 9 pages of this tread and nothing's working at all. I'm using a prosilver based style, I believe. I would like the mod to show me a dropdown menu of who has voted for what, but it's not working at all. Help?

User avatar
Volksdevil
Registered User
Posts: 2414
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil
Contact:

Re: [BETA] Show poll voters for phpBB3

Post by Volksdevil » Tue Oct 19, 2010 3:20 pm

Hi, Could we specify this to only work in certain forums? And could we change the text "Poll" to something else within those specified forums such as "event" ?
My phpBB Extensions
Finally found great Website Hosting from Image KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Mixer | My Volkswagen Corrado G60

Luba
Registered User
Posts: 1
Joined: Wed Dec 15, 2010 6:15 pm

Re: [BETA] Show poll voters for phpBB3

Post by Luba » Wed Dec 15, 2010 9:57 pm

Hi,
I had set up my phpbb 3.0.8 Board and wanted exactly these additional informations for my polls. The code didn't fit anymore on the current version of code and this mod which was developed basing on this code also isn't available, so I changed a few lines to get it running again. Her is the code for poll voters under the percentage bar with prosilver template. There's a problem with the layout, the voters are only under the percentage bar, when the radio button for changing the choice is also displayed, otherwise the voters are in the <div> or <dd> floating left, I will have a look the next days, but it's working.
Greetings, Luba

################ viewtopic.php
//SEARCH FOR

Code: Select all

foreach ($poll_info as $poll_option)
{
	$option_pct = ($poll_total > 0) ? $poll_option['poll_option_total'] / $poll_total : 0;
	$option_pct_txt = sprintf("%.1d%%", round($option_pct * 100));

//ADD AFTER

Code: Select all

/* ###############Begin 'Show voters' MOD by Ernst Vaarties */
/* ###############Begin 'Show voters' MOD by Ernst Vaarties */
$sql_voters = 
'SELECT username
FROM ' . POLL_VOTES_TABLE . ', ' . USERS_TABLE . '
WHERE topic_id = ' . $topic_id . '
AND poll_option_id = ' . $poll_option['poll_option_id'] . '
AND ' . POLL_VOTES_TABLE . '.vote_user_id = ' . USERS_TABLE . '.user_id
ORDER BY username ASC';

$results_voters = $db->sql_query($sql_voters);
$voters_total = 0;
$voters_string = "";

// Add all voters to a string.
while ($row_voters = $db->sql_fetchrow($results_voters)) 
{
	$voters_total = $voters_total + 1;
	$voters_string = $voters_string . ", " . $row_voters['username'];
}

// Is the total nr of voters <> the nr of votes for the poll? Add this to the same string.
if ($voters_total <> $poll_option['poll_option_total'])
{
	$voters_string = $voters_string . ", <> " . ($poll_option['poll_option_total'] - $voters_total);
}

$voters_string = ltrim($voters_string, ", ");

// Add the string to the list.
$poll_option['poll_option_voters'] = $voters_string;
$db->sql_freeresult($results_voters);
/* ####################End 'Show voters' MOD by Ernst Vaarties */ 
/* ####################End 'Show voters' MOD by Ernst Vaarties */ 

//SEARCH FOR

Code: Select all

'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false)

//ADD BEFORE

Code: Select all

'POLL_OPTION_VOTERS' 	=> $poll_option['poll_option_voters']),


//################ styles/prosilver/template/viewtopic_body.php

//SEARCH FOR

Code: Select all

<dd><!-- IF poll_option.POLL_OPTION_RESULT == 0 -->{L_NO_VOTES}<!-- ELSE -->{poll_option.POLL_OPTION_PERCENT}<!-- ENDIF --></dd>


//REPLACE WITH (There's still a problem with the layout: not correct, when there's no radiobutton for alternating the choice..)

Code: Select all

<dd><!-- IF poll_option.POLL_OPTION_RESULT == 0 -->{L_NO_VOTES}<!-- ELSE -->{poll_option.POLL_OPTION_PERCENT}</dd><dd class="resultbar">{poll_option.POLL_OPTION_VOTERS}</dd>

Locked

Return to “[3.0.x] Abandoned MODs”