X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=planets%2Fplanets.php;h=d40e6c61a1b34ba1c92ea390c632e4a1820da122;hb=e452272dec8ed37d56585f0bd4861d3fb7d0a34a;hp=1c6ed43b94ac8624a2e691e3fc3c99f51ab3f8f3;hpb=63d605702fe5f98d3215cf0172748b41f7881db9;p=friendica-addons.git diff --git a/planets/planets.php b/planets/planets.php index 1c6ed43b..d40e6c61 100755 --- a/planets/planets.php +++ b/planets/planets.php @@ -4,22 +4,7 @@ * Description: Sample Friendica plugin/addon. Set a random planet from the Emprire when posting. * Version: 1.0 * Author: Mike Macgirvin - * Author: Darth Baldwin - * - * - * - * - * Addons are registered with the system in the - * .htconfig.php file. - * - * $a->config['system']['addon'] = 'plugin1,plugin2,etc.'; - * - * When registration is detected, the system calls the plugin - * name_install() function, located in 'addon/name/name.php', - * where 'name' is the name of the addon. - * If the addon is removed from the configuration list, the - * system will call the name_uninstall() function. - * + * Author: Tony Baldwin */ @@ -107,15 +92,8 @@ function planets_post_hook($a, &$item) { * */ - $planets = array('Alderaan','Tatooine','Dagoba','Polis Massa','Coruscant','Hoth','Endor','Kamino','Rattatak','Mustafar','Iego','Geonosis','Felucia','Dantooine','Ansion','Artaru','Bespin','Boz Pity','Cato Neimoidia','Christophsis','Kashyyk','Kessel','Malastare','Mygeeto','Nar Shaddaa','Ord Mantell','Saleucami','Subterrel','Death Star','Teth','Tund','Utapau','Yavin'); -# $zones = timezone_identifiers_list(); -# foreach($zones as $zone) { -# if((strpos($zone,'/')) && (! stristr($zone,'US/')) && (! stristr($zone,'Etc/'))) -# $planets[] = str_replace('_', ' ',substr($zone,strpos($zone,'/') + 1)); -# } -# -# if(! count($planets)) -# return; + $planets = array('Alderaan','Tatooine','Dagobah','Polis Massa','Coruscant','Hoth','Endor','Kamino','Rattatak','Mustafar','Iego','Geonosis','Felucia','Dantooine','Ansion','Artaru','Bespin','Boz Pity','Cato Neimoidia','Christophsis','Kashyyyk','Kessel','Malastare','Mygeeto','Nar Shaddaa','Ord Mantell','Saleucami','Subterrel','Death Star','Teth','Tund','Utapau','Yavin'); + $planet = array_rand($planets,1); $item['location'] = $planets[$planet]; @@ -168,15 +146,23 @@ function planets_settings(&$a,&$s) { /* Add some HTML to the existing form */ - $s .= '
'; + $s .= ''; + $s .= '

' . t('Planets') . '

'; + $s .= '
'; + $s .= ''; /* provide a submit button */ - $s .= '
'; + $s .= '
'; }