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

sepulchre

#420
Well I checked this thread earlier from my phone and was delighted someone had finally done what none of the rest of us could do and updated this mod for RC3, its just a pity this has been removed, I understand the reasons but this mod had been dead for months, the author hasn't even replied to this thread since -

Quote from: Søren Bjerg on July 20, 2009, 09:39:57 AM
In all honestly I haven't followed development of SMF since... uhh, I think my forum was left at 1.1.3 when I found a use for it again.

I could probably set up a development environment and delve into how stuff works - or will work in 2.0 - in SMF to make a 2.0 version of the modification, though a more able and experienced coder would probably be preferred (my code may work - sometimes - but it isn't exactly pretty)?

Surely this mod must be "abandoned" by now in anyone's terms? Can the mod be released or in the very least examined by SMF?

Thanks

Kindred

if someone submits it to the mod site, yes, the team can and will review it.
Сл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."

koops

Quote from: juvebalkan on May 31, 2010, 03:04:52 PM
No, I didn't say it's my version, I just said it's adopted for RC3 and that's it...I didn't remove anything from the source code, original author or anything. In past posts, the creator of this post gave permission as I saw for anyone who can adopt this mod for some new version of SMF. Since none made it available for RC3, I thought I might help.

I tested it on my own forum, and it is working without any problems. You can remove it and review it, it's not a problem.

Sorry if I caused some trouble, intention was to help, otherwise I would keep this to myself... :)

I think the other way you can do this all within the rules would be to post the code and the files that you changed (if there isn't an huge rewrite).

This way you've provided the information on how to make it work for people that want it while also not violating any other rules.

This is a mod that still has people interested in getting working for 2.0rc3 so I for one would be very interested in it ;)
SMF 2.0RC5, Simple portal 2.3.3, Aeva Media    1.4c

koops

#423
For those trying to get it to install on rc3 the change is a simple one from the rc2 version that was already posted.

All juvebalkan's version changes was the following

QuoteOn the line 4, instead of   

<install for="2.0 RC2">
I put
<install for="2.0 RC3">

On the line 18, instead of
<uninstall for="2.0 RC2">
I put
<uninstall for="2.0 RC3">

Thats it! All kudos to juvebalkan :D

So you'll just have to manually extract, edit and then repackage the files and it should allow you to install it.

edit: I had to manually re-edit the display.template.php file to comment out an extra "}" in the code to get it to work correctly. The main foreach function add's an extra "}" that wasn't in the original template code.
SMF 2.0RC5, Simple portal 2.3.3, Aeva Media    1.4c

koops

Does any one know the php code to put in to get the colored bar back in addition to the names?

I though it was this :

around line 47 find
<dd class="middletext statsbar', $option['voted_this'] ? ' voted' : '', '">

and append this after it.

<dd class="middletext statsbar', $option['voted_this'] ? ' voted' : '', '">

I then get the html code for bar in the page source like this :

ie. <div class="bar" style="width: 148.2px;"><div style="width: 144.2px;">

But nothing is visible.
SMF 2.0RC5, Simple portal 2.3.3, Aeva Media    1.4c

Dark//Virus

I installed this mod in RC3, removed the extra } bracket, but i dont see where i can view the voters, unless it doesnt count if i am a voter?
(15:10) <@DV> !ban Ard-Choille
(15:10) -ChanServ- Banned Ard-Choille from #deluxe.
(15:10) <@DV> Man that felt good

adbrad

Quote from: Dark//Virus on June 02, 2010, 05:03:33 PM
I installed this mod in RC3, removed the extra } bracket, but i dont see where i can view the voters, unless it doesnt count if i am a voter?

have you enabled in admin.

Quote from: adbrad on January 21, 2010, 01:52:31 PM
Quote from: mghome59 on January 21, 2010, 12:51:12 PM
enable it from Forum » Administration Center » Features and Options ?

thankyou this is the bit i was missing it never showed in my first install working perfect now

Dark//Virus

Yes, i beleive its enabled

Anywho, we are customizing this mod so instead of global permissions/change

It has a tick box when creating the poll to make it anonymous or open
(15:10) <@DV> !ban Ard-Choille
(15:10) -ChanServ- Banned Ard-Choille from #deluxe.
(15:10) <@DV> Man that felt good

chinaren

Hi, just looking through some of the recent posts here, but it's a bit muddled.


Would the updated/amended ('unofficial') version of this work on 2RC3 with multiple polls mod on?  I'd really quite like it.


Also:


QuoteAnywho, we are customizing this mod so instead of global permissions/change

It has a tick box when creating the poll to make it anonymous or open



Does this mean you've done this already, or still working on it?  If so, is the code posted somewhere here?  Also, when you say anonymous, do you mean that it will just show who's voted, but not what for?


Sorry to ask so many questions!
The Opus Path - The Next Generation of the Written Word

ljsevern

Sorry for the necro bump, but I would love a mod that does this in 1.1.11

miDnIghtEr20C

Quote from: ljsevern on July 12, 2010, 08:20:55 PM
Sorry for the necro bump, but I would love a mod that does this in 1.1.11
i too would like a mod like this.    is this the only one, or is there anything that will work with 1.1.11?

miDnIghtEr20C

yay... i finally got this to work!   :D   awesome!    just one question.    is there a way to make it optional in the poll to be viewed by all?   that way some polls are hidden, and some are viewable, depending on what you pick?       

is that already talked about in this thread?   what page?    thanks guys.

Stigmartyr

Quote from: mghome59 on January 21, 2010, 09:45:25 AM
Hope it`s ok now. Uninstall previous, then delete it, upload this one.  Don`t forget to clean your cache (from forum root) and enable who voted what from 

    * Forum » Administration Center » Features and Options

Confirmed: this mod attached to the post above installed successfully in SMF RC2 via package manager without a hitch.  I am running a curve based theme, if that helps as well, meaning I didn't have to do any additional theme edits, though it said it would fail on my iPhone theme, who cares.  Who uses iPhones anymore :P

Søren Bjerg

Likely to nobody's surprise I once again didn't get any work done updating this modification, although I didn't exactly promise to do so either. Also, I see no opportunity in near to far future to set up a development environment, get the newest publicly available version of SMF, figure out how stuff works now and recreate the modification - much less when people have already fixed and improved the code... so I fall back on one of my previous posts:

Quote from: Søren Bjerg on July 12, 2009, 06:37:56 AM
[...] I'll happily give permission to someone else to take over the development of the modification.
RUNE HORDES dot INFO - SMF 1.1.10 w/ Custom Profile Mod... and various permissions hooks and template changes (new topic form).

Rasyr

Has this been updated for SMF 2.0 RC4?

HorTs

I wish some clever person would take this over.

HorTs

Has anyone got it working with RC5 yet?

rbeuker

I have got it working on a patched RC4 version--I'm not sure if it'd also work on RC5.

USE AT YOUR OWN RISK!!

Check the contents of the modification.xml file and find the section that changes the Display.template.php file.
Below's the code I've used:

  <file name="$themedir/Display.template.php">
    <operation>
      <search position="replace"><![CDATA[ // Show each option with its corresponding percentage bar.
foreach ($context['poll']['options'] as $option)
{
echo '
<dt class="middletext', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt>
<dd class="middletext statsbar', $option['voted_this'] ? ' voted' : '', '">';

if ($context['allow_poll_view'])
echo '
', $option['bar_ndt'], '
<span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>';

echo '
</dd>';
}

]]></search>
      <add><![CDATA[ // Show each option with its corresponding percentage bar.
foreach ($context['poll']['options'] as $option)
{
if (!allowedTo('poll_view_voters') || $modSettings['whovotedwhatMode'] == 'disabled')
{
echo '
<dt class="middletext', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt>
<dd class="middletext statsbar', $option['voted_this'] ? ' voted' : '', '">';

if ($context['allow_poll_view'])
echo '
', $option['bar_ndt'], '
<span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>';

echo '
</dd>';
}
else
{
switch ($modSettings['whovotedwhatMode'])
{
case 'select':
echo '
<dt class="middletext', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt>
<dd class="middletext statsbar">';
if ($context['allow_poll_view'])
{
echo '' . $option['bar'] . ' ' . $option['votes'] . ' (' . $option['percent'] . '%)' . ' ' . '<select id="jumpto" name="voters' . $option['ID_OPTION'] . '" 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 selected="selected" value="">----------------------</option>';
              }
              echo '
                  </select>';
}
else
{
echo '';
}
echo '</dd>';
break;
case 'table':
echo '
<dt class="middletext', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt>
<dd class="middletext statsbar">';
if ($context['allow_poll_view'])
{
echo '' . $option['bar'] . ' ' . $option['votes'] . ' (' . $option['percent'] . '%)<br />';
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> ';
                }
              }
}
else
{
echo '';
}
echo '</dd>';
break;
}
}
}

]]></add>
    </operation>
  </file>


In the package-info.xml file you can change "RC2" to your Forum version (RC3, RC4 or RC5).

I have not changed the wvwDB.php file.

Put all 3 files into a zip file and try installing it using the package manager.

Good luck! :)

HorTs

Thanks, that worked great for me on RC5.

I really appreciate your effort in helping me.

hcfwesker

I got over 40 MODs, and your fix installed perfectly on smf2 RC4, rbeuker!  thanx a bunch :)

Advertisement: