#author("2020-04-26T00:02:30+09:00","","")
#author("2020-04-26T00:03:52+09:00","","")
** steam.inc.php [#y9704d69]
|RIGHT:100|LEFT:360|c
|~サマリ|Steam埋め込みウィジェットを表示|
|~リビジョン|1.01|
|~対応バージョン|1.5.3|
|~投稿者|[[M.Taniguchi]]|
|~投稿日|&new{2020-04-25 (土) 17:23:39};|
**概要 [#c33472f9]

Steam埋め込みウィジェットを表示するプラグイン。

**使い方 [#ma2f06a1]

#steam(製品ID[,紹介文])

-製品ID … Steam内対象ソフトのストアページURL「https: //store.steampowered.com/app/123456/Hoge/」における「123456」部分の数字
-紹介文 … 任意の文字列。省略すると各ソフト既定の紹介文が表示される

''使用例''

 #steam(123456,最高のFPS!)

**コード [#g482d0e8]

steam.inc.php~
(下記のコードをコピーして、plugin ディレクトリに steam.inc.php というファイル名で保存してください)

 <?php
 /*
 PukiWiki - Yet another WikiWikiWeb clone.
 steam.inc.php, v1.01 2020 M.Taniguchi
 License: GPL v3 or (at your option) any later version
 
 Steam埋め込みウィジェットを表示するプラグイン。
 
 【使い方】
 #readingtime(製品ID[,紹介文])
 
 製品ID … Steam内対象ソフトのストアページURL「//store.steampowered.com/app/123456/Hoge/」における「123456」部分の数字
 紹介文 … 任意の文字列。省略すると各ソフト既定の紹介文が表示される
 
 【使用例】
 #readingtime(123456,最高のFPS!)
 */
 
 define('PLUGIN_STEAM_WIDGET_ATTRIBUTES', 'frameborder="0" width="646" height="190"');	// ウィジェットiframe要素の属性(公式ウィジェット仕様に合わせておくこと)
 define('PLUGIN_STEAM_INTRO_MAXLEN', 375);	// 紹介文の最大文字数(公式ウィジェット仕様に合わせておくこと)
 
 function plugin_steam_convert() {
 	list($code, $intro) = func_get_args();
 
 	if (!isset($code)) return '#steam(code[,introduction])';
 
 	if (isset($intro)) $intro = '?t=' . urlencode(mb_strimwidth($intro, 0, PLUGIN_STEAM_INTRO_MAXLEN));
 
 	$widgetTag = '<iframe src="https:'.'//store.steampowered.com/widget/' . htmlspecialchars($code) . '/' . $intro . '" ' . PLUGIN_STEAM_WIDGET_ATTRIBUTES . ' style="max-width:100%;max-height:auto"></iframe>';
 
 	return '<style>._p_steam iframe{}</style><div class="_p_steam">' . $widgetTag . '</div>';
 	return '<div class="_p_steam">' . $widgetTag . '</div>';
 }
 

**ライセンス [#w567828e]

GPL v3

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Site admin: PukiWiki Development Team

PukiWiki 1.5.4+ © 2001-2022 PukiWiki Development Team. Powered by PHP 5.6.40-0+deb8u12. HTML convert time: 0.210 sec.

OSDN