"Refreshing" a category page via MediaWiki program calls

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

"Refreshing" a category page via MediaWiki program calls

Hugh Prior
I have a page Alpha, which contains a "Category: X" link, but the "Category:
X" page does not have the page Alpha listed on it.  When I edit the page
Alpha then the "Category: X" page correctly lists the Alpha page.  My
question: how can I force, with MediaWiki calls, an update of the category
links.  I have tried with the following code to even check if the category
links are OK, but this does not seem to work.  Thanks for any ideas.

$pageName = "Alpha";
$title = new Title();
$title = $title->newFromText($pageName);

$linkCache = new LinkCache();
$linkCache->preFill($title);

$catLinks = $linkCache->getCategoryLinks();

print_r($catLinks, "catLinks");



_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: "Refreshing" a category page via MediaWiki program calls

Rob Church
If it's the one page, just null-edit it (hit edit, then save without
making a change). If it's multiple pages, run the refreshLinks.php
command line script in the maintenance dir. to update all the link
tables.


Rob Church

On 17/02/06, Hugh Prior <[hidden email]> wrote:

> I have a page Alpha, which contains a "Category: X" link, but the "Category:
> X" page does not have the page Alpha listed on it.  When I edit the page
> Alpha then the "Category: X" page correctly lists the Alpha page.  My
> question: how can I force, with MediaWiki calls, an update of the category
> links.  I have tried with the following code to even check if the category
> links are OK, but this does not seem to work.  Thanks for any ideas.
>
> $pageName = "Alpha";
> $title = new Title();
> $title = $title->newFromText($pageName);
>
> $linkCache = new LinkCache();
> $linkCache->preFill($title);
>
> $catLinks = $linkCache->getCategoryLinks();
>
> print_r($catLinks, "catLinks");
>
>
>
> _______________________________________________
> MediaWiki-l mailing list
> [hidden email]
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: "Refreshing" a category page via MediaWikiprogram calls

Hugh Prior
I know that when I do it manually all have to do is null-edit the page.

I will check out the refreshLinks.php; I may well be able to use that.
Thanks.

In seems to me though that "refreshLinks.php" is a batch approach.  If I
know the actual page which needs the category links fixing is there though a
direct function I can call?  I see the "fixLinksFromArticle" in
"refreshLinks.inc".  This I suppose would do it.  But is this the normal way
that a page during a manual null-edit would ensure that it's links are up to
date?  If not, what functions do the updating?

"Rob Church" <[hidden email]> wrote in
message news:[hidden email]...
> If it's the one page, just null-edit it (hit edit, then save without
> making a change). If it's multiple pages, run the refreshLinks.php
> command line script in the maintenance dir. to update all the link
> tables.



_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: "Refreshing" a category page via MediaWikiprogram calls

Rob Church
Those would, if I recall, be in the Article class...


Rob Church

On 18/02/06, Hugh Prior <[hidden email]> wrote:

> I know that when I do it manually all have to do is null-edit the page.
>
> I will check out the refreshLinks.php; I may well be able to use that.
> Thanks.
>
> In seems to me though that "refreshLinks.php" is a batch approach.  If I
> know the actual page which needs the category links fixing is there though a
> direct function I can call?  I see the "fixLinksFromArticle" in
> "refreshLinks.inc".  This I suppose would do it.  But is this the normal way
> that a page during a manual null-edit would ensure that it's links are up to
> date?  If not, what functions do the updating?
>
> "Rob Church" <[hidden email]> wrote in
> message news:[hidden email]...
> > If it's the one page, just null-edit it (hit edit, then save without
> > making a change). If it's multiple pages, run the refreshLinks.php
> > command line script in the maintenance dir. to update all the link
> > tables.
>
>
>
> _______________________________________________
> MediaWiki-l mailing list
> [hidden email]
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l