Viewing source code of m:BASH generator (download)
<?php
//include('/home/soxred93/public_html/common/header.php');
include('/home/soxred93/wikibot.classes.php');
require_once( '/home/soxred93/public_html/phptemp/PHPtemp.php' );
require_once( '/home/soxred93/public_html/phptemp/Language.php' );
require_once( '/home/soxred93/public_html/sitenotice.php' );
$phptemp = new PHPtemp( '/home/soxred93/public_html/templates/main.tpl' );
$language = new Language( array( "en", "ms" ) );
$lang = $language->getLang();
$langlinks = $language->generateLangLinks();
$phptemp->load_config( '/home/soxred93/public_html/configs/'.$lang.'.conf', 'main' );
$phptemp->load_config( '/home/soxred93/public_html/bash/configs/'.$lang.'.conf', 'bash' );
$http = new http;
$phptemp->assign( "header", $phptemp->getConf('rqfrom') . " <a href=\"http://meta.wikimedia.org/wiki/IRC/Quotes\">m:BASH</a>" );
$text = $http->get('http://meta.wikimedia.org/w/index.php?title=IRC/Quotes&action=raw&ctype=text/css', false);
$text = explode('<pre><nowiki>', $text);
$text = explode('</nowiki></pre>', $text[1]);
$text = explode('%%', $text[0]);
$text = substr($text[0], 2);
$text = htmlspecialchars($text);
$text = trim($text);
$text = preg_replace('/\n/', '<br />', $text);
$quotes = explode("%<br />", $text);
$endcontent = null;
if ( isset($_GET['id']) ) {
$endcontent = "<span style=\"font-family:monospace;\">".$quotes[$_GET['id']]."</span>";
$phptemp->assign( "page", $_GET['id'] );
}
elseif ( isset($_GET['showall']) ) {
foreach( $quotes as $id => $quote ) {
$endcontent .= "<h3>".$phptemp->getConf('quote')." # $id</h3>";
$endcontent .= "<span style=\"font-family:monospace;\">$quote</span>";
}
$phptemp->assign( "page", $phptemp->getConf('abq') );
}
else {
$rand = rand(0, count($quotes));
$endcontent .= "<h3>".$phptemp->getConf('quote')." # $rand</h3>";
$endcontent .= "<span style=\"font-family:monospace;\">".$quotes[$rand]."</span>";
$phptemp->assign( "page", $phptemp->getConf('rbq') );
}
$endcontent .= "<div style=\"font-size:200%;margin-top:2em\"><a href='http://toolserver.org/~soxred93/bash/?lang=$lang'>".$phptemp->getConf('another')."</a></div>";
$sitenotice = checkSiteNotice();
if( $sitenotice ) {
$phptemp->assign( "alert", $sitenotice );
}
$phptemp->assign( "content", $endcontent);
$phptemp->assign( "curlang", $lang );
$phptemp->assign( "langlinks", $langlinks );
$phptemp->assign( "source", "bash" );
$phptemp->display();
//include('/home/soxred93/public_html/common/footer.php');
?>