User:Addbot/Source

The following is automatically generated by Addbot.

Bot (bot.addbot.php)
&lt;?

//From http://toolserver.org/~chris/highlight.php?d=chris/classes/&amp;f=botclasses.php require 'bot.classes.php';

$wiki = new wikipedia; $wiki-&gt;url = 'http://en.wikipedia.org/w/api.php'; global $wiki;

$user = &quot;Addbot&quot;; $owner = &quot;Addshore&quot;;

require 'bot.password.php'; $wiki-&gt;login($user,$pass); echo &quot;USER: Logged In!\n&quot;; unset($pass); ?&gt;

talksubst/run.php
&lt;?PHP require '../bot.addbot.php';

//Get the list of templates and strip away the rubbish $awbutt = explode('expand the template(s) on the user talk page.',$wiki-&gt;getpage('Wikipedia:AutoWikiBrowser/User_talk_templates')); $awbutt = str_ireplace(']]',,str_ireplace('# ',,str_ireplace('# [[','|',ereg_replace (&quot;\n&quot;,'',$awbutt[1])))); //$awbutt = str_ireplace('&lt;noinclude&gt;&lt;/noinclude&gt;This page contains templates that AWB will automatically substitute on user talk pages as part of the AWB general fixes. Please make sure that general fixes are enabled, and this will be done when processing user talk pages. The MediaWiki API is used to automatically substitute and expand the template(s) on the user talk page.).','',$awbutt); $awbutt = explode('|',$awbutt);

//check each template foreach ($awbutt as $template) {	//Get the pages the template is found on	$pages = $wiki-&gt;getTransclusions($template); foreach ($pages as $page) {		//If it is a user talk page and is not a sub page if ( (strpos($page,&quot;User talk:&quot;) !== FALSE) &amp;&amp; (strpos($page,&quot;/&quot;) === FALSE) ) {			//Get the content and try to subst the template $content = $wiki-&gt;getpage($page); $content = str_ireplace(&quot;{{&quot;.$template,&quot;{{subst:&quot;.$template,$content); $content = str_ireplace(&quot;{{&quot;.str_replace(&quot;Template:&quot;,&quot;&quot;,$template),&quot;{{subst:&quot;.$template,$content); echo &quot;$page\n\r&quot;; $wiki-&gt;edit($page,$content,&quot;Bot: Substing template $template&quot;,true); }	} } ?&gt;

sandbox/run_clean.php
&lt;?PHP require '../bot.addbot.php'; require 'sandboxes.php'; global $wiki;

//Check all of the content sets for ($i = 1; $i &lt;= count($sandbox); $i++) { //And check each page for this content for ($j = 1; $j &lt;= (count($sandbox[$i])-1); $j++) { $page = $sandbox[$i][$j]; $content = $sandbox[$i][0]; if ($wiki-&gt;getpage($page) == $content) {						$wiki-&gt;edit($page,$content,&quot;Bot: Restoring $page&quot;,true); }       } }

?&gt;

sandbox/run_header.php
&lt;?PHP require '../bot.addbot.php'; require 'sandboxes.php'; global $wiki;

//Check all of the content sets for ($i = 1; $i &lt;= count($sandbox); $i++) { //And check each page for this content for ($j = 1; $j &lt;= (count($sandbox[$i])-1); $j++) { $page = $sandbox[$i][$j]; $content = $sandbox[$i][0]; if (strpos($wiki-&gt;getpage($page),$content) === FALSE) { $wiki-&gt;edit($page,$content,&quot;Bot: Restoring $page header&quot;,true); }       } }

?&gt;

sandbox/sandboxes.php
&lt;?

//Sandboxes $sandbox[1][0] = &quot;\n&lt;!-- Hello! Feel free to try your formatting and editing skills below this line. As this page is for editing experiments, this page will automatically be cleaned every 12 hours. --&gt;&quot;; $sandbox[1][1] = 'Wikipedia:Sandbox'; $sandbox[2][0] = &quot;\n&lt;!-- Hello! Feel free to try your formatting and editing skills below this line. As this page is for editing experiments, this page will automatically be cleaned every 12 hours. --&gt;&quot;; $sandbox[2][1] = 'Wikipedia_talk:Sandbox'; $sandbox[3][0] = &quot;\n&lt;!-- Hello! Feel free to try your formatting and editing skills below this line. As this page is for editing experiments, this page will automatically be cleaned every 12 hours. --&gt;&quot;; $sandbox[3][1] = 'Wikipedia:Tutorial (Editing)/sandbox'; $sandbox[3][2] = 'Wikipedia:Tutorial (Formatting)/sandbox'; $sandbox[3][3] = 'Wikipedia:Tutorial (Wikipedia links)/sandbox'; $sandbox[3][4] = 'Wikipedia:Tutorial (Citing sources)/sandbox'; $sandbox[3][5] = 'Wikipedia:Tutorial (Keep in mind)/sandbox'; $sandbox[4][0] = &quot;\n&lt;!-- Hello! Feel free to try your formatting and editing skills below this line. As this page is for editing experiments, this page will automatically be cleaned every 12 hours. --&gt;&quot;; for($i = 1; $i &lt;= 9; $i++){ $sandbox[4][$i] = &quot;Template_talk:X$i&quot;; } $sandbox[4][10] = 'Wikipedia talk:Tutorial/Editing/sandbox'; $sandbox[4][11] = 'Wikipedia talk:Tutorial/Formatting/sandbox'; $sandbox[4][12] = 'Wikipedia talk:Tutorial/Wikipedia links/sandbox'; $sandbox[4][13] = 'Wikipedia talk:Tutorial/Citing sources/sandbox'; $sandbox[4][14] = 'Wikipedia talk:Tutorial/Keep in mind/sandbox'; $sandbox[5][0] = &quot;&lt;noinclude&gt;\nThis sandbox is itself a template. This sandbox is for experimenting with templates.\n\n&lt;/noinclude&gt;\n\nIf you defined parameters such as &lt;tt&gt;&lt;nowiki&gt;&lt;/nowiki&gt;&lt;/tt&gt;:\n;First:\n;Second:\n;Name:\n\n&quot;; $sandbox[5][1] = 'Template:Template sandbox'; $sandbox[6][0] = &quot;&lt;noinclude&gt;\nThis sandbox is itself a template. This sandbox is for experimenting with templates.\n\n&lt;/noinclude&gt;\n\nIf you defined parameters such as &lt;tt&gt;&lt;nowiki&gt;&lt;/nowiki&gt;&lt;/tt&gt;:\n;First:\n;Second:\n;Name:\n\n\n&lt;!-- Hello! Feel free to try your formatting and editing skills below this line. As this page is for editing experiments, this page will automatically be cleaned every 12 hours. --&gt;&quot;; for($i = 1; $i &lt;= 9; $i++){ $sandbox[6][$i] = &quot;Template:X$i&quot;; }

?&gt;

sourcecode/run.php
&lt;? require '../bot.addbot.php';

$wiki-&gt;edit('User:'.$user.'/Source',       'The following is automatically generated by '.$user.&quot;.\n\n\n&quot;.		//&quot;==Classes (bot.classes.php)==\n\n&lt;pre&gt;&quot;.htmlentities(file_get_contents('../bot.classes.php')).&quot;&lt;/pre&gt;\n\n\n&quot;.        &quot;==Bot (bot.addbot.php)==\n\n&quot;.'&lt;pre&gt;'.htmlentities(file_get_contents('../bot.addbot.php')).&quot;&lt;/pre&gt;\n\n\n&quot;.		&quot;==Talksubst Bot==\n\n&quot;.		&quot;===talksubst/run.php===\n\n&lt;pre&gt;&quot;.htmlentities(file_get_contents('../talksubst/run.php')).&quot;&lt;/pre&gt;\n\n\n&quot;.		&quot;==Sandbox Bot==\n\n&quot;.        &quot;===sandbox/run_clean.php===\n\n&lt;pre&gt;&quot;.htmlentities(file_get_contents('../sandbox/run_clean.php')).&quot;&lt;/pre&gt;\n\n\n&quot;.		&quot;===sandbox/run_header.php===\n\n&lt;pre&gt;&quot;.htmlentities(file_get_contents('../sandbox/run_header.php')).&quot;&lt;/pre&gt;\n\n\n&quot;. &quot;===sandbox/sandboxes.php===\n\n&lt;pre&gt;&quot;.htmlentities(file_get_contents('../sandbox/sandboxes.php')).&quot;&lt;/pre&gt;\n\n\n&quot;. &quot;==Sourcecode Bot==\n\n&quot;. &quot;===sourcecode/run.php===\n\n&lt;pre&gt;&quot;.htmlentities(file_get_contents('run.php')).&quot;&lt;/pre&gt;\n\n\n&quot; ,'BOT: Automated source upload');

?&gt;