![]() |
|
modification of rating-Plugin - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: Plugins (https://forum.zenphoto.org/forum-6.html) +--- Thread: modification of rating-Plugin (/thread-9664.html) |
modification of rating-Plugin - the_griffin - 19-02-2012 Hi, I run Zenphoto 1.2.2 for a very long time successfully including a modification of the rating-plugin. This modification did a replacement of the user-IP by an user-ID (integer value) which I got from my MyBB-forum settings. This is necessary because our forum has several users with different user-IDs but the same IP. On the other side I don't want to get the same user being able to rate an image again and again by using a different IP. After upgrading to PHP5.3 I had to upgrade Zenphoto as well and tried to integrate my ID-modification for the rating plugin again. However, it seems that something at the rating plugin changed fundamentely. I have been trying to get rid of this problems by several weeks but didn't succeed. Therefore, I would be very glad to get any hints how to exchange the IP by an integer value (user-ID) again at the rating plugin. Thank you very much in advance. modification of rating-Plugin - acrylian - 20-02-2012 Sorry, 1.2.2 is so old that I don't even remember what was different back then. IF you want to us e the same users on your forum and on your Zenphoto install you should take a look at federated_logon plugin instead. modification of rating-Plugin - the_griffin - 20-02-2012 Hi acrylian, Thank you very much for your answer. I don't blame you for not remembering about this old version... I suppose that your proposed plugin might be too much for my purpose. The gallery can be accessed by logged in users only and upload of image and creating albums is restricted to admins. It was charming to avoid the user-IP and using their ID instead. Therefore I intend not to work with var_dump($ip) shows that the user-ID is existing but it seems that the update.php doesn't get it. Any help would really much appreciated as the gallery is really amazing and most welcome in my forum. modification of rating-Plugin - acrylian - 21-02-2012 Sorry, I cannot dig into this specific problem. The data is submitted via ajax so you might need to add something. modification of rating-Plugin - the_griffin - 21-02-2012 Thank you for your reply, acrylian. However, I think that ajax only submitts the stars rating value but not the IP. Or am I wrong? modification of rating-Plugin - acrylian - 21-02-2012 Haven't looked at it for quite some time but it does use the IP. It has however an option to hash the IP as storing purely it is considered a privacy issue in countries of the EU. So maybe you have enabled that. modification of rating-Plugin - the_griffin - 21-02-2012 When using the IP, what is not my intention, the database shows this entry: Nevertheless, is the IP-hash done by zenphoto and if yes, where could I find the setting for this? modification of rating-Plugin - sbillard - 21-02-2012 You want the The latter is fixed in the nightly build tonight. Of course, this will not help in the situation you describe as it simply hashes the IP address so that the paranoid EU cannot complain. You will need to replace the modification of rating-Plugin - the_griffin - 22-02-2012 I am not sure what you mean with "Disguise IP", sorry. As described above, replacing the getUserIP() function in the rating plugin was my original intention and the way I how I did it in the 1.2.2 zenphoto version. I inlude the global variables from the MyBB software to be able to read the uid of the user by using I tried to use modification of rating-Plugin - sbillard - 23-02-2012 Well, as I said the Replacing the modification of rating-Plugin - the_griffin - 23-02-2012 Thank you for your reply. As far as I see there are two getUserIP() calls to replace. One in the rating.php and one in the upgrade.php. I have enabled the gallery sessions as well. Are you able to tell me if I need to set session_start() in these two files as well or will be I am still hoping to get rid of the problem by myself.... modification of rating-Plugin - sbillard - 23-02-2012 Zenphoto will do the However, sessions can expire, etc. This depends on PHP settings. Your other option is to store the user id in a cookie. That does not require sessions, thus does not need the gallery sessions option. modification of rating-Plugin - the_griffin - 28-02-2012 I guess, I am going to lose this battle....
I can't get it work..... modification of rating-Plugin - sbillard - 29-02-2012 I am not exactly sure what your problem is:
modification of rating-Plugin - the_griffin - 29-02-2012 Thank you for your patience, sbillard! I really appreciate it. I hope to be able to explain where my problems are. For the lines 'a:1...' and 'a2:...' I understand you explanation. Line a1 shows the first rating of user 1 and line a4 shows the last rating of user 6 (including the rating of users 1, 3, 4 [b]and[/b] 6). A user with ID 5 has not rated any image. modification of rating-Plugin - sbillard - 29-02-2012 Well, I really do not know what to say. The database items you show are serialized arrays of what is stored as the voters. They translate as follows. (The array index is the voter, the value is the vote.) a:2:{i:1;d:5;i:3;d:3;}array a:3:{i:5;s:1:"4";i:3;s:1:"4";i:4;d:5;}array a:4:{i:5;s:1:"4";i:3;s:1:"4";i:4;d:5;i:6;d:2;}array modification of rating-Plugin - the_griffin - 02-03-2012 Thank you everybody for supporting my request. My changed rating-system is working now! I guess I had some cache problems but now it seems that everything is fine. I will now move the zenphoto-gallery to my live system, hoping that everything will keep working as well.... Thank you again for all your assistance and last but not least your patience! |