Module: Ratings
jnash
Joined: 2004-08-02
Posts: 814 |
Posted: Tue, 2012-05-29 01:23 |
A simple photo ratings module - See full details here It can be found here
We need help from you, the community:
1) More hearts.png files - This is a weird file, and the PSD for photoshop is included
in the module zip file
It is a reverse transparent png (meaning only the center of the hearts are transparent)
We could use anything unique for our gallery!
These need to be same size/proportion/etc. as the the hearts.png for simplicity sakes
2) CSS needs to be tweaked to be more attractive. It's wrapped in a white box because
the hearts.png background is white. We're going to make this configurable, but still
need a more attractive solution.
3) A new module that uses that will use this data to allow viewing by
rankings / searching by ratings / etc.
Current issue working list: * Thanks! |
|
Posts: 27300
Not sure how you want to collaborate.
We should be able to rate videos as well.
ratings_block.php
if($item->is_photo()){
to
if ($item->is_photo() || $item->is_movie()){
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 27300
Found a star image.
I guess some admin setting to choose the type of image to use as we get more feedback.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 344
Fantastic!
There seem to be many open-source star icons we can use, I suppose that we can add our own star images if we edit the code?
Also, will albums be able to sort by star ratings?
Posts: 27300
post the star icons that you find that are similar to the ones in the images directory. Must be the same size/dimensions.
In the future we might be able to sort by ratings as well as a dynamic album.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 814
updated code... if you have suggestions on collaboration, let me know
Posts: 344
Guys , just curious...what's the purpose of the ratings module if you can't sort an album by it?
Posts: 814
skunker, to rate them of course!
Seriously though, did you read this above in the original post:
Posts: 344
Hi jnash,
Don't take my comment the wrong way. I love the new module you are working on and I will support you as much as I can. I was just wondering what happens after you rate the images. If there are new features you are working on, then I'll shut up Keep up the good work!
Posts: 27300
skunker and others:
so the more the community gives the more the community gets.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 27300
Some of the ideas that I have came up with:
http://codex.gallery2.org/Gallery3:Modules:ratings#Development
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 814
I'm not taking it the wrong way, I just meant that we have to walk before we can run! Thanks for the feedback.
James
Posts: 814
Dave, I've made the 'hearts' image configurable... (sort of, still working it - framework done though)
However, the images you provided above are not drop in replacements, the image is off when displayed. However, I see that there are vars that must be set for the image being used on the msteigerwalt page. This may be difficult to code in if they aren't drop-in replacements...
EDIT: it appears that the CSS would need modification as well if the images are swapped out. UNLESS the images are exact in dimensions (including the 'hearts')...
So this should be added into the CSS part of the TO-DO's
We really need a collaborative space for this...
* The ratings.css and bottom of ratings.js both define where/how the icon image is placed and 'filled'
* Should the 'search and sorts' be included in this module, or the search module modified/updated? I'm think this module as an 'option' in the blocks displayed.
Posts: 814
NOTES GOING FORWARD: I bumped the version to 2, however, keep in mind that since quite a few things changed, the module should be completely removed and then reinstalled to get everything back on track...
Posts: 27300
I figured one might be close. I was really hoping the community that has barked and barked so long for a module like this, that at least one member of this community would step up with the skills we don't have to do a simple image or two.
I will stop my rant now.
I think that we should just use images that are the same dimensions to fit in the existing method for now.
@search: I don't think at this time. Just a dynamic album first and then sorting of albums later.
I think that getting more images (see above community) will further the deployment of this module in dark themes.
@collaboration: I will let you be the prime and I'll give code snippets as needed. I'll send you a email address as well. JUst keep the codex version up to date so I can work on the most recent version, unless you want to do a git gallery-contrib. I'm open to anything you want.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 344
if you guys give me a chance, I'll help out. This has been the busiest week for me thus far of the year. Stand by!
Posts: 814
Great, thanks!
Dave, I added all the frameworks for the customization of the image and the word used (heart) in the text.
So, we're set once we get some images to work with.
I'm freezing things on my end for now, so feel free to go to town.
James
Posts: 344
Here are some custom stars I made. Just need to know what size they need to be for this module and how to implement them.
Posts: 8339
if interested http://css-tricks.com/star-ratings/
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 27300
skunker, What we need is images like the one provided 100x300px.
If you can make files similar to:
gallery/modules/ratings/vendor/img/hearts.png
with stars and not hearts with a white background.
with stars and not hearts with a black background.
with hearts with a black background.
all the same dimensions following this as a general guideline:
[img]http://gallery.menalto.com/files/hearts-diagram.png[/img]
Thanks!
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 344
Thanks Dave, will work on that tonight.
Posts: 76
I hope you guys get this to work as I really like this idea.
Fingers crossed.
Keep up the great work!
Posts: 814
I did this icon up real quick as a drop-in replacement for hearts.png
Filmstrip
[img]http://codex.gallery2.org/images/5/59/Filmstrip.png[/img]
- also -
[img]http://codex.gallery2.org/images/3/35/Filmstrip-blk.png[/img]
- also -
[img]http://codex.gallery2.org/images/9/98/Filmstrip-gry.png[/img]
Posts: 814
I also modified the css a bit to make things appear a bit better with the iconsets...
So, new version up on the codex.
Posts: 76
New version is much easier to install. Thanks.
It comes up in the modules list as Ratings and is Version 4. I still cant get it to work. I see the text under the photo saying
"Ratings
Click on a heart to cast your vote:
0/5 s (0 vote)"
But I don't see any hearts and there is no-where to click. Have I missed something or done something wrong?
Cheers
Posts: 814
Doh, made a mistake on version in the installer... I'll fix that and re-upload.
Also, ensure that the directory is owned and readable by the webserver user. This may be why the hearts aren't showing up. (I re-did the perms in the zip as well, but double check)
Bumped to v5 for a minor fix on display...
Posts: 76
Now have V5 thanks. Permissions set in the rating directory and sub albums and files to 777 - is that what you meant?
Still no hearts to click
Posts: 814
hmmm
Will have to troubleshoot somehow, let me think about it a bit.
See if you can see them by browsing to:
http://yourgalleryurl/modules/ratings/vendor/img/hearts.png
Posts: 76
jnash - a couple of things.
Yes, if I browse to that folder I can see the image.
I should say that I have 4 websites with gallery installed - all are 3.0.2. but they have different themes, modules etc
I have been trying your module on my own StAndrews theme and having limited success.
Just tried it on another site using left & right wind and I get the text with an area to drag the mouse over where I assume the hearts should be. There is a dragable area which changes colour but when I click in the area - I get a busy icon but nothing seems to happen.
Sorry about this.
Maybe other folk are having more success ?
You are doing great work. I have the utmost admiration for people who can write modules.
Cheers (and goodnight)
Posts: 814
One more piece, and maybe we can solve the first part: Go to your Admin->settings->advanced and tell me what you have for ratings/iconset
I don't think it's a 3.0.2 issue, but we'll get there.
Posts: 27300
It is a SQL issue.
mysql_query("select * from vars where module_name = 'ratings' and name = 'iconset'");
returns nothing for me as I have a table prefix.
I was thinking making this a UI admin setting like:
[img]http://gallery.menalto.com/files/Admin_movie_overlay.png[/img]
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 814
floridave, awesome catch on the error, fixed, and re-uploaded corrected - still v5 though, so reinstall.
shug17: redownload and reinstall
I like the UI design, now I just need to incorporate it. That's next I suppose.
Posts: 76
Blimey! do you guys never sleep? lol!
Sorry to say the new update is still not working - I still can't see the hearts. They are there in the folder - I can browse and see them there but they just do not show up on the photo page.
The module is nearly working on the left&right wind theme but is working less well on StAndrews theme.
I wish I could help!
Posts: 48
Same problem here, I've just installed the latest version of the add-on but the images won't show up in my gallery - I've tried both hearts and stars, located under photo or in sidebar. The text appears but nothing to click on. I am on Gallery 3.0.2.
I am very excited about this add-on and can't wait to get it to work! Sorry I am no good with graphics so I can't be of much help here
Posts: 814
I'm wondering if this is a g3 3.0.2 issue. I can't ascertain what could possibly be wrong here.EDIT: I found a couple more db selects that weren't prefixed properly. Fixed and re-uploaded. Try this ver and see if it's still broke, and if so, please check your admin->settings->advanced and tell me what you have set for ratings->iconset
Thanks
Ver 6 up - these fixes and adds initial support for iconset selection.
Posts: 48
The value for 'iconset' is
http://gallery.ronankeatingnews.com/index.php/modules/ratings/vendor/img/hearts.png
Looking at it, I just realised that the 'index.php/' is what makes the URL incorrect - the image is at
http://gallery.ronankeatingnews.com/modules/ratings/vendor/img/hearts.png
I think that's it. In the source code of a gallery item page, I can see it uses the incorrect URL as background image in the <style> information.
Another thing I've noticed is that when I set the rating to show in the sidebar, the ratings block displays twice.
Posts: 76
Hello,
I see the changes in the settings menu but nothing has changed when I got to the photo page - still no graphic on the StAndrews Theme and only a coloured bar on the wind left&right theme.
I am going to attach some grabs from the one website that is working better which uses the wind left&right theme.
Hope this helps.
Gonna go try it on one more gallery install with another different theme.
Posts: 76
Me again!
tried v6 on a third gallery installation using a themroller theme and I get the block under the photo but no graphic or coloured dragable block.
I attach a screen grab showing what comes up.
Hope this is all helping?
Posts: 48
Check out the URL to the rating image in the source code of your page.... Perhaps the path in your gallery is wrong like it is in mine?
Posts: 76
I will if you point me towards where I am looking.
Thanks
Posts: 814
Okay, jusie, excellent catch. I think I can account for this in the code and make appropriate corrections. Give me a bit to work with it.
Posts: 814
Jusie, new file uploaded, give this one a shot. It removes the 'index.php' from the img URL
Shug, I'm not sure what the issue is with yours, the URL looks good from your screenshot. Does it work on the wind theme? Also, what browser are you using? And, do you have a link to your website? (You can 'write to author' below to send it to me privately if you want)
Posts: 48
Open the source code by right clicking anywhere on your page and in the context menu there is an option to show the source code. Search the HTML file for e.g. 'rabidRating' and you will find a bit that starts with <style> and contains a background image URL for the rating.
Posts: 48
Just downloaded and installed v6 - I think it removes the complete URL, not just 'index.php', lol!
HTML source now contains:
Feel free to have a look at the source to see the 'ratingurl' that was constructed in my gallery.
http://gallery.ronankeatingnews.com/index.php/fanpics/2012/0205_melbourne/sam057
Posts: 76
here is a link to the website with the wind left&right theme - the one that is nearly working.
http://seangroat.co.uk/gallery3/index.php/animals/13437
I am using Firefox 12.0
Best wishes
Posts: 814
Okay, give v7 a try, if not, I'm going back to the drawing board for a while to rethink this out. This plugin is a pain to modify for gallery unfortunately.
Posts: 814
I think I'm going to just rewrite the entire thing here soon. We're using a JS module from a third party, and it's integration into the gallery is a real PITA... I think if the functionality is brought in to a true G3 module, we may be better off.
Posts: 344
I held off on doing any design work because I couldn't get it to work on my default theme. Also, the PSD was confusing. Jnash, let us know how we can help. Thanks,
Posts: 48
Sorry to hear this is turning out to be so difficult =/
I can try the latest version out tomorrow. But I guess if it is easier to start from scratch and create a clean new add-on, that might be the better option.
Posts: 76
Dinna do anything rash!
It appears to be working on the wind left&right theme - the hearts are there and they change colour - just waiting to see if the database records it.
Nope - the wee icon keeps spinning round and never stops.
You are so close!!
Posts: 814
Think we got the image bug fixed up. Also found another instance of a bad url with index.php in it causing vote not to succeed.
shug17, give v8 a shot.
I've not given up yet, cause I can't find another good alternative to this script. Maybe I just need a break from it for a bit.
Let's cross our fingers.
Skunker, take a look at filmstrip.png and you'll get a better idea now hopefully on the graphics... Only thing to remember is the center of the 'star' needs to be transparent, and if I got this right,
2px side border, [20pxL x 20-30pxH star, 2px divider](x5 stars) and then 2px side border -- all this centered on a 100Hx300W background <- hopefully this makes some sense...