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']

if ($wnew==1) {		 $temp1 ="Add Your Content Here \n\n "; $text=$temp1; }	return true; }

function categorychange($catpage) {	$boxtext = "Create an Article to 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)