|
Re: blog extension: msg#00168org.wikimedia.mediawiki
Sorry for not answering so quickly, YOUR ENTRIES My extension should work for you independently of the namespace (as Rowan stated) You just have to make in your entry: - a [[Category:Blog]] link and - a link to the frontpage of your blog (let's call it John_Blog) And then, with <blog>cat=Blog<blog> or <blog>page=John_Blog;cat=Blog<blog> in your John_Blog page, you should see all the entries. That's the good news. LIMITS: Now, if you want to have entries only ten by ten, it's fairly easy (well, I suppose :-)): just add the sql instruction for limits (don't forget to make a sort by ID before):let's call them $from and $to (beware, in the Special:Allpages, $from refers to the name of the page, I will use the number) global $wgUseCategoryMagic, $wgUser,$wgParser,$parserOptions,$wgTitle, $wgOut,$wgLinkCache,$from,$to; $ns = $wgRequest->getVal( 'ns' ); if(!isset($ns)) $ns = 0; $from = $wgRequest->getVal( 'from' ); if(!isset($from)) $ns = 0; $to = $wgRequest->getVal( 'to' ); if(!isset($to)) $to = 10; And the sql should look like: $sql = "SELECT cur_id,cur_namespace,cur_title,cur_text, cur_is_redirect FROM links,cur,categorylinks WHERE l_to={$lid} AND l_from=cur_id AND cl_from=cur_id AND cl_to='$cat' ORDER BY `cur_id` DESC LIMIT $from , $to"; LINKS: ask ROWAN :-) My problem is in the creation of the links: for all the entries (from 1to 10, 10to 20). How can I catch the number of entries, without making twice the query (one for counting, one for displaying)? Sorry, I'm in HR, php is just a hobby ;-) Hope it helps. François John Yu wrote: Thanks Rowan and Francois. |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: multi language mediawiki site: 00168, FxParlant |
|---|---|
| Next by Date: | page creation date: 00168, FxParlant |
| Previous by Thread: | Re: Re: blog extensioni: 00168, John Yu |
| Next by Thread: | Disable all caching?: 00168, Jesper Krogh |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |