The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

Board index Plugins I need a voting plugin, will pay

Creating and modifying plugins.
carl_galloway
Regular
 
Posts: 1328
Joined: Sun Dec 04, 2005 6:43 pm
Location: Andalucia, Spain

Postby carl_galloway » Thu Jan 17, 2008 9:40 am

Gee a lot has happened since my last worthless reply to this thread.

Gregman I'm loving what you've done with the plugin, it's been a long time coming, thanks dude.

You guys made a comment somewhere about modernising the code away from the old legacy stuff (a lot of which was written several years ago) and frankly has been the proverbial pain in the ass for any of us who have developed themes, often plugins are the worst culprit because none of them use the same bit of code, if you guys can update the html in the karma plugin away from the standard div filled with links to an unordered list that would be awesome, I think it would be a lot easier for us all if every plugin was standardised with lists instead of container divs. Heck it makes the html almost identical to our navbars which has got to be a good thing.

I've had a moment to test the plugin on my test server and I love the config options but I'd also like to see two other functions added if they're possible,

1. Make it possible to extend the karma voting period to all time. For me personally I'd prefer to see my all time votes instead of just articles upto x days after they were published.

2. I'd love to see a sidebar list of most popular entries, but not the current karma ranking which lists the author and their popularity, I'd prefer a list similar to the recent entries list but showing the top x number of popular entries.

Once again can't wait to see what the finished result will look like. Good work Gregman

User avatar
garvinhicking
Core Developer
 
Posts: 28954
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Thu Jan 17, 2008 4:11 pm

Hi!

I, too, can't sadly follow this whole thread because of very little time (work + s9y-book related).

However, I also love what you guys are up to. It will hugely increase the fun with entry voting.

Since it was me that introduced this legacy code: Feel free to drop it. IMHO an ordered list (even IMHO better than an unordered list) is semantecially much better than a simple div.

It might make styling a bit harder though, because margins/paddings are not so easily stackable than within a div if you want that to work cross-browser, as I remember.

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/

User avatar
Don Chambers
Regular
 
Posts: 3077
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA

Postby Don Chambers » Thu Jan 17, 2008 5:23 pm

carl_galloway wrote:2. I'd love to see a sidebar list of most popular entries, but not the current karma ranking which lists the author and their popularity, I'd prefer a list similar to the recent entries list but showing the top x number of popular entries.


Carl - there is a popular entries plugin that does exactly that.... and the method used to determine what is popular is selectable. It can be based on comment count, karma total and a few other things. Actually, that plugin desperately needs to be updated after this. I don't want to sidetrack this thread, but what would be sweet is the ability to factor in a few different things to determine what is popular.... the rating, hit count, # comments, etc, all factored in, possibly with some kind of weight scale the user could configure. I would also like to see the plugin have the ability to show most popular by month, year, and possibly all time. But, first lets get this one cleaned up!!! :wink:

User avatar
judebert
Regular
 
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL

Postby judebert » Fri Jan 18, 2008 1:38 am

Great job, everybody! I think we've got a mostly-complete graphical extension for our karma plugin. All that's left is to simplify that old legacy code, and maybe a little bit of formatting.

I'm finally making progress on the categorytemplate priority thing. I expect to have that done tomorrow; after that, I'll be happy to pick up gregman's latest mods and clean out the legacy cruft. We'll talk about the sidebar plugin some other time.

Are there any outstanding bugs I should be paying attention to while I'm at it? Anything that we know needs close attention?
Judebert
---
Website | Wishlist | PayPal

User avatar
Don Chambers
Regular
 
Posts: 3077
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA

Postby Don Chambers » Fri Jan 18, 2008 6:56 pm

Jude - thanks for taking on the task of cleaning up the legacy code. You have a lot of experience doing that with s9y plugins, so I'm sure this will be right up your alley!! I don't envy you though!!! :o)

User avatar
judebert
Regular
 
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL

Postby judebert » Fri Jan 18, 2008 8:04 pm

There's a lot of spaghetti and redirection. Nevertheless, I think I'm making pretty good progress. I should have something soon.
Judebert
---
Website | Wishlist | PayPal

carl_galloway
Regular
 
Posts: 1328
Joined: Sun Dec 04, 2005 6:43 pm
Location: Andalucia, Spain

Postby carl_galloway » Fri Jan 18, 2008 8:16 pm

Hey Jude, that's great news, this particular feature has been asked for so many times in the past so I'm really pleased to see this plugin getting so much attention right now. I downloaded the latest version on Gregman's site and I'm really impressed that it works well in IE6 as well, and getting rid of that legacy code is a major step forward - sorry garv
:D

User avatar
garvinhicking
Core Developer
 
Posts: 28954
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Fri Jan 18, 2008 8:50 pm

Hi!

judebert wrote:There's a lot of spaghetti and redirection. Nevertheless, I think I'm making pretty good progress. I should have something soon.


Do you mean that javascript redirection? That was added to prevent bots like Google etc. to "hit" a voting.

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/

User avatar
judebert
Regular
 
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL

Postby judebert » Tue Jan 22, 2008 9:48 pm

No, although I'll keep that in mind as I sweep through it. I'm thinking "redirection" in the way that a variable will be assigned a value, which isn't used, but instead added to a string, which is then used in an sprintf(); you can't figure out what the output will be unless you redirect your attention repeatedly to different lines.

Several variables seem to go through multiple transformations before they're finally used. I'm going to try to simplify that, so you can easily tell where a variable is assigned its final value and what's going to be output.
Judebert
---
Website | Wishlist | PayPal

User avatar
garvinhicking
Core Developer
 
Posts: 28954
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Wed Jan 23, 2008 12:06 pm

Hi Judebert!

Ah, okay. I see. I generally use this when I want to keep string modifications as performance-low as possible. But deal with this as you see fit. :)

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/

User avatar
judebert
Regular
 
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL

Postby judebert » Thu Jan 24, 2008 4:30 pm

I recently got a question about my progress, and figured I should let everyone know what I'm up to.

I got sidetracked by the categorytemplates plugin. I'm back to working on the karma plugin now.

My first step was some code formatting and documentation. Then I uploaded it to my site for a test. The existing karma bar disappeared.

This is the same problem I had with the categorytemplates plugin: upgrading wasn't fully tested. I'm dealing with that, then I'll move on to the rest of the cleanup.
Judebert
---
Website | Wishlist | PayPal

User avatar
Don Chambers
Regular
 
Posts: 3077
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA

Postby Don Chambers » Thu Jan 24, 2008 4:40 pm

No apologies necessary for delays caused by working on the category templates plugin!!!

User avatar
judebert
Regular
 
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL

Postby judebert » Mon Jan 28, 2008 10:33 pm

My status as of right now:

I've simplified a lot of the code. (It no longer generates the HTML for every possibility, but only for the one that it's actually going to use). I've bypassed a lot of the sprintf() calls, which I've determined to be a PHP performance hog.

I'm working on getting a graphical preview for all the available rating bars in the plugin configuration. (You have to use the "css_backend" hook for the admin page, not the "css" hook. I feel like an idiot for allowing that to take up so much of my time.)

Once I've got that, I'm going to do some more cleanup, then add a config item for a minimum number of votes before the rating is displayed (and possibly something similar for visits).

Then I think I'll be done. Any comments?
Judebert
---
Website | Wishlist | PayPal

User avatar
garvinhicking
Core Developer
 
Posts: 28954
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Tue Jan 29, 2008 11:07 am

Hi!

I've simplified a lot of the code. (It no longer generates the HTML for every possibility, but only for the one that it's actually going to use). I've bypassed a lot of the sprintf() calls, which I've determined to be a PHP performance hog.


IMHO "performance hog" is really relative. You usually don't have millions of sprintf() calls on a page, where this would really take impact.

IMHO the worth of better readability and clarity of sprintf, when many variable placements are involved, is worth the slight drawback.

But since you planned on improving the plugins code readability, I'm sure you found a good solution to this :)

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/

User avatar
judebert
Regular
 
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL

Postby judebert » Wed Jan 30, 2008 5:48 pm

garvinhicking wrote:IMHO the worth of better readability and clarity of sprintf, when many variable placements are involved, is worth the slight drawback.

But since you planned on improving the plugins code readability, I'm sure you found a good solution to this :)


Boy, I sure hope so. The original code made a huge format string, often including pieces from other sprintf() calls. Then it used an sprintf() with 6 parameters -- which we expanded to 11 to include all the link descriptions!

At this point, I'm leaving the sprintf() calls that are already in language files, so we don't have to retranslate them. But I'm axing the giant sprintf() and replacing it with something more understandable.

The original code also generated all the possible HTML (including sprintf() calls) and then printed only the one it needed. That's been optimized to only create the HTML when it's required.

I'm currently doing my real, paying job; but when I get any free moments, I go back to the karma plugin. I've got it displaying a preview of the available rating bars on its config page, which I'm hashing out with Don. I've also got it using graphics on an upgrade without changing the configuration.

The big problem at the moment is the alignment. The plugin defaults to flush-right; it was easy enough for templates to change that just by styling the text-align. But text-align doesn't apply to the tags we have to use for a graphical rating bar.

I'm going to program something that checks the stylesheet and styles the graphics accordingly. That should create a result that matches the template's intention 90% of the time. I'll probably add an override in the plugin configuration, too, so anybody who gets a default result he doesn't like can just go configure the plugin.

Don and I are also having a usability discussion that we'll likely bring into the forums, too. It's about the text used to indicate the current karma. If we keep the current textual rating, it tells the total karma points. That's pretty confusing if you just voted "5 stars" and the total only goes up by 2. But if we change the rating system to show an average, then an article voted "worst" five times gets 5 total points, and an article voted "good" once only gets four points. The "popular entries" plugin would have to be changed to understand that. No good solution yet, so we're skipping the display (Greg's solution) and working on other stuff for now.

SO: progress. Slow but steady. Big things in the works. Development version on display at my website.
Judebert
---
Website | Wishlist | PayPal

PreviousNext


Return to Plugins

Who is online

Users browsing this forum: No registered users and 0 guests