forum.coppermine-gallery.net

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: martl on March 12, 2006, 11:30:59 pm

Title: voting is broken?
Post by: martl on March 12, 2006, 11:30:59 pm
i have a gallery running (you can check it out at http://www.tourgalerie.de/gallery (http://www.tourgalerie.de/gallery)

last week i upgraded from 1.20 RC2 to 1.4.4 stable.

I also reset all recent votes. registered users are allowed to vote.

Now i have the following phenomenon:

The Gallery registers all given votes correctly. But the calculated resulting vote seems to be broken for some reason, so that in  the "displayimage" screen the table row entry for Votes gives wrong values.

For example. that overall diplay for this picture tells me "Rating: (4 Votes) <5 stars>"
http://www.tourgalerie.de/gallery/displayimage.php?pos=-135

but when you check out the details, you'll see there is a different number of votes given (more) and the calculated value is also wrong.

there have the following manipulations done from me:

- i deleted a double vote entry from both cpgd_vote_stats and cpg11d_votes
- i wanted to know which userID voted what, so i added a table row to cpg11_vote_stats to put that in, and added the italicized pieces to "ratepic.php"

Code: [Select]
[i]$m_username = stripslashes(USER_NAME);[/i]

// Insert the record in database
$query = "INSERT INTO {$CONFIG['TABLE_VOTE_STATS']}
                  SET
                    pid = $pic,
                    rating = $rate,
                    Ip   = '$_SERVER[REMOTE_ADDR]',
                    sdate = '$time',
                    referer = '$_SERVER[HTTP_REFERER]',
                    browser = '$browser',
                    os = '$os'[i],
                    m_username = '$m_username'[/i]";

can these manipulations have caused that problem?
if not, did i discover a bug?

ty for your help!

Martin
Title: Re: voting is broken?
Post by: martl on March 13, 2006, 12:12:25 am
i had the very bright idea meanwhile to try out if deleting my database table extension and using the original .php-file will help, but no effect ...

i now restored my modifications in case some of you guys wanna have a look at the gallery.
Title: Re: voting is broken?
Post by: martl on March 14, 2006, 05:11:53 pm
I forgot to add: i had reset all votes along with the update to 1.4.4 using the admin interface for the album.

i now removed the votes again, now on a "per picture" basis. After doing this, the tables "votes" and "vote_stats" still had entries, although the "best votes" website showed no pictures anymore. I suspect this was the reason, though i dont know why the tables weren't cleaned.
Apparently the average was calculated on all votes, but the displayed values were only the ones given after the upgrade (?)

I cleared the tables using PHPMyAdmin and enabled voting again now again.

We'll see what happens.

Martin
Title: Re: voting is broken?
Post by: Nibbler on March 15, 2006, 06:11:51 pm
Moving this into bugs, seems the hit and vote stats are not reset along with the traditional hit and vote counters.
Title: Re: voting is broken?
Post by: Joachim Müller on May 18, 2006, 07:47:14 am
they are probably not reset because the detailed stats have been added after the reset feature, so this was an omission.
Title: Re: voting is broken?
Post by: Abbas Ali on May 18, 2006, 10:14:46 am
Fixed in stable and devel branch. Please confirm.
Title: Re: voting is broken?
Post by: Joachim Müller on May 18, 2006, 09:11:22 pm
Works as advertized for me (checking with devel branch checkout). Thanks for fixing, marking thread accordingly.