Re: Extension:AllBooks
Raffaele <[email protected]>
| Newsgroups | gmane.org.wikimedia.textbook |
|---|---|
| Message-ID | <op.t9tc42n9xb4ju7@kaloo> |
First of all, thanks for your replay and your suggestions. > CC'ing to Wikitech-l. Some more review: > > * The way NUMBEROFBOOKS is calculated (scanning the page namespace) is > not acceptable, performance-wise. It needs to work like > NUMBEROFPAGES, etc., with a site_stats row or similar. OK, I'll learn how use caching :-D > * The allbooks-regex message might not be a great way of doing things: > ** Since results will have to be stored in various ways, like the > count being stored in site_stats, it's probably not feasible to change > the regex used without running a maintenance script. A config option > might therefore be better. > ** Directly inputting the regex into a query is VERY VERY BAD! It's > an immediate SQL injection attack. Also, it will cause the query to > break in the presence of things like single quotes. Use > Database::addQuotes() here. Ok i'm going to correct it > * Generating AllBooks using a REGEXP query is . . . maybe not ideal, > altogether. Usually we have a flag in the table, for instance, > page_is_redirect. It might be okay given that you'd "just" be > scanning a few times as many rows, in the average case, and only for > views of a certain special page. But a flag would be nice. What do you mean? A "is_book" flag? I saw that exists the a kind of "is supbage" flag but unfortuately not every Wikibooks use the subpage convention :( > * If you're using the Xml functions, you don't have to use > htmlspecialchars explicitly. It will double-escape the variable. > * Variable names that are in Italian are kind of funny, but not really > in accordance with our coding standards. :) $conta -> $count, > $numero -> $number Yes, it was a beta, I'll fix them (italian was for developing :D ) > > This is only a quick glance, mind you. I haven't actually tested it > and probably won't find the time to do so. > > Overall, I'm not sure this is the best way to tackle the problem. Has > Wikibooks considered, for instance, having the books' "main pages" be > in the main namespace, and the various pages be in a namespace like > "Page"? Then the problem is partly solved right away: you can use > Special:AllPages set to the main namespace to get a list of books. > For NUMBEROFBOOKS, you just need PAGESINNAMESPACE to be enabled, which > is fairly feasible at some point if someone's willing to do a little > optimization work, since it's a generally-requested feature. I think it is not very intuitive -- the real content should be in the main namespace. The best thing would be that each Wikibooks followed the subpages naming convention (book title/chapter). IT may be a multilingual policy or something like that. By the way, is there any developer who can help me? I have knowledge of PHP but i'm not a very great mediawiki developer. It would be better having some help by any expert developer, mostly for caching and other advanced stuff :-). --Ramac > > On Thu, Apr 17, 2008 at 5:33 PM, mike.lifeguard > <[email protected]> wrote: >> If you remember back in November we were asked what would be on a >> technical >> wishlist for Wikibooks. One of the things we said[2] we wanted was a >> way to >> list all books & enumerate them (all *books* as opposed to all pages). >> Ramac >> and Pietrodn have been working on an extension[2] which does this. >> >> >> >> Darklama and I have taken an initial look at things, and Simetrical >> found >> one error that has been corrected. Anyone who is technically-minded is >> invited to review & test the code. Everyone else is invited to discuss >> improvements. >> >> >> >> The extension is documented at mediawiki.org, but here's a quick >> overview >> for the sake of convenience: >> >> *Adds the {{NUMBEROFBOOKS}} variable >> >> *Adds [[Special:AllBooks]], which lists all books in specified >> namespaces >> >> *List books beginning at some prefix using ?offset=whatever >> >> *The regex used to determine what is a book and what isn't is a system >> message, so administrators may edit it, though the default should work >> for >> most (all?) Wikibooks languages >> >> >> >> After this much time with apparently no interest in developing >> anything for >> Wikibooks it's exciting to finally see such active development on >> something >> needed specifically for this project. Many thanks to Ramac and >> Pietrodn for >> their work, and also those who have helped them along the way. >> Hopefully >> this is the beginning of a trend, and more tools will be developed to >> fulfill our wishlist! >> >> >> >> -Mike.lifeguard >> >> >> >> >> >> [1] >> http://lists.wikimedia.org/pipermail/textbook-l/2007-November/001164.html >> >> [2] http://www.mediawiki.org/wiki/Extension:AllBooks >> >> >> >> _______________________________________________ >> Textbook-l mailing list >> [email protected] >> https://lists.wikimedia.org/mailman/listinfo/textbook-l >> > > _______________________________________________ > Textbook-l mailing list > [email protected] > https://lists.wikimedia.org/mailman/listinfo/textbook-l -- Creato con il rivoluzionario client e-mail di Opera: http://www.opera.com/mail/