diff --git a/pageheader.tgz b/pageheader.tgz old mode 100755 new mode 100644 index a0cedc556..209180332 Binary files a/pageheader.tgz and b/pageheader.tgz differ diff --git a/pageheader/README b/pageheader/README index f9b1752b7..9ba60788c 100755 --- a/pageheader/README +++ b/pageheader/README @@ -3,3 +3,6 @@ Page Header For server admins only. Displays a text message for system announcements' The message is entered in the admin account at settings, Plugin settings. + +If you want to use HTML in the pageheader, create a file called pageheader.html +in the document root of your friendica instance and add the html there. diff --git a/pageheader/pageheader.css b/pageheader/pageheader.css index 49232cfa5..24608edb7 100755 --- a/pageheader/pageheader.css +++ b/pageheader/pageheader.css @@ -7,6 +7,8 @@ #pageheader-words { float: left; margin-top: 10px; + width: 400px; + height: 150px; } #pageheader-submit { diff --git a/pageheader/pageheader.php b/pageheader/pageheader.php index 947926cd5..7c65f8b56 100755 --- a/pageheader/pageheader.php +++ b/pageheader/pageheader.php @@ -4,8 +4,9 @@ /** * Name: Page Header * Description: Inserts a page header - * Version: 1.0 + * Version: 1.1 * Author: Keith Fernie + * Hauke Altmann * */ @@ -49,7 +50,8 @@ function pageheader_addon_settings(&$a,&$s) { $s .= '
'; $s .= '

' . t('"pageheader" Settings') . '

'; $s .= '
'; $s .= '
'; @@ -70,12 +72,18 @@ function pageheader_addon_settings_post(&$a,&$b) { } function pageheader_fetch($a,&$b) { + + if(file_exists('pageheader.html')){ + $s = file_get_contents('pageheader.html'); + } else { + $s = get_config('pageheader', 'text'); + } $a->page['htmlhead'] .= '' . "\r\n"; - $s = get_config('pageheader','text'); + if(! $s) $s = ''; if ($s != '') - $b .= ''; + $b .= ''; } diff --git a/pledgie.tgz b/pledgie.tgz index 02d0b53b2..48c5e8173 100644 Binary files a/pledgie.tgz and b/pledgie.tgz differ diff --git a/pledgie/pledgie.css b/pledgie/pledgie.css new file mode 100755 index 000000000..9cb9896d3 --- /dev/null +++ b/pledgie/pledgie.css @@ -0,0 +1,28 @@ +#pledgie-label { + float: left; + width: 300px; + margin-top: 10px; +} + +#pledgie-campaign { + float: left; + margin-top: 10px; + width: 100px; +} + +#pledgie-describe { + float: left; + margin-top: 10px; + width: 300px; +} + +#pledgie-submit { + margin-top: 15px; +} + +.pledgie { + text-align: center; + width 100%; + margin-top: 25px; + font-size: 20px; +} diff --git a/pledgie/pledgie.php b/pledgie/pledgie.php index c88dcbeb3..af72a45fb 100644 --- a/pledgie/pledgie.php +++ b/pledgie/pledgie.php @@ -1,17 +1,79 @@ - * Status: Unsupported - * */ + * Name: Pledgie + * Description: Show link to Friendica pledgie account for donating + * Version: 1.1 + * Author: tony baldwin + * Hauke Altmann + * + */ -function pledgie_install() { register_hook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active'); } +function pledgie_install() { + register_hook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active'); + register_hook('plugin_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings'); + register_hook('plugin_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post'); +} +function pledgie_uninstall() { + unregister_hook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active'); + unregister_hook('plugin_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings'); + unregister_hook('plugin_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post'); +} -function pledgie_uninstall() { unregister_hook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active'); } +function pledgie_addon_settings(&$a,&$s) { + + if(! is_site_admin()) + return; + + /* Add our stylesheet to the page so we can make our settings look nice */ + + $a->page['htmlhead'] .= '' . "\r\n"; + + $campaign = get_config('pledgie-campaign','text'); + $describe = get_config('pledgie-describe','text'); + + if(! $campaign) + $campaign = ''; + + if(! describe) + $describe = ''; + + $s .= '
'; + $s .= '

' . t('"pledgie" Settings') . '

'; + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + $s .= '
'; + + return; +} + +function pledgie_addon_settings_post(&$a,&$b) { + + if(! is_site_admin()) + return; + + if($_POST['pledgie-submit']) { + set_config('pledgie-describe','text',trim(strip_tags($_POST['pledgie-describe']))); + set_config('pledgie-campaign','text',trim(strip_tags($_POST['pledgie-campaign']))); + info( t('pledgie Settings saved.') . EOL); + } +} function pledgie_active(&$a,&$b) { - //$b .= '
\'Click
'; -} + $campaign = get_config('pledgie-campaign','text'); + $describe = get_config('pledgie-describe','text'); + $b .= '
'; + $b .= $describe . '
\'Click
'; +} \ No newline at end of file