Extension:Add Article to Category

It is able to add an inputbox(for create new article) to each category page. The content of new page will contain "[[category:]]" automatically.

Install

 * 1) Download the extension at HERE or the section BELOW.
 * 2) Upload the articletocategory.php to your extensions/ directory.
 * 3) Add include("extensions/articletocategory.php"); to your LocalSettings.php file.
 * 4) Done

Update

 * 03/09 -- Fix a bug in the zip file, please download again.

CODE
 'Add Article to Category',    'description' => 'Your MediaWiki will get an inputbox on each Category page, and you can create a new article directly to that category',    'author' => 'Liang Chen The BiGreat',     'url' => 'http://www.liang-chen.com/myworld/content/view/36/70/' ); $wgHooks['EditFormPreloadText'][] = 'addcategory'; $wgHooks['CategoryPageView'][] = 'categorychange'; function addcategory(&$text) {	$cname = $_GET['category']; $wnew = $_GET['new']; global $wgContLang;

if ($wnew==1) {                $ns = $wgContLang->getFormattedNsText(NS_CATEGORY); $text ="Add Your Content Here\r\n\r\n$ns:".$cname.""; }	return true; }

function categorychange($catpage) {	$boxtext = "Create an Article in this category"; $btext = "Submit"; global $wgOut; global $wgScript; $Action = htmlspecialchars( $wgScript );

//$wgOut->addWikiText( "Test"); $temp2=<< function clearText(thefield){ if (thefield.defaultValue==thefield.value) thefield.value = "" } function addText(thefield){ if (thefield.value=="") thefield.value = thefield.defaultValue }

ENDFORM; $wgOut->addHTML($temp2); return true; } ?>

DEMO
I Don't Like Exams (MediaWiki 1.9.3)