diff --git a/curweather/README.md b/curweather/README.md new file mode 100644 index 00000000..ff43f248 --- /dev/null +++ b/curweather/README.md @@ -0,0 +1,29 @@ +Current Weather +=============== + +If activated by your user this addon adds a widget to the users network tab +sidebar showing current weather informations (temperature, relative humidity, +wind conditions and preassure) from [OpenWeatherMap](http://openweathermap.org). +The user can configure the location as e.g. *Berlin,DE* or the zip code "14476,DE". + +The language for the request at OpenWeatherMap is set to the UI language of +friendica. If the string for the description of the current weather conditions +is available in this language depends on OpenWeatherMap, fallback is english. + +**You should get an APPID from OpenWeatherMap if you want to use this widget.** +You can register [here](http://openweathermap.org/register). + +Credits +------- + +* Tony Baldwin wrote the original addon for Friendica +* Fabio Comuni +* Tobias Diekershoff switched the sources to OpenWeatherMap after the original + provider turned off support for locations outside of the USA. + +Known Issues +------------ + +* Localization does not work (Jul 15) data requested via XML are EN only but + have moew information available compared to data requested via JSON which is + available in other languages as well. Right now we use the XML dataset diff --git a/curweather/curweather.css b/curweather/curweather.css index 6c127963..69574ff0 100644 --- a/curweather/curweather.css +++ b/curweather/curweather.css @@ -1,10 +1,11 @@ - -#curtemp-settings-label, #curtemp-location-label, #curtemp-enable-label { - float: left; - width: 200px; - margin-bottom: 25px; +#curweather-network img { + float: left; + margin: 30px 10px; } -#curtemp-network { - float: left; +ul.curweather-details li { + list-type: none; +} +p.curweather-footer { + font-size: 0.8em; } diff --git a/curweather/curweather.php b/curweather/curweather.php index 67d5939e..59d7e378 100644 --- a/curweather/curweather.php +++ b/curweather/curweather.php @@ -1,29 +1,78 @@ - Find the location code for the station or airport nearest you here. - * Version: 1.0 + * Description: Shows current weather conditions for user's location on their network page. + * Version: 1.1 * Author: Tony Baldwin * Author: Fabio Comuni + * Author: Tobias Diekershoff * */ -require_once('addon/curweather/getweather.php'); + +require_once('include/network.php'); +require_once("mod/proxy.php"); +require_once('include/text.php'); + +// get the weather data from OpenWeatherMap +function getWeather( $loc, $units='metric', $lang='en', $appid='', $cachetime=0) { + $url = "http://api.openweathermap.org/data/2.5/weather?q=".$loc."&appid=".$appid."&lang=".$lang."&units=".$units."&mode=xml"; + $cached = Cache::get('curweather'.md5($url)); + $now = new DateTime(); + if (!is_null($cached)) { + $cdate = get_pconfig(local_user(), 'curweather', 'last'); + $cached = unserialize($cached); + if ($cdate + $cachetime > $now->getTimestamp()) { + return $cached; + } + } + try { + $res = new SimpleXMLElement(fetch_url($url)); + } catch (Exception $e) { + info(t('Error fetching weather data.\nError was: '.$e->getMessage())); + return false; + } + if ((string)$res->temperature['unit']==='metric') { + $tunit = '°C'; + $wunit = 'm/s'; + } else { + $tunit = '°F'; + $wunit = 'mph'; + } + if ( trim((string)$res->weather['value']) == trim((string)$res->clouds['name']) ) { + $desc = (string)$res->clouds['name']; + } else { + $desc = (string)$res->weather['value'].', '.(string)$res->clouds['name']; + } + $r = array( + 'city'=> (string) $res->city['name'][0], + 'country' => (string) $res->city->country[0], + 'lat' => (string) $res->city->coord['lat'], + 'lon' => (string) $res->city->coord['lon'], + 'temperature' => (string) $res->temperature['value'][0].$tunit, + 'pressure' => (string) $res->pressure['value'].(string)$res->pressure['unit'], + 'humidity' => (string) $res->humidity['value'].(string)$res->humidity['unit'], + 'descripion' => $desc, + 'wind' => (string)$res->wind->speed['name'].' ('.(string)$res->wind->speed['value'].$wunit.')', + 'update' => (string)$res->lastupdate['value'], + 'icon' => (string)$res->weather['icon'] + ); + set_pconfig(local_user(), 'curweather', 'last', $now->getTimestamp()); + Cache::set('curweather'.md5($url), serialize($r)); + return $r; +} function curweather_install() { register_hook('network_mod_init', 'addon/curweather/curweather.php', 'curweather_network_mod_init'); register_hook('plugin_settings', 'addon/curweather/curweather.php', 'curweather_plugin_settings'); register_hook('plugin_settings_post', 'addon/curweather/curweather.php', 'curweather_plugin_settings_post'); - } function curweather_uninstall() { unregister_hook('network_mod_init', 'addon/curweather/curweather.php', 'curweather_network_mod_init'); unregister_hook('plugin_settings', 'addon/curweather/curweather.php', 'curweather_plugin_settings'); unregister_hook('plugin_settings_post', 'addon/curweather/curweather.php', 'curweather_plugin_settings_post'); - } - function curweather_network_mod_init(&$fk_app,&$b) { if(! intval(get_pconfig(local_user(),'curweather','curweather_enable'))) @@ -31,27 +80,56 @@ function curweather_network_mod_init(&$fk_app,&$b) { $fk_app->page['htmlhead'] .= '' . "\r\n"; - // the getweather file does all the work here - // the $rpt value is needed for location - // which getweather uses to fetch the weather data for weather and temp + // $rpt value is needed for location + // $lang will be taken from the browser session to honour user settings + // TODO $lang does not work if the default settings are used + // and not all response strings are translated + // $units can be set in the settings by the user + // $appid is configured by the admin in the admin panel + // those parameters will be used to get: cloud status, temperature, preassure + // and relative humidity for display, also the relevent area of the map is + // linked from lat/log of the reply of OWMp $rpt = get_pconfig(local_user(), 'curweather', 'curweather_loc'); - $wxdata = GetWeather::get($rpt); - $temp = $wxdata['TEMPERATURE_STRING']; - $weather = $wxdata['WEATHER']; - $rhumid = $wxdata['RELATIVE_HUMIDITY']; - $pressure = $wxdata['PRESSURE_STRING']; - $wind = $wxdata['WIND_STRING']; - $curweather = '
-
-

'.t("Current Weather").'

'; - $curweather .= "Weather: $weather
- Temperature: $temp
- Relative Humidity: $rhumid
- Pressure: $pressure
- Wind: $wind"; - $curweather .= '
'; + // set the language to the browsers language and use metric units + $lang = $_SESSION['language']; + $units = get_pconfig( local_user(), 'curweather', 'curweather_units'); + $appid = get_config('curweather','appid'); + $cachetime = intval(get_config('curweather','cachetime')); + if ($units==="") + $units = 'metric'; + $ok = true; + + $res = getWeather($rpt, $units, $lang, $appid, $cachetime); + if ($res===false) + $ok = false; + + if ($ok) { + $t = get_markup_template("widget.tpl", "addon/curweather/" ); + $curweather = replace_macros ($t, array( + '$title' => t("Current Weather"), + '$icon' => proxy_url('http://openweathermap.org/img/w/'.$res['icon'].'.png'), + '$city' => $res['city'], + '$lon' => $res['lon'], + '$lat' => $res['lat'], + '$description' => $res['descripion'], + '$temp' => $res['temperature'], + '$relhumidity' => array('caption'=>t('Relative Humidity'), 'val'=>$res['humidity']), + '$pressure' => array('caption'=>t('Pressure'), 'val'=>$res['pressure']), + '$wind' => array('caption'=>t('Wind'), 'val'=> $res['wind']), + '$lastupdate' => t('Last Updated').': '.$res['update'].'UTC', + '$databy' => t('Data by'), + '$showonmap' => t('Show on map') + )); + } else { + $t = get_markup_template('widget-error.tpl', 'addon/curweather/'); + $curweather = replace_macros( $t, array( + '$problem' => t('There was a problem accessing the weather data. But have a look'), + '$rpt' => $rpt, + '$atOWM' => t('at OpenWeatherMap') + )); + } $fk_app->page['aside'] = $curweather.$fk_app->page['aside']; @@ -63,6 +141,7 @@ function curweather_plugin_settings_post($a,$post) { return; set_pconfig(local_user(),'curweather','curweather_loc',trim($_POST['curweather_loc'])); set_pconfig(local_user(),'curweather','curweather_enable',intval($_POST['curweather_enable'])); + set_pconfig(local_user(),'curweather','curweather_units',trim($_POST['curweather_units'])); info( t('Current Weather settings updated.') . EOL); } @@ -73,36 +152,53 @@ function curweather_plugin_settings(&$a,&$s) { if(! local_user()) return; - /* Add our stylesheet to the curweather so we can make our settings look nice */ - - $a->page['htmlhead'] .= '' . "\r\n"; - /* Get the current state of our config variable */ $curweather_loc = get_pconfig(local_user(), 'curweather', 'curweather_loc'); + $curweather_units = get_pconfig(local_user(), 'curweather', 'curweather_units'); + $appid = get_config('curweather','appid'); + if ($appid=="") { + $noappidtext = t('No APPID found, please contact your admin to optain one.'); + } else { + $noappidtext = ''; + } $enable = intval(get_pconfig(local_user(),'curweather','curweather_enable')); $enable_checked = (($enable) ? ' checked="checked" ' : ''); - - /* Add some HTML to the existing form */ - - $s .= '
'; - $s .= '

' . t('Current Weather') . '

'; - $s .= '
'; - $s .= '

Find the location code for the airport/weather station nearest you here.

'; - $s .= ''; - $s .= ''; - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - $s .= '
'; - - /* provide a submit button */ - - $s .= '
'; + // load template and replace the macros + $t = get_markup_template("settings.tpl", "addon/curweather/" ); + $s = replace_macros ($t, array( + '$submit' => t('Save Settings'), + '$header' => t('Current Weather').' '.t('Settings'), + '$noappidtext' => $noappidtext, + '$info' => t('Enter either the name of your location or the zip code.'), + '$curweather_loc' => array( 'curweather_loc', t('Your Location'), $curweather_loc, t('Identifier of your location (name or zip code), e.g. Berlin,DE or 14476,DE.') ), + '$curweather_units' => array( 'curweather_units', t('Units'), $curweather_units, t('select if the temperatur should be displayed in °C or °F'), array('metric'=>'°C', 'imperial'=>'°F')), + '$enabled' => array( 'curweather_enable', t('Show weather data'), $enable, '') + )); + return; } - - +// Config stuff for the admin panel to let the admin of the node set a APPID +// for accessing the API of openweathermap +function curweather_plugin_admin_post (&$a) { + if(! is_site_admin()) + return; + if ($_POST['curweather-submit']) { + set_config('curweather','appid',trim($_POST['appid'])); + set_config('curweather','cachetime',trim($_POST['cachetime'])); + info( t('Curweather settings saved.'.EOL)); + } +} +function curweather_plugin_admin (&$a, &$o) { + if(! is_site_admin()) + return; + $appid = get_config('curweather','appid'); + $cachetime = get_config('curweather','cachetime'); + $t = get_markup_template("admin.tpl", "addon/curweather/" ); + $o = replace_macros ($t, array( + '$submit' => t('Save Settings'), + '$cachetime' => array('cachetime', t('Caching Interval'), $cachetime, t('For how long should the weather data be cached? Choose according your OpenWeatherMap account type.'), array('0'=>t('no cache'), '300'=>'5 '.t('minutes'), '900'=>'15 '.t('minutes'), '1800'=>'30 '.t('minutes'), '3600'=>'60 '.t('minutes'))), + '$appid' => array('appid', t('Your APPID'), $appid, t('Your API key provided by OpenWeatherMap')) + )); +} diff --git a/curweather/getweather.php b/curweather/getweather.php deleted file mode 100644 index b4660b9e..00000000 --- a/curweather/getweather.php +++ /dev/null @@ -1,230 +0,0 @@ -$i){ - $a=explode(" | ",$i); - if(is_numeric(array_search($wx,$a))){ - self::$wxdata['ICON']="$imgpath/$k.jpg"; - break; - } - } - - // Replace any null elements with "Not available" - foreach(array_keys(self::$wxdata) as $key){ - self::$wxdata[$key]=self::$wxdata[$key]=="NULL"?"Not available":self::$wxdata[$key]; - } - - // If we got humidity - if(is_numeric(self::$wxdata['RELATIVE_HUMIDITY'])) - // Append a percent sign - self::$wxdata['RELATIVE_HUMIDITY'].="%"; - - // Do some formatting to make the output a little friendlier - if(self::$wxdata['VISIBILITY_MI']=="NA") - self::$wxdata['VISIBILITY']="Not available"; - if(self::$wxdata['VISIBILITY']!="Not available") - self::$wxdata['VISIBILITY']=(1*self::$wxdata['VISIBILITY_MI'])." miles"; - - // If we got wind data - if(is_numeric(self::$wxdata['WIND_MPH'])){ - // We're going to output wind data as both MPH from a cardinal direction - // and as Knots from a direction in degrees - - // Calculate the value for Knots - self::$wxdata['WIND_KNOTS']=self::$wxdata['WIND_MPH']/1.15; - - // Format the output - $wind=sprintf("From the %s at %d mph (%03.0f° at %d knots)",self::$wxdata['WIND_DIR'],self::$wxdata['WIND_MPH'],self::$wxdata['WIND_DEGREES'],self::$wxdata['WIND_KNOTS']); - - // If we got a value for wind gusts - if(is_numeric(self::$wxdata['WIND_GUST_MPH']) && self::$wxdata['WIND_GUST_MPH']>0){ - // add it into the wind string - $wind=str_replace("mph","gusting to ".self::$wxdata['WIND_GUST_MPH']." mph
", $wind); - $knots=sprintf("%d",self::$wxdata['WIND_GUST_MPH']/1.15); - $wind=str_replace("knots","gusting to $knots knots",$wind); - } - } else { - // Otherwise, if wind is zero, we'll show "Calm" - $wind=self::$wxdata['WIND_MPH']=="Not available"?"Not available":"Calm"; - } // Done with wind - self::$wxdata['WIND_STRING']=$wind; - - } // Done getting and formatting the data - return self::$wxdata; - } - - function startElement($parser, $name, $attrs) { - self::$itemname=$name; - self::$itemdata=""; - } - - function endElement($parser, $name) { - self::$wxdata[self::$itemname]=self::$itemdata; - self::$itemdata=""; - } - - function characterData($parser, $data) { - self::$itemdata.=$data; - } - - function defineIcons(){ - // See http://weather.gov/data/current_obs/weather.php for source data for this function - $retVal['bkn']="Mostly Cloudy | Mostly Cloudy with Haze | Mostly Cloudy and Breezy"; - $retVal['skc']="Fair | Clear | Fair with Haze | Clear with Haze | Fair and Breezy | Clear and Breezy"; - $retVal['few']="A Few Clouds | A Few Clouds with Haze | A Few Clouds and Breezy"; - $retVal['sct']="Partly Cloudy | Party Cloudy with Haze | Partly Cloudy and Breezy"; - $retVal['ovc']="Overcast | Overcast with Haze | Overcast and Breezy"; - $retVal['nfg']="Fog/Mist | Fog | Freezing Fog | Shallow Fog | Partial Fog | Patches of Fog | Fog in Vicinity | Freezing Fog in Vicinity | Shallow Fog in Vicinity | Partial Fog in Vicinity | Patches of Fog in Vicinity | Showers in Vicinity Fog | Light Freezing Fog | Heavy Freezing Fog"; - $retVal['smoke']="Smoke"; - $retVal['fzra']="Freezing Rain | Freezing Drizzle | Light Freezing Rain | Light Freezing Drizzle | Heavy Freezing Rain | Heavy Freezing Drizzle | Freezing Rain in Vicinity | Freezing Drizzle in Vicinity"; - $retVal['ip']="Ice Pellets | Light Ice Pellets | Heavy Ice Pellets | Ice Pellets in Vicinity | Showers Ice Pellets | Thunderstorm Ice Pellets | Ice Crystals | Hail | Small Hail/Snow Pellets | Light Small Hail/Snow Pellets | Heavy Small Hail/Snow Pellets | Showers Hail | Hail Showers"; - $retVal['mix']="Freezing Rain Snow | Light Freezing Rain Snow | Heavy Freezing Rain Snow | Freezing Drizzle Snow | Light Freezing Drizzle Snow | Heavy Freezing Drizzle Snow | Snow Freezing Rain| Light Snow Freezing Rain | Heavy Snow Freezing Rain | Snow Freezing Drizzle | Light Snow Freezing Drizzle | Heavy Snow Freezing Drizzle"; - $retVal['raip']="Rain Ice Pellets | Light Rain Ice Pellets | Heavy Rain Ice Pellets | Drizzle Ice Pellets | Light Drizzle Ice Pellets | Heavy Drizzle Ice Pellets | Ice Pellets Rain | Light Ice Pellets Rain | Heavy Ice Pellets Rain | Ice Pellets Drizzle | Light Ice Pellets Drizzle | Heavy Ice Pellets Drizzle"; - $retVal['rasn']="Rain Snow | Light Rain Snow | Heavy Rain Snow | Snow Rain | Light Snow Rain | Heavy Snow Rain | Drizzle Snow | Light Drizzle Snow | Heavy Drizzle Snow | Snow Drizzle | Light Snow Drizzle | Heavy Snow Drizzle"; - $retVal['shra']="Rain Showers | Light Rain Showers | Heavy Rain Showers | Rain Showers in Vicinity | Light Showers Rain | Heavy Showers Rain | Showers Rain | Showers Rain in Vicinity | Rain Showers Fog/Mist | Light Rain Showers Fog/Mist | Heavy Rain Showers Fog/Mist | Rain Showers in Vicinity Fog/Mist | Light Showers Rain Fog/Mist | Heavy Showers Rain Fog/Mist | Showers Rain Fog/Mist | Showers Rain in Vicinity Fog/Mist"; - $retVal['tsra']="Thunderstorm | Light Thunderstorm Rain | Heavy Thunderstorm Rain | Thunderstorm Rain Fog/Mist | Light Thunderstorm Rain Fog/Mist | Heavy Thunderstorm Rain Fog/Mist | Thunderstorm Showers in Vicinity | | Light Thunderstorm Rain Haze | Heavy Thunderstorm Rain Haze | Thunderstorm Fog | Light Thunderstorm Rain Fog | Heavy Thunderstorm Rain Fog | Thunderstorm Light Rain | Thunderstorm Heavy Rain | Thunderstorm Rain Fog/Mist | Thunderstorm Light Rain Fog/Mist | Thunderstorm Heavy Rain Fog/Mist | Thunderstorm in Vicinity Fog/Mist | Thunderstorm Showers in Vicinity | Thunderstorm in Vicinity | Thunderstorm in Vicinity Haze | Thunderstorm Haze in Vicinity | Thunderstorm Light Rain Haze | Thunderstorm Heavy Rain Haze | Thunderstorm Fog | Thunderstorm Light Rain Fog | Thunderstorm Heavy Rain Fog | Thunderstorm Hail | Light Thunderstorm Rain Hail | Heavy Thunderstorm Rain Hail | Thunderstorm Rain Hail Fog/Mist | Light Thunderstorm Rain Hail Fog/Mist | Heavy Thunderstorm Rain Hail Fog/Mist | Thunderstorm Showers in Vicinity Hail | | Light Thunderstorm Rain Hail Haze | Heavy Thunderstorm Rain Hail Haze | Thunderstorm Hail Fog | Light Thunderstorm Rain Hail Fog | Heavy Thunderstorm Rain Hail Fog | Thunderstorm Light Rain Hail | Thunderstorm Heavy Rain Hail | Thunderstorm Rain Hail Fog/Mist | Thunderstorm Light Rain Hail Fog/Mist | Thunderstorm Heavy Rain Hail Fog/Mist | Thunderstorm in Vicinity Hail Fog/Mist | Thunderstorm Showers in Vicinity Hail | Thunderstorm in Vicinity Hail | Thunderstorm in Vicinity Hail Haze | Thunderstorm Haze in Vicinity Hail | Thunderstorm Light Rain Hail Haze | Thunderstorm Heavy Rain Hail Haze | Thunderstorm Hail Fog | Thunderstorm Light Rain Hail Fog | Thunderstorm Heavy Rain Hail Fog | Thunderstorm Small Hail/Snow Pellets | Thunderstorm Rain Small Hail/Snow Pellets | Light Thunderstorm Rain Small Hail/Snow Pellets | Heavy Thunderstorm Rain Small Hail/Snow Pellets"; - $retVal['sn']="Snow | Light Snow | Heavy Snow | Snow Showers | Light Snow Showers | Heavy Snow Showers | Showers Snow | Light Showers Snow | Heavy Showers Snow | Snow Fog/Mist | Light Snow Fog/Mist | Heavy Snow Fog/Mist | Snow Showers Fog/Mist | Light Snow Showers Fog/Mist | Heavy Snow Showers Fog/Mist | Showers Snow Fog/Mist | Light Showers Snow Fog/Mist | Heavy Showers Snow Fog/Mist | Snow Fog | Light Snow Fog | Heavy Snow Fog | Snow Showers Fog | Light Snow Showers Fog | Heavy Snow Showers Fog | Showers Snow Fog | Light Showers Snow Fog | Heavy Showers Snow Fog | Showers in Vicinity Snow | Snow Showers in Vicinity | Snow Showers in Vicinity Fog/Mist | Snow Showers in Vicinity Fog | Low Drifting Snow | Blowing Snow | Snow Low Drifting Snow | Snow Blowing Snow | Light Snow Low Drifting Snow | Light Snow Blowing Snow | Heavy Snow Low Drifting Snow | Heavy Snow Blowing Snow | Thunderstorm Snow | Light Thunderstorm Snow | Heavy Thunderstorm Snow | Snow Grains | Light Snow Grains | Heavy Snow Grains | Heavy Blowing Snow | Blowing Snow in Vicinity"; - $retVal['wind']="Windy | Fair and Windy | A Few Clouds and Windy | Partly Cloudy and Windy | Mostly Cloudy and Windy | Overcast and Windy"; - $retVal['hi_shwrs']="Showers in Vicinity | Showers in Vicinity Fog/Mist | Showers in Vicinity Fog | Showers in Vicinity Haze"; - $retVal['fzrara']="Freezing Rain Rain | Light Freezing Rain Rain | Heavy Freezing Rain Rain | Rain Freezing Rain | Light Rain Freezing Rain | Heavy Rain Freezing Rain | Freezing Drizzle Rain | Light Freezing Drizzle Rain | Heavy Freezing Drizzle Rain | Rain Freezing Drizzle | Light Rain Freezing Drizzle | Heavy Rain Freezing Drizzle"; - $retVal['hi_tsra']="Thunderstorm in Vicinity | Thunderstorm in Vicinity Fog/Mist | Thunderstorm in Vicinity Fog | Thunderstorm Haze in Vicinity | Thunderstorm in Vicinity Haze"; - $retVal['ra1']="Light Rain | Drizzle | Light Drizzle | Heavy Drizzle | Light Rain Fog/Mist | Drizzle Fog/Mist | Light Drizzle Fog/Mist | Heavy Drizzle Fog/Mist | Light Rain Fog | Drizzle Fog | Light Drizzle Fog | Heavy Drizzle Fog"; - $retVal['ra']="Rain | Heavy Rain | Rain Fog/Mist | Heavy Rain Fog/Mist | Rain Fog | Heavy Rain Fog"; - $retVal['nsvrtsra']="Funnel Cloud | Funnel Cloud in Vicinity | Tornado/Water Spout"; - $retVal['dust']="Dust | Low Drifting Dust | Blowing Dust | Sand | Blowing Sand | Low Drifting Sand | Dust/Sand Whirls | Dust/Sand Whirls in Vicinity | Dust Storm | Heavy Dust Storm | Dust Storm in Vicinity | Sand Storm | Heavy Sand Storm | Sand Storm in Vicinity"; - $retVal['mist']="Haze"; - return $retVal; - } -// end CLASS -} -?> diff --git a/curweather/lang/C/messages.po b/curweather/lang/C/messages.po index b462719c..b2ed6e5e 100644 --- a/curweather/lang/C/messages.po +++ b/curweather/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-27 05:01-0500\n" +"POT-Creation-Date: 2015-07-13 18:46+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,26 +17,114 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: curweather.php:46 +#: curweather.php:30 +msgid "Error fetching weather data.\\nError was: " +msgstr "" + +#: curweather.php:103 curweather.php:163 msgid "Current Weather" msgstr "" -#: curweather.php:67 +#: curweather.php:109 +msgid "Relative Humidity" +msgstr "" + +#: curweather.php:110 +msgid "Pressure" +msgstr "" + +#: curweather.php:111 +msgid "Wind" +msgstr "" + +#: curweather.php:112 +msgid "Last Updated" +msgstr "" + +#: curweather.php:113 +msgid "Data by" +msgstr "" + +#: curweather.php:114 +msgid "Show on map" +msgstr "" + +#: curweather.php:119 +msgid "There was a problem accessing the weather data. But have a look" +msgstr "" + +#: curweather.php:121 +msgid "at OpenWeatherMap" +msgstr "" + +#: curweather.php:137 msgid "Current Weather settings updated." msgstr "" -#: curweather.php:90 -msgid "Current Weather Settings" +#: curweather.php:152 +msgid "No APPID found, please contact your admin to optain one." msgstr "" -#: curweather.php:93 -msgid "Weather Location: " +#: curweather.php:162 curweather.php:191 +msgid "Save Settings" msgstr "" -#: curweather.php:96 -msgid "Enable Current Weather" +#: curweather.php:163 +msgid "Settings" msgstr "" -#: curweather.php:104 -msgid "Submit" +#: curweather.php:165 +msgid "Enter either the name of your location or the zip code." +msgstr "" + +#: curweather.php:166 +msgid "Your Location" +msgstr "" + +#: curweather.php:166 +msgid "" +"Identifier of your location (name or zip code), e.g. Berlin,DE or " +"14476,DE." +msgstr "" + +#: curweather.php:167 +msgid "Units" +msgstr "" + +#: curweather.php:167 +msgid "select if the temperatur should be displayed in °C or °F" +msgstr "" + +#: curweather.php:168 +msgid "Show weather data" +msgstr "" + +#: curweather.php:181 +msgid "Curweather settings saved." +msgstr "" + +#: curweather.php:192 +msgid "Caching Interval" +msgstr "" + +#: curweather.php:192 +msgid "" +"For how long should the weather data be cached? Choose according your " +"OpenWeatherMap account type." +msgstr "" + +#: curweather.php:192 +msgid "no cache" +msgstr "" + +#: curweather.php:192 +msgid "minutes" +msgstr "" + +#: curweather.php:193 +msgid "Your APPID" +msgstr "" + +#: curweather.php:193 +msgid "Your API key provided by OpenWeatherMap" msgstr "" diff --git a/curweather/templates/admin.tpl b/curweather/templates/admin.tpl new file mode 100644 index 00000000..0d43ae57 --- /dev/null +++ b/curweather/templates/admin.tpl @@ -0,0 +1,3 @@ +{{include file="field_input.tpl" field=$appid}} +{{include file="field_select.tpl" field=$cachetime}} +
diff --git a/curweather/templates/settings.tpl b/curweather/templates/settings.tpl new file mode 100644 index 00000000..09f6f506 --- /dev/null +++ b/curweather/templates/settings.tpl @@ -0,0 +1,15 @@ + +

{{$header}}

+
+ diff --git a/curweather/templates/widget-error.tpl b/curweather/templates/widget-error.tpl new file mode 100644 index 00000000..c5762404 --- /dev/null +++ b/curweather/templates/widget-error.tpl @@ -0,0 +1 @@ +
{{$problem}} {{$atOWM}}.
diff --git a/curweather/templates/widget.tpl b/curweather/templates/widget.tpl new file mode 100644 index 00000000..b893eef6 --- /dev/null +++ b/curweather/templates/widget.tpl @@ -0,0 +1,17 @@ +
+
+

{{$title}}: {{$city}}

+
+

+ +

    +
  • {{$temp}}
  • +
  • {{$relhumidity['caption']}}: {{$relhumidity['val']}}
  • +
  • {{$pressure['caption']}}: {{$pressure['val']}}
  • +
  • {{$wind['caption']}}: {{$wind['val']}}
  • +

+ +
+
diff --git a/curweather/test.php b/curweather/test.php deleted file mode 100644 index cd51c23c..00000000 --- a/curweather/test.php +++ /dev/null @@ -1,5 +0,0 @@ - -* Author: Tobias Diekershoff +* Author: Tobias Diekershoff */ function irc_install() { diff --git a/krynn/krynn.css b/krynn/krynn.css deleted file mode 100755 index 466a3ecd..00000000 --- a/krynn/krynn.css +++ /dev/null @@ -1,14 +0,0 @@ - - - -#krynn-enable-label { - float: left; - width: 200px; - margin-bottom: 25px; -} - -#krynn-checkbox { - float: left; -} - - diff --git a/krynn/krynn.php b/krynn/krynn.php deleted file mode 100755 index de968713..00000000 --- a/krynn/krynn.php +++ /dev/null @@ -1,173 +0,0 @@ - - * Planets Author: Tony Baldwin - * Author: Dylan Thiedeke - * - *"My body was my sacrifice... for my magic. This damage is permanent." - Raistlin Majere - */ - - -function krynn_install() { - - /** - * - * Our demo plugin will attach in three places. - * The first is just prior to storing a local post. - * - */ - - register_hook('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook'); - - /** - * - * Then we'll attach into the plugin settings page, and also the - * settings post hook so that we can create and update - * user preferences. - * - */ - - register_hook('plugin_settings', 'addon/krynn/krynn.php', 'krynn_settings'); - register_hook('plugin_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post'); - - logger("installed krynn"); -} - - -function krynn_uninstall() { - - /** - * - * uninstall unregisters any hooks created with register_hook - * during install. It may also delete configuration settings - * and any other cleanup. - * - */ - - unregister_hook('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook'); - unregister_hook('plugin_settings', 'addon/krynn/krynn.php', 'krynn_settings'); - unregister_hook('plugin_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post'); - - - logger("removed krynn"); -} - - - -function krynn_post_hook($a, &$item) { - - /** - * - * An item was posted on the local system. - * We are going to look for specific items: - * - A status post by a profile owner - * - The profile owner must have allowed our plugin - * - */ - - logger('krynn invoked'); - - if(! local_user()) /* non-zero if this is a logged in user of this system */ - return; - - if(local_user() != $item['uid']) /* Does this person own the post? */ - return; - - if($item['parent']) /* If the item has a parent, this is a comment or something else, not a status post. */ - return; - - /* Retrieve our personal config setting */ - - $active = get_pconfig(local_user(), 'krynn', 'enable'); - - if(! $active) - return; - - /** - * - * OK, we're allowed to do our stuff. - * Here's what we are going to do: - * load the list of timezone names, and use that to generate a list of krynn locales. - * Then we'll pick one of those at random and put it in the "location" field for the post. - * - */ - - $krynn = array('Ansalon','Abanasinia','Solace','Haven','Gateway','Qualinost','Ankatavaka','Pax Tharkas','Ergoth','Newsea','Straights of Schallsea','Plains of Dust','Tarsis','Barren Hills','Que Shu','Citadel of Light','Solinari','Hedge Maze','Tower of High Sorcery','Inn of the Last Home','Last Heroes Tomb','Academy of Sorcery','Gods Row','Temple of Majere','Temple of Kiri-Jolith','Temple of Mishakal','Temple of Zeboim','The Trough','Sad Town','Xak Tsaroth','Zhaman','Skullcap','Saifhum','Karthay','Mithas','Kothas','Silver Dragon Mountain','Silvanesti'); - - $planet = array_rand($krynn,1); - $item['location'] = $krynn[$planet]; - - return; -} - - - - -/** - * - * Callback from the settings post function. - * $post contains the $_POST array. - * We will make sure we've got a valid user account - * and if so set our configuration setting for this person. - * - */ - -function krynn_settings_post($a,$post) { - if(! local_user()) - return; - if($_POST['krynn-submit']) - set_pconfig(local_user(),'krynn','enable',intval($_POST['krynn'])); -} - - -/** - * - * Called from the Plugin Setting form. - * Add our own settings info to the page. - * - */ - - - -function krynn_settings(&$a,&$s) { - - if(! local_user()) - return; - - /* Add our stylesheet to the page so we can make our settings look nice */ - - $a->page['htmlhead'] .= '' . "\r\n"; - - /* Get the current state of our config variable */ - - $enabled = get_pconfig(local_user(),'krynn','enable'); - - $checked = (($enabled) ? ' checked="checked" ' : ''); - - /* Add some HTML to the existing form */ - - $s .= ''; - $s .= '

' . t('Krynn') . '

'; - $s .= '
'; - $s .= ''; - -} - - diff --git a/krynn/lang/C/messages.po b/krynn/lang/C/messages.po deleted file mode 100644 index 0831b915..00000000 --- a/krynn/lang/C/messages.po +++ /dev/null @@ -1,30 +0,0 @@ -# ADDON krynn -# Copyright (C) -# This file is distributed under the same license as the Friendica krynn addon package. -# -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-27 05:01-0500\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: krynn.php:150 -msgid "Krynn Settings" -msgstr "" - -#: krynn.php:152 -msgid "Enable Krynn Plugin" -msgstr "" - -#: krynn.php:158 -msgid "Submit" -msgstr "" diff --git a/krynn/lang/ca/strings.php b/krynn/lang/ca/strings.php deleted file mode 100644 index ec7bf803..00000000 --- a/krynn/lang/ca/strings.php +++ /dev/null @@ -1,5 +0,0 @@ -strings["Krynn Settings"] = "Ajustos de Krynn"; -$a->strings["Enable Krynn Plugin"] = "Activa Plugin de Krynn"; -$a->strings["Submit"] = "Enviar"; diff --git a/krynn/lang/cs/messages.po b/krynn/lang/cs/messages.po deleted file mode 100644 index 69e803e3..00000000 --- a/krynn/lang/cs/messages.po +++ /dev/null @@ -1,32 +0,0 @@ -# ADDON krynn -# Copyright (C) -# This file is distributed under the same license as the Friendica krynn addon package. -# -# -# Translators: -# Michal Šupler , 2014-2015 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-27 05:01-0500\n" -"PO-Revision-Date: 2015-02-11 19:37+0000\n" -"Last-Translator: Michal Šupler \n" -"Language-Team: Czech (http://www.transifex.com/projects/p/friendica/language/cs/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: cs\n" -"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" - -#: krynn.php:150 -msgid "Krynn Settings" -msgstr "Krynn Nastavení" - -#: krynn.php:152 -msgid "Enable Krynn Plugin" -msgstr "Povolit Krynn plugin" - -#: krynn.php:158 -msgid "Submit" -msgstr "Odeslat" diff --git a/krynn/lang/cs/strings.php b/krynn/lang/cs/strings.php deleted file mode 100644 index e725ffc3..00000000 --- a/krynn/lang/cs/strings.php +++ /dev/null @@ -1,10 +0,0 @@ -=2 && $n<=4) ? 1 : 2;; -}} -; -$a->strings["Krynn Settings"] = "Krynn Nastavení"; -$a->strings["Enable Krynn Plugin"] = "Povolit Krynn plugin"; -$a->strings["Submit"] = "Odeslat"; diff --git a/krynn/lang/de/messages.po b/krynn/lang/de/messages.po deleted file mode 100644 index 12dceb31..00000000 --- a/krynn/lang/de/messages.po +++ /dev/null @@ -1,33 +0,0 @@ -# ADDON Krynn -# Copyright (C) -# This file is distributed under the same license as the Friendica Krynn addon package. -# -# -# Translators: -# Abrax , 2014 -# bavatar , 2014 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-27 05:01-0500\n" -"PO-Revision-Date: 2014-10-15 12:32+0000\n" -"Last-Translator: Abrax \n" -"Language-Team: German (http://www.transifex.com/projects/p/friendica/language/de/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: de\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: Krynn.php:150 -msgid "Krynn Settings" -msgstr "Planeten Einstellungen" - -#: Krynn.php:152 -msgid "Enable Krynn Plugin" -msgstr "Planeten-Plugin aktivieren" - -#: Krynn.php:158 -msgid "Submit" -msgstr "Senden" diff --git a/krynn/lang/de/strings.php b/krynn/lang/de/strings.php deleted file mode 100644 index 74b5e9f9..00000000 --- a/krynn/lang/de/strings.php +++ /dev/null @@ -1,10 +0,0 @@ -strings["Krynn Settings"] = "Krynn Einstellungen"; -$a->strings["Enable Krynn Plugin"] = "Krynn-Plugin aktivieren"; -$a->strings["Submit"] = "Senden"; diff --git a/krynn/lang/eo/strings.php b/krynn/lang/eo/strings.php deleted file mode 100644 index 8b8dd24a..00000000 --- a/krynn/lang/eo/strings.php +++ /dev/null @@ -1,5 +0,0 @@ -strings["Krynn Settings"] = "Agordo pri Krynn"; -$a->strings["Enable Krynn Plugin"] = "Ŝalti la Krynn kromprogamon"; -$a->strings["Submit"] = "Sendi"; diff --git a/krynn/lang/es/strings.php b/krynn/lang/es/strings.php deleted file mode 100644 index 3369d1b4..00000000 --- a/krynn/lang/es/strings.php +++ /dev/null @@ -1,5 +0,0 @@ -strings["Krynn Settings"] = "Configuración de Krynn"; -$a->strings["Enable Krynn Plugin"] = "Activar el módulo de planetas Krynn"; -$a->strings["Submit"] = "Envíar"; diff --git a/krynn/lang/fr/strings.php b/krynn/lang/fr/strings.php deleted file mode 100644 index 601f9502..00000000 --- a/krynn/lang/fr/strings.php +++ /dev/null @@ -1,5 +0,0 @@ -strings["Krynn Settings"] = "Réglages des Krynn"; -$a->strings["Enable Krynn Plugin"] = "Activer Krynn"; -$a->strings["Submit"] = "Envoyer"; diff --git a/krynn/lang/is/strings.php b/krynn/lang/is/strings.php deleted file mode 100644 index 976a601e..00000000 --- a/krynn/lang/is/strings.php +++ /dev/null @@ -1,5 +0,0 @@ -strings["Krynn Settings"] = ""; -$a->strings["Enable Krynn Plugin"] = ""; -$a->strings["Submit"] = "Senda inn"; diff --git a/krynn/lang/it/messages.po b/krynn/lang/it/messages.po deleted file mode 100644 index 2dbfa3c7..00000000 --- a/krynn/lang/it/messages.po +++ /dev/null @@ -1,32 +0,0 @@ -# ADDON krynn -# Copyright (C) -# This file is distributed under the same license as the Friendica krynn addon package. -# -# -# Translators: -# fabrixxm , 2014 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-27 05:01-0500\n" -"PO-Revision-Date: 2014-10-15 09:01+0000\n" -"Last-Translator: fabrixxm \n" -"Language-Team: Italian (http://www.transifex.com/projects/p/friendica/language/it/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: it\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: krynn.php:150 -msgid "Krynn Settings" -msgstr "Impostazioni \"Pianeti\"" - -#: krynn.php:152 -msgid "Enable Krynn Plugin" -msgstr "Abilita il plugin \"Pianeti\"" - -#: krynn.php:158 -msgid "Submit" -msgstr "" diff --git a/krynn/lang/it/strings.php b/krynn/lang/it/strings.php deleted file mode 100644 index 9e4d7037..00000000 --- a/krynn/lang/it/strings.php +++ /dev/null @@ -1,10 +0,0 @@ -strings["Krynn Settings"] = "Impostazioni \"Kryn"; -$a->strings["Enable Krynn Plugin"] = "Abilita il plugin \"Krynn\""; -$a->strings["Submit"] = ""; diff --git a/krynn/lang/nb-no/strings.php b/krynn/lang/nb-no/strings.php deleted file mode 100644 index 06ad32cb..00000000 --- a/krynn/lang/nb-no/strings.php +++ /dev/null @@ -1,5 +0,0 @@ -strings["Krynn Settings"] = ""; -$a->strings["Enable Krynn Plugin"] = ""; -$a->strings["Submit"] = "Lagre"; diff --git a/krynn/lang/pl/strings.php b/krynn/lang/pl/strings.php deleted file mode 100644 index 239001b1..00000000 --- a/krynn/lang/pl/strings.php +++ /dev/null @@ -1,5 +0,0 @@ -strings["Krynn Settings"] = ""; -$a->strings["Enable Krynn Plugin"] = ""; -$a->strings["Submit"] = "Potwierdź"; diff --git a/krynn/lang/pt-br/strings.php b/krynn/lang/pt-br/strings.php deleted file mode 100644 index a3b2d663..00000000 --- a/krynn/lang/pt-br/strings.php +++ /dev/null @@ -1,5 +0,0 @@ -strings["Krynn Settings"] = "Configuração dos Krynn"; -$a->strings["Enable Krynn Plugin"] = "Habilita configuração dos Krynn"; -$a->strings["Submit"] = "Enviar"; diff --git a/krynn/lang/ro/messages.po b/krynn/lang/ro/messages.po deleted file mode 100644 index 2e629e1c..00000000 --- a/krynn/lang/ro/messages.po +++ /dev/null @@ -1,32 +0,0 @@ -# ADDON krynn -# Copyright (C) -# This file is distributed under the same license as the Friendica krynn addon package. -# -# -# Translators: -# Doru DEACONU , 2014 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-27 05:01-0500\n" -"PO-Revision-Date: 2014-11-27 14:16+0000\n" -"Last-Translator: Doru DEACONU \n" -"Language-Team: Romanian (Romania) (http://www.transifex.com/projects/p/friendica/language/ro_RO/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ro_RO\n" -"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" - -#: krynn.php:150 -msgid "Krynn Settings" -msgstr "Configurări Krynn" - -#: krynn.php:152 -msgid "Enable Krynn Plugin" -msgstr "Activare Modul Krynn" - -#: krynn.php:158 -msgid "Submit" -msgstr "Trimite" diff --git a/krynn/lang/ro/strings.php b/krynn/lang/ro/strings.php deleted file mode 100644 index 88a84ee8..00000000 --- a/krynn/lang/ro/strings.php +++ /dev/null @@ -1,10 +0,0 @@ -19)||(($n%100==0)&&($n!=0)))?2:1));; -}} -; -$a->strings["Krynn Settings"] = "Configurări Krynn"; -$a->strings["Enable Krynn Plugin"] = "Activare Modul Krynn"; -$a->strings["Submit"] = "Trimite"; diff --git a/krynn/lang/ru/strings.php b/krynn/lang/ru/strings.php deleted file mode 100644 index 8fd1069b..00000000 --- a/krynn/lang/ru/strings.php +++ /dev/null @@ -1,5 +0,0 @@ -strings["Krynn Settings"] = ""; -$a->strings["Enable Krynn Plugin"] = ""; -$a->strings["Submit"] = "Подтвердить"; diff --git a/krynn/lang/sv/strings.php b/krynn/lang/sv/strings.php deleted file mode 100644 index 3ec569a7..00000000 --- a/krynn/lang/sv/strings.php +++ /dev/null @@ -1,3 +0,0 @@ -strings["Submit"] = "Spara"; diff --git a/krynn/lang/zh-cn/strings.php b/krynn/lang/zh-cn/strings.php deleted file mode 100644 index dcbfbeb7..00000000 --- a/krynn/lang/zh-cn/strings.php +++ /dev/null @@ -1,5 +0,0 @@ -strings["Krynn Settings"] = "行星设置"; -$a->strings["Enable Krynn Plugin"] = "使行星插件可用"; -$a->strings["Submit"] = "提交"; diff --git a/planets/planets.php b/planets/planets.php index d40e6c61..72698cb9 100755 --- a/planets/planets.php +++ b/planets/planets.php @@ -92,7 +92,7 @@ function planets_post_hook($a, &$item) { * */ - $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'); + $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'); $planet = array_rand($planets,1); $item['location'] = $planets[$planet]; @@ -146,20 +146,12 @@ function planets_settings(&$a,&$s) { /* Add some HTML to the existing form */ - $s .= ''; - $s .= '

' . t('Planets') . '

'; - $s .= '
'; - $s .= ''; } } function statusnet_settings_post ($a,$post) { if(! local_user()) return; - // don't check GNU Social settings if GNU Social submit button is not clicked + // don't check statusnet settings if statusnet submit button is not clicked if (!x($_POST,'statusnet-submit')) return; if (isset($_POST['statusnet-disconnect'])) { /*** - * if the GNU Social-disconnect checkbox is set, clear the GNU Social configuration + * if the statusnet-disconnect checkbox is set, clear the statusnet configuration */ del_pconfig(local_user(), 'statusnet', 'consumerkey'); del_pconfig(local_user(), 'statusnet', 'consumersecret'); @@ -178,7 +178,7 @@ function statusnet_settings_post ($a,$post) { } else { if (isset($_POST['statusnet-preconf-apiurl'])) { /*** - * If the user used one of the preconfigured GNU Social server credentials + * If the user used one of the preconfigured StatusNet server credentials * use them. All the data are available in the global config. * Check the API Url never the less and blame the admin if it's not working ^^ */ @@ -200,7 +200,7 @@ function statusnet_settings_post ($a,$post) { goaway($a->get_baseurl().'/settings/connectors'); } else { if (isset($_POST['statusnet-consumersecret'])) { - // check if we can reach the API of the GNU Social server + // check if we can reach the API of the StatusNet server // we'll check the API Version for that, if we don't get one we'll try to fix the path but will // resign quickly after this one try to fix the path ;-) $apibase = $_POST['statusnet-baseapi']; @@ -222,18 +222,18 @@ function statusnet_settings_post ($a,$post) { set_pconfig(local_user(), 'statusnet', 'baseapi', $apibase ); } else { // still not the correct API base, let's do noting - notice( t('We could not contact the GNU Social API with the Path you entered.').EOL ); + notice( t('We could not contact the StatusNet API with the Path you entered.').EOL ); } } goaway($a->get_baseurl().'/settings/connectors'); } else { if (isset($_POST['statusnet-pin'])) { - // if the user supplied us with a PIN from GNU Social, let the magic of OAuth happen + // if the user supplied us with a PIN from StatusNet, let the magic of OAuth happen $api = get_pconfig(local_user(), 'statusnet', 'baseapi'); $ckey = get_pconfig(local_user(), 'statusnet', 'consumerkey' ); $csecret = get_pconfig(local_user(), 'statusnet', 'consumersecret' ); // the token and secret for which the PIN was generated were hidden in the settings - // form as token and token2, we need a new connection to GNU Social using these token + // form as token and token2, we need a new connection to StatusNet using these token // and secret to request a Access Token with the PIN $connection = new StatusNetOAuth($api, $ckey, $csecret, $_POST['statusnet-token'], $_POST['statusnet-token2']); $token = $connection->getAccessToken( $_POST['statusnet-pin'] ); @@ -256,7 +256,7 @@ function statusnet_settings_post ($a,$post) { if (!intval($_POST['statusnet-mirror'])) del_pconfig(local_user(),'statusnet','lastid'); - info( t('GNU Social settings updated.') . EOL); + info( t('StatusNet settings updated.') . EOL); }}}} } function statusnet_settings(&$a,&$s) { @@ -291,11 +291,11 @@ function statusnet_settings(&$a,&$s) { $css = (($enabled) ? '' : '-disabled'); $s .= ''; - $s .= '

'. t('GNU Social Import/Export/Mirror').'

'; + $s .= '

'. t('StatusNet Import/Export/Mirror').'

'; $s .= '
'; $s .= '