I need a voting plugin, will pay
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Very great news! Guess I can start counting my dollars then!
Regards,
Garvin
Very great news! Guess I can start counting my dollars then!
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Hi again,
I think, I'm done. You can have a look at the new karma_plugin diamond style at http://www.boerse-aktien-geld.de. It's far from being perfect, but it's works. Changing the images is possible, but related to some work (creating the images, renaming the images (adding the score into the filename!), changing the js and css file). Maybe you wonder about the size of the diamonds. Well I like them big
But don't expect to much! As I'm not into Ajax, the plugin is not as user friendly as the wp one.
Any suggestions welcome!
Greg
I think, I'm done. You can have a look at the new karma_plugin diamond style at http://www.boerse-aktien-geld.de. It's far from being perfect, but it's works. Changing the images is possible, but related to some work (creating the images, renaming the images (adding the score into the filename!), changing the js and css file). Maybe you wonder about the size of the diamonds. Well I like them big
Any suggestions welcome!
Greg
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
I like that! Care to share some code to show us what you modified? Preferrable a unified diff, or the full file(s)?
Regards,
Garvin
I like that! Care to share some code to show us what you modified? Preferrable a unified diff, or the full file(s)?
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Hi,
sure, where shall I put it? Finishing the plugin kept me from falling asleep the last view nights. It shouldn't be for nothing. I won't be able to show you every line of code I modified or added, because my discipline in commenting my code is not very well grown. But I can tell you what I did:
Greg
sure, where shall I put it? Finishing the plugin kept me from falling asleep the last view nights. It shouldn't be for nothing. I won't be able to show you every line of code I modified or added, because my discipline in commenting my code is not very well grown. But I can tell you what I did:
- 1.Changed the vote range to 1 to 5.
2. Created four different images (grey diamond, yellow diamond, half yellow half grey diamond, green diamond)
3. Gave each of the 5 diamonds a different id.
4. Wrote an css file to get the right diamonds in place.
5. Created a new javscript file in order to get them glowing
6. Added both files in the frontend header
7. Changed the calculation of the karma_points to fit the scale (I didn't want to change the database, so I decided to calculate the points in variation of the user votes with a 5 step rounding: 0, 5, 10, 15, ..., 50)
8. Created static images to display at the frontpage for acceleration reasons
9. Made lots of other changes to get the plugin working.
Greg
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Sure, as I offered, I'm willing to add in a donation - do you have a paypal account? Then I could donate money so that the plugin can be contribued to serendipity. I think carl will/might drop his dollars in as well, and then you could post the files somewhere on your blog or on http://nopaste.php-q.net so that we can view and add them?
Best regards,
Garvin
Sure, as I offered, I'm willing to add in a donation - do you have a paypal account? Then I could donate money so that the plugin can be contribued to serendipity. I think carl will/might drop his dollars in as well, and then you could post the files somewhere on your blog or on http://nopaste.php-q.net so that we can view and add them?
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Hi,
na, you missunderstood me. I will contribute the plugin to s9y being rewarded or not (this is, what makes it open source, right?). On the other hand: "Christmas presents" are always welcome! I don't have a paypal account, but set up an amazon wishlist (see the signature).
best regards
Greg
BTW: I will post a zip file on my blog.
na, you missunderstood me. I will contribute the plugin to s9y being rewarded or not (this is, what makes it open source, right?). On the other hand: "Christmas presents" are always welcome! I don't have a paypal account, but set up an amazon wishlist (see the signature).
best regards
Greg
BTW: I will post a zip file on my blog.
Last edited by gregman on Fri Dec 14, 2007 4:20 pm, edited 2 times in total.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Maybe you'd like to setup a paypal account? Your wishlist-items are actually a bit higher than what I can donate right now.
Tell us when you'Ve posted the plugin on your blog!
Regards,
Garvin
Ah, okay. But it would've been fine if you wanted to be rewarded first. That was, what this thread was about.na, you missunderstood me. I will contribute the plugin to s9y being rewarded or not (this is, what makes it open source, right?). On the other hand: "Christmas presents" are always welcome! I don't have a paypal account, but set up an amazon wishlist (see the signature).
Maybe you'd like to setup a paypal account? Your wishlist-items are actually a bit higher than what I can donate right now.
Tell us when you'Ve posted the plugin on your blog!
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Great job. What is the javascript for? The reason I ask is I am wondering if some simple image map, combined with background and foreground images might get the job done, but perhaps not.
Something I see as critical is the ability to use different images, which also means different sized images, without the need to need to modify the plugin or js. But perhaps suggestions would be better made after everyone has had an opportunity to review the actual code.
One other thing - the "popular entries" plugin can work in conjunction with the karma plugin. Have you tested these 2 together to see what, if any, impact your calculation has on the popular entries?
Again - great job!!
Something I see as critical is the ability to use different images, which also means different sized images, without the need to need to modify the plugin or js. But perhaps suggestions would be better made after everyone has had an opportunity to review the actual code.
One other thing - the "popular entries" plugin can work in conjunction with the karma plugin. Have you tested these 2 together to see what, if any, impact your calculation has on the popular entries?
Again - great job!!
=Don=
Hi,
I posted the zip file (serendipity-event_karma_ds.zip) on my blog http://www.boerse-aktien-geld.de. I also created a payppal account (paypal (at) boerse-aktien-geld (dot) de).
Best regards
Greg
I posted the zip file (serendipity-event_karma_ds.zip) on my blog http://www.boerse-aktien-geld.de. I also created a payppal account (paypal (at) boerse-aktien-geld (dot) de).
Best regards
Greg
Last edited by gregman on Fri Dec 14, 2007 5:10 pm, edited 1 time in total.
Thanks for the compliment. Actually the karma plugin already contained javascript (in the plugin itself, not in an external file) and I thought it would be better for future improvements (e.g. ajax).Don Chambers wrote:Great job. What is the javascript for?
Sorry, I had no time to test the plugin substantially. But it propably might work, as I didn't change the database...
Greg
UPDATE:
I did some minor changes. Especially the loading time of the green diamond when "hovering" the diamonds for the fist time was a thorn in my side. Therefore the green diamond is loaded in in the background of an empty div container when loading the entry site. Sorry for this hack, but I didn't find a pure css solution for the interactivity even after hours of searching. Further I experienced some difficulties with IE 5.x. The voting action of the karma plugin (the text based one too) wasn't working. So I changed the javascript href code into pure html href. But as I can't imagine why Garvin preferred the javascript solution, this might to be revoked.
Greg
I did some minor changes. Especially the loading time of the green diamond when "hovering" the diamonds for the fist time was a thorn in my side. Therefore the green diamond is loaded in in the background of an empty div container when loading the entry site. Sorry for this hack, but I didn't find a pure css solution for the interactivity even after hours of searching. Further I experienced some difficulties with IE 5.x. The voting action of the karma plugin (the text based one too) wasn't working. So I changed the javascript href code into pure html href. But as I can't imagine why Garvin preferred the javascript solution, this might to be revoked.
Greg
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
I have not reviewed it yet, but I promise to do so within the next day. The good news is that a lot of people were interested in this plugin, so you should be able to get a lot of quality feedback quickly (subject to everyone's availability, of course!).
Just like I mentioned before though - a key issue from my perspective is to be able to replace the images as mindlessly as possible... which includes the size of the images I don't like big!
Maybe bulletproof has a couple of concepts that could be utilized here. First, we have the ability to detect any filename that ends in a certain naming convention. We use this to "see" available colorset stylesheets so a user can select one. Perhaps there is a concept there you can take advantage to allow users to select images with a particular naming convention that happen to be available in the plugin folder.
Something else we do is to switch the default xml icon, which is usually orange, with a colorset-specific version. This is as simple as hiding the foreground image and applying our desired background image.
Not sure if any of this can work for you, but thought I would mention it.
Just like I mentioned before though - a key issue from my perspective is to be able to replace the images as mindlessly as possible... which includes the size of the images I don't like big!
Something else we do is to switch the default xml icon, which is usually orange, with a colorset-specific version. This is as simple as hiding the foreground image and applying our desired background image.
Not sure if any of this can work for you, but thought I would mention it.
=Don=
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
I just had a very minor, quick review. Some notes:
1. Try to use "(int)$serendipity['GET']['id']" when you use it like in the frontend_header place, else you might be subject to SQL injection
2. Use propper array access: Instead of $diamond[0][points] you need to use $diamond[0]['points'] (quotes around non-numerical array indices are else first interpreted as constants, which costs performance and looks strange)
3. Try to concatenate echo strings like "echo $var1 . $var2 . $var3" instead of "echo $var1, $var2, $var3" to keep the coding style consistent with other s9y code. Also, proper indenting (4 spaces, no tabes) is a nice thing to have
. Also use { and } even if they're optional, and use breaks after that (especially in files like diamondstyle.*.php)
4. Instead of emitting your own stylesheet through diamondstyle.css.php you could use the existing "css" event hook in the plugin api to inject the things you need to have. The less additional HTTP calls, the better.
5. In your diamondstyle.js.php use htmlspecialchars() around $_SERVER['PHP_SELF'] as well, else you'Re subject to XSS attacks.
6. You can simplify your javascript a lot, to someting like this:
Then you could emit that javascript inline in the karma plugin, also removing another external PHP file that would need calling. 
7. Instead of creating a new plugin for using the image-style voting, you could add a plugin option to choose between the old s9y method and your new one?
As I wrote above - those are minor details. I like the general direction and I believe it could greatly enhance this plugin!
Regards,
Garvin
I just had a very minor, quick review. Some notes:
1. Try to use "(int)$serendipity['GET']['id']" when you use it like in the frontend_header place, else you might be subject to SQL injection
2. Use propper array access: Instead of $diamond[0][points] you need to use $diamond[0]['points'] (quotes around non-numerical array indices are else first interpreted as constants, which costs performance and looks strange)
3. Try to concatenate echo strings like "echo $var1 . $var2 . $var3" instead of "echo $var1, $var2, $var3" to keep the coding style consistent with other s9y code. Also, proper indenting (4 spaces, no tabes) is a nice thing to have
4. Instead of emitting your own stylesheet through diamondstyle.css.php you could use the existing "css" event hook in the plugin api to inject the things you need to have. The less additional HTTP calls, the better.
5. In your diamondstyle.js.php use htmlspecialchars() around $_SERVER['PHP_SELF'] as well, else you'Re subject to XSS attacks.
6. You can simplify your javascript a lot, to someting like this:
Code: Select all
function glow(rating) {
for (i = 1; i <= rating; i++) {
document.getElementById('serendipity_karmaVoting_link' + rating).style.backgroundImage = 'url(<?php echo dirname($_SERVER['PHP_SELF']) ; ?>/img/<?php echo $glow_image; ?>)';
}
}
7. Instead of creating a new plugin for using the image-style voting, you could add a plugin option to choose between the old s9y method and your new one?
As I wrote above - those are minor details. I like the general direction and I believe it could greatly enhance this plugin!
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Hi,
many thanks for your suggestions.
1. - 3. done
4. Can you tell me, how to get the entryid in the css event hook? $serendipity['GET']['id'] seems not to be set in there.
5. done
6. Sorry, I tried to lessen the code, but it did not work, i.e. it didn't show the same glowing effect. To me putting the script-code into the karma_plugin is not very search engine friendly, but surely will work.
7. Due to the different calculation of the points that won't make much sense
Regards
Greg
many thanks for your suggestions.
1. - 3. done
4. Can you tell me, how to get the entryid in the css event hook? $serendipity['GET']['id'] seems not to be set in there.
5. done
6. Sorry, I tried to lessen the code, but it did not work, i.e. it didn't show the same glowing effect. To me putting the script-code into the karma_plugin is not very search engine friendly, but surely will work.
7. Due to the different calculation of the points that won't make much sense
Regards
Greg