Creating and modifying plugins.
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
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.
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!!!
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?
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!!! )
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
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.
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.
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.
No apologies necessary for delays caused by working on the category templates plugin!!!
Voting plugin status
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?
Re: Voting plugin status
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
Re: Voting plugin status
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.
Who is online
Users browsing this forum: No registered users and 0 guests