「AsciiArtsExtension」の版間の差分
提供: Yourpedia
| 5行目: | 5行目: | ||
==ソースコード== | ==ソースコード== | ||
<pre> | <pre> | ||
| − | |||
<?php | <?php | ||
if ( ! defined( 'MEDIAWIKI' ) ) | if ( ! defined( 'MEDIAWIKI' ) ) | ||
| 26行目: | 25行目: | ||
function asciiArts($aainput) { | function asciiArts($aainput) { | ||
$aaoutput = htmlspecialchars($aainput); | $aaoutput = htmlspecialchars($aainput); | ||
| − | return '<pre style="font-family:\'MS Pゴシック\',IPAMonaPGothic; background:#fff; border:0; margin-left: 1em;">'."$aaoutput".' | + | return '<pre style="font-family:\'MS Pゴシック\',IPAMonaPGothic; background:#fff; border:0; margin-left: 1em;">'."$aaoutput".'</pre>'; |
} | } | ||
?> | ?> | ||
| − | |||
</pre> | </pre> | ||
2007年4月19日 (木) 00:17時点における版
使用方法
- 以下のソースをコピペして、$IP/extensions/AsciiArts/aa.php を作る。
- LocalSettings.php に、require_once( "extensions/AsciiArts/aa.php" ); を追加する。
ソースコード
<?php
if ( ! defined( 'MEDIAWIKI' ) )
die();
$wgExtensionCredits['parserhook'][] = array(
'name' => 'AsciiArts',
'author' => 'Beyond',
'description' => '<aa>(^_^)</aa>',
'url' => 'http://ja.yourpedia.org/wiki/AsciiArtsExtension'
);
$wgExtensionFunctions[] = 'wfAsciiArtsExtension';
function wfAsciiArtsExtension() {
global $wgParser;
$wgParser->setHook( 'aa', 'asciiArts' );
}
function asciiArts($aainput) {
$aaoutput = htmlspecialchars($aainput);
return '<pre style="font-family:\'MS Pゴシック\',IPAMonaPGothic; background:#fff; border:0; margin-left: 1em;">'."$aaoutput".'</pre>';
}
?>