![]() |
|
Image Rating Tutorial - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Image Rating Tutorial (/thread-1044.html) Pages:
1
2
|
Image Rating Tutorial - thinkdreams - 2007-01-04 Rating Hack Tutorial:
HEAD Section Image Rating Tutorial - jayray999 - 2007-01-04 Good work but it does not work for me.
Image Rating Tutorial - thinkdreams - 2007-01-04 @jay- since it was a hack made by a zenphoto poster whose site was down for others, and I grabbed it, i figured i'd post it. but i can't guarantee it works in everyone's implementation, since I haven't tested it at all on anyone's install. everyone else is welcome to post here and help us work out the bugs, as I'm sure there are some. You may try initializing the SQL table with some data first, before voting. It does mention something about that in the readme file. Image Rating Tutorial - jayray999 - 2007-01-04 No problem, but I will post anyway if someone has an idea. I made some changes but no luck so far. I ran a new SQL query 'CREATE TABLE This ran and then I initialized by running. 'INSERT INTO The paths seem ok to me. Everything runs fine (i.e. no errors) except the vote does not register!! Image Rating Tutorial - jayray999 - 2007-01-04 Also what does this paragraph in the README file mean? I did away with the INSERT statement, because someone could get the db.php href and alter that (though not the rating or the IP) to add a new line into your db. I couldn't figure out a decent way to check that. So, at least for now, any new raters placed on a page have to be entered in your db manually, before votes can be registered to that id. Is this the source of my troubles? Image Rating Tutorial - jayray999 - 2007-01-04 Yup, it is the insert and initialize thing. So I added the following line into the _drawrating.php file and all is well!!!! After the line: $query=mysql_query("SELECT total_votes, total_value, used_ips FROM $tableName WHERE id='$id' ")or die(" Error: ".mysql_error()); Add: if (mysql_num_rows($query) == 0) { And it works. Of course, on this forum I can never get code to show up accurately so I don't know but believe me this works. Of course I wonder if the original reason for avoiding the INSERT command in favor of manual insert is still valid. Any thoughts anybody? Image Rating Tutorial - jayray999 - 2007-01-04 Just to give credit where it is due...here is the big forum on how to use this rating system: http://www.masugadesign.com/the-lab/scripts/unobtrusive-ajax-star-rating-bar/ Comment number 12. WaxOr is what helped. Others have done things like most popular etc. Image Rating Tutorial - thinkdreams - 2007-01-04 @jay- did you do line #4 on my tutorial? I noted that in the drawrating file, I had to COMPLETELY hardcode the URL to get it to work:
Thus, http://www.thinkdreams.com/zenphoto/themes/thinkdreams_photoblog would be what I would use in my case. That might be causing your issue. Image Rating Tutorial - thinkdreams - 2007-01-04 sorry, i was composing my response after you had posted, and I didn't refresh.... Glad to see it working. Image Rating Tutorial - jayray999 - 2007-01-04 So do you think the INSERT INTO $tableName solution is a bad idea? If so, I might try your URL instead of SERVER PATH suggestion. BTW, thanks a lot for everything. Now for some cool icons...I think the stars (starrating.gif) are much nicer but they come with a rectangular white background block that does not take kindly to transparency. On the masugadesign.com page they tell you how to design custom icons. Image Rating Tutorial - thinkdreams - 2007-01-04 if you look in the images dir, i started on a psd template of my own that i use, that you can model from if you like. Image Rating Tutorial - SubJunk - 2007-01-04 Great stuff guys, with all the changes in this discussion it works perfectly! Image Rating Tutorial - jayray999 - 2007-01-04 Oh great. Very thoughtful. Image Rating Tutorial - jayray999 - 2007-01-04 I just tried without the INSERT mod and even with a complete URL and manual database initialization it does not work for me. So back to INSERT and all that comes with it. Image Rating Tutorial - thinkdreams - 2007-01-05 hmm. what i can't understand is why some installations it works, and on some it doesn't. seems to be ok for subjunk. @subjunk, is there anything possibly different about your install that you could share that might help jayray out? and mod_rewrite is off right now on yours jayray right? Image Rating Tutorial - jayray999 - 2007-01-05 No mod_rewrite is ON. I thought you dismissed that as a possible cause. Anyway, as long as the INSERT command is not terribly insecure I don't mind running it so. Image Rating Tutorial - jayray999 - 2007-01-05 No mod_rewrite is ON. I thought you dismissed that as a possible cause. Anyway, as long as the INSERT command is not terribly insecure I don't mind running it so. Image Rating Tutorial - thinkdreams - 2007-01-05 mod_rewrite needs to be off. then it should work. (at least from what i've found). since most people's 1.0.6 installations are going to be non-mod_rewrite to use subalbums anyway, I assumed where I should have explicitly stated it in the instructions. I apologize for that oversight. Try it without mod_rewrite just for kicks. The problem is that the db.php call in the drawrating file is coded for a specific url and parameters, and it will get messed around with mod_rewrite. There may be a way to fix it in the mod_rewrite statements but I'm not sure how to go about that. Image Rating Tutorial - jayray999 - 2007-01-05 Ok. I will experiment and let you know. Image Rating Tutorial - thinkdreams - 2007-01-05 Cool. Thanks Jay for testing too. |