friendica-addons/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php

49 lines
1.3 KiB
PHP
Raw Normal View History

<?php
/**
* Name: Infinite Improbability Drive
* Description: Infinitely Improbably Find A Random User
* Version: 1.0
* Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
*/
use Friendica\App;
use Friendica\Core\Hook;
use Friendica\DI;
2018-01-22 20:03:11 +01:00
function infiniteimprobabilitydrive_install()
{
Hook::register('app_menu', 'addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php', 'infiniteimprobabilitydrive_app_menu');
}
function infiniteimprobabilitydrive_app_menu(App $a, array &$b)
2018-01-22 20:03:11 +01:00
{
$b['app_menu'][] = '<div class="app-title"><a href="infiniteimprobabilitydrive">' . DI::l10n()->t('Infinite Improbability Drive') . '</a></div>';
}
2018-01-22 20:03:11 +01:00
function infiniteimprobabilitydrive_module()
{
return;
}
function infiniteimprobabilitydrive_content(App $a)
2018-01-22 20:03:11 +01:00
{
$baseurl = DI::baseUrl()->get() . '/addon/infiniteimprobabilitydrive';
2018-01-22 20:03:11 +01:00
$o = '';
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'.DI::baseUrl()->get().'/addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.css"/>';
$baseurl = DI::baseUrl()->get();
2018-01-22 20:03:11 +01:00
$o .= <<< EOT
<br><br>
<p>Try another destination with the <a href="$baseurl/infiniteimprobabilitydrive">Infinite Improbability Drive</a>
<iframe src ="$baseurl/randprof" height="1200" width="1024">
EOT;
2018-01-22 20:03:11 +01:00
return $o;
}