News:

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

Main Menu

Who Voted What?

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

Previous topic - Next topic

traktorku

hi
i installed this mod but then i couldnt see the result of the polling

Vinspire

Quote from: traktorku on March 18, 2007, 03:38:58 PM
hi
i installed this mod but then i couldnt see the result of the polling

I had the same problem.

toma.baza

I recommend you to check if all updates (according to modification.xml) have happened. I change files manually and it started to work. Also you can try to change mod from "Select box" to "Table" if it will help.

Vinspire

Quote from: toma.baza on March 22, 2007, 09:41:29 AM
I recommend you to check if all updates (according to modification.xml) have happened. I change files manually and it started to work. Also you can try to change mod from "Select box" to "Table" if it will help.

I can view the result after i've changed the setting to "table"

anyway, any idea which file i should check for the manual installation to make sure the "select box" to work ?

edwardsiow

Quote from: traktorku on March 18, 2007, 03:38:58 PM
hi
i installed this mod but then i couldnt see the result of the polling


i also face the same problem....hmmm

edwardsiow

yes!!! table view and select box view can!!!

thanks for the creator of this mod....

weblady

I installed this mod... but had to change to "table view" to get it to work... no complaints here tho, I think this is a GREAT mod... fantastic to know WHO actually voted for what!  I've only been running my smf for a few months and was shocked that this function wasn't already a part of the forum... I LOVE this mod!  Thanks!
http://www.ladiesplace.net/community [nofollow]
---the Ladies Place on the Net --- Stop by, the coffee's always on!

dDOTr2

a great mod. thanks for making this.

it works great but i m flooded with this error message. kindly plz help me regrading this or can i ignore this error. thanks in advance. btw i m using Dilber MC theme.




http://localhost/indiamusics/index.php
8: Undefined index: whovotedwhatMode
File: C:\wamp\www\indiamusics\Themes\default\Display.template.php (main sub template - eval?)
Line: 59

BCB

Quote from: toma.baza on March 22, 2007, 09:41:29 AM
I recommend you to check if all updates (according to modification.xml) have happened. I change files manually and it started to work. Also you can try to change mod from "Select box" to "Table" if it will help.

Where would I do this? I have made sure that the changes have all taken effect in the files and it appears to have.

Any help on this would be great.

BTW this is what I am running on my site
Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
TinyPortal v0.9.7 © Bloc

bassmadrigal

#109
I installed the mod, and got this at the top of the screen :
// [Who Voted What?] $txt['poll_view_voters_expand_to_view'] = 'Expand to view:'; $txt['poll_view_voters_expanded_help1'] = 'Select a name to view'; $txt['poll_view_voters_expanded_help2'] = 'the member\'s profile...'; $txt['cannot_poll_view_voters'] = 'Sorry, you\'re not allowed to view which members voted for what option in the poll.'; $txt['permissionname_poll_view_voters'] = 'View voters'; $txt['permissionhelp_poll_view_voters'] = 'This permission allows people to see which members voted for what option in a poll.'; $txt['whovotedwhatMode'] = 'Who Voted What? mode'; $txt['whovotedwhatMode0'] = 'Select Box'; $txt['whovotedwhatMode1'] = 'Table View';

its on the very top of every page.   I am using the same theme as your site, I noticed.  I have checked the .php files listed in the mod.xml file, and everything appears to be good.

brotherlordacid

Exactly the same problem as the poster above me.
Latest Smf version, default theme. Help?  ;)

Kindred

the mod is apparently adding the text strings to modifications.english.php AFTER the closing ?>

go into modifications.english.php and move the ?> to the end of the file.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

bassmadrigal

Duh, can't believe I missed that, the mod is still not working though, I'll double check that all of the files are not like that one.  Thank you for that.

kvanorsdel

Quote from: Vinspire on September 13, 2006, 01:49:22 PM
Quote from: corruptor on September 13, 2006, 01:08:26 PM
This is the single most frustrating fact about mods!
There needs to be a way simplify this by using a standard or keeping things consitant.
I tried to modify the files manually but got errors. I am not a programmer, and reading lines of code is not fun to me. (my problem, I know)
I am scared I will mess up a working site... (yes I make backups)
If anyone can help, I would love you forever for it. ( i know, you are all excited about that!  ::)  )

Quote from: usvi4me on September 13, 2006, 01:37:54 PM
For now this is my resolution as I really WANT this mod.

When I need to look at a poll and find out who voted what, I set the server mode in maintenance for a few minutes, change to the default theme and check the results.  Then ofcourse I have to remember to set it back to MY preferred theme and take it out of maintenance mode.

Maybe Soren will find us a fix ......

The thing is this is not Soren fault. He can't modified every single themes in SMF Board you know ?  :-\

Anyway, I've highlighted out what you guys need to do.

What you need to do to get it to work on other theme is modified Display.template.php and Modifications.english.php

P/S : Remember to make a backup copy of this file before you modified it :)

Display.template.php

Search for

![CDATA[ // 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>';


Replace that code with this

![CDATA[ // 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>' : '', '';
        // [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>';
}


Then go to your theme language folder look for Modifications.english.php file

Search

position="end"

Add this code before that code

![CDATA[// [Who Voted What?]
$txt['poll_view_voters_expand_to_view'] = 'Expand to view:';
$txt['poll_view_voters_expanded_help1'] = 'Select a name to view';
$txt['poll_view_voters_expanded_help2'] = 'the member\'s profile...';
$txt['cannot_poll_view_voters'] = 'Sorry, you\'re not allowed to view which members voted for what option in the poll.';
$txt['permissionname_poll_view_voters'] = 'View voters';
$txt['permissionhelp_poll_view_voters'] = 'This permission allows people to see which members voted for what option in a poll.';

I manually added the above codes in the Black22 TP theme and the drop down boxes in my polls appear but no names appear and I can not see any permissions to allow membergroups to view the View Voter That doesn't show up in the options.
SMF 1.1.1 with TP v0.9.7

bassmadrigal

Well today I went through and followed the modifications.xml file to the T. Initially I wasn't seeing any polls so I switched to the table mode. Now the polls show up but I still can't see who voted.

Here are my errors.

Undefined index: voted_this
Undefined index: option
Undefined index: bar
Undefined index: ID_OPTION
Undefined index: votes
Undefined index: percent

In the file
$Themedir/Display.template.php

kvanorsdel

SO how do I switch it to table mode to see if that works?
SMF 1.1.1 with TP v0.9.7

gtron

Quote from: BCB on April 06, 2007, 05:56:58 PM



Quote from: toma.baza on March 22, 2007, 09:41:29 AM
I recommend you to check if all updates (according to modification.xml) have happened. I change files manually and it started to work. Also you can try to change mod from "Select box" to "Table" if it will help.

Where would I do this? I have made sure that the changes have all taken effect in the files and it appears to have.

Any help on this would be great.

BTW this is what I am running on my site
Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
TinyPortal v0.9.7 © Bloc

Admin> Features and Options> Basic Features> Who Voted What? mode (drop down box)


Quote from: bassmadrigal on April 11, 2007, 04:03:30 PM
I installed the mod, and got this at the top of the screen :
// [Who Voted What?] $txt['poll_view_voters_expand_to_view'] = 'Expand to view:'; $txt['poll_view_voters_expanded_help1'] = 'Select a name to view'; $txt['poll_view_voters_expanded_help2'] = 'the member\'s profile...'; $txt['cannot_poll_view_voters'] = 'Sorry, you\'re not allowed to view which members voted for what option in the poll.'; $txt['permissionname_poll_view_voters'] = 'View voters'; $txt['permissionhelp_poll_view_voters'] = 'This permission allows people to see which members voted for what option in a poll.'; $txt['whovotedwhatMode'] = 'Who Voted What? mode'; $txt['whovotedwhatMode0'] = 'Select Box'; $txt['whovotedwhatMode1'] = 'Table View';

its on the very top of every page.   I am using the same theme as your site, I noticed.  I have checked the .php files listed in the mod.xml file, and everything appears to be good.



if the code appares after %> in the following file move %> to the end of the file. if %> doesn't exsist at all... add it to the end of the following file....

Themes/default/languages/Modifications.english.php.


Quote from: kvanorsdel on April 18, 2007, 11:22:53 PM
SO how do I switch it to table mode to see if that works?


Admin> Features and Options> Basic Features> Who Voted What? mode (drop down box)

samames

this mod made my whole board shift to the left and made everything bigger, praise God it uninstalled well and went back to normall, i think it clashed with my shoutbox mod.
Firefox 3 user. Mac user. Pc user.

bassmadrigal

OK I went through all the code again and now see who voted. And it seems the errors I posted above were from a post before we converted the forum to smf, so that could be the problem.

Anyways the problem I am running into now has been mentioned previously in the thread. I am getting the results of the who voted on the poll twice. I dug through Display.template.php and have not found any duplicates.

I have created a temporary account for whoever to view this.
Account Name: temporary
Account Password: Aq36mdo8

Link to problem post: http://forums.xboxjunkies.org/index.php?topic=135.0

But all polls show up like this.

As far as I can tell it seems like it is this code that is the culprit

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;';
                  }
                }
              }


It seems that the foreach that runs for some reason doubles the results.

I am at a loss, hopefully someone more knowledgeable can help me out. And it happens in both the classic theme and my modified Aa Damage. So the problem may not lie in the Display.template.php

Kindred

look in the database...  are the values stored twice?   Or maybe being read into the array twice?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: