「AsciiArtsExtension」の版間の差分
提供: Yourpedia
細 (118.157.177.209 (トーク) による編集を オレリ による直前の版へ差し戻しました) |
|||
| 1行目: | 1行目: | ||
| − | + | ==使用方法== | |
| − | + | # 以下のソースをコピペして、$IP/extensions/AsciiArts/aa.php を作る。 | |
| − | + | # LocalSettings.php に、require_once( "extensions/AsciiArts/aa.php" ); を追加する。 | |
| − | + | <!-- s --> | |
| − | + | ||
| − | + | ==ソースコード== | |
| − | + | <pre> | |
| − | + | <?php | |
| − | + | if ( ! defined( 'MEDIAWIKI' ) ) | |
| − | + | die(); | |
| − | + | ||
| − | + | $wgExtensionCredits['parserhook'][] = array( | |
| − | + | 'name' => 'AsciiArts', | |
| − | + | 'author' => 'Beyond', | |
| − | + | 'description' => '<nowiki><aa>夕べのロース売れんかいなぁ!</aa></nowiki>', | |
| − | + | '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>'; | |
| − | + | } | |
| − | + | ||
| − | + | ?> | |
| − | + | </pre> | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
2020年7月12日 (日) 15:08時点における最新版
使用方法[編集]
- 以下のソースをコピペして、$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>';
}
?>