News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Who Voted What?

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

Previous topic - Next topic

Søren Bjerg

Quote from: lemur21 on January 25, 2007, 03:45:35 PM
That's very possible - but I'm way out of my element here in determining what to remove.

Could I attach the files here, and - maybe - you could take a quick look at them?

Chris
Sure thing - I believe Display.template.php might be the incriminating file.
RUNE HORDES dot INFO - SMF 1.1.10 w/ Custom Profile Mod... and various permissions hooks and template changes (new topic form).

lemur21

OK - here are the files...I'm attaching a handful, just to see if it could be one of these....

Thanks!

Chris

Søren Bjerg

In your Display.php file, the following block of code appears twice (and thus inserting the names of the voters into an array twice):


// Get information about the voters... [Who Voted What?]
    $request = db_query("
      SELECT
        lp.ID_CHOICE, lp.ID_MEMBER, m.realName
      FROM {$db_prefix}log_polls AS lp
        LEFT JOIN {$db_prefix}members AS m ON (m.ID_MEMBER = lp.ID_MEMBER)
      WHERE lp.ID_POLL = $topicinfo[ID_POLL]
      ORDER BY m.realName", __FILE__, __LINE__);
    while ($row = mysql_fetch_assoc($request)) {
      if(!isset($context['poll']['options'][$row['ID_CHOICE']]['voters']))
      {
        $context['poll']['options'][$row['ID_CHOICE']]['voters'] = array();
      }
      $voter = array(
        'ID_MEMBER' => $row['ID_MEMBER'],
        'realName' => $row['realName']
      );
      array_push($context['poll']['options'][$row['ID_CHOICE']]['voters'], $voter);
    }
    mysql_free_result($request);
}


If you remove one of them, it should work as intended.
RUNE HORDES dot INFO - SMF 1.1.10 w/ Custom Profile Mod... and various permissions hooks and template changes (new topic form).

lemur21

Yep - that did it...I didn't really want to go tinkering around, but I started thinking, it probably had to be in the sources directory (since I DIDN'T replace that directory).

Thanks again!

Chris

puttputt

#84
I installed 1.1.1, made a few style template changes to the Default theme, then proceeded to install this mod.  So far, it doesn't appear to be installing and displays 2 "Modification parse errors"

After cmoding every file's permission, still nothing. Oddly enough, I don't find a "Display.php" file either.

I would love to incorporate this feature 

Thanks

EDIT: Ok... I finally located my "Display.php" file!

MoreBloodWine

SMF 1.1.1  - TP 0.9.7

Same error both on the default theme and my custom theme... whats wrong and how can it be fixed...

8: Undefined index: whovotedwhatMode
File: /home/choiceo2/public_html/Themes/default/Display.template.php (main sub template - eval?)
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


growwl

hi søren!
could you provide the "alternative" who voted what mod for smf 1.1.2?

Squaregarden

Hi@ALL,

yeah that would be great! We just had a situation where we could have used it. So what can we do? Will u make us happy?  8)

LG Squaregarden

Søren Bjerg

I'll see if I can get around to bringing the version compatibility up to date later today.

Until then, try adding 1.1.2 to the "install for" list in the packages-info.xml file:

<install for="1.1.1, 1.1.2">
RUNE HORDES dot INFO - SMF 1.1.10 w/ Custom Profile Mod... and various permissions hooks and template changes (new topic form).

MoreBloodWine

**Looks down at the below quote... and thinks... well it did install ok and on the custom theme but wonders what the below error means... but also wonders why when he goes to a poll that the whole thing is messed up and one cant even view the poll or vote in it let alone view the voters who voted before the mod was installed**

Quote from: MoreBloodWine on February 04, 2007, 11:31:20 PM
SMF 1.1.1  - TP 0.9.7

Same error both on the default theme and my custom theme... whats wrong and how can it be fixed...

8: Undefined index: whovotedwhatMode
File: /home/choiceo2/public_html/Themes/default/Display.template.php (main sub template - eval?)

Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


growwl

hi søren, any news on the alternative version?

Søren Bjerg

I've uploaded an updated package with native (un)installation support for 1.1.2 - should work.
RUNE HORDES dot INFO - SMF 1.1.10 w/ Custom Profile Mod... and various permissions hooks and template changes (new topic form).

MoreBloodWine

Hey Soren... have you had a chance to look at what I was trying to point out on the last page... its the same on the default theme so I know its nothing to do with the custom edits I made to my custom theme...
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Søren Bjerg

I think the "Undefined index" error has to do with language strings not having been added to the language file. Should probably try reinstalling the modification... that's about all the ideas I have.
RUNE HORDES dot INFO - SMF 1.1.10 w/ Custom Profile Mod... and various permissions hooks and template changes (new topic form).

MoreBloodWine

#94
Quote from: Søren Bjerg on February 22, 2007, 01:31:59 PM
I think the "Undefined index" error has to do with language strings not having been added to the language file. Should probably try reinstalling the modification... that's about all the ideas I have.
I've uninstalled / reinstalled a few times on both my production sites and my test site "default theme" ... results the same accross all three sites... so right now I'm kinda puzzled...  

Edit : Not sure if this will help but heres lines 48 - 56 of the file giving the error (Themes/default/Display.template.php)...


// Show each option with its corresponding percentage bar.
foreach ($context['poll']['options'] as $option)
{
The troublesome line number 51 --->        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>' : '', '';
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


sgtschulze

I got it to work by selecting "Table View". I liked the drop down box better but oh well.  

Søren Bjerg

The drop-down box doesn't work anymore?
RUNE HORDES dot INFO - SMF 1.1.10 w/ Custom Profile Mod... and various permissions hooks and template changes (new topic form).

Me313

hello.

i need help..hope u all dont mind..

am using helios_tp..and trying to make this mods work with the theme..but i dont know how to make it work anymore..what code should i put and where?display.php?but where? ..help?

thank you in advance..
a new user of smf...

J!ass

#98
Hey guys,

I installed the mod on my upgraded SMF 1.1.2 and it works. But I've got the problem, that the last choice is beeing displayed two times, if voted.
It looks like this:
[nofollow]


Thanks in advance
J!ass

WifiGamer

I hate to ask for a request in the mist of all of these issues. But.....

Is there any chance to add a permission on to this mod to only allow the owner of the poll (the creator) to view who voted what?

As it stands right now it looks like if I enable it on a membergroup then they can always see who voted what on any poll.  What I'd like is to only allow a person to view who voted if they are the ones who created the poll.  But also have the option to assign other member groups (like moderators) to always view who voted on any poll on the boards they are moderator's for?

I'm kinda new to SMF and can edit files OK but a little leery about creating a new permission from scratch.

BTW this is a great mod.  I love seeing who voted what and I love this mod because it satisfies my curiosity :P

Advertisement: