| | |
| | | catch(Exception $e) { |
| | | } |
| | | |
| | | $forced = FALSE; |
| | | if(empty($arg)) { |
| | | $arg = 'Warszawa'; |
| | | $forced = TRUE; |
| | |
| | | $arg = trim($msg->args); |
| | | } |
| | | |
| | | $out = new BotMsg(); |
| | | |
| | | if(empty($arg)) { |
| | | if(isset($this->session->miasto)) { |
| | | return new BotMsg('Aktualnie ustawione miejsce to: '.htmlspecialchars($this->session->miasto).', '.htmlspecialchars($this->session->countryName)); |
| | | if(isset($msg->session->miasto)) { |
| | | return new BotMsg('Aktualnie ustawione miejsce to: '.htmlspecialchars($msg->session->miasto).', '.htmlspecialchars($msg->session->kraj)); |
| | | } |
| | | |
| | | try { |
| | |
| | | } |
| | | else |
| | | { |
| | | $out = new BotMsg(); |
| | | |
| | | } |
| | | |
| | | $api = new api_geonames(); |
| | |
| | | $msg->session->cc = $dane['countryCode']; |
| | | $msg->session->geo = array('lat' => $dane['lat'], 'lon' => $dane['lng']); |
| | | |
| | | $out->a('<p>Ustawiono miejsce: '.htmlspecialchars($this->session->miasto).', '.htmlspecialchars($this->session->countryName).'</p>'); |
| | | $out->a('<p>Ustawiono miejsce: '.htmlspecialchars($msg->session->miasto).', '.htmlspecialchars($msg->session->kraj).'</p>'); |
| | | |
| | | return $out; |
| | | } |
| | | } |
| | | ?> |