Revision [12109]

This is an old revision of WikipediaAction made by RolandStens on 2005-12-05 23:35:35.

 

Wikipedia Action

Last edited by RolandStens
Mon, 05 Dec 2005 23:35 UTC [diff]


This action is meant to automatically incorporate http://wikipedia.org content in your pages.
To use it as a standalone action simply add for instance:
{{wikipedia topic="Workflow"}} in the page body.

Save the code below as actions/wikipedia.php.

The action

Current version: 0.1

Changes:

To do:



actions/wikipedia.php


<?php
    $topic = $vars['topic'];
    $file = file_get_contents('http://en.wikipedia.org/wiki/'.$topic);
    $file = str_replace('href="/', 'href="http://en.wikipedia.org/', $file);
    preg_match_all('#<!-- start content -->(.*?)<!-- end content -->#es', $file, $ar);
    unset($file);
    if (is_array($ar[1])) echo $ar[1][0];
    else echo '';
?>


Extracted and changed from:
Mediawiki MySite class DOCS (ver. 0.1.0)
AUTHOR: Piotr Maliński
Contact: riklaunim@gmail.com
Site: http://www.english.rk.edu.pl | http://www.cms.rk.edu.pl - Polish
License: GPL


There are 7 comments on this page. [Show comments]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki