Creating and modifying plugins.
I'm getting closer! I've just run into my first difficult problem!
The voting doesn't work well with permalinks.
If you're voting from the extended article of a permalinked page, you get returned to the front page. If the article is still on the front page, its voting bar is placed at the top. Your vote still gets recorded.
I was expecting to be returned to the permalinked page, with the voting bar at the top.
I think the problem is the URL of the voting link. It's created by appending "&serendipity[karmaVote]=X&serendipity[karmaID]=Y#karmaVoteY" to the original URL. The karmaVote and karmaID are still used, and the #karmaVoteY moves you to the voting bar.
Unfortunately, on a permalink page, the url looks like this:
While the relevant RewriteRules, at the very bottom of the .htaccess, are:
RewriteRule ^index\.(html?|php.+) index.php [R=permanent,L,QSA]
RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA]
RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]
I'm not certain, but I think the first one of that three is picking up the URL. We are pointing to index.php.+, so we're getting redirected to index.php, right? (My address bar still points to the full URL, and all the voting links are still pointing to the full URL, too.)
When I do this from a non-permalinked article, it works as expected.
In the code, I get the URL with serendipity_currentURL(). Is there a better way to get the URL of the current page, for my purposes?
But when I vote
http://judebert.com/wasted_youth/index. ... erendipity[karmaVote]=2&serendipity[karmaId]=204#karma_vote204
I *do* get back to the extended article page?
Ah, you meant "Custom Permalinks" using the plugin.
Are you already using the version I updated yesterday? Actually I believe the fix I applied will also fix your problem.
And for more images, be sure to see this forum entry: http://board.s9y.org/viewtopic.php?t=12300
I just installed the new plugin and I am speechless!
Just some few suggestions:
was missing in the german language files.
Further I experienced some problems with word rating switched on. The word-rating doesn't match to a negative given vote. This probably is caused by the integer converting (e.g. integer of -2 + 0.5 = - 1!). Therefore I removed this line and switched the following code to
Ah, good idea. (I guess I never had any entries rated below "Okay". ) No need to truncate to an integer. Why didn't I think of that?
I'll have that checked in about 10 minutes from now.
And thanks! You contributed the impetus to get this moving; I'm glad you're impressed with the result!
I just thought about the problem with the custom permalink plugin. Wouldn't it help to use $_SERVER['REQUEST_URI'] on every entry with an .htm/l ending, e.g.
It works fine on my installation.
That would create trouble on servers without URL rewriting cause it would then use index.php?/archives/permalink.htm?blabla with two "?"s.
I would like to see some enhancements in the plugin:
* It would be nice to have the voting implemented as AJAX calls, so we don't have to reload the page for this.
* An option to disable the page call counter, if the visitor is just voting, proviewing or comitting a comment.
Is there something we can do about it?
About the German language files: I already changed them in the cvs. It seems my last changes didn't reach judebert, so they didn't made it into the cvs.
Re: Enahncement wishes
I'll look into it and see what I can do.
An interesting idea. It should be possible: just check for the appropriate fields and refuse to increment the visit counter if they're present.
I thought I included those. If you send them again, I'll be happy to re-commit them.
Re: Enahncement wishes
I recently managed to do this using jquery but the "ajax call" feature only supports imagevoting and no voting timeouts. If it seems to be of use anyhow let me know. I will share some code.
Who is online
Users browsing this forum: Google [Bot] and 2 guests