(Created page with 'This is a list of tips and tricks I use on various WikiMedia that I run. Unless noted, this applies to the <tt>1.15.1 – 2009-07-13</tt> version. = Disable links = On [[L…')
 
(Disable links)
Line 5: Line 5:
 
= Disable links =
 
= Disable links =
  
On [[Laussywiki]], you can't follow a red-link (that refers to a page that still does not exist). If you try to force your way, you will be blocked by login permissions. But normal users do not get distracted in opening a page that tells them it does not exist and that they cannot create it. The link, however, exists, to inform it will/should appear at some point.
+
On [[Laussywiki]], you can't follow a red-link (that refers to a page that still does not exist), unless you're Elena or myself. If you try to force your way, you will be blocked by login permissions. Regular users do not get distracted in opening a page that tells them it does not exist and that they cannot create it. The link, however, exists, to inform it will/should appear at some point and brings light on how the authors structure their thoughts.
  
 
This is achieved by patching ''Linker.php'', c. Line 287:
 
This is achieved by patching ''Linker.php'', c. Line 287:
Line 18: Line 18:
 
}
 
}
 
</pre>
 
</pre>
 +
 +
We added the line that adds <pre>onclick="return false;"</pre> to the <tt>a</tt> tag, which prevents unlogged users to go further.

Revision as of 18:55, 15 November 2009

This is a list of tips and tricks I use on various WikiMedia that I run.

Unless noted, this applies to the 1.15.1 – 2009-07-13 version.

Disable links

On Laussywiki, you can't follow a red-link (that refers to a page that still does not exist), unless you're Elena or myself. If you try to force your way, you will be blocked by login permissions. Regular users do not get distracted in opening a page that tells them it does not exist and that they cannot create it. The link, however, exists, to inform it will/should appear at some point and brings light on how the authors structure their thoughts.

This is achieved by patching Linker.php, c. Line 287:

		# Get a default title attribute.
		if( in_array( 'known', $options ) ) {
			$defaults['title'] = $target->getPrefixedText();
		} else {
		  $defaults['title'] = wfMsg( 'red-link-title', $target->getPrefixedText() );
		  if ( $wgUser->isLoggedIn() ) { $defaults['onclick'] = "return false;"; }
		}
We added the line that adds
onclick="return false;"
to the a tag, which prevents unlogged users to go further.