Voting/Polling version 0.9
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
****UPDATE****** 13 September 2003 Sorry this has taken so long, but here is the latest version. Features
<LI> Completely configurable from album properties <LI> voting can be either rank (voters choose one 1st, one 2nd, one 3rd etc) or critique (each image is evaluated independently). <LI> Rank voting is done using radio buttons, critiques on a pull down menu, or if th ere is a single choice - a checkbox. <LI> Voting results can be hidden, or displayed in summary form on the album pages, plus there is a page with complete results. <LI> Both the displayed names and the value for each polling option is configurable for each album. <LI> voting can be completely open (recorded against session id), or restricted to members only (using UID). <LI> Poll can be stopped and started at will <LI> If "nobody" can vote, and results aren't displayed, then to users the album looks exactly the way it does now. <LI> Results are shown graphically in ranking order and in broken down form for each photo. <LI> Graphical displays include links to each photo <LI> Votes can be changed at any time while the poll is open <LI> For rank voting, your current choices are displayed at the top of page one <LI> Any number of voting options are available (including just a checkbox "I like this picture") <LI> For rank voting, total score is based on a weighted sum of all votes <LI> For critique voting, total score is based on the average of votes cast **UPDATE** This code now lives at http://sourceforge.net/tracker/?func=detail&aid=693373&group_id=7130&atid=307130[/] |
|
vampy
Joined: 2002-12-05
Posts: 86 |
![]() |
Sorry if this is a dumb question but how do I run the patch file. If it needs to be run using ssh, I would be totally lost. Could you guide me? Thank you so much. I really appreciate your time and not to mention your brain. :grin: |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Quote:
Sorry if this is a dumb question but how do I run the patch file. If it needs to be run using ssh, I would be totally lost. Could you guide me? Thank you so much. I really appreciate your time and not to mention your brain. :grin: Have you got ssh access? If so, ftp the patch file into your gallery directory, then SSH in. From the SSH terminal, change directory to your gallery directory (eg cd public_html/gallery), then type If you don't see any error messages, then it's time to test it. |
|
josephp
Joined: 2002-10-03
Posts: 172 |
![]() |
Quote:
>>Sorry if this is a dumb question but how do I run the patch file. If it needs to be run using ssh, I would be totally lost. Could you guide me? Thank you so much. I really appreciate your time and not to mention your brain. :grin: << That DOESNT work, or maybe it doesnt work with CVS versions eh? |
|
drazin
Joined: 2002-11-23
Posts: 144 |
![]() |
bash-2.05$ patch -p0 < vote_release_candidate.patch i got it working it looks great! but when you vote it displays this is what i get when i run the patch...i hope it works |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Quote:
That DOESNT work, or maybe it doesnt work with CVS versions eh? No, the last test I ran (about 24 hours ago) was against a freshly checked out HEAD revision of the CVS source. What errors did you see? |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Quote:
patching file css/embedded_style.css.default That's ok! It means your warning text won't be blue - but I think you can live with that. Quote:
i got it working it looks great! but when you vote it displays this Known behaviour - though it looks like it should be fixed. The Rank is only recalculated when drawing the thumbnail page. If you go to the thumbnail page, then back to the image page, you should get a correct value. Now you know why it's version 0.9! |
|
josephp
Joined: 2002-10-03
Posts: 172 |
![]() |
Quote:
>>That DOESNT work, or maybe it doesnt work with CVS versions eh? << I am using 1.3.4-CVS-B15 it tells me all errors for all files like failed all the way and it doesnt work |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Quote:
I am using 1.3.4-CVS-B15 I just downloaded that version. The patch works. It doesn't sound like you are in the right directory. Patch will fail if it can't find the named files. You need to run the patch in the gallery directory, ie the same directory that albums.php etc are in. eg |
|
josephp
Joined: 2002-10-03
Posts: 172 |
![]() |
Quote:
>> I am using 1.3.4-CVS-B15 The error says: -bash-2.05b$ patch -p0 < vote_release_candidate.patch Now What? |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
can you email me one of your files, say classes/AlbumItem.php? Run zip or gzip on it first, so it doesn't get converted in anyway. email it to gallery @ mcgalliard.freeuk.com [I tried the experiment again (this time on a Linux machine), unpacking a fresh gallery from gallery.1.3.4-cvs-b15.tar.gz. My patch ran fine. As yours failed on every change, my guess is that your repository and mine differ in some way on every single line, so what I am looking for is DOS line feeds on every line, or something similar.] |
|
Picolio
![]()
Joined: 2003-02-02
Posts: 18 |
![]() |
This is FANTASTIC Joan!! Thank You!!! It installed quite easily with my first try :grin: I'm only seeing one issue so far (note I've had it installed all of five minutes...) In one album at I voted for three pictures giving two of the pics a "2" and one of the pics a "1" where one is the highest. But the results are showing what should have been the "1st place pic" as being in 3rd place... ----- 11-20-2001_max_out_cold Maxamus_01 Any ideas? |
|
Picolio
![]()
Joined: 2003-02-02
Posts: 18 |
![]() |
Nevermind Joan... I pulled out my old 1st grade math book and think I figured it out :grin: |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Quote:
Nevermind Joan... I pulled out my old 1st grade math book and think I figured it out :grin: No, you've done good, because visiting your site helped me discover a major, major BUUUUUGGG!!!!!!!!!! Watch this space |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Bug fix: Open poll_properties.php. Everywhere it says "Everyone" replace it with "Everybody". That's three changes. Then open util.php. Replace getVotingID and canVote with these versions. } |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
NOTE: After fixing the bug, click on poll properties, and make sure "Who can vote" is still set to the correct value. |
|
Picolio
![]()
Joined: 2003-02-02
Posts: 18 |
![]() |
Ok the edits have been made. When I made the edits it did change "Everybody" to logged in..but I've updated that back to everybody. Would you like to re-test? Everything's looking good to me .. but what do I know? LOL |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Quote:
Ok the edits have been made. Yup, looks much better. Before, all votes were recorded as user NULL, so there was only ever one voter, now you have 3. Big WHOOPS there. |
|
Picolio
![]()
Joined: 2003-02-02
Posts: 18 |
![]() |
Well so far I'm THRILLED to have this feature. Again THANK YOU for continuing to work on it!!!! You've done great :smile: If I had a feature request it would simply be the ability to "Apply properties to all sub-albums". Overall this is a great addition and kudos for the ease of installation!!! |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Quote:
i got it working it looks great! but when you vote it displays this This is because the position is only updated when the graph is drawn on the main page - so if your vote would (for example) move something from first to second position, you won't see that until you go back to the thumbnails page. This should fix this, save it, and run it on a gallery you have already modified using the release candidate voting patch. You'll need to do the above getVoterClass fix by hand. <!-- BBCode Start --><A HREF="http://www.mcgalliard.org/content/gallery/vote_release_candidate_bugfix.patch" TARGET="_blank">vote_release_candidate_bugfix.patch</A><!-- BBCode End --> |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
latest version is <!-- BBCode Start --><A HREF="http://www.mcgalliard.org/content/gallery/vote_release_candidate_0.9.1.zip" TARGET="_blank">vote_release_candidate_0.9.1.zip</A><!-- BBCode End --> |
|
matadler
Joined: 2003-01-23
Posts: 11 |
![]() |
Hi joan, thanks a lot for your great work. I discovered a small bug in poll_results.php: There's one ')' missing at the end: It must be <!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE> $ranks=array_keys(showResultsGraph($num_rows))</TD></TR></TABLE><!-- BBCode End --> Cheers |
|
josephp
Joined: 2002-10-03
Posts: 172 |
![]() |
Quote:
can you email me one of your files, say classes/AlbumItem.php? Run zip or gzip on it first, so it doesn't get converted in anyway. email it to gallery @ mcgalliard.freeuk.com I did just a fresh install, I dont get it either ... it has to be your script not mine, becuase my scripts are brandly NEW and updated! |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Quote:
$ranks=array_keys(showResultsGraph($num_rows)) Good catch. Probably should put a semi colon at the end, viz: |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Quote:
I did just a fresh install, I dont get it either ... Ok, but it works for me on a fresh installation - and other people have installed it successfully. If you are really struggling, here is a patched version of 1.3.4 <!-- BBCode Start --><A HREF="http://www.mcgalliard.org/content/gallery/gallery.1.3.4-cvs-b15_vote.tar.gz" TARGET="_blank">gallery.1.3.4-cvs-b15_vote.tar.gz</A><!-- BBCode End --> |
|
gothballoon
![]()
Joined: 2003-02-17
Posts: 68 |
![]() |
I think this may be a bug I used the fully built patched version of the script. it dose this when i try to revote |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Quote:
I think this may be a bug I can't reproduce it. Can you post a link to your site (or PM me) with details on exactly how to get this error. Once I see it, I can try to reproduce it locally. thanks |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Goths problem turns out to be one that occurs on his server, but not mine. Something to do with session variables, I think. Anyway, if you have a similar problem (or just want nicer URLs), you can make this change to view_album.php. } </TD></TR></TABLE><!-- BBCode End --> } </TD></TR></TABLE><!-- BBCode End --> |
|
vampy
Joined: 2002-12-05
Posts: 86 |
![]() |
Sorry, but I'm not really comfortable with using ssh. Could I do it manually? Thanks for all your help. |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Quote:
Sorry, but I'm not really comfortable with using ssh. Could I do it manually? Thanks for all your help. You could use a Windows version of patch, see this <!-- BBCode Start --><A HREF="http://gallery.sf.net/forums.php?topic=3586" TARGET="_blank">thread</A><!-- BBCode End --> or just grab a complete patched version <!-- BBCode Start --><A HREF="http://www.mcgalliard.org/content/gallery/gallery.1.3.4-cvs-b15_vote.tar.gz" TARGET="_blank">gallery.1.3.4-cvs-b15_vote.tar.gz</A><!-- BBCode End --> I can't suggest you do it by hand, as you'd add or modify 810 lines across 6 files. |
|
matadler
Joined: 2003-01-23
Posts: 11 |
![]() |
Hi! In case you want to see joan's scripts 'voting' and 'extra_fields' in action, check out my gallery:<!-- BBCode Start --><A HREF="http://www.matadler.de/gallery/" TARGET="_blank">My personal travel pictures</A><!-- BBCode End -->. CU Mathias |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Sorry - the results code can't cope with negative numbers! I had a look at how to change it, but it opened all new issues about how the graphh should be drawn, so instead I suggest you add the lines indicated with +s to poll_properties.php <!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE> --- 42,51 ---- |
|
vampy
Joined: 2002-12-05
Posts: 86 |
![]() |
Hi, Joan. I have finally been able to patch it by asking my hosting company since they could not grant me access to the patch command in ssh. It seems to be working but I need to confirm with you as I receive a few error messages when the patch was ran. Could you tell me if any of the error messages are important? If so, how do I correct them? patching file util.php BTW, I added some extra codes to the patched files to achieve what I want. Basically, I cut the caption to only show 40 characters and also in the full results view, I replaced the captions with the thumbnail. Thank you so much for all your effort. |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
Can't tell if that's a problem. Have a look at the .rej files. They contain the before and after snapshot of what failed to change. You should be able to work out how to do those changes by hand. If you can't understand them, send them to me: gallery @ mcgalliard.freeuk.com |
|
dds
Joined: 2003-02-09
Posts: 37 |
![]() |
Help l just installed Joans new mod to my gallery and even did a fresh install with here version and l get this error how do l correct this Fatal error: Call to undefined function: getvoterclass() in /home/sites/site59/web/modules/gallery/util.php on line 1462 l have set permissions on all the folder and did follow the install but still doesnt work any help would be appreciated thanks dds |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
That function should be in classes/Album.php. Have you got the right version with that in it? |
|
dds
Joined: 2003-02-09
Posts: 37 |
![]() |
Thanks Joan for responding this is the version l downloaded from your previouse post in this section of the forum gallery.1.3.4-cvs-b15_vote.tar i unpacked it and FTP all the contents up and did a clean install setting all the folders to 777 and then ran the setup everything went well but when l go to creat a folder or add a folder it gives me this error is it possible l dont have the right version you mean if so where can l get it l seen this one in a previuse post that you had mentioned that it was a full install with the hack already applied .. and thank youy in advance for getting back to me so soon looking forward to hearing from you again . DDS :razz: ps sorry for my spelling it sucks l know ...lol :eek: |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
See, that's where my problem is. I just downloaded http://www.mcgalliard.org/content/gallery/gallery.1.3.4-cvs-b15_vote.tar.gz, unpacked it and tested it and it works fine. Something is corrupted in yours, and we need to find out what. Did you ftp the stuff in the classes directory to the correct place? I suspect you have up to date files in your gallery directory, but out of date ones in the subdirectories. |
|
daoist
Joined: 2002-08-22
Posts: 38 |
![]() |
i get ERROR: requested index [102] out of bounds [101] Fatal error: Call to a member function on a non-object in /home/picdump/public_html/gallery/classes/Album.php on line 762 here: http://picdump.dhs.org/gallery/daofunnynet?&page=3 it appears to happen only when trying to vote on the third page of the album, voting works on the first two pages. i've done the change described above to remove the line 90 error, but this persists. here is another album hosted on my site with voting turned on: http://picdump.dhs.org/gallery/forum |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
It's a bug! Good work. The fix is simple. Open view_album.php. Find this line: |
|
beaco
Joined: 2003-03-17
Posts: 5 |
![]() |
i am getting this error: Fatal error: Call to undefined function: isitemowner() in /gallery/reset_votes.php on line 39 where is this function located. I have V1.33 and have done a search but cannot find it. Is it a new function to 1.34? isowner function appears to works the vote button at the bottom of the page doesn't work either (ie. after thumbnails) - this is probably part of the same error. |
|
daoist
Joined: 2002-08-22
Posts: 38 |
![]() |
thanks for the quick reply. as soon as I can get internet connectivity back for my server from my school (long story) i'll apply the change and see how it works. |
|
npereira
Joined: 2002-09-24
Posts: 114 |
![]() |
2 questions. My first: What I mean is that I don't want to have to tell users that they need to press on "show polling". Can I make a certain album as show polling by default? My second: Thanks, This is exactly what I was looking for! YOU HAVE MADE MY DAY! Then I came here and found exactly what I needed. Installed it, and it works great! My only problem is that I don't want users to vote more than once per month. Regards, NPereira |
|
npereira
Joined: 2002-09-24
Posts: 114 |
![]() |
Hey I see alot of people having problems with there hoster not having shell or ssh access. Check this hoster out. They are GREATE and INEXPENSIVE ! I STRONGLY SUGGEST THESES GUY'S ! |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
npereira wrote:
2 questions. 1) Sure. Edit view_album.php and find if (!canVote()) { $showPolling=false; } else if (!isset($showPolling)) { $showPolling = $gallery->session->albumPolling[$gallery->album->fields["name"]]; if (!isset($showPolling)) { $showPolling = true; } } and replace it with if (!canVote()) { $showPolling=false; } else if (!isset($showPolling)) { $showPolling=true; } and delete else if (canVote()) { $adminCommands .= '<a href="'. makeGalleryUrl("view_album.php", array("set_albumName" => $gallery->session->albumName, "showPolling" => true)). '"><nobr>[show polling]</nobr></a>'; } 2) There's no date information recorded with the votes. You'd have to write it yourself. I'd just make only registered users allowed to vote, and have a new competition every month, but that's me. |
|
npereira
Joined: 2002-09-24
Posts: 114 |
![]() |
Hey Joan, How does the Voting/Polling work when you don't want a person to vote more than once per month. My poll properties are setup as 'everybody'. Is there a way to have it so no one can vote more than once per month? Please advise! |
|
nonamer66
Joined: 2003-05-26
Posts: 3 |
![]() |
joan, is there a version that only does voting/polling of the albums and not the photos? Also for it to possibly rank them in order of highest votes. thanks. |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
nonamer66 wrote:
joan, is there a version that only does voting/polling of the albums and not the photos?. No, but it could be written. Not high on my priorities nonamer66 wrote:
Also for it to possibly rank them in order of highest votes. It does that, within an album. |
|
daoist
Joined: 2002-08-22
Posts: 38 |
![]() |
I'd like to upgrade to 1.3.4-RC3, but the link to this patch seems to be dead. is there an updated version of this patch available? thanks. |
|
joan
![]()
Joined: 2002-10-21
Posts: 3473 |
![]() |
I've update the link on page one. But this is still a 1.3.3 patch, and I have not time table for upgrading it - though I hope to introduce a version in 1.3.5 |
|
npereira
Joined: 2002-09-24
Posts: 114 |
![]() |
joan wrote:
latest version is <!-- BBCode Start --><A HREF="http://www.mcgalliard.org/content/gallery/vote_release_candidate_0.9.1.zip" TARGET="_blank">vote_release_candidate_0.9.1.zip</A><!-- BBCode End --> Joan, Is this the lastest release of the vote candidate? Let me know if there is one better! Nelson |
|