First let me say this is one of my favorite modules. Really like what you can do with it. Simple vote + or - allows for some cool things.

I've been playing around with it more today and figured how to use Views and blocks to show users that voted + and users that voted - in separate blocks. Wondering if anyway to display user's picture instead of name? So I have 2 blocks on each node. One displays all voters pics that liked the node, and the other all those that didn't.

I also have a block that displays the sum of points assigned a node, and the total votes. Is there a way to show a count of the + votes vs. a count of the - votes? So I can show:

Node point value = 6 points (done)
total votes = 10 (done)
plus votes = 8
minus votes = 2

Want to show this so readers get a sense for the percentage fo voters opinions.

thanks for any assistance.

Comments

madjr’s picture

This is not very hard you just need to modify the theme a bit.

Anyway can you tell us step by step how u made the blocks, that way i can further test it in my pc and get back to u (i.e. what displays, filters, sorting, etc. you used)

pshadow’s picture

Thanks for your offer to help on this.

To get a list of users who voted and brak down between +1 votes and -1 votes I did the following:

In Views:
- created a view as block
- show field VotingAPI points vote user -> displays username of vote caster
- show field VotingAPI points vote value -> displays +1 or -1
- for Argument I have 'Node: ID'
- then I put php code in "Blocks" section to show only on node types.

That basically gives me a list of users who have voted on a particular node with name and vote value. To separate positive voters from negative, I just replicate into 2 Views blocks and add a 'filter' for VotingAPI votes points value -> Is Equal To -1 or Is Equal To +1.

So would love to replace username with user profile picture.

And secondarily, I would love to figure how to show a count of positive votes and count of negative votes for each node and based on that count get a % of 'recommendation'. Currently all the VotingAPI percent fields don't hold any data.

Here's a sample I found that kinda does what I was thinking. It takes the number of positive reviews and number of negative reviews to get a 98% of positive reviews.
http://www.webhostingunleashed.com/lunarpages

Basically want to do the same. So 90% of my members voted this node +1...

Hope that makes sense.

madjr’s picture

Yes, it makes sense.

As am a little busy atm, I haven't tested this myself. Some php snipplets will be needed and a lot of trial and error (depending mostly on the theme you are using some elements may be repeated or not in the place where you may want them to be as it may break or might interfere with other elements)

To get you started the basic idea would be this:

-If you want to work only on that particular block , that block name would be $block->delta so you should open Block.tpl.php and add something like this

if ($block->delta == your_block_name) { 
Things you want to change for that block here;
}

-To add a picture use:

if ($picture) {
    print $picture;
  }

You will be inserting the pic inside a

, so you can sort it out where ever you want in the block.

For now you may want to show both the pic and username till we get the other things resolved.

-You may add the code for the "Percentage" (%) to the header or body of the Block. The formula is "(positive votes / total votes) * 100 = percentage". So you just need the Variables/constants from the "up down module".

Anyway, when i get some free time i can better help replicate this. Meanwhile i seen a few forum posts asking similar questions about "profile picture" theming, am sure some people have done this much better than my example above :)

marvil07’s picture

Version: » 5.x-1.x-dev
Status: Active » Closed (won't fix)

No more features to 5.x, please take a look to the update on the project page, now 5.x is not-really-maintained.

this is related to #811694: New widget for splitting of votes in positives/negatives (5 voted up, 2 voted down)