Jump to content

Topic on Extension talk:LiquidThreads

Solution: Exclude LiquidThreads from certain namespaces / avoid conflict with Wikilog

1
Kappa~mediawikiwiki (talkcontribs)

Here is a solution for excluding LiquidThreads 2.0 from certain namespaces and to avoid conflicts with other extensions such as Wikilog:

$IP/extensions/LiquidThreads/LiquidThreads.php: insert at the end of the file:

//Namespaces in which NOT to enable LQT
$wgLqtExcludeNamespaces = array();

$IP/extensions/LiquidThreads/classes/Dispatch.php: insert in the function isLqtPage ( $title ) (line 114) after the lines

		if ( !$title ) {
			return false;
		}

the following lines

// Ignore it if it's e.g. a blog,
// makes no sense to have LiquidThreads there.
	global $wgLqtExcludeNamespaces;
	if ( in_array( $title->getNamespace(), $wgLqtExcludeNamespaces ) ) {
			return false;
	     }

$IP/LocalSettings.php: now provides a variable for specifying the namespaces which are to be excluded from the LiquidThreads functionality. Example:

##LiquidThreads
require_once("$IP/extensions/LiquidThreads/LiquidThreads.php");
$wgLqtExcludeNamespaces[]=401;

## Wikilog
require_once( 'extensions/Wikilog/Wikilog.php' );
Wikilog::setupNamespace( 400, 'Blog', 'Blog_talk' );

According to this specification Wikilog creates the namespaces 400 ("Blog") and (implicitly defined) 401 ("Blog_talk"). For LiquidThreads namespace 401 is excluded. It thus can be used for the comment function of Wikilog

Tested with MW 1.19, MW 1.18 + LQT 2.0-alpha + Wikilog 1.2.0 Kappa (talk) 15:35, 17 July 2012 (UTC)

This post was posted by Kappa~mediawikiwiki, but signed as Kappa.

Reply to "Solution: Exclude LiquidThreads from certain namespaces / avoid conflict with Wikilog"