2011-06-14 19:39:05 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2018-01-20 11:01:59 -05:00
|
|
|
* Demo addon for adding various types of Flash games to Friendica.
|
2011-06-14 19:39:05 -04:00
|
|
|
* In this case we're using "Hot Shot Sniper" by FlashGames247
|
2012-01-26 20:12:10 -05:00
|
|
|
*
|
|
|
|
* Name: Sniper
|
|
|
|
* Description: Basic demonstration of flash game addons for Friendica
|
|
|
|
* Version: 1.0
|
|
|
|
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
2011-06-14 19:39:05 -04:00
|
|
|
*/
|
2018-12-26 02:28:16 -05:00
|
|
|
use Friendica\Core\Hook;
|
2011-06-14 19:39:05 -04:00
|
|
|
|
|
|
|
function sniper_install() {
|
2018-12-26 02:28:16 -05:00
|
|
|
Hook::register('app_menu', 'addon/sniper/sniper.php', 'sniper_app_menu');
|
2011-06-14 19:39:05 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
function sniper_uninstall() {
|
2018-12-26 02:28:16 -05:00
|
|
|
Hook::unregister('app_menu', 'addon/sniper/sniper.php', 'sniper_app_menu');
|
2011-06-14 19:39:05 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function sniper_app_menu($a,&$b) {
|
2011-09-28 07:30:48 -04:00
|
|
|
$b['app_menu'][] = '<div class="app-title"><a href="sniper">Hot Shot Sniper</a></div>';
|
2011-06-14 19:39:05 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function sniper_module() {}
|
|
|
|
|
|
|
|
function sniper_content(&$a) {
|
|
|
|
|
2018-10-09 14:13:22 -04:00
|
|
|
$baseurl = $a->getBaseURL() . '/addon/sniper';
|
2011-06-14 19:39:05 -04:00
|
|
|
|
|
|
|
$o .= <<< EOT
|
|
|
|
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="620" height="480" id="hotshotsniper" align="middle">
|
|
|
|
<param name="allowScriptAccess" value="sameDomain" />
|
|
|
|
<param name="movie" value="$baseurl/hotshotsniper.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="$baseurl/hotshotsniper.swf" quality="high" bgcolor="#000000" width="620" height="480" name="hotshotsniper" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
|
|
|
|
</object>
|
|
|
|
EOT;
|
|
|
|
|
|
|
|
return $o;
|
2012-01-31 06:10:36 -05:00
|
|
|
}
|