Extension talk:WatchSubpages

From mediawiki.org
Latest comment: 14 years ago by Johnp125

I have the code working but I can't seem to get anything added to my watch list. Can I get an example or a step by step of how this is suppose to work? Thanks --Johnp125 20:55, 9 March 2010 (UTC)Reply

Answered my own question. This is a great extension but to get it working you have to make sure the $wgNamespacesWithSubpages = array_fill(0, 200, true); is in the localsettings.php file or something like it. Also this only works with something normally turned off in mediawiki which are subpages as the name applies. So all your pages will need to be redone. if you have a page like page is now has to be page/new page so when you are using the special:watchsubpages all the pages in the page will show up in a list of subpages. I think this is a very very good tool but I would like to see it with categories as well. Categories are used in wikis all the time and I think can be integrated much easier on most wiki configurations without having to update all the pages on your wiki.

--Johnp125 15:03, 10 March 2010 (UTC)Reply

How to use this extension[edit]

Hi, Prod.
I cannot find the item of Watchsubpages in the Special:Specialpages. Until I use the url http://127.0.0.1/mywiki/index.php/Special:Watchsubpages or make [[Special:Watchsubpages]] by myself. :-)--Roc michael 22:27, 21 May 2008 (UTC)Reply

It should be under the "Restricted Special Pages" heading, under the "other" subheading if you have 1.13. --Skizzerz 22:41, 21 May 2008 (UTC)Reply

What this does[edit]

I had to dig into the source to figure out what this does.

	/**
	 * Get a list of titles that are subpages of a given title, excluding talk pages,
	 * and return as a two-dimensional array with namespace, title and
	 * redirect status
	 *
	 * @param $guide GuideName
	 * @return array
	 */
	private function getPrefixlistInfo( $namespace = NS_MAIN, $guide ) {
		$prefixList = $this->getNamespaceKeyAndText($namespace, $guide);

		$titles = array();
		list( $prefixNS, $prefixKey, $guide ) = $prefixList;
		$dbr = wfGetDB( DB_MASTER );
		$res = $dbr->select( 'page',
			array( 'page_namespace', 'page_title', 'page_id', 'page_is_redirect' ),
			array(
				'page_namespace' => $prefixNS,
				'page_title LIKE \'' . $dbr->escapeLike( $prefixKey ) .'%\'',
			),
			__METHOD__,
			array(
				'ORDER BY'  => 'page_title',
				'USE INDEX' => 'name_title',
			)
		);

Ah. I suspect page_title LIKE clause is used to find pages with a common title prefix. A precise definition of "subpage" in the extension description would be valuable. - MaxEnt 20:58, 24 July 2008 (UTC)Reply

Sorry for the delayed response, but see Help:Subpages for a definition of what subpages are. --Skizzerz 04:45, 13 December 2008 (UTC)Reply

Watch all future subpages[edit]

Anyone want to extend this to let you watch all future subpages of a page? It looks like right now it just does a one-off 'subscription' to present subpages.

Permissions[edit]

This extension doesn't show up or work correctly in MW 1.15.1 unless you set the $wg permissions:

$wgGroupPermissions['user' ]['watchsubpages'] = true;

--Ccornell 09:48, 17 September 2009 (UTC)Reply