內海
Strict Standards: Non-static method Title::legalChars() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1982
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
Strict Standards: Non-static method MagicWord::get() should not be called statically, assuming $this from incompatible context in /var/www/html/mediawiki/includes/Parser.php on line 1952
From PHSea
Revision as of 20:23, 27 April 2008 Smilelong (Talk | contribs) ← Previous diff |
Current revision Smilelong (Talk | contribs) |
||
Line 1: | Line 1: | ||
[[Image:內海.jpg|710px]] | [[Image:內海.jpg|710px]] | ||
+ | Here’s how I referenced the extension as a template: | ||
- | <br> [[Special:Userlogin|请加入我们吧]], 让每首歌都能找到他自己的歌词吧.<br><br> | + | |
- | <whtml> | + | |
- | <table border =0> | + | |
- | <tr><td width = 35%> | + | title=My test YouTube dealee |
- | <object width="400" height="220"><param name="movie" value="http://www.youtube.com/v/bBfKi2hHD_w&rel=1&color1=0xe1600f&color2=0xfebd01&border=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/bBfKi2hHD_w&rel=1&color1=0xe1600f&color2=0xfebd01&border=1" type="application/x-shockwave-flash" wmode="transparent" width="300" height="200"></embed></object> | + | movie_url=http://www.youtube.com/v/yWQhBnpFEpg |
- | </td><td> | + | embed_source_url=http://www.youtube.com/v/yWQhBnpFEpg |
- | <b>多语言支持的TuneWiki 2.1发布了,快去installer升级吧!!</b><br><br> | + | wrap = yes |
- | <b>Jesus Diaz在GizModo上发表了TuneWiki的最新消息, | + | width=500 |
- | <a href="http://gizmodo.com/339048/tunewiki-is-the-karaoke+like-lyrics-app-apple-must-include-in-iphone" >去看看吧</a> 或者 <a href="http://www.everythingicafe.com/forum/third-party-applications/tunewiki-20256.html#post177440"> | + | height=400 |
- | 看看用户的评价</a> | + | |
- | <br/> | + | |
- | <br>点击menu你可以看到YouTube上更多关于TuneWiki的视频内容. | + | Here’s the css: |
- | </td></tr></table> | + | |
- | </whtml> | + | |
+ | #youtube { | ||
+ | margin: 0px 0px 40px 0px; | ||
+ | float:left; | ||
+ | width:300px; | ||
+ | height:200px; | ||
+ | position:relative; | ||
+ | border:0px solid #333333; | ||
+ | } | ||
+ | |||
+ | Here’s the php script called youtub_extension.php: | ||
+ | |||
+ | |||
+ | |||
+ | * title=My test YouTube dealee | ||
+ | * movie_url=http://www.youtube.com/v/yWQhBnpFEpg | ||
+ | * embed_source_url=http://www.youtube.com/v/yWQhBnpFEpg | ||
+ | * wrap = yes | ||
+ | * width=500 | ||
+ | * height=400 | ||
+ | * | ||
+ | */ | ||
+ | |||
+ | $wgExtensionFunctions[] = ‘registerYouTubeExtension’; | ||
+ | $wgExtensionCredits[’parserhook’][] = array( | ||
+ | ‘name’ => ‘YouTube’, | ||
+ | ‘author’ => ‘Patrick Ragsdale’, | ||
+ | ‘url’ => ‘http://www.scriptalias.com’, | ||
+ | ); | ||
+ | |||
+ | function registerYouTubeExtension() { | ||
+ | |||
+ | global $wgParser; | ||
+ | $wgParser->setHook(’YouTube’, ‘renderYouTube’); | ||
+ | |||
+ | } | ||
+ | |||
+ | /** | ||
+ | * | ||
+ | * We can provide values based on parameters listed between the | ||
+ | * and tags | ||
+ | * | ||
+ | **/ | ||
+ | |||
+ | function renderYouTube($YouTube) { | ||
+ | |||
+ | global $wgTitle; | ||
+ | |||
+ | $YouTubearea = new YouTubearea(); | ||
+ | getYouTubeOptions($YouTubearea->title,$YouTube,’title’); | ||
+ | getYouTubeOptions($YouTubearea->movie_url,$YouTube,’movie_url’); | ||
+ | getYouTubeOptions($YouTubearea->embed_source_url,$YouTube,’embed_source_url’); | ||
+ | getYouTubeOptions($YouTubearea->wrap,$YouTube,’wrap’); | ||
+ | getYouTubeOptions($YouTubearea->width,$YouTube,’width’); | ||
+ | getYouTubeOptions($YouTubearea->height,$YouTube,’height’); | ||
+ | $YouTubehtml = $YouTubearea->render(); | ||
+ | |||
+ | $YouTubehtml=str_replace(”{{PAGENAME}}”,$wgTitle->getText(),$YouTubehtml); | ||
+ | if($YouTubehtml) { | ||
+ | return $YouTubehtml; | ||
+ | } else { | ||
+ | return “ Input box ‘{$YouTube->type}’ not | ||
+ | defined.“; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * | ||
+ | * This function will collect the values and define them in the | ||
+ | * function renderTest | ||
+ | * | ||
+ | **/ | ||
+ | |||
+ | function getYouTubeOptions(&$value,&$YouTube,$name,$isNumber=false) { | ||
+ | |||
+ | if(preg_match(”/^\s*$name\s*=\s*(.*)/mi”,$YouTube,$matches)) { | ||
+ | if($isNumber) { | ||
+ | $value=intval($matches[1]); | ||
+ | } else { | ||
+ | $value=htmlspecialchars($matches[1]); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * | ||
+ | * The class is define here. We set it above on line 42 | ||
+ | * and requested an instance of it on line 46 | ||
+ | * | ||
+ | **/ | ||
+ | |||
+ | class YouTubearea { | ||
+ | |||
+ | function render() { | ||
+ | if ($this->wrap == “yes”) { | ||
+ | $csstop =” | ||
+ | “; | ||
+ | $cssbottom = “ | ||
+ | |||
+ | “; | ||
+ | $width = “300″; | ||
+ | $height = “200″; | ||
+ | } | ||
+ | else { | ||
+ | $csstop =”"; | ||
+ | $cssbottom = “”; | ||
+ | $width = $this->width; | ||
+ | $height = $this->height; | ||
+ | } | ||
+ | |||
+ | $YouTube=<<title |
Current revision
Here’s how I referenced the extension as a template:
title=My test YouTube dealee
movie_url=http://www.youtube.com/v/yWQhBnpFEpg
embed_source_url=http://www.youtube.com/v/yWQhBnpFEpg
wrap = yes
width=500
height=400
Here’s the css:
- youtube {
margin: 0px 0px 40px 0px; float:left; width:300px; height:200px; position:relative; border:0px solid #333333; }
Here’s the php script called youtub_extension.php:
* title=My test YouTube dealee * movie_url=http://www.youtube.com/v/yWQhBnpFEpg * embed_source_url=http://www.youtube.com/v/yWQhBnpFEpg * wrap = yes * width=500 * height=400 *
- /
$wgExtensionFunctions[] = ‘registerYouTubeExtension’; $wgExtensionCredits[’parserhook’][] = array( ‘name’ => ‘YouTube’, ‘author’ => ‘Patrick Ragsdale’, ‘url’ => ‘http://www.scriptalias.com’, );
function registerYouTubeExtension() {
global $wgParser; $wgParser->setHook(’YouTube’, ‘renderYouTube’);
}
/**
- We can provide values based on parameters listed between the
- and tags
-
- /
function renderYouTube($YouTube) {
global $wgTitle;
$YouTubearea = new YouTubearea(); getYouTubeOptions($YouTubearea->title,$YouTube,’title’); getYouTubeOptions($YouTubearea->movie_url,$YouTube,’movie_url’); getYouTubeOptions($YouTubearea->embed_source_url,$YouTube,’embed_source_url’); getYouTubeOptions($YouTubearea->wrap,$YouTube,’wrap’); getYouTubeOptions($YouTubearea->width,$YouTube,’width’); getYouTubeOptions($YouTubearea->height,$YouTube,’height’); $YouTubehtml = $YouTubearea->render();
$YouTubehtml=str_replace(”內海”,$wgTitle->getText(),$YouTubehtml); if($YouTubehtml) { return $YouTubehtml; } else { return “ Input box ‘{$YouTube->type}’ not defined.“; } }
/**
- This function will collect the values and define them in the
- function renderTest
-
- /
function getYouTubeOptions(&$value,&$YouTube,$name,$isNumber=false) {
if(preg_match(”/^\s*$name\s*=\s*(.*)/mi”,$YouTube,$matches)) {
if($isNumber) { $value=intval($matches[1]); } else { $value=htmlspecialchars($matches[1]); } } }
/**
- The class is define here. We set it above on line 42
- and requested an instance of it on line 46
-
- /
class YouTubearea {
function render() { if ($this->wrap == “yes”) { $csstop =” “; $cssbottom = “
“; $width = “300″; $height = “200″; } else { $csstop =”"; $cssbottom = “”; $width = $this->width; $height = $this->height; }
$YouTube=<<title