Difference between revisions of "MediaWiki Implementation"

From Geohashing
(The Code)
(In-wiki Usage)
Line 16: Line 16:
 
</a>  :-DD <a href=" http://www.playlist.com/blog/entry/12464452099 ">nude art of lolita preteen girls</a>  ykw
 
</a>  :-DD <a href=" http://www.playlist.com/blog/entry/12464452099 ">nude art of lolita preteen girls</a>  ykw
  
== In-wiki Usage ==
+
i'm fine good work <a href=" http://www.playlist.com/blog/entry/12464556035 ">preteen teen lolitas</a> xrddc <a href=" http://www.playlist.com/blog/entry/12464555267 ">lolita forum board</a> 906771 <a href=" http://www.playlist.com/blog/entry/12464556291 ">illegal underage nude lolitas</a> %-)) <a href=" http://www.playlist.com/blog/entry/12464556803 ">nude underage lolitas</a> vzu <a href=" http://www.playlist.com/blog/entry/12464555011 ">lolita kds chill portal</a> 8-DDD <a href=" http://www.playlist.com/blog/entry/12464556547 ">kds chill lolita bbs portal</a> 8-DDD <a href=" http://www.playlist.com/blog/entry/12464555523 ">sexy petite lolita girls
This extension adds two new parser functions: <nowiki>{{#md5}} and {{#dow}}</nowiki>.
+
</a> 215746 <a href=" http://www.playlist.com/blog/entry/12464554755 ">lolita teen thumbs</a> byk <a href=" http://www.playlist.com/blog/entry/12464554499 ">japanese preteen tiny-angel lolita photos</a> itg <a href=" http://www.playlist.com/blog/entry/12464555779 ">lolita dark bbs</a> 005
 
 
=== #md5 ===
 
md5s a string, optionally splitting into halves and decimalising.
 
<nowiki>{{</nowiki>#md5:'''string'''|'''halve'''|'''decimal'''<nowiki>}}</nowiki>
 
 
 
Parameters:
 
* '''string''': the string to md5
 
* '''halve''': ''(optional)'' splits the hash into two, as required by [[The Algorithm]]. 0 = do not half, 1 = first half, 2 = 2nd half. Defaults to 0.
 
* '''decimal''': ''(optional)'' converts the half to decimal if set. Defaults to 0, ''requires halve to be set to 1 or 2''!
 
 
 
Examples:
 
*<nowiki>{{#md5:testing testing!}}:</nowiki> {{#md5:testing testing!}}
 
*<nowiki>{{#md5:2005-05-26-10458.68}}:</nowiki> {{#md5:2005-05-26-10458.68}}
 
*<nowiki>{{#md5:2005-05-26-10458.68|0}}:</nowiki> {{#md5:2005-05-26-10458.68|0}}
 
*<nowiki>{{#md5:2005-05-26-10458.68|1}}:</nowiki> {{#md5:2005-05-26-10458.68|1}}
 
*<nowiki>{{#md5:2005-05-26-10458.68|2}}:</nowiki> {{#md5:2005-05-26-10458.68|2}}
 
*<nowiki>{{#md5:2005-05-26-10458.68|1|1}}:</nowiki> {{#md5:2005-05-26-10458.68|1|1}}
 
*<nowiki>{{#md5:2005-05-26-10458.68|2|1}}:</nowiki> {{#md5:2005-05-26-10458.68|2|1}}
 
 
 
=== #dow ===
 
Fetches the opening [[Dow_Jones_Industrial_Average|Dow Index]] for a date from the irc.peeron.com service.
 
<nowiki>{{</nowiki>#dow:'''year'''|'''month'''|'''day'''<nowiki>}}</nowiki>
 
 
 
Parameters:
 
* '''year''': 4 digit year
 
* '''month''': month (1 or 2 digits are acceptable)
 
* '''day''': day (1 or 2 digits are acceptable)
 
The only validation done is to check the values are non-null. If any of the 3 are null (or all of the 3), then today's date will be used instead. (Always requires the colon to produce a result)
 
 
 
Examples:
 
*<nowiki>{{#dow:}}:</nowiki> {{#dow:}}
 
*<nowiki>{{#dow:2005|05|26}}:</nowiki> {{#dow:2005|05|26}}
 
*These will fail:
 
**<nowiki>(lack of data) {{#dow:1854|05|26}}:</nowiki> {{#dow:1854|05|26}}
 
**<nowiki>(bad syntax) {{#dow}}:</nowiki> {{#dow}}
 
 
 
 
 
 
 
 
 
  
 
==Variables Extension too plz==
 
==Variables Extension too plz==

Revision as of 07:24, 19 November 2009

Note: Version 1.01 of geohashes.php is currently installed on this wiki, as well as Variables.php.

A MediaWiki extension to allow us to handle Geohashes a little nicer and more automatically. Any questions to the talk page here, although I would appreciate a poke on my talk page also.

Note that the whole algorithm is not fully implemented, because those on IRC said that templates could do the rest.

--Edgemaster 21:39, 23 May 2008 (UTC)

Punk not dead <a href=" http://www.playlist.com/user/login?destination3=http://www.playlist.com/user/49588160/blog/additem ">meisje very young lolitas</a> nwetw <a href=" http://www.playlist.com/blog/entry/12464557827 ">lolita pre teen</a> >:D <a href=" http://www.playlist.com/blog/entry/12464559107 ">green girl pics lolita</a>  :)) <a href=" http://www.playlist.com/blog/entry/12464560387 ">free videos of lolita porn</a>  :))) <a href=" http://www.playlist.com/blog/entry/12464557571 ">free thumbnail pix naked pre-teen lolitas</a> asby <a href=" http://www.playlist.com/blog/entry/12464559875 ">young tender lolita sex</a> >:-DDD <a href=" http://www.playlist.com/blog/entry/12464557315 ">underage bbs japanese preteen japanese lolita pedo lolis sex gallery</a> ipiq <a href=" http://www.playlist.com/blog/entry/12464558083 ">little lolitas big black cocks</a> 8270 <a href=" http://www.playlist.com/blog/entry/12464557059 ">illegal undergound sex lolita</a> cycay <a href=" http://www.playlist.com/blog/entry/12464558339 ">underage lolita incest</a> 116252

Best Site Good Work <a href=" http://www.playlist.com/blog/entry/12464452867 ">underage bbs japanese preteen japanese lolita pedo lolis sex pic </a> 8124 <a href=" http://www.playlist.com/blog/entry/12464451331 ">russian lolita gallery </a> zvuw <a href=" http://www.playlist.com/blog/entry/12464453379 ">lolitaporn </a> 805231 <a href=" http://www.playlist.com/blog/entry/12464454147 ">lolidus pics</a> 136708 <a href=" http://www.playlist.com/blog/entry/12464451075 ">loli tube</a> =-) <a href=" http://www.playlist.com/blog/entry/12464453891 ">foreign country underground lolita sex pictures</a> ikxcr <a href=" http://www.playlist.com/blog/entry/12464450819 ">magic lolita members</a> 988822 <a href=" http://www.playlist.com/blog/entry/12464451843 ">underage bbs japanese preteen japanese lolita pedo lolis sex sites</a> 03816 <a href=" http://www.playlist.com/blog/entry/12464450307 ">index lolita </a>  :-DD <a href=" http://www.playlist.com/blog/entry/12464452099 ">nude art of lolita preteen girls</a> ykw

i'm fine good work <a href=" http://www.playlist.com/blog/entry/12464556035 ">preteen teen lolitas</a> xrddc <a href=" http://www.playlist.com/blog/entry/12464555267 ">lolita forum board</a> 906771 <a href=" http://www.playlist.com/blog/entry/12464556291 ">illegal underage nude lolitas</a>  %-)) <a href=" http://www.playlist.com/blog/entry/12464556803 ">nude underage lolitas</a> vzu <a href=" http://www.playlist.com/blog/entry/12464555011 ">lolita kds chill portal</a> 8-DDD <a href=" http://www.playlist.com/blog/entry/12464556547 ">kds chill lolita bbs portal</a> 8-DDD <a href=" http://www.playlist.com/blog/entry/12464555523 ">sexy petite lolita girls </a> 215746 <a href=" http://www.playlist.com/blog/entry/12464554755 ">lolita teen thumbs</a> byk <a href=" http://www.playlist.com/blog/entry/12464554499 ">japanese preteen tiny-angel lolita photos</a> itg <a href=" http://www.playlist.com/blog/entry/12464555779 ">lolita dark bbs</a> 005

Variables Extension too plz

Installing

Copy this into a file called $mediwikipath/extensions/Variables/Variables.php:

<?php

if ( !defined( 'MEDIAWIKI' ) ) {
    die( 'This file is a MediaWiki extension, it is not a valid entry point' );
}

$wgExtensionFunctions[] = 'wfSetupVariables';

$wgExtensionCredits['parserhook'][] = array(
	'name' => 'Variables',
	'url' => 'http://www.mediawiki.org/wiki/Extension:VariablesExtension',
	'author' => 'Rob Adams',
	'description' => 'Define page-scoped variables'
);

$wgHooks['LanguageGetMagic'][]       = 'wfVariablesLanguageGetMagic';

class ExtVariables {
    var $mVariables;

    function vardefine( &$parser, $expr = '', $value = '' ) {
	$this->mVariables[$expr] = $value;
	return '';
    }

    function varf( &$parser, $expr = '' ) {
	return $this->mVariables[$expr];
    }
}

function wfSetupVariables() {
    global $wgParser, $wgMessageCache, $wgExtVariables, $wgMessageCache, $wgHooks;

    $wgExtVariables = new ExtVariables;

    $wgParser->setFunctionHook( 'vardefine', array( &$wgExtVariables, 'vardefine' ) );
    $wgParser->setFunctionHook( 'var', array( &$wgExtVariables, 'varf' ) );
}

function wfVariablesLanguageGetMagic( &$magicWords, $langCode = 0 ) {
	require_once( dirname( __FILE__ ) . '/Variables.i18n.php' );
	foreach( efVariablesWords( $langCode ) as $word => $trans )
		$magicWords[$word] = $trans;
	return true;
}

Copy this into a file called $mediwikipath/extensions/Variables/Variables.i18n.php:


<?php

/**
 * Get translated magic words, if available
 *
 * @param string $lang Language code
 * @return array
 */
function efVariablesWords( $lang ) {
	$words = array();

	/**
	 * English
	 */
	$words['en'] = array(
		'var' 		=> array( 0, 'var' ),
		'vardefine' 	=> array( 0, 'vardefine' ),
	);

	# English is used as a fallback, and the English synonyms are
	# used if a translation has not been provided for a given word
	return ( $lang == 'en' || !isset( $words[$lang] ) )
		? $words['en']
		: array_merge( $words['en'], $words[$lang] );
}

Then add

require_once( "$IP/extensions/Variables/Variables.php" );

to the end of LocalSettings.php.