mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-10 10:28:50 +00:00
addon repository relocated
This commit is contained in:
parent
2bf19ae652
commit
056921b1e8
124 changed files with 11673 additions and 1 deletions
27
fortunate/fortunate.php
Normal file
27
fortunate/fortunate.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
/**
|
||||
* Name: Fortunate
|
||||
* Description: Add a random fortune cookie at the bottom of every pages.
|
||||
* Version: 1.0
|
||||
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
||||
*/
|
||||
|
||||
|
||||
function fortunate_install() {
|
||||
register_hook('page_end', 'addon/fortunate/fortunate.php', 'fortunate_fetch');
|
||||
}
|
||||
|
||||
function fortunate_uninstall() {
|
||||
unregister_hook('page_end', 'addon/fortunate/fortunate.php', 'fortunate_fetch');
|
||||
}
|
||||
|
||||
|
||||
function fortunate_fetch($a,&$b) {
|
||||
|
||||
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'
|
||||
. $a->get_baseurl() . '/addon/fortunate/fortunate.css' . '" media="all" />' . "\r\n";
|
||||
|
||||
$s = fetch_url('http://fortunemod.com/cookie.php?numlines=2&equal=1&rand=' . mt_rand());
|
||||
$b .= '<div class="fortunate">' . $s . '</div>';
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue