News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

View Voters at Polls

Started by Nibogo, May 02, 2011, 12:54:31 PM

Previous topic - Next topic

eric1234

I notice that normal user also able to view that who vote for who. >.<

May i know how to set it that it is only the Admin and selected membergroup that can view? :)


Ray Cardillo

Quote from: Shorti25 on July 31, 2011, 06:52:15 AM
Quote from: Shorti25 on July 14, 2011, 03:15:16 AM
Quote from: Shorti25 on June 30, 2011, 12:40:12 AM
it would be great to make the voters shown only to admins
is it possible ?
maybe there will be only something included like "allowed if admin"
but where and what´s the right code for it

help please
bump

In support of CNY Roller Derby, I was asked if similar capabilities are possible with SMF, so I asked other mod writers for similar features, but was denied by all of them.  So I had to spend the time to derive requirements from their needs and create a new modification.  Since I had to spend the time, I also spent the time to contribute back to the community and release it as an official modification.

I don't want to list all of the features here, but it can do what you asked about by configuring a poll to be PRIVATE instead of DISCRETE or PUBLIC and it can do lots of other stuff that others have asked about.  So we think it's awesome, but I am also willing to consider implementing other features in the future, as time permits.

The modification is known as Voter Visibility and it was recently approved for release so we are hoping that others start using it and help spread the word!  :)

Author of the Voter Visibility mod customization.  Adds the ability to see (and control who sees) who voted for what.  Allows you to conduct secret ballots.  Can also be used to coordinate volunteer signups, and more.

usrfsledge

Any updates for v2.0.7 coming up, or is this mod dead?


usrfsledge

Thanks, I'm gonna try that


Blade73

well im still using this mod but there is one thing that i would like to get some help with
Thats is the names that is showned is the reg. username in our forums all has been given a displayname , so where is it possible to change that?

Thx in advance for any asistance.

Nibogo

Quote from: Blade73 on September 08, 2018, 01:05:43 PM
well im still using this mod but there is one thing that i would like to get some help with
Thats is the names that is showned is the reg. username in our forums all has been given a displayname , so where is it possible to change that?

Thx in advance for any asistance.

Unfortunately that can only be changed code wise :(

Combert

Hi

I am not a coder, but I changed these two operations in the install.xml file to make it 2.0.15 compatible and make it show real names instead of user name.

Maybe someone with better smf coding knwoledge can check if what I did was OK.


        <operation>
            <search position="replace"><![CDATA[$context['allow_poll_view'] = allowedTo('moderate_board') || $pollinfo['hide_results'] == 0 || ($pollinfo['hide_results'] == 1 && $context['poll']['has_voted']) || $context['poll']['is_expired'];
$context['poll']['show_results'] = $context['allow_poll_view'] && (isset($_REQUEST['viewresults']) || isset($_REQUEST['viewResults']));
$context['show_view_results_button'] = $context['allow_vote'] && $context['allow_poll_view'] && !$context['poll']['show_results'];]]></search>
            <add><![CDATA[$context['allow_poll_view'] = allowedTo('moderate_board') || $pollinfo['hide_results'] == 0 || ($pollinfo['hide_results'] == 1 && $context['poll']['has_voted']) || $context['poll']['is_expired'];
            $context['poll']['view_voters'] = $context['allow_poll_view'] && isset($_REQUEST['viewvoters']) && $pollinfo['show_voters'] == 1;
            $context['poll']['show_results'] = !$context['poll']['view_voters'] && $context['allow_poll_view'] && (isset($_REQUEST['viewresults']) || isset($_REQUEST['viewResults']));
            $context['show_view_results_button'] = $context['poll']['view_voters'] || ($context['allow_vote'] && $context['allow_poll_view'] && !$context['poll']['show_results']);
            $context['show_view_voters_button'] = $context['poll']['show_voters'] && !$context['poll']['view_voters'];]]></add>
        </operation>
        <operation>
            <search position="replace"><![CDATA[// Now look through each option, and...]]></search>
            <add><![CDATA[// View Voters!
            if ($context['poll']['view_voters'])
            {
                $request = $smcFunc['db_query']('', '
                    SELECT lp.id_member, mem.real_name, lp.id_choice
                    FROM {db_prefix}log_polls AS lp
                        LEFT JOIN {db_prefix}members AS mem ON (lp.id_member = mem.id_member)
                    WHERE lp.id_poll = {int:id_poll}',
                    array(
                        'id_poll' => $context['poll']['id'],
                    )
                );
           
                while ($row = $smcFunc['db_fetch_assoc']($request))
                {
                    $pollOptions[$row['id_choice']]['voters'][$row['id_member']] = $row['real_name'];
                }
                $smcFunc['db_free_result']($request);
            }

            // Now look through each option, and...]]></add>
        </operation>

Advertisement: