Extension talk:PageAfterAndBefore

Any ideas on how to link to the previous or next page? When I surround a –  command in , it somehow displays as a heading:


 * you could try the latest version; get it here. Jean-Lou Dupont 23:59, 23 August 2007 (UTC)

Trouble with usage
Could you give an example of how to insert this into a wiki page? I don't understand the instructions. I've tried:

And all I get is the final page within that category. Help?
 * The brackets  mean optional parameters.
 * Some examples:
 * Jean-Lou Dupont 11:44, 15 November 2007 (UTC)
 * Jean-Lou Dupont 11:44, 15 November 2007 (UTC)
 * Jean-Lou Dupont 11:44, 15 November 2007 (UTC)

MySQL problem with apostrophes (RESOLVED)
Whenever I try to use this extension on an article that has an apostrophe in the title, the saved page displays the following error message:


 * A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:


 * (SQL query hidden)


 * from within function "". MySQL returned error "1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[title of article after the apostrophe]')=-1 AND `wiki_categorylinks`.cl_to = 'Tran' at line 1 (mysql.[my database])".

Do you know how this can be fixed?

Thanks.
 * Many thanks to you! I had forgotten to 'escape' properly the parameters before passing them to the DB layer -> potential for SQL injection attacks. I have fixed the issue in v1.0.2. Just do pear upgrade mediawiki/pageafterandbefore (assuming you are using PEAR). Jean-Lou Dupont 16:36, 20 November 2007 (UTC)

filtercurrent?
After looking through the code (although I am not fluent in PHP) and what documentation there is, I am baffled as to the actual functionality of the filtercurrent parameter.

If I set filtercurrent=yes in a call to firstpage on the first page of the category, it has the same behavior as if filtercurrent is not set.

It appears that filtercurrent is supposed cause firstpage to do nothing if it is called on the first page of the set. Instead, it always returns the name of the first article in the set, no matter what.

What am I not understanding? —Twisted86 08:08, 21 December 2007 (UTC)
 * I have added some clarifications text on the main page. Hope this helps. Jean-Lou Dupont 14:03, 21 December 2007 (UTC)

Thanks for the clarification. So, filtercurrent is supposed to do what I thought it was supposed to. Unfortunately, if I call #firstpage on the first page of the set, it returns the name of the article regardless of what filtercurrent is set to be.

A bug perhaps? Thanks. —Twisted86 22:15, 21 December 2007 (UTC)
 * Somewhat ;-) The format of the article title was the database one (i.e. with the underscores instead of the spaces). I have changed this to the normal article title format. Please try it out in version 1.0.3. Jean-Lou Dupont 00:44, 22 December 2007 (UTC)
 * Oooppss... I think I broke something in the process... please wait for my signal before trying 1.0.3. Sorry! Jean-Lou Dupont 01:19, 22 December 2007 (UTC)

DEFAULTSORT
The extension gets confused when there is a page with a magic word in use. The page in question behaves just fine, but the next page after it does not link properly. —Twisted86 09:54, 21 December 2007 (UTC)


 * I've looked succinctly at the MediaWiki parser code but I can't really figure out (in two minutes) what would be the expected behavior if I were to add support for DEFAULTSORT; what would be yours? Jean-Lou Dupont 14:08, 21 December 2007 (UTC)

Fair enough. I would expect PAAB to respect DEFAULTSORT, so that articles in a given category would be ordered by PAAB as follows:

What presently happens is that Bar nexts to Fubar and Foobar prevs to Fubar, but calling #pagebefore or #pagenext in Fubar returns immediately with no article name (#firstpage and #lastpage work just fine).

Thanks for the speedy reply. —Twisted86 22:01, 21 December 2007 (UTC)
 * I am still unclear on how I am going to address this limitation (if at all). It seems to me I would need to perform more processing on the database on each call to the parser function. If I get sufficient demand for this feature, I'll consider implementing it. Jean-Lou Dupont 00:47, 22 December 2007 (UTC)

If I knew more about PHP programming and MySQL, I'd make an intelligent suggestion. I think I can come up with a wiki-kluge in the meanwhile. Thanks. —Twisted86 01:52, 22 December 2007 (UTC)

apostrophes and parentheses
I hate to be the squeaky wheel, but calls to #pageafter and #pagebefore where the article has an apostrophe ( ' ) in the title or where the article has parentheses in the title return empty.

The calls are in a template that is transcluded into the page in question. The page name is being passed to #pagebefore/after using. —Twisted86 22:42, 21 December 2007 (UTC)
 * I believe I have addressed this bug in version 1.0.3 available right now in SVN/PEAR. Please try it out and let me know. Jean-Lou Dupont 00:45, 22 December 2007 (UTC)
 * Oooppss... I think I broke something in the process... please wait for my signal before trying 1.0.3. Sorry! Jean-Lou Dupont 01:20, 22 December 2007 (UTC)

Okay. Just post here when you're ready. Thanks! —Twisted86 05:58, 23 December 2007 (UTC)