Who Voted What?

Started by Søren Bjerg, August 30, 2006, 09:25:16 PM

Previous topic - Next topic

bassmadrigal

No the values are not stored twice, and I don't know where to look to see the the values are being read into the array twice.

I guess it is time to go back to the modification.xml and see if possibly any duplicates were put in. I did double check all my theme files and those are fine, so I am assuming it is in another one.

Surfy

#121
Very great Mod!!  :o

The only thing i`m missing - is the Useroption to make Polls
- normal (secret) Votes
- public Votes (Who voted what)

This would be great!

Surfy

Quote from: Surfy on May 16, 2007, 08:16:20 PM
Very great Mod!!  :o

The only thing i`m missing - is the Useroption to make Polls
- normal (secret) Votes
- public Votes (Who voted what)

This would be great!

I hope this addon is possible  ;)

Its a must have, that the Polls also could be anonymous  ;)

Hyronymus

Would it be possible to see the votes per membergroup? It can be interesting to compare how many people from Membergroup A and Membergroup Bvoted yes or no on a poll. Especially if one membergroup is more likely to be affected by the issue being polled.

Søren Bjerg

I'm pretty hung up with various other projects at the moment, so I won't be doing any further work on the modification any time soon.
RUNE HORDES dot INFO - SMF 1.1.10 w/ Custom Profile Mod... and various permissions hooks and template changes (new topic form).

Brad Jones

If anyone is having problems, after installing this mod, whereas their poll results no longer show up...

  • Go to:  Admin -> Features and Options -> Basic Features
  • Find the drop-down for "Who Voted What? mode".
  • Change it to "Table View".
  • Click "Save".
If you'd rather have the select box instead of the table view, perform the steps listed above, and then after you click "Save"...

  • Find the drop-down for "Who Voted What? mode".
  • Change it to "Table View".
  • Click "Save".

MinasC

i get an error when trying to install to smf 1.1.3 ! isn't it compatible ?

Søren Bjerg

Apparently it isn't. However, I won't be able to update it any time soon due to the lack of a local development environment.
RUNE HORDES dot INFO - SMF 1.1.10 w/ Custom Profile Mod... and various permissions hooks and template changes (new topic form).

barath56

cant it support 1.1.3

MinasC

Quote from: Søren Bjerg on June 29, 2007, 07:10:50 AM
Apparently it isn't. However, I won't be able to update it any time soon due to the lack of a local development environment.

too bad to hear , it's a really nice mod , used it before i upgrated !

RiderRaghav

When will you release a newer version for smf v1.1.3 ... ???
 
Thanks in advance ;)

Fustrate

I got it running easily in 1.1.3 ...

Just go into package-info.xml and put ,1.1.3 after 1.1.2 in the "install for" and "uninstall for" elements.

Then do the Display.template.php change by hand, it's only one thing.

Also remember to change to Table View as mentioned earlier.
Steven Hoffman
Former Team Member, 2009-2012

RiderRaghav

Quote from: YodaOfDarkness on June 30, 2007, 01:57:32 PM
I got it running easily in 1.1.3 ...

Just go into package-info.xml and put ,1.1.3 after 1.1.2 in the "install for" and "uninstall for" elements.

Then do the Display.template.php change by hand, it's only one thing.

Also remember to change to Table View as mentioned earlier.

Can you please explain it in detail ??? coz  I'm new to all this... sry


Fustrate

#133
Okay, download the 1_1_2 file to your desktop.

Using WinZip or another program, unzip the files to a folder. Go into that folder and right-click package-info.xml . Find the two places where it says
for="1.1.2" and replace them with for="1.1.2,1.1.3"

Using WinZip (or whatever you're using) again, select the package-info file and the modification file, and right-click them. Select "add to (name).zip"

You can then install this mod just like any other. Once it's installed, go to your Admin area and then to Features and Options (on the left). Near the top should be an option for "Who Voted What? mode" - change it to "Table View".

IF you're using a custom theme, open your Display.template.php under that theme's folder and find these lines:

<table border="0" cellpadding="0" cellspacing="0">';

// Show each option with its corresponding percentage bar.
foreach ($context['poll']['options'] as $option)
echo '
<tr>
<td style="padding-right: 2ex;', $option['voted_this'] ? 'font-weight: bold;' : '', '">', $option['option'], '</td>', $context['allow_poll_view'] ? '
<td nowrap="nowrap">' . $option['bar'] . ' ' . $option['votes'] . ' (' . $option['percent'] . '%)</td>' : '', '
</tr>';


change them to

<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse;">';

// Show each option with its corresponding percentage bar.
foreach ($context['poll']['options'] as $option)
{
        switch($modSettings['whovotedwhatMode']) {
          case 'select':
    echo '
    <tr>
    <td style="padding-right: 2ex;', $option['voted_this'] ? 'font-weight: bold;' : '', '">', $option['option'], '</td>', $context['allow_poll_view'] ? '
    <td nowrap="nowrap">' . $option['bar'] . ' ' . $option['votes'] . ' (' . $option['percent'] . '%)</td>' : '', '';
            // [Who Voted What?]
            if (allowedTo('poll_view_voters'))
            {
              echo '
      <td style="padding-left: 2ex;">
                        <select name="voters' . $option['ID_OPTION'] . '" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);" style="width: 150px;">';
              if (!empty($context['poll']['options'][$option['ID_OPTION']]['voters']))
              {
                echo '
                          <option selected="selected" value="#">' . $txt['poll_view_voters_expand_to_view'] . '</option>
                          <option disabled="disabled" value="">----------------------</option>';
                foreach ($context['poll']['options'][$option['ID_OPTION']]['voters'] as $voter)
                {
                  echo '
                          <option value="?action=profile;u=' . $voter['ID_MEMBER'] . '"> => ' . $voter['realName'] . '</option>';
                }
                echo '
                          <option disabled="disabled" value="">----------------------</option>
                          <option disabled="disabled" value="">' . $txt['poll_view_voters_expanded_help1'] . '</option>
                          <option disabled="disabled" value="">' . $txt['poll_view_voters_expanded_help2'] . '</option>';
   
              } else
              {
                echo '
                          <option disabled="disabled" selected="selected" value="">----------------------</option>';
              }
              echo '
                        </select>
                      </td>
              ';
            }
            echo '
    </tr>';
            break;
          case 'table':
    echo '
    <tr>
    <td style="padding-right: 4ex; vertical-align: top;', $option['voted_this'] ? 'font-weight: bold;' : '', '">', $option['option'], '</td>';
            if($context['allow_poll_view']) {
              echo '
                    <td style="padding-right: 4ex;">
                      ', $option['bar'], '<br />';
              if(allowedTo('poll_view_voters'))
              {
                if(!empty($context['poll']['options'][$option['ID_OPTION']]['voters']))
                {
                  foreach($context['poll']['options'][$option['ID_OPTION']]['voters'] as $voter)
                  {
                    echo '<small><a href="?action=profile;u=' . $voter['ID_MEMBER'] . '">', $voter['realName'], '</a></small>&nbsp;';
                  }
                }
              }
              echo '
                    </td>
                    <td style="padding-left: 2ex; padding-right: 2ex; text-align: center; vertical-align: top;">', $option['votes'], '</td>
                    <td style="padding-left: 4ex; text-align: right; vertical-align: top;">', $option['percent'], '%</td>';
            }
            echo '
    </tr>';
            break;
        }
}


That should be it :) sorry if they're a bit hard to understand - I've never been good at giving detailed instructions :(
Steven Hoffman
Former Team Member, 2009-2012

MinasC

Quote from: YodaOfDarkness on June 30, 2007, 01:57:32 PM
I got it running easily in 1.1.3 ...

Just go into package-info.xml and put ,1.1.3 after 1.1.2 in the "install for" and "uninstall for" elements.

Then do the Display.template.php change by hand, it's only one thing.

Also remember to change to Table View as mentioned earlier.

worked for me too , thnx a lot mate !

farknduckRC

Thanks for the info YodaofDarkness, mod worked perfect!

Ninoslav

Yes, works flawlessly!
∑∆T M∑! :)

jasonhoblin

RE: user names list out without wrapping; user names nowrap

Didn't have time to see if this error was mentioned already, but since i took the time to fix it, i'd figured i should share.

The problem was the list of who voted for what was listing horizontally without wrapping. the table just pushed off to the right in a single row.

I am using the Dilber Multicolor theme. In the Display.template.php file in the default theme folder around line 101,

at the end of the echo, i edited the space from a coded space ...

echo '<small><a href="?action=profile;u=' . $voter['ID_MEMBER'] . '">', $voter['realName'], '</a></small>&nbsp';

...to an actual space...

echo '<small><a href="?action=profile;u=' . $voter['ID_MEMBER'] . '">', $voter['realName'], '</a></small> ';

... and now my list of voted users wraps. fyi.

^jasonhoblin
^jasonhoblin

Rysiek

Quote from: YodaOfDarkness on June 30, 2007, 04:31:20 PM
Okay, download the 1_1_2 file to your desktop.

Using WinZip or another program, unzip the files to a folder. Go into that folder and right-click package-info.xml . Find the two places where it says
for="1.1.2" and replace them with for="1.1.2,1.1.3"

Using WinZip (or whatever you're using) again, select the package-info file and the modification file, and right-click them. Select "add to (name).zip"

You can then install this mod just like any other. Once it's installed, go to your Admin area and then to Features and Options (on the left). Near the top should be an option for "Who Voted What? mode" - change it to "Table View".
....

That should be it :) sorry if they're a bit hard to understand - I've never been good at giving detailed instructions :(

Okay, so I tried to install this package but no go. Then I was excited to see this thread and rushed off to do it. However, after making the change (which was only changing the for="1.1.2" stuff since I'm using the default theme), SMF tells me the package is not valid or corrupt. :/ Any ideas?

And yes, I'm using 1.1.3 and it's a fresh install.

jossanaijr

Quote from: YodaOfDarkness on June 30, 2007, 04:31:20 PM
Okay, download the 1_1_2 file to your desktop.

Using WinZip or another program, unzip the files to a folder. Go into that folder and right-click package-info.xml . Find the two places where it says
for="1.1.2" and replace them with for="1.1.2,1.1.3"

Using WinZip (or whatever you're using) again, select the package-info file and the modification file, and right-click them. Select "add to (name).zip"

You can then install this mod just like any other. Once it's installed, go to your Admin area and then to Features and Options (on the left). Near the top should be an option for "Who Voted What? mode" - change it to "Table View".

IF you're using a custom theme, open your Display.template.php under that theme's folder and find these lines:

<table border="0" cellpadding="0" cellspacing="0">';

// Show each option with its corresponding percentage bar.
foreach ($context['poll']['options'] as $option)
echo '
<tr>
<td style="padding-right: 2ex;', $option['voted_this'] ? 'font-weight: bold;' : '', '">', $option['option'], '</td>', $context['allow_poll_view'] ? '
<td nowrap="nowrap">' . $option['bar'] . ' ' . $option['votes'] . ' (' . $option['percent'] . '%)</td>' : '', '
</tr>';


change them to

<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse;">';

// Show each option with its corresponding percentage bar.
foreach ($context['poll']['options'] as $option)
{
        switch($modSettings['whovotedwhatMode']) {
          case 'select':
    echo '
    <tr>
    <td style="padding-right: 2ex;', $option['voted_this'] ? 'font-weight: bold;' : '', '">', $option['option'], '</td>', $context['allow_poll_view'] ? '
    <td nowrap="nowrap">' . $option['bar'] . ' ' . $option['votes'] . ' (' . $option['percent'] . '%)</td>' : '', '';
            // [Who Voted What?]
            if (allowedTo('poll_view_voters'))
            {
              echo '
      <td style="padding-left: 2ex;">
                        <select name="voters' . $option['ID_OPTION'] . '" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);" style="width: 150px;">';
              if (!empty($context['poll']['options'][$option['ID_OPTION']]['voters']))
              {
                echo '
                          <option selected="selected" value="#">' . $txt['poll_view_voters_expand_to_view'] . '</option>
                          <option disabled="disabled" value="">----------------------</option>';
                foreach ($context['poll']['options'][$option['ID_OPTION']]['voters'] as $voter)
                {
                  echo '
                          <option value="?action=profile;u=' . $voter['ID_MEMBER'] . '"> => ' . $voter['realName'] . '</option>';
                }
                echo '
                          <option disabled="disabled" value="">----------------------</option>
                          <option disabled="disabled" value="">' . $txt['poll_view_voters_expanded_help1'] . '</option>
                          <option disabled="disabled" value="">' . $txt['poll_view_voters_expanded_help2'] . '</option>';
   
              } else
              {
                echo '
                          <option disabled="disabled" selected="selected" value="">----------------------</option>';
              }
              echo '
                        </select>
                      </td>
              ';
            }
            echo '
    </tr>';
            break;
          case 'table':
    echo '
    <tr>
    <td style="padding-right: 4ex; vertical-align: top;', $option['voted_this'] ? 'font-weight: bold;' : '', '">', $option['option'], '</td>';
            if($context['allow_poll_view']) {
              echo '
                    <td style="padding-right: 4ex;">
                      ', $option['bar'], '<br />';
              if(allowedTo('poll_view_voters'))
              {
                if(!empty($context['poll']['options'][$option['ID_OPTION']]['voters']))
                {
                  foreach($context['poll']['options'][$option['ID_OPTION']]['voters'] as $voter)
                  {
                    echo '<small><a href="?action=profile;u=' . $voter['ID_MEMBER'] . '">', $voter['realName'], '</a></small>&nbsp;';
                  }
                }
              }
              echo '
                    </td>
                    <td style="padding-left: 2ex; padding-right: 2ex; text-align: center; vertical-align: top;">', $option['votes'], '</td>
                    <td style="padding-left: 4ex; text-align: right; vertical-align: top;">', $option['percent'], '%</td>';
            }
            echo '
    </tr>';
            break;
        }
}


That should be it :) sorry if they're a bit hard to understand - I've never been good at giving detailed instructions :(

Well this is a detailed instrunction!
And worked perfectly.
SMF 1.1.3

Thank you!

Advertisement: