diff --git a/.tx/config b/.tx/config
index 50b8ef45..599edaee 100644
--- a/.tx/config
+++ b/.tx/config
@@ -1,12 +1,6 @@
[main]
host = https://www.transifex.com
-[friendica.addon_appnet_messagespo]
-file_filter = appnet/lang//messages.po
-source_file = appnet/lang/C/messages.po
-source_lang = en
-type = PO
-
[friendica.addon_blackout_messagespo]
file_filter = blackout/lang//messages.po
source_file = blackout/lang/C/messages.po
@@ -37,12 +31,6 @@ source_file = buglink/lang/C/messages.po
source_lang = en
type = PO
-[friendica.addon_cal_messagespo]
-file_filter = cal/lang//messages.po
-source_file = cal/lang/C/messages.po
-source_lang = en
-type = PO
-
[friendica.addon_communityhome_messagespo]
file_filter = communityhome/lang//messages.po
source_file = communityhome/lang/C/messages.po
@@ -73,24 +61,12 @@ source_file = dwpost/lang/C/messages.po
source_lang = en
type = PO
-[friendica.addon_editplain_messagespo]
-file_filter = editplain/lang//messages.po
-source_file = editplain/lang/C/messages.po
-source_lang = en
-type = PO
-
[friendica.addon_forumdirectory_messagespo]
file_filter = forumdirectory/lang//messages.po
source_file = forumdirectory/lang/C/messages.po
source_lang = en
type = PO
-[friendica.addon_forumlist_messagespo]
-file_filter = forumlist/lang//messages.po
-source_file = forumlist/lang/C/messages.po
-source_lang = en
-type = PO
-
[friendica.addon_fromapp_messagespo]
file_filter = fromapp/lang//messages.po
source_file = fromapp/lang/C/messages.po
@@ -115,12 +91,6 @@ source_file = gnot/lang/C/messages.po
source_lang = en
type = PO
-[friendica.addon_gpluspost_messagespo]
-file_filter = gpluspost/lang//messages.po
-source_file = gpluspost/lang/C/messages.po
-source_lang = en
-type = PO
-
[friendica.addon_gravatar_messagespo]
file_filter = gravatar/lang//messages.po
source_file = gravatar/lang/C/messages.po
@@ -301,6 +271,12 @@ source_file = rendertime/lang/C/messages.po
source_lang = en
type = PO
+[friendica.addon_securemail_messagespo]
+file_filter = securemail/lang//messages.po
+source_file = securemail/lang/C/messages.po
+source_lang = en
+type = PO
+
[friendica.addon_showmore_messagespo]
file_filter = showmore/lang//messages.po
source_file = showmore/lang/C/messages.po
@@ -313,12 +289,6 @@ source_file = smileybutton/lang/C/messages.po
source_lang = en
type = PO
-[friendica.addon_snautofollow_messagespo]
-file_filter = snautofollow/lang//messages.po
-source_file = snautofollow/lang/C/messages.po
-source_lang = en
-type = PO
-
[friendica.addon_startpage_messagespo]
file_filter = startpage/lang//messages.po
source_file = startpage/lang/C/messages.po
@@ -361,9 +331,9 @@ source_file = twitter/lang/C/messages.po
source_lang = en
type = PO
-[friendica.addon_uhremotestorage_messagespo]
-file_filter = uhremotestorage/lang//messages.po
-source_file = uhremotestorage/lang/C/messages.po
+[friendica.addon_viewsrc_messagespo]
+file_filter = viewsrc/lang//messages.po
+source_file = viewsrc/lang/C/messages.po
source_lang = en
type = PO
@@ -385,6 +355,12 @@ source_file = wppost/lang/C/messages.po
source_lang = en
type = PO
+[friendica.addon_xmpp_messagespo]
+file_filter = xmpp/lang//messages.po
+source_file = xmpp/lang/C/messages.po
+source_lang = en
+type = PO
+
[friendica.addon_yourls_messagespo]
file_filter = yourls/lang//messages.po
source_file = yourls/lang/C/messages.po
diff --git a/appnet/AppDotNet.php b/appnet/AppDotNet.php
new file mode 100644
index 00000000..32361314
--- /dev/null
+++ b/appnet/AppDotNet.php
@@ -0,0 +1,1647 @@
+_clientId = $client_id;
+ $this->_clientSecret = $client_secret;
+
+ // if the digicert certificate exists in the same folder as this file,
+ // remember that fact for later
+ if (file_exists(dirname(__FILE__).'/DigiCertHighAssuranceEVRootCA.pem')) {
+ $this->_sslCA = dirname(__FILE__).'/DigiCertHighAssuranceEVRootCA.pem';
+ }
+ }
+
+ /**
+ * Set whether or not to strip Envelope Response (meta) information
+ * This option will be deprecated in the future. Is it to allow
+ * a stepped migration path between code expecting the old behavior
+ * and new behavior. When not stripped, you still can use the proper
+ * method to pull the meta information. Please start converting your code ASAP
+ */
+ public function includeResponseEnvelope() {
+ $this->_stripResponseEnvelope=false;
+ }
+
+ /**
+ * Construct the proper Auth URL for the user to visit and either grant
+ * or not access to your app. Usually you would place this as a link for
+ * the user to client, or a redirect to send them to the auth URL.
+ * Also can be called after authentication for additional scopes
+ * @param string $callbackUri Where you want the user to be directed
+ * after authenticating with App.net. This must be one of the URIs
+ * allowed by your App.net application settings.
+ * @param array $scope An array of scopes (permissions) you wish to obtain
+ * from the user. Currently options are stream, email, write_post, follow,
+ * messages, and export. If you don't specify anything, you'll only receive
+ * access to the user's basic profile (the default).
+ */
+ public function getAuthUrl($callback_uri,$scope=null) {
+
+ // construct an authorization url based on our client id and other data
+ $data = array(
+ 'client_id'=>$this->_clientId,
+ 'response_type'=>'code',
+ 'redirect_uri'=>$callback_uri,
+ );
+
+ $url = $this->_authUrl;
+ if ($this->_accessToken) {
+ $url .= 'authorize?';
+ } else {
+ $url .= 'authenticate?';
+ }
+ $url .= $this->buildQueryString($data);
+
+ if ($scope) {
+ $url .= '&scope='.implode('+',$scope);
+ }
+
+ // return the constructed url
+ return $url;
+ }
+
+ /**
+ * Call this after they return from the auth page, or anytime you need the
+ * token. For example, you could store it in a database and use
+ * setAccessToken() later on to return on behalf of the user.
+ */
+ public function getAccessToken($callback_uri) {
+ // if there's no access token set, and they're returning from
+ // the auth page with a code, use the code to get a token
+ if (!$this->_accessToken && isset($_GET['code']) && $_GET['code']) {
+
+ // construct the necessary elements to get a token
+ $data = array(
+ 'client_id'=>$this->_clientId,
+ 'client_secret'=>$this->_clientSecret,
+ 'grant_type'=>'authorization_code',
+ 'redirect_uri'=>$callback_uri,
+ 'code'=>$_GET['code']
+ );
+
+ // try and fetch the token with the above data
+ $res = $this->httpReq('post',$this->_authUrl.'access_token', $data);
+
+ // store it for later
+ $this->_accessToken = $res['access_token'];
+ $this->_username = $res['username'];
+ $this->_user_id = $res['user_id'];
+ }
+
+ // return what we have (this may be a token, or it may be nothing)
+ return $this->_accessToken;
+ }
+
+ /**
+ * Check the scope of current token to see if it has required scopes
+ * has to be done after a check
+ */
+ public function checkScopes($app_scopes) {
+ if (!count($this->_scopes)) {
+ return -1; // _scope is empty
+ }
+ $missing=array();
+ foreach($app_scopes as $scope) {
+ if (!in_array($scope,$this->_scopes)) {
+ if ($scope=='public_messages') {
+ // messages works for public_messages
+ if (in_array('messages',$this->_scopes)) {
+ // if we have messages in our scopes
+ continue;
+ }
+ }
+ $missing[]=$scope;
+ }
+ }
+ // identify the ones missing
+ if (count($missing)) {
+ // do something
+ return $missing;
+ }
+ return 0; // 0 missing
+ }
+
+ /**
+ * Set the access token (eg: after retrieving it from offline storage)
+ * @param string $token A valid access token you're previously received
+ * from calling getAccessToken().
+ */
+ public function setAccessToken($token) {
+ $this->_accessToken = $token;
+ }
+
+ /**
+ * Deauthorize the current token (delete your authorization from the API)
+ * Generally this is useful for logging users out from a web app, so they
+ * don't get automatically logged back in the next time you redirect them
+ * to the authorization URL.
+ */
+ public function deauthorizeToken() {
+ return $this->httpReq('delete',$this->_baseUrl.'token');
+ }
+
+ /**
+ * Retrieve an app access token from the app.net API. This allows you
+ * to access the API without going through the user access flow if you
+ * just want to (eg) consume global. App access tokens are required for
+ * some actions (like streaming global). DO NOT share the return value
+ * of this function with any user (or save it in a cookie, etc). This
+ * is considered secret info for your app only.
+ * @return string The app access token
+ */
+ public function getAppAccessToken() {
+
+ // construct the necessary elements to get a token
+ $data = array(
+ 'client_id'=>$this->_clientId,
+ 'client_secret'=>$this->_clientSecret,
+ 'grant_type'=>'client_credentials',
+ );
+
+ // try and fetch the token with the above data
+ $res = $this->httpReq('post',$this->_authUrl.'access_token', $data);
+
+ // store it for later
+ $this->_appAccessToken = $res['access_token'];
+ $this->_accessToken = $res['access_token'];
+ $this->_username = null;
+ $this->_user_id = null;
+
+ return $this->_accessToken;
+ }
+
+ /**
+ * Returns the total number of requests you're allowed within the
+ * alloted time period.
+ * @see getRateLimitReset()
+ */
+ public function getRateLimit() {
+ return $this->_rateLimit;
+ }
+
+ /**
+ * The number of requests you have remaining within the alloted time period
+ * @see getRateLimitReset()
+ */
+ public function getRateLimitRemaining() {
+ return $this->_rateLimitRemaining;
+ }
+
+ /**
+ * The number of seconds remaining in the alloted time period.
+ * When this time is up you'll have getRateLimit() available again.
+ */
+ public function getRateLimitReset() {
+ return $this->_rateLimitReset;
+ }
+
+ /**
+ * The scope the user has
+ */
+ public function getScope() {
+ return $this->_scope;
+ }
+
+ /**
+ * Internal function, parses out important information App.net adds
+ * to the headers.
+ */
+ protected function parseHeaders($response) {
+ // take out the headers
+ // set internal variables
+ // return the body/content
+ $this->_rateLimit = null;
+ $this->_rateLimitRemaining = null;
+ $this->_rateLimitReset = null;
+ $this->_scope = null;
+
+ $response = explode("\r\n\r\n",$response,2);
+ $headers = $response[0];
+
+ if($headers == 'HTTP/1.1 100 Continue') {
+ $response = explode("\r\n\r\n",$response[1],2);
+ $headers = $response[0];
+ }
+
+ if (isset($response[1])) {
+ $content = $response[1];
+ }
+ else {
+ $content = null;
+ }
+
+ // this is not a good way to parse http headers
+ // it will not (for example) take into account multiline headers
+ // but what we're looking for is pretty basic, so we can ignore those shortcomings
+ $headers = explode("\r\n",$headers);
+ foreach ($headers as $header) {
+ $header = explode(': ',$header,2);
+ if (count($header)<2) {
+ continue;
+ }
+ list($k,$v) = $header;
+ switch ($k) {
+ case 'X-RateLimit-Remaining':
+ $this->_rateLimitRemaining = $v;
+ break;
+ case 'X-RateLimit-Limit':
+ $this->_rateLimit = $v;
+ break;
+ case 'X-RateLimit-Reset':
+ $this->_rateLimitReset = $v;
+ break;
+ case 'X-OAuth-Scopes':
+ $this->_scope = $v;
+ $this->_scopes=explode(',',$v);
+ break;
+ }
+ }
+ return $content;
+ }
+
+ /**
+ * Internal function. Used to turn things like TRUE into 1, and then
+ * calls http_build_query.
+ */
+ protected function buildQueryString($array) {
+ foreach ($array as $k=>&$v) {
+ if ($v===true) {
+ $v = '1';
+ }
+ elseif ($v===false) {
+ $v = '0';
+ }
+ unset($v);
+ }
+ return http_build_query($array);
+ }
+
+
+ /**
+ * Internal function to handle all
+ * HTTP requests (POST,PUT,GET,DELETE)
+ */
+ protected function httpReq($act, $req, $params=array(),$contentType='application/x-www-form-urlencoded') {
+ $ch = curl_init($req);
+ $headers = array();
+ if($act != 'get') {
+ curl_setopt($ch, CURLOPT_POST, true);
+ // if they passed an array, build a list of parameters from it
+ if (is_array($params) && $act != 'post-raw') {
+ $params = $this->buildQueryString($params);
+ }
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
+ $headers[] = "Content-Type: ".$contentType;
+ }
+ if($act != 'post' && $act != 'post-raw') {
+ curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($act));
+ }
+ if($act == 'get' && isset($params['access_token'])) {
+ $headers[] = 'Authorization: Bearer '.$params['access_token'];
+ }
+ else if ($this->_accessToken) {
+ $headers[] = 'Authorization: Bearer '.$this->_accessToken;
+ }
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($ch, CURLINFO_HEADER_OUT, true);
+ curl_setopt($ch, CURLOPT_HEADER, true);
+ if ($this->_sslCA) {
+ curl_setopt($ch, CURLOPT_CAINFO, $this->_sslCA);
+ }
+ $this->_last_response = curl_exec($ch);
+ $this->_last_request = curl_getinfo($ch,CURLINFO_HEADER_OUT);
+ $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+ curl_close($ch);
+ if ($http_status==0) {
+ throw new AppDotNetException('Unable to connect to '.$req);
+ }
+ if ($http_status<200 || $http_status>=300) {
+ throw new AppDotNetException('HTTP error '.$this->_last_response);
+ }
+ if ($this->_last_request===false) {
+ if (!curl_getinfo($ch,CURLINFO_SSL_VERIFYRESULT)) {
+ throw new AppDotNetException('SSL verification failed, connection terminated.');
+ }
+ }
+ $response = $this->parseHeaders($this->_last_response);
+ $response = json_decode($response,true);
+
+ if (isset($response['meta'])) {
+ if (isset($response['meta']['max_id'])) {
+ $this->_maxid=$response['meta']['max_id'];
+ $this->_minid=$response['meta']['min_id'];
+ }
+ if (isset($response['meta']['more'])) {
+ $this->_more=$response['meta']['more'];
+ }
+ if (isset($response['meta']['marker'])) {
+ $this->_last_marker=$response['meta']['marker'];
+ }
+ }
+
+ // look for errors
+ if (isset($response['error'])) {
+ if (is_array($response['error'])) {
+ throw new AppDotNetException($response['error']['message'],
+ $response['error']['code']);
+ }
+ else {
+ throw new AppDotNetException($response['error']);
+ }
+ }
+
+ // look for response migration errors
+ elseif (isset($response['meta']) && isset($response['meta']['error_message'])) {
+ throw new AppDotNetException($response['meta']['error_message'],$response['meta']['code']);
+ }
+
+ // if we've received a migration response, handle it and return data only
+ elseif ($this->_stripResponseEnvelope && isset($response['meta']) && isset($response['data'])) {
+ return $response['data'];
+ }
+
+ // else non response migration response, just return it
+ else {
+ return $response;
+ }
+ }
+
+
+ /**
+ * Get max_id from last meta response data envelope
+ */
+ public function getResponseMaxID() {
+ return $this->_maxid;
+ }
+
+ /**
+ * Get min_id from last meta response data envelope
+ */
+ public function getResponseMinID() {
+ return $this->_minid;
+ }
+
+ /**
+ * Get more from last meta response data envelope
+ */
+ public function getResponseMore() {
+ return $this->_more;
+ }
+
+ /**
+ * Get marker from last meta response data envelope
+ */
+ public function getResponseMarker() {
+ return $this->_last_marker;
+ }
+
+ /**
+ * Fetch API configuration object
+ */
+ public function getConfig() {
+ return $this->httpReq('get',$this->_baseUrl.'config');
+ }
+
+ /**
+ * Return the Filters for the current user.
+ */
+ public function getAllFilters() {
+ return $this->httpReq('get',$this->_baseUrl.'filters');
+ }
+
+ /**
+ * Create a Filter for the current user.
+ * @param string $name The name of the new filter
+ * @param array $filters An associative array of filters to be applied.
+ * This may change as the API evolves, as of this writing possible
+ * values are: user_ids, hashtags, link_domains, and mention_user_ids.
+ * You will need to provide at least one filter name=>value pair.
+ */
+ public function createFilter($name='New filter', $filters=array()) {
+ $filters['name'] = $name;
+ return $this->httpReq('post',$this->_baseUrl.'filters',$filters);
+ }
+
+ /**
+ * Returns a specific Filter object.
+ * @param integer $filter_id The ID of the filter you wish to retrieve.
+ */
+ public function getFilter($filter_id=null) {
+ return $this->httpReq('get',$this->_baseUrl.'filters/'.urlencode($filter_id));
+ }
+
+ /**
+ * Delete a Filter. The Filter must belong to the current User.
+ * @return object Returns the deleted Filter on success.
+ */
+ public function deleteFilter($filter_id=null) {
+ return $this->httpReq('delete',$this->_baseUrl.'filters/'.urlencode($filter_id));
+ }
+
+ /**
+ * Process user description, message or post text.
+ * Mentions and hashtags will be parsed out of the
+ * text, as will bare URLs. To create a link in the text without using a
+ * bare URL, include the anchor text in the object text and include a link
+ * entity in the function call.
+ * @param string $text The text of the description/message/post
+ * @param array $data An associative array of optional post data. This
+ * will likely change as the API evolves, as of this writing allowed keys are:
+ * reply_to, and annotations. "annotations" may be a complex object represented
+ * by an associative array.
+ * @param array $params An associative array of optional data to be included
+ * in the URL (such as 'include_annotations' and 'include_machine')
+ * @return array An associative array representing the post.
+ */
+ public function processText($text=null, $data = array(), $params = array()) {
+ $data['text'] = $text;
+ $json = json_encode($data);
+ $qs = '';
+ if (!empty($params)) {
+ $qs = '?'.$this->buildQueryString($params);
+ }
+ return $this->httpReq('post',$this->_baseUrl.'text/process'.$qs, $json, 'application/json');
+ }
+
+ /**
+ * Create a new Post object. Mentions and hashtags will be parsed out of the
+ * post text, as will bare URLs. To create a link in a post without using a
+ * bare URL, include the anchor text in the post's text and include a link
+ * entity in the post creation call.
+ * @param string $text The text of the post
+ * @param array $data An associative array of optional post data. This
+ * will likely change as the API evolves, as of this writing allowed keys are:
+ * reply_to, and annotations. "annotations" may be a complex object represented
+ * by an associative array.
+ * @param array $params An associative array of optional data to be included
+ * in the URL (such as 'include_annotations' and 'include_machine')
+ * @return array An associative array representing the post.
+ */
+ public function createPost($text=null, $data = array(), $params = array()) {
+ $data['text'] = $text;
+
+ $json = json_encode($data);
+ $qs = '';
+ if (!empty($params)) {
+ $qs = '?'.$this->buildQueryString($params);
+ }
+ return $this->httpReq('post',$this->_baseUrl.'posts'.$qs, $json, 'application/json');
+ }
+
+ /**
+ * Returns a specific Post.
+ * @param integer $post_id The ID of the post to retrieve
+ * @param array $params An associative array of optional general parameters.
+ * This will likely change as the API evolves, as of this writing allowed keys
+ * are: include_annotations.
+ * @return array An associative array representing the post
+ */
+ public function getPost($post_id=null,$params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'posts/'.urlencode($post_id)
+ .'?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * Delete a Post. The current user must be the same user who created the Post.
+ * It returns the deleted Post on success.
+ * @param integer $post_id The ID of the post to delete
+ * @param array An associative array representing the post that was deleted
+ */
+ public function deletePost($post_id=null) {
+ return $this->httpReq('delete',$this->_baseUrl.'posts/'.urlencode($post_id));
+ }
+
+ /**
+ * Retrieve the Posts that are 'in reply to' a specific Post.
+ * @param integer $post_id The ID of the post you want to retrieve replies for.
+ * @param array $params An associative array of optional general parameters.
+ * This will likely change as the API evolves, as of this writing allowed keys
+ * are: count, before_id, since_id, include_muted, include_deleted,
+ * include_directed_posts, and include_annotations.
+ * @return An array of associative arrays, each representing a single post.
+ */
+ public function getPostReplies($post_id=null,$params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'posts/'.urlencode($post_id)
+ .'/replies?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * Get the most recent Posts created by a specific User in reverse
+ * chronological order (most recent first).
+ * @param mixed $user_id Either the ID of the user you wish to retrieve posts by,
+ * or the string "me", which will retrieve posts for the user you're authenticated
+ * as.
+ * @param array $params An associative array of optional general parameters.
+ * This will likely change as the API evolves, as of this writing allowed keys
+ * are: count, before_id, since_id, include_muted, include_deleted,
+ * include_directed_posts, and include_annotations.
+ * @return An array of associative arrays, each representing a single post.
+ */
+ public function getUserPosts($user_id='me', $params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'users/'.urlencode($user_id)
+ .'/posts?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * Get the most recent Posts mentioning by a specific User in reverse
+ * chronological order (newest first).
+ * @param mixed $user_id Either the ID of the user who is being mentioned, or
+ * the string "me", which will retrieve posts for the user you're authenticated
+ * as.
+ * @param array $params An associative array of optional general parameters.
+ * This will likely change as the API evolves, as of this writing allowed keys
+ * are: count, before_id, since_id, include_muted, include_deleted,
+ * include_directed_posts, and include_annotations.
+ * @return An array of associative arrays, each representing a single post.
+ */
+ public function getUserMentions($user_id='me',$params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'users/'
+ .urlencode($user_id).'/mentions?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * Return the 20 most recent posts from the current User and
+ * the Users they follow.
+ * @param array $params An associative array of optional general parameters.
+ * This will likely change as the API evolves, as of this writing allowed keys
+ * are: count, before_id, since_id, include_muted, include_deleted,
+ * include_directed_posts, and include_annotations.
+ * @return An array of associative arrays, each representing a single post.
+ */
+ public function getUserStream($params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'posts/stream?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * Returns a specific user object.
+ * @param mixed $user_id The ID of the user you want to retrieve, or the string
+ * "me" to retrieve data for the users you're currently authenticated as.
+ * @param array $params An associative array of optional general parameters.
+ * This will likely change as the API evolves, as of this writing allowed keys
+ * are: include_annotations|include_user_annotations.
+ * @return array An associative array representing the user data.
+ */
+ public function getUser($user_id='me', $params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'users/'.urlencode($user_id)
+ .'?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * Returns multiple users request by an array of user ids
+ * @param array $params An associative array of optional general parameters.
+ * This will likely change as the API evolves, as of this writing allowed keys
+ * are: include_annotations|include_user_annotations.
+ * @return array An associative array representing the users data.
+ */
+ public function getUsers($user_arr, $params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'users?ids='.join(',',$user_arr)
+ .'&'.$this->buildQueryString($params));
+ }
+
+ /**
+ * Add the specified user ID to the list of users followed.
+ * Returns the User object of the user being followed.
+ * @param integer $user_id The user ID of the user to follow.
+ * @return array An associative array representing the user you just followed.
+ */
+ public function followUser($user_id=null) {
+ return $this->httpReq('post',$this->_baseUrl.'users/'.urlencode($user_id).'/follow');
+ }
+
+ /**
+ * Removes the specified user ID to the list of users followed.
+ * Returns the User object of the user being unfollowed.
+ * @param integer $user_id The user ID of the user to unfollow.
+ * @return array An associative array representing the user you just unfollowed.
+ */
+ public function unfollowUser($user_id=null) {
+ return $this->httpReq('delete',$this->_baseUrl.'users/'.urlencode($user_id).'/follow');
+ }
+
+ /**
+ * Returns an array of User objects the specified user is following.
+ * @param mixed $user_id Either the ID of the user being followed, or
+ * the string "me", which will retrieve posts for the user you're authenticated
+ * as.
+ * @return array An array of associative arrays, each representing a single
+ * user following $user_id
+ */
+ public function getFollowing($user_id='me') {
+ return $this->httpReq('get',$this->_baseUrl.'users/'.$user_id.'/following');
+ }
+
+ /**
+ * Returns an array of User objects for users following the specified user.
+ * @param mixed $user_id Either the ID of the user being followed, or
+ * the string "me", which will retrieve posts for the user you're authenticated
+ * as.
+ * @return array An array of associative arrays, each representing a single
+ * user following $user_id
+ */
+ public function getFollowers($user_id='me') {
+ return $this->httpReq('get',$this->_baseUrl.'users/'.$user_id.'/followers');
+ }
+
+ /**
+ * Return Posts matching a specific #hashtag.
+ * @param string $hashtag The hashtag you're looking for.
+ * @param array $params An associative array of optional general parameters.
+ * This will likely change as the API evolves, as of this writing allowed keys
+ * are: count, before_id, since_id, include_muted, include_deleted,
+ * include_directed_posts, and include_annotations.
+ * @return An array of associative arrays, each representing a single post.
+ */
+ public function searchHashtags($hashtag=null, $params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'posts/tag/'
+ .urlencode($hashtag).'?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * Retrieve a list of all public Posts on App.net, often referred to as the
+ * global stream.
+ * @param array $params An associative array of optional general parameters.
+ * This will likely change as the API evolves, as of this writing allowed keys
+ * are: count, before_id, since_id, include_muted, include_deleted,
+ * include_directed_posts, and include_annotations.
+ * @return An array of associative arrays, each representing a single post.
+ */
+ public function getPublicPosts($params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'posts/stream/global?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * List User interactions
+ */
+ public function getMyInteractions($params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'users/me/interactions?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * Retrieve a user's user ID by specifying their username.
+ * Now supported by the API. We use the API if we have a token
+ * Otherwise we scrape the alpha.app.net site for the info.
+ * @param string $username The username of the user you want the ID of, without
+ * an @ symbol at the beginning.
+ * @return integer The user's user ID
+ */
+ public function getIdByUsername($username=null) {
+ if ($this->_accessToken) {
+ $res=$this->httpReq('get',$this->_baseUrl.'users/@'.$username);
+ $user_id=$res['data']['id'];
+ } else {
+ $ch = curl_init('https://alpha.app.net/'.urlencode(strtolower($username)));
+ curl_setopt($ch, CURLOPT_POST, false);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($ch,CURLOPT_USERAGENT,
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0.1) Gecko/20100101 Firefox/7.0.1');
+ $response = curl_exec($ch);
+ curl_close($ch);
+ $temp = explode('title="User Id ',$response);
+ $temp2 = explode('"',$temp[1]);
+ $user_id = $temp2[0];
+ }
+ return $user_id;
+ }
+
+ /**
+ * Mute a user
+ * @param integer $user_id The user ID to mute
+ */
+ public function muteUser($user_id=null) {
+ return $this->httpReq('post',$this->_baseUrl.'users/'.urlencode($user_id).'/mute');
+ }
+
+ /**
+ * Unmute a user
+ * @param integer $user_id The user ID to unmute
+ */
+ public function unmuteUser($user_id=null) {
+ return $this->httpReq('delete',$this->_baseUrl.'users/'.urlencode($user_id).'/mute');
+ }
+
+ /**
+ * List the users muted by the current user
+ * @return array An array of associative arrays, each representing one muted user.
+ */
+ public function getMuted() {
+ return $this->httpReq('get',$this->_baseUrl.'users/me/muted');
+ }
+
+ /**
+ * Star a post
+ * @param integer $post_id The post ID to star
+ */
+ public function starPost($post_id=null) {
+ return $this->httpReq('post',$this->_baseUrl.'posts/'.urlencode($post_id).'/star');
+ }
+
+ /**
+ * Unstar a post
+ * @param integer $post_id The post ID to unstar
+ */
+ public function unstarPost($post_id=null) {
+ return $this->httpReq('delete',$this->_baseUrl.'posts/'.urlencode($post_id).'/star');
+ }
+
+ /**
+ * List the posts starred by the current user
+ * @param array $params An associative array of optional general parameters.
+ * This will likely change as the API evolves, as of this writing allowed keys
+ * are: count, before_id, since_id, include_muted, include_deleted,
+ * include_directed_posts, and include_annotations.
+ * See https://github.com/appdotnet/api-spec/blob/master/resources/posts.md#general-parameters
+ * @return array An array of associative arrays, each representing a single
+ * user who has starred a post
+ */
+ public function getStarred($user_id='me', $params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'users/'.urlencode($user_id).'/stars'
+ .'?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * List the users who have starred a post
+ * @param integer $post_id the post ID to get stars from
+ * @return array An array of associative arrays, each representing one user.
+ */
+ public function getStars($post_id=null) {
+ return $this->httpReq('get',$this->_baseUrl.'posts/'.urlencode($post_id).'/stars');
+ }
+
+ /**
+ * Returns an array of User objects of users who reposted the specified post.
+ * @param integer $post_id the post ID to
+ * @return array An array of associative arrays, each representing a single
+ * user who reposted $post_id
+ */
+ public function getReposters($post_id){
+ return $this->httpReq('get',$this->_baseUrl.'posts/'.urlencode($post_id).'/reposters');
+ }
+
+ /**
+ * Repost an existing Post object.
+ * @param integer $post_id The id of the post
+ * @return not a clue
+ */
+ public function repost($post_id){
+ return $this->httpReq('post',$this->_baseUrl.'posts/'.urlencode($post_id).'/repost');
+ }
+
+ /**
+ * Delete a post that the user has reposted.
+ * @param integer $post_id The id of the post
+ * @return not a clue
+ */
+ public function deleteRepost($post_id){
+ return $this->httpReq('delete',$this->_baseUrl.'posts/'.urlencode($post_id).'/repost');
+ }
+
+ /**
+ * List the posts who match a specific search term
+ * @param array $params a list of filter, search query, and general Post parameters
+ * see: https://developers.app.net/reference/resources/post/search/
+ * @param string $query The search query. Supports
+ * normal search terms. Searches post text.
+ * @return array An array of associative arrays, each representing one post.
+ * or false on error
+ */
+ public function searchPosts($params = array(), $query='', $order='default') {
+ if (!is_array($params)) {
+ return false;
+ }
+ if (!empty($query)) {
+ $params['query']=$query;
+ }
+ if ($order=='default') {
+ if (!empty($query)) {
+ $params['order']='score';
+ } else {
+ $params['order']='id';
+ }
+ }
+ return $this->httpReq('get',$this->_baseUrl.'posts/search?'.$this->buildQueryString($params));
+ }
+
+
+ /**
+ * List the users who match a specific search term
+ * @param string $search The search query. Supports @username or #tag searches as
+ * well as normal search terms. Searches username, display name, bio information.
+ * Does not search posts.
+ * @return array An array of associative arrays, each representing one user.
+ */
+ public function searchUsers($search="") {
+ return $this->httpReq('get',$this->_baseUrl.'users/search?q='.urlencode($search));
+ }
+
+ /**
+ * Return the 20 most recent posts for a stream using a valid Token
+ * @param array $params An associative array of optional general parameters.
+ * This will likely change as the API evolves, as of this writing allowed keys
+ * are: count, before_id, since_id, include_muted, include_deleted,
+ * include_directed_posts, and include_annotations.
+ * @return An array of associative arrays, each representing a single post.
+ */
+ public function getTokenStream($params = array()) {
+ if ($params['access_token']) {
+ return $this->httpReq('get',$this->_baseUrl.'posts/stream?'.$this->buildQueryString($params),$params);
+ } else {
+ return $this->httpReq('get',$this->_baseUrl.'posts/stream?'.$this->buildQueryString($params));
+ }
+ }
+
+ /**
+ * Get a user object by username
+ * @param string $name the @name to get
+ * @return array representing one user
+ */
+ public function getUserByName($name=null) {
+ return $this->httpReq('get',$this->_baseUrl.'users/@'.$name);
+ }
+
+ /**
+ * Return the 20 most recent Posts from the current User's personalized stream
+ * and mentions stream merged into one stream.
+ * @param array $params An associative array of optional general parameters.
+ * This will likely change as the API evolves, as of this writing allowed keys
+ * are: count, before_id, since_id, include_muted, include_deleted,
+ * include_directed_posts, and include_annotations.
+ * @return An array of associative arrays, each representing a single post.
+ */
+ public function getUserUnifiedStream($params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'posts/stream/unified?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * Update Profile Data via JSON
+ * @data array containing user descriptors
+ */
+ public function updateUserData($data = array(), $params = array()) {
+ $json = json_encode($data);
+ return $this->httpReq('put',$this->_baseUrl.'users/me'.'?'.
+ $this->buildQueryString($params), $json, 'application/json');
+ }
+
+ /**
+ * Update a user image
+ * @which avatar|cover
+ * @image path reference to image
+ */
+ protected function updateUserImage($which = 'avatar', $image = null) {
+ $data = array($which=>"@$image");
+ return $this->httpReq('post-raw',$this->_baseUrl.'users/me/'.$which, $data, 'multipart/form-data');
+ }
+
+ public function updateUserAvatar($avatar = null) {
+ if($avatar != null)
+ return $this->updateUserImage('avatar', $avatar);
+ }
+
+ public function updateUserCover($cover = null) {
+ if($cover != null)
+ return $this->updateUserImage('cover', $cover);
+ }
+
+ /**
+ * update stream marker
+ */
+ public function updateStreamMarker($data = array()) {
+ $json = json_encode($data);
+ return $this->httpReq('post',$this->_baseUrl.'posts/marker', $json, 'application/json');
+ }
+
+ /**
+ * get a page of current user subscribed channels
+ */
+ public function getUserSubscriptions($params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'channels?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * get user channels
+ */
+ public function getMyChannels($params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'channels/me?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * create a channel
+ * note: you cannot create a channel with type=net.app.core.pm (see createMessage)
+ */
+ public function createChannel($data = array()) {
+ $json = json_encode($data);
+ return $this->httpReq('post',$this->_baseUrl.'channels'.($pm?'/pm/messsages':''), $json, 'application/json');
+ }
+
+ /**
+ * get channelid info
+ */
+ public function getChannel($channelid, $params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'channels/'.$channelid.'?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * get multiple channels' info by an array of channelids
+ */
+ public function getChannels($channels, $params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'channels?ids='.join(',',$channels).'&'.$this->buildQueryString($params));
+ }
+
+ /**
+ * update channelid
+ */
+ public function updateChannel($channelid, $data = array()) {
+ $json = json_encode($data);
+ return $this->httpReq('put',$this->_baseUrl.'channels/'.$channelid, $json, 'application/json');
+ }
+
+ /**
+ * subscribe from channelid
+ */
+ public function channelSubscribe($channelid) {
+ return $this->httpReq('post',$this->_baseUrl.'channels/'.$channelid.'/subscribe');
+ }
+
+ /**
+ * unsubscribe from channelid
+ */
+ public function channelUnsubscribe($channelid) {
+ return $this->httpReq('delete',$this->_baseUrl.'channels/'.$channelid.'/subscribe');
+ }
+
+ /**
+ * get all user objects subscribed to channelid
+ */
+ public function getChannelSubscriptions($channelid, $params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'channel/'.$channelid.'/subscribers?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * get all user IDs subscribed to channelid
+ */
+ public function getChannelSubscriptionsById($channelid) {
+ return $this->httpReq('get',$this->_baseUrl.'channel/'.$channelid.'/subscribers/ids');
+ }
+
+
+ /**
+ * get a page of messages in channelid
+ */
+ public function getMessages($channelid, $params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'channels/'.$channelid.'/messages?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * create message
+ * @param $channelid numeric or "pm" for auto-chanenl (type=net.app.core.pm)
+ * @param $data array('text'=>'YOUR_MESSAGE') If a type=net.app.core.pm, then "destinations" key can be set to address as an array of people to send this PM too
+ */
+ public function createMessage($channelid,$data) {
+ $json = json_encode($data);
+ return $this->httpReq('post',$this->_baseUrl.'channels/'.$channelid.'/messages', $json, 'application/json');
+ }
+
+ /**
+ * get message
+ */
+ public function getMessage($channelid,$messageid) {
+ return $this->httpReq('get',$this->_baseUrl.'channels/'.$channelid.'/messages/'.$messageid);
+ }
+
+ /**
+ * delete messsage
+ */
+ public function deleteMessage($channelid,$messageid) {
+ return $this->httpReq('delete',$this->_baseUrl.'channels/'.$channelid.'/messages/'.$messageid);
+ }
+
+
+ /**
+ * Get Application Information
+ */
+ public function getAppTokenInfo() {
+ // requires appAccessToken
+ if (!$this->_appAccessToken) {
+ $this->getAppAccessToken();
+ }
+ // ensure request is made with our appAccessToken
+ $params['access_token']=$this->_appAccessToken;
+ return $this->httpReq('get',$this->_baseUrl.'token',$params);
+ }
+
+ /**
+ * Get User Information
+ */
+ public function getUserTokenInfo() {
+ return $this->httpReq('get',$this->_baseUrl.'token');
+ }
+
+ /**
+ * Get Application Authorized User IDs
+ */
+ public function getAppUserIDs() {
+ // requires appAccessToken
+ if (!$this->_appAccessToken) {
+ $this->getAppAccessToken();
+ }
+ // ensure request is made with our appAccessToken
+ $params['access_token']=$this->_appAccessToken;
+ return $this->httpReq('get',$this->_baseUrl.'apps/me/tokens/user_ids',$params);
+ }
+
+ /**
+ * Get Application Authorized User Tokens
+ */
+ public function getAppUserTokens() {
+ // requires appAccessToken
+ if (!$this->_appAccessToken) {
+ $this->getAppAccessToken();
+ }
+ // ensure request is made with our appAccessToken
+ $params['access_token']=$this->_appAccessToken;
+ return $this->httpReq('get',$this->_baseUrl.'apps/me/tokens',$params);
+ }
+
+ public function getLastRequest() {
+ return $this->_last_request;
+ }
+ public function getLastResponse() {
+ return $this->_last_response;
+ }
+
+ /**
+ * Registers your function (or an array of object and method) to be called
+ * whenever an event is received via an open app.net stream. Your function
+ * will receive a single parameter, which is the object wrapper containing
+ * the meta and data.
+ * @param mixed A PHP callback (either a string containing the function name,
+ * or an array where the first element is the class/object and the second
+ * is the method).
+ */
+ public function registerStreamFunction($function) {
+ $this->_streamCallback = $function;
+ }
+
+ /**
+ * Opens a stream that's been created for this user/app and starts sending
+ * events/objects to your defined callback functions. You must define at
+ * least one callback function before opening a stream.
+ * @param mixed $stream Either a stream ID or the endpoint of a stream
+ * you've already created. This stream must exist and must be valid for
+ * your current access token. If you pass a stream ID, the library will
+ * make an API call to get the endpoint.
+ *
+ * This function will return immediately, but your callback functions
+ * will continue to receive events until you call closeStream() or until
+ * App.net terminates the stream from their end with an error.
+ *
+ * If you're disconnected due to a network error, the library will
+ * automatically attempt to reconnect you to the same stream, no action
+ * on your part is necessary for this. However if the app.net API returns
+ * an error, a reconnection attempt will not be made.
+ *
+ * Note there is no closeStream, because once you open a stream you
+ * can't stop it (unless you exit() or die() or throw an uncaught
+ * exception, or something else that terminates the script).
+ * @return boolean True
+ * @see createStream()
+ */
+ public function openStream($stream) {
+ // if there's already a stream running, don't allow another
+ if ($this->_currentStream) {
+ throw new AppDotNetException('There is already a stream being consumed, only one stream can be consumed per AppDotNetStream instance');
+ }
+ // must register a callback (or the exercise is pointless)
+ if (!$this->_streamCallback) {
+ throw new AppDotNetException('You must define your callback function using registerStreamFunction() before calling openStream');
+ }
+ // if the stream is a numeric value, get the stream info from the api
+ if (is_numeric($stream)) {
+ $stream = $this->getStream($stream);
+ $this->_streamUrl = $stream['endpoint'];
+ }
+ else {
+ $this->_streamUrl = $stream;
+ }
+ // continue doing this until we get an error back or something...?
+ $this->httpStream('get',$this->_streamUrl);
+
+ return true;
+ }
+
+ /**
+ * Close the currently open stream.
+ * @return true;
+ */
+ public function closeStream() {
+ if (!$this->_lastStreamActivity) {
+ // never opened
+ return;
+ }
+ if (!$this->_multiStream) {
+ throw new AppDotNetException('You must open a stream before calling closeStream()');
+ }
+ curl_close($this->_currentStream);
+ curl_multi_remove_handle($this->_multiStream,$this->_currentStream);
+ curl_multi_close($this->_multiStream);
+ $this->_currentStream = null;
+ $this->_multiStream = null;
+ }
+
+ /**
+ * Retrieve all streams for the current access token.
+ * @return array An array of stream definitions.
+ */
+ public function getAllStreams() {
+ return $this->httpReq('get',$this->_baseUrl.'streams');
+ }
+
+ /**
+ * Returns a single stream specified by a stream ID. The stream must have been
+ * created with the current access token.
+ * @return array A stream definition
+ */
+ public function getStream($streamId) {
+ return $this->httpReq('get',$this->_baseUrl.'streams/'.urlencode($streamId));
+ }
+
+ /**
+ * Creates a stream for the current app access token.
+ *
+ * @param array $objectTypes The objects you want to retrieve data for from the
+ * stream. At time of writing these can be 'post', 'star', and/or 'user_follow'.
+ * If you don't specify, all events will be retrieved.
+ */
+ public function createStream($objectTypes=null) {
+ // default object types to everything
+ if (is_null($objectTypes)) {
+ $objectTypes = array('post','star','user_follow');
+ }
+ $data = array(
+ 'object_types'=>$objectTypes,
+ 'type'=>'long_poll',
+ );
+ $data = json_encode($data);
+ $response = $this->httpReq('post',$this->_baseUrl.'streams',$data,'application/json');
+ return $response;
+ }
+
+ /**
+ * Update stream for the current app access token
+ *
+ * @param integer $streamId The stream ID to update. This stream must have been
+ * created by the current access token.
+ * @param array $data allows object_types, type, filter_id and key to be updated. filter_id/key can be omitted
+ */
+ public function updateStream($streamId,$data) {
+ // objectTypes is likely required
+ if (is_null($data['object_types'])) {
+ $data['object_types'] = array('post','star','user_follow');
+ }
+ // type can still only be long_poll
+ if (is_null($data['type'])) {
+ $data['type']='long_poll';
+ }
+ $data = json_encode($data);
+ $response = $this->httpReq('put',$this->_baseUrl.'streams/'.urlencode($streamId),$data,'application/json');
+ return $response;
+ }
+
+ /**
+ * Deletes a stream if you no longer need it.
+ *
+ * @param integer $streamId The stream ID to delete. This stream must have been
+ * created by the current access token.
+ */
+ public function deleteStream($streamId) {
+ return $this->httpReq('delete',$this->_baseUrl.'streams/'.urlencode($streamId));
+ }
+
+ /**
+ * Deletes all streams created by the current access token.
+ */
+ public function deleteAllStreams() {
+ return $this->httpReq('delete',$this->_baseUrl.'streams');
+ }
+
+ /**
+ * Internal function used to process incoming chunks from the stream. This is only
+ * public because it needs to be accessed by CURL. Do not call or use this function
+ * in your own code.
+ * @ignore
+ */
+ public function httpStreamReceive($ch,$data) {
+ $this->_lastStreamActivity = time();
+ $this->_streamBuffer .= $data;
+ if (!$this->_streamHeaders) {
+ $pos = strpos($this->_streamBuffer,"\r\n\r\n");
+ if ($pos!==false) {
+ $this->_streamHeaders = substr($this->_streamBuffer,0,$pos);
+ $this->_streamBuffer = substr($this->_streamBuffer,$pos+4);
+ }
+ }
+ else {
+ $pos = strpos($this->_streamBuffer,"\r\n");
+ while ($pos!==false) {
+ $command = substr($this->_streamBuffer,0,$pos);
+ $this->_streamBuffer = substr($this->_streamBuffer,$pos+2);
+ $command = json_decode($command,true);
+ if ($command) {
+ call_user_func($this->_streamCallback,$command);
+ }
+ $pos = strpos($this->_streamBuffer,"\r\n");
+ }
+ }
+ return strlen($data);
+ }
+
+ /**
+ * Opens a long lived HTTP connection to the app.net servers, and sends data
+ * received to the httpStreamReceive function. As a general rule you should not
+ * directly call this method, it's used by openStream().
+ */
+ protected function httpStream($act, $req, $params=array(),$contentType='application/x-www-form-urlencoded') {
+ if ($this->_currentStream) {
+ throw new AppDotNetException('There is already an open stream, you must close the existing one before opening a new one');
+ }
+ $headers = array();
+ $this->_streamBuffer = '';
+ if ($this->_accessToken) {
+ $headers[] = 'Authorization: Bearer '.$this->_accessToken;
+ }
+ $this->_currentStream = curl_init($req);
+ curl_setopt($this->_currentStream, CURLOPT_HTTPHEADER, $headers);
+ curl_setopt($this->_currentStream, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($this->_currentStream, CURLINFO_HEADER_OUT, true);
+ curl_setopt($this->_currentStream, CURLOPT_HEADER, true);
+ if ($this->_sslCA) {
+ curl_setopt($this->_currentStream, CURLOPT_CAINFO, $this->_sslCA);
+ }
+ // every time we receive a chunk of data, forward it to httpStreamReceive
+ curl_setopt($this->_currentStream, CURLOPT_WRITEFUNCTION, array($this, "httpStreamReceive"));
+
+ // curl_exec($ch);
+ // return;
+
+ $this->_multiStream = curl_multi_init();
+ $this->_lastStreamActivity = time();
+ curl_multi_add_handle($this->_multiStream,$this->_currentStream);
+ }
+
+ public function reconnectStream() {
+ $this->closeStream();
+ $this->_connectFailCounter++;
+ // if we've failed a few times, back off
+ if ($this->_connectFailCounter>1) {
+ $sleepTime = pow(2,$this->_connectFailCounter);
+ // don't sleep more than 60 seconds
+ if ($sleepTime>60) {
+ $sleepTime = 60;
+ }
+ sleep($sleepTime);
+ }
+ $this->httpStream('get',$this->_streamUrl);
+ }
+
+ /**
+ * Process an open stream for x microseconds, then return. This is useful if you want
+ * to be doing other things while processing the stream. If you just want to
+ * consume the stream without other actions, you can call processForever() instead.
+ * @param float @microseconds The number of microseconds to process for before
+ * returning. There are 1,000,000 microseconds in a second.
+ *
+ * @return void
+ */
+ public function processStream($microseconds=null) {
+ if (!$this->_multiStream) {
+ throw new AppDotNetException('You must open a stream before calling processStream()');
+ }
+ $start = microtime(true);
+ $active = null;
+ $inQueue = null;
+ $sleepFor = 0;
+ do {
+ // if we haven't received anything within 5.5 minutes, reconnect
+ // keepalives are sent every 5 minutes (measured on 2013-3-12 by @ryantharp)
+ if (time()-$this->_lastStreamActivity>=330) {
+ $this->reconnectStream();
+ }
+ curl_multi_exec($this->_multiStream, $active);
+ if (!$active) {
+ $httpCode = curl_getinfo($this->_currentStream,CURLINFO_HTTP_CODE);
+ // don't reconnect on 400 errors
+ if ($httpCode>=400 && $httpCode<=499) {
+ throw new AppDotNetException('Received HTTP error '.$httpCode.' check your URL and credentials before reconnecting');
+ }
+ $this->reconnectStream();
+ }
+ // sleep for a max of 2/10 of a second
+ $timeSoFar = (microtime(true)-$start)*1000000;
+ $sleepFor = $this->streamingSleepFor;
+ if ($timeSoFar+$sleepFor>$microseconds) {
+ $sleepFor = $microseconds - $timeSoFar;
+ }
+
+ if ($sleepFor>0) {
+ usleep($sleepFor);
+ }
+ } while ($timeSoFar+$sleepFor<$microseconds);
+ }
+
+ /**
+ * Process an open stream forever. This function will never return, if you
+ * want to perform other actions while consuming the stream, you should use
+ * processFor() instead.
+ * @return void This function will never return
+ * @see processFor();
+ */
+ public function processStreamForever() {
+ while (true) {
+ $this->processStream(600);
+ }
+ }
+
+
+ /**
+ * Upload a file to a user's file store
+ * @param string $file A string containing the path of the file to upload.
+ * @param array $data Additional data about the file you're uploading. At the
+ * moment accepted keys are: mime-type, kind, type, name, public and annotations.
+ * - If you don't specify mime-type, ADNPHP will attempt to guess the mime type
+ * based on the file, however this isn't always reliable.
+ * - If you don't specify kind ADNPHP will attempt to determine if the file is
+ * an image or not.
+ * - If you don't specify name, ADNPHP will use the filename of the first
+ * parameter.
+ * - If you don't specify public, your file will be uploaded as a private file.
+ * - Type is REQUIRED.
+ * @param array $params An associative array of optional general parameters.
+ * This will likely change as the API evolves, as of this writing allowed keys
+ * are: include_annotations|include_file_annotations.
+ * @return array An associative array representing the file
+ */
+ public function createFile($file, $data, $params=array()) {
+ if (!$file) {
+ throw new AppDotNetException('You must specify a path to a file');
+ }
+ if (!file_exists($file)) {
+ throw new AppDotNetException('File path specified does not exist');
+ }
+ if (!is_readable($file)) {
+ throw new AppDotNetException('File path specified is not readable');
+ }
+
+ if (!$data) {
+ $data = array();
+ }
+
+ if (!array_key_exists('type',$data) || !$data['type']) {
+ throw new AppDotNetException('Type is required when creating a file');
+ }
+
+ if (!array_key_exists('name',$data)) {
+ $data['name'] = basename($file);
+ }
+
+ if (array_key_exists('mime-type',$data)) {
+ $mimeType = $data['mime-type'];
+ unset($data['mime-type']);
+ }
+ else {
+ $mimeType = null;
+ }
+ if (!array_key_exists('kind',$data)) {
+ $test = @getimagesize($path);
+ if ($test && array_key_exists('mime',$test)) {
+ $data['kind'] = 'image';
+ if (!$mimeType) {
+ $mimeType = $test['mime'];
+ }
+ }
+ else {
+ $data['kind'] = 'other';
+ }
+ }
+ if (!$mimeType) {
+ $finfo = finfo_open(FILEINFO_MIME_TYPE);
+ $mimeType = finfo_file($finfo, $file);
+ finfo_close($finfo);
+ }
+ if (!$mimeType) {
+ throw new AppDotNetException('Unable to determine mime type of file, try specifying it explicitly');
+ }
+ if (!array_key_exists('public',$data) || !$data['public']) {
+ $public = false;
+ }
+ else {
+ $public = true;
+ }
+
+ $data['content'] = "@$file;type=$mimeType";
+ return $this->httpReq('post-raw',$this->_baseUrl.'files', $data, 'multipart/form-data');
+ }
+
+
+ public function createFilePlaceholder($file = null, $params=array()) {
+ $name = basename($file);
+ $data = array('annotations' => $params['annotations'], 'kind' => $params['kind'],
+ 'name' => $name, 'type' => $params['metadata']);
+ $json = json_encode($data);
+ return $this->httpReq('post',$this->_baseUrl.'files', $json, 'application/json');
+ }
+
+ public function updateFileContent($fileid, $file) {
+
+ $data = file_get_contents($file);
+ $finfo = finfo_open(FILEINFO_MIME_TYPE);
+ $mime = finfo_file($finfo, $file);
+ finfo_close($finfo);
+
+ return $this->httpReq('put',$this->_baseUrl.'files/' . $fileid
+ .'/content', $data, $mime);
+ }
+
+ /**
+ * Allows for file rename and annotation changes.
+ * @param integer $file_id The ID of the file to update
+ * @param array $params An associative array of file parameters.
+ * @return array An associative array representing the updated file
+ */
+ public function updateFile($file_id=null, $params=array()) {
+ $data = array('annotations' => $params['annotations'] , 'name' => $params['name']);
+ $json = json_encode($data);
+ return $this->httpReq('put',$this->_baseUrl.'files/'.urlencode($file_id), $json, 'application/json');
+ }
+
+ /**
+ * Returns a specific File.
+ * @param integer $file_id The ID of the file to retrieve
+ * @param array $params An associative array of optional general parameters.
+ * This will likely change as the API evolves, as of this writing allowed keys
+ * are: include_annotations|include_file_annotations.
+ * @return array An associative array representing the file
+ */
+ public function getFile($file_id=null,$params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'files/'.urlencode($file_id)
+ .'?'.$this->buildQueryString($params));
+ }
+
+ public function getFileContent($file_id=null,$params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'files/'.urlencode($file_id)
+ .'/content?'.$this->buildQueryString($params));
+ }
+
+ /** $file_key : derived_file_key */
+ public function getDerivedFileContent($file_id=null,$file_key=null,$params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'files/'.urlencode($file_id)
+ .'/content/'.urlencode($file_key)
+ .'?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * Returns file objects.
+ * @param array $file_ids The IDs of the files to retrieve
+ * @param array $params An associative array of optional general parameters.
+ * This will likely change as the API evolves, as of this writing allowed keys
+ * are: include_annotations|include_file_annotations.
+ * @return array An associative array representing the file data.
+ */
+ public function getFiles($file_ids=array(), $params = array()) {
+ $ids = '';
+ foreach($file_ids as $id) {
+ $ids .= $id . ',';
+ }
+ $params['ids'] = substr($ids, 0, -1);
+ return $this->httpReq('get',$this->_baseUrl.'files'
+ .'?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * Returns a user's file objects.
+ * @param array $params An associative array of optional general parameters.
+ * This will likely change as the API evolves, as of this writing allowed keys
+ * are: include_annotations|include_file_annotations|include_user_annotations.
+ * @return array An associative array representing the file data.
+ */
+ public function getUserFiles($params = array()) {
+ return $this->httpReq('get',$this->_baseUrl.'users/me/files'
+ .'?'.$this->buildQueryString($params));
+ }
+
+ /**
+ * Delete a File. The current user must be the same user who created the File.
+ * It returns the deleted File on success.
+ * @param integer $file_id The ID of the file to delete
+ * @return array An associative array representing the file that was deleted
+ */
+ public function deleteFile($file_id=null) {
+ return $this->httpReq('delete',$this->_baseUrl.'files/'.urlencode($file_id));
+ }
+
+}
+
+class AppDotNetException extends Exception {}
diff --git a/appnet/DigiCertHighAssuranceEVRootCA.pem b/appnet/DigiCertHighAssuranceEVRootCA.pem
new file mode 100644
index 00000000..9e6810ab
--- /dev/null
+++ b/appnet/DigiCertHighAssuranceEVRootCA.pem
@@ -0,0 +1,23 @@
+-----BEGIN CERTIFICATE-----
+MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs
+MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
+d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
+ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL
+MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3
+LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug
+RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm
++9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW
+PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM
+xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB
+Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3
+hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg
+EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF
+MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA
+FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec
+nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z
+eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF
+hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2
+Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
+vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep
++OkuE6N36B9K
+-----END CERTIFICATE-----
diff --git a/appnet/README.md b/appnet/README.md
new file mode 100644
index 00000000..ec24753c
--- /dev/null
+++ b/appnet/README.md
@@ -0,0 +1,15 @@
+App.net Plugin
+==============
+
+With this addon to friendica you can give your users the possibility to post their *public* messages to App.net and
+to import their timeline. The messages will be strapped their rich context and shortened to 256 characters length if
+necessary.
+
+Installation
+------------
+
+If you have an developer account you can create an Application for all of your users at
+[https://account.app.net/developer/apps/](https://account.app.net/developer/apps/). Add the redirect uri
+"https://your.server.name/appnet/connect" (Replace "your.server.name" with the hostname of your server)
+
+If you can't create an application (because you only have a free account) this addon still works, but your users have to create individual applications on their own.
diff --git a/appnet/appnet.css b/appnet/appnet.css
new file mode 100644
index 00000000..b1d8d27e
--- /dev/null
+++ b/appnet/appnet.css
@@ -0,0 +1,29 @@
+#appnet-import-label, #appnet-disconnect-label, #appnet-token-label,
+#appnet-enable-label, #appnet-bydefault-label,
+#appnet-clientid-label, #appnet-clientsecret-label {
+ float: left;
+ width: 200px;
+ margin-top: 10px;
+}
+
+#appnet-import, #appnet-disconnect, #appnet-token,
+#appnet-checkbox, #appnet-bydefault,
+#appnet-clientid, #appnet-clientsecret {
+ float: left;
+ margin-top: 10px;
+}
+
+#appnet-submit {
+ margin-top: 15px;
+}
+
+#appnet-avatar {
+ float: left;
+ width: 48px;
+ height: 48px;
+ padding: 2px;
+}
+#appnet-info-block {
+ height: 52px;
+ vertical-align: middle;
+}
diff --git a/appnet/appnet.php b/appnet/appnet.php
new file mode 100644
index 00000000..151a81ee
--- /dev/null
+++ b/appnet/appnet.php
@@ -0,0 +1,1358 @@
+
+ * Status: Unsupported
+ */
+
+/*
+ To-Do:
+ - Use embedded pictures for the attachment information (large attachment)
+ - Sound links must be handled
+ - https://alpha.app.net/sr_rolando/post/32365203 - double pictures
+ - https://alpha.app.net/opendev/post/34396399 - location data
+*/
+
+require_once('include/enotify.php');
+require_once("include/socgraph.php");
+
+define('APPNET_DEFAULT_POLL_INTERVAL', 5); // given in minutes
+
+function appnet_install() {
+ register_hook('post_local', 'addon/appnet/appnet.php', 'appnet_post_local');
+ register_hook('notifier_normal', 'addon/appnet/appnet.php', 'appnet_send');
+ register_hook('jot_networks', 'addon/appnet/appnet.php', 'appnet_jot_nets');
+ register_hook('cron', 'addon/appnet/appnet.php', 'appnet_cron');
+ register_hook('connector_settings', 'addon/appnet/appnet.php', 'appnet_settings');
+ register_hook('connector_settings_post','addon/appnet/appnet.php', 'appnet_settings_post');
+ register_hook('prepare_body', 'addon/appnet/appnet.php', 'appnet_prepare_body');
+ register_hook('check_item_notification','addon/appnet/appnet.php', 'appnet_check_item_notification');
+}
+
+
+function appnet_uninstall() {
+ unregister_hook('post_local', 'addon/appnet/appnet.php', 'appnet_post_local');
+ unregister_hook('notifier_normal', 'addon/appnet/appnet.php', 'appnet_send');
+ unregister_hook('jot_networks', 'addon/appnet/appnet.php', 'appnet_jot_nets');
+ unregister_hook('cron', 'addon/appnet/appnet.php', 'appnet_cron');
+ unregister_hook('connector_settings', 'addon/appnet/appnet.php', 'appnet_settings');
+ unregister_hook('connector_settings_post', 'addon/appnet/appnet.php', 'appnet_settings_post');
+ unregister_hook('prepare_body', 'addon/appnet/appnet.php', 'appnet_prepare_body');
+ unregister_hook('check_item_notification','addon/appnet/appnet.php', 'appnet_check_item_notification');
+}
+
+function appnet_module() {}
+
+function appnet_content(&$a) {
+ if(! local_user()) {
+ notice( t('Permission denied.') . EOL);
+ return '';
+ }
+
+ require_once("mod/settings.php");
+ settings_init($a);
+
+ if (isset($a->argv[1]))
+ switch ($a->argv[1]) {
+ case "connect":
+ $o = appnet_connect($a);
+ break;
+ default:
+ $o = print_r($a->argv, true);
+ break;
+ }
+ else
+ $o = appnet_connect($a);
+
+ return $o;
+}
+
+function appnet_check_item_notification($a, &$notification_data) {
+ $own_id = get_pconfig($notification_data["uid"], 'appnet', 'ownid');
+
+ $own_user = q("SELECT `url` FROM `contact` WHERE `uid` = %d AND `alias` = '%s' LIMIT 1",
+ intval($notification_data["uid"]),
+ dbesc("adn::".$own_id)
+ );
+
+ if ($own_user)
+ $notification_data["profiles"][] = $own_user[0]["url"];
+}
+
+function appnet_plugin_admin(&$a, &$o){
+ $t = get_markup_template( "admin.tpl", "addon/appnet/" );
+
+ $o = replace_macros($t, array(
+ '$submit' => t('Save Settings'),
+ // name, label, value, help, [extra values]
+ '$clientid' => array('clientid', t('Client ID'), get_config('appnet', 'clientid' ), ''),
+ '$clientsecret' => array('clientsecret', t('Client Secret'), get_config('appnet', 'clientsecret' ), ''),
+ ));
+}
+
+function appnet_plugin_admin_post(&$a){
+ $clientid = ((x($_POST,'clientid')) ? notags(trim($_POST['clientid'])) : '');
+ $clientsecret = ((x($_POST,'clientsecret')) ? notags(trim($_POST['clientsecret'])): '');
+ set_config('appnet','clientid',$clientid);
+ set_config('appnet','clientsecret',$clientsecret);
+ info( t('Settings updated.'). EOL );
+}
+
+function appnet_connect(&$a) {
+ require_once 'addon/appnet/AppDotNet.php';
+
+ $clientId = get_config('appnet','clientid');
+ $clientSecret = get_config('appnet','clientsecret');
+
+ if (($clientId == "") || ($clientSecret == "")) {
+ $clientId = get_pconfig(local_user(),'appnet','clientid');
+ $clientSecret = get_pconfig(local_user(),'appnet','clientsecret');
+ }
+
+ $app = new AppDotNet($clientId, $clientSecret);
+
+ try {
+ $token = $app->getAccessToken($a->get_baseurl().'/appnet/connect');
+
+ logger("appnet_connect: authenticated");
+ $o .= t("You are now authenticated to app.net. ");
+ set_pconfig(local_user(),'appnet','token', $token);
+ }
+ catch (AppDotNetException $e) {
+ $o .= t("
First way: Register an application at https://account.app.net/developer/apps/ and enter Client ID and Client Secret. ');
+ $s .= sprintf(t("Use '%s' as Redirect URI
"
+msgstr ""
+
+#: appnet.php:80
+msgid "return to the connector page"
+msgstr ""
+
+#: appnet.php:94
+msgid "Post to app.net"
+msgstr ""
+
+#: appnet.php:125 appnet.php:129
+msgid "App.net Export"
+msgstr ""
+
+#: appnet.php:142
+msgid "Currently connected to: "
+msgstr ""
+
+#: appnet.php:144
+msgid "Enable App.net Post Plugin"
+msgstr ""
+
+#: appnet.php:149
+msgid "Post to App.net by default"
+msgstr ""
+
+#: appnet.php:153
+msgid "Import the remote timeline"
+msgstr ""
+
+#: appnet.php:159
+msgid ""
+"
Error fetching user profile. Please clear the configuration and try again."
+"
"
+msgstr ""
+
+#: appnet.php:164
+msgid "
You have two ways to connect to App.net.
"
+msgstr ""
+
+#: appnet.php:166
+msgid ""
+"
First way: Register an application at https://account.app.net/developer/apps/ and enter "
+"Client ID and Client Secret. "
+msgstr ""
+
+#: appnet.php:167
+#, php-format
+msgid "Use '%s' as Redirect URI
První možnost: Registrovat svou žádost na https://account.app.net/developer/apps/ a zadat Client ID and Client Secret. "
+
+#: appnet.php:167
+#, php-format
+msgid "Use '%s' as Redirect URI
"
+
+#: appnet.php:180
+msgid "Token"
+msgstr "Token"
+
+#: appnet.php:192
+msgid "Sign in using App.net"
+msgstr "Přihlásit se s použitím App.net"
+
+#: appnet.php:197
+msgid "Clear OAuth configuration"
+msgstr "Vymazat konfiguraci OAuth"
+
+#: appnet.php:204
+msgid "Save Settings"
+msgstr "Uložit Nastavení"
diff --git a/appnet/lang/cs/strings.php b/appnet/lang/cs/strings.php
new file mode 100644
index 00000000..4bc45427
--- /dev/null
+++ b/appnet/lang/cs/strings.php
@@ -0,0 +1,29 @@
+=2 && $n<=4) ? 1 : 2;;
+}}
+;
+$a->strings["Permission denied."] = "Přístup odmítnut.";
+$a->strings["You are now authenticated to app.net. "] = "Nyní jste přihlášen k app.net.";
+$a->strings["
Error fetching token. Please try again.
"] = "
Chyba v přenesení tokenu. Prosím zkuste to znovu.
";
+$a->strings["return to the connector page"] = "návrat ke stránce konektor";
+$a->strings["Post to app.net"] = "Poslat příspěvek na app.net";
+$a->strings["App.net Export"] = "App.net Export";
+$a->strings["Currently connected to: "] = "V současné době připojen k:";
+$a->strings["Enable App.net Post Plugin"] = "Aktivovat App.net Post Plugin";
+$a->strings["Post to App.net by default"] = "Defaultně poslat na App.net";
+$a->strings["Import the remote timeline"] = "Importovat vzdálenou časovou osu";
+$a->strings["
Error fetching user profile. Please clear the configuration and try again.
"] = "
Chyba v přenesení uživatelského profilu. Prosím zkuste smazat konfiguraci a zkusit to znovu.
První možnost: Registrovat svou žádost na https://account.app.net/developer/apps/ a zadat Client ID and Client Secret. ";
+$a->strings["Use '%s' as Redirect URI
Erster Weg: Registriere eine Anwendung unter https://account.app.net/developer/apps/ und wähle eine Client ID und ein Client Secret."
+
+#: appnet.php:167
+#, php-format
+msgid "Use '%s' as Redirect URI
Erster Weg: Registriere eine Anwendung unter https://account.app.net/developer/apps/ und wähle eine Client ID und ein Client Secret.";
+$a->strings["Use '%s' as Redirect URI
Zweiter Weg: Beantrage ein Token unter http://dev-lite.jonathonduerig.com/. ";
+$a->strings["Set these scopes: 'Basic', 'Stream', 'Write Post', 'Public Messages', 'Messages'.
"] = "Verwende folgende Scopes: 'Basic', 'Stream', 'Write Post', 'Public Messages', 'Messages'.";
+$a->strings["Token"] = "Token";
+$a->strings["Sign in using App.net"] = "Per App.net anmelden";
+$a->strings["Clear OAuth configuration"] = "OAuth Konfiguration löschen";
+$a->strings["Save Settings"] = "Einstellungen speichern";
diff --git a/appnet/lang/es/messages.po b/appnet/lang/es/messages.po
new file mode 100644
index 00000000..a44089d7
--- /dev/null
+++ b/appnet/lang/es/messages.po
@@ -0,0 +1,118 @@
+# ADDON appnet
+# Copyright (C)
+# This file is distributed under the same license as the Friendica appnet addon package.
+#
+#
+# Translators:
+# Alberto Díaz Tormo , 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: friendica\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 11:47+0200\n"
+"PO-Revision-Date: 2016-10-13 21:25+0000\n"
+"Last-Translator: Alberto Díaz Tormo \n"
+"Language-Team: Spanish (http://www.transifex.com/Friendica/friendica/language/es/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: es\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: appnet.php:39
+msgid "Permission denied."
+msgstr "Permiso denegado"
+
+#: appnet.php:73
+msgid "You are now authenticated to app.net. "
+msgstr "Ahora está autenticado en app.net."
+
+#: appnet.php:77
+msgid "
Error fetching token. Please try again.
"
+msgstr "
Advertencia de error. Por favor inténtelo de nuevo.
"
+
+#: appnet.php:80
+msgid "return to the connector page"
+msgstr "vuelva a pa página de conexón"
+
+#: appnet.php:94
+msgid "Post to app.net"
+msgstr "Publique en app.net"
+
+#: appnet.php:125 appnet.php:129
+msgid "App.net Export"
+msgstr "Exportar a app.net"
+
+#: appnet.php:142
+msgid "Currently connected to: "
+msgstr "Actualmente conectado a:"
+
+#: appnet.php:144
+msgid "Enable App.net Post Plugin"
+msgstr "Habilitar el plugin de publicación de App.net"
+
+#: appnet.php:149
+msgid "Post to App.net by default"
+msgstr "Publicar en App.net por defecto"
+
+#: appnet.php:153
+msgid "Import the remote timeline"
+msgstr "Importar la línea de tiempo remota"
+
+#: appnet.php:159
+msgid ""
+"
Error fetching user profile. Please clear the configuration and try "
+"again.
"
+msgstr "
Advertencia de error de perfil. Por favor borre la configuración e inténtelo de nuevo.
Primera forma: Registrar una aplicación en https://account.app.net/developer/apps/ y seleccionar Client ID y Client Secret. "
+
+#: appnet.php:167
+#, php-format
+msgid "Use '%s' as Redirect URI
Segunda manera: traiga un símbolo a http://dev-lite.jonathonduerig.com/"
+
+#: appnet.php:178
+msgid ""
+"Set these scopes: 'Basic', 'Stream', 'Write Post', 'Public Messages', "
+"'Messages'.
"
+msgstr "Seleccione estas posibilidades: 'Básico', 'Continuo', 'Escribir entrada', 'Mensajes públicos', 'Mensajes'."
+
+#: appnet.php:180
+msgid "Token"
+msgstr "Símbolo"
+
+#: appnet.php:192
+msgid "Sign in using App.net"
+msgstr "Regístrese usando App.net"
+
+#: appnet.php:197
+msgid "Clear OAuth configuration"
+msgstr "Borre la configuración OAuth"
+
+#: appnet.php:204
+msgid "Save Settings"
+msgstr "Guardar los ajustes"
diff --git a/appnet/lang/es/strings.php b/appnet/lang/es/strings.php
new file mode 100644
index 00000000..020c6f35
--- /dev/null
+++ b/appnet/lang/es/strings.php
@@ -0,0 +1,29 @@
+strings["Permission denied."] = "Permiso denegado";
+$a->strings["You are now authenticated to app.net. "] = "Ahora está autenticado en app.net.";
+$a->strings["
Error fetching token. Please try again.
"] = "
Advertencia de error. Por favor inténtelo de nuevo.
";
+$a->strings["return to the connector page"] = "vuelva a pa página de conexón";
+$a->strings["Post to app.net"] = "Publique en app.net";
+$a->strings["App.net Export"] = "Exportar a app.net";
+$a->strings["Currently connected to: "] = "Actualmente conectado a:";
+$a->strings["Enable App.net Post Plugin"] = "Habilitar el plugin de publicación de App.net";
+$a->strings["Post to App.net by default"] = "Publicar en App.net por defecto";
+$a->strings["Import the remote timeline"] = "Importar la línea de tiempo remota";
+$a->strings["
Error fetching user profile. Please clear the configuration and try again.
"] = "
Advertencia de error de perfil. Por favor borre la configuración e inténtelo de nuevo.
Primera forma: Registrar una aplicación en https://account.app.net/developer/apps/ y seleccionar Client ID y Client Secret. ";
+$a->strings["Use '%s' as Redirect URI
"] = "Use '%s' como Redirigir URI";
+$a->strings["Client ID"] = "ID de cliente";
+$a->strings["Client Secret"] = "Secreto de cliente";
+$a->strings["
Segunda manera: traiga un símbolo a http://dev-lite.jonathonduerig.com/";
+$a->strings["Set these scopes: 'Basic', 'Stream', 'Write Post', 'Public Messages', 'Messages'.
"] = "Seleccione estas posibilidades: 'Básico', 'Continuo', 'Escribir entrada', 'Mensajes públicos', 'Mensajes'.";
+$a->strings["Token"] = "Símbolo";
+$a->strings["Sign in using App.net"] = "Regístrese usando App.net";
+$a->strings["Clear OAuth configuration"] = "Borre la configuración OAuth";
+$a->strings["Save Settings"] = "Guardar los ajustes";
diff --git a/appnet/lang/fr/messages.po b/appnet/lang/fr/messages.po
new file mode 100644
index 00000000..6f5f2997
--- /dev/null
+++ b/appnet/lang/fr/messages.po
@@ -0,0 +1,119 @@
+# ADDON appnet
+# Copyright (C)
+# This file is distributed under the same license as the Friendica appnet addon package.
+#
+#
+# Translators:
+# Hypolite Petovan , 2016
+# Jak , 2014
+msgid ""
+msgstr ""
+"Project-Id-Version: friendica\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 11:47+0200\n"
+"PO-Revision-Date: 2016-09-24 02:12+0000\n"
+"Last-Translator: Hypolite Petovan \n"
+"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: fr\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: appnet.php:39
+msgid "Permission denied."
+msgstr "Autorisation refusée"
+
+#: appnet.php:73
+msgid "You are now authenticated to app.net. "
+msgstr "Vous êtes maintenant authentifié sur app.net"
+
+#: appnet.php:77
+msgid "
Error fetching token. Please try again.
"
+msgstr "
Impossible d'obtenir le jeton, merci de réessayer.
"
+
+#: appnet.php:80
+msgid "return to the connector page"
+msgstr "revenir à la page du connecteur"
+
+#: appnet.php:94
+msgid "Post to app.net"
+msgstr "Publier sur app.net"
+
+#: appnet.php:125 appnet.php:129
+msgid "App.net Export"
+msgstr "Export App.net"
+
+#: appnet.php:142
+msgid "Currently connected to: "
+msgstr "Actuellement connecté à :"
+
+#: appnet.php:144
+msgid "Enable App.net Post Plugin"
+msgstr "Activer le plugin de publication app.net"
+
+#: appnet.php:149
+msgid "Post to App.net by default"
+msgstr "Publier sur App.net par défaut"
+
+#: appnet.php:153
+msgid "Import the remote timeline"
+msgstr "Importer la timeline distante"
+
+#: appnet.php:159
+msgid ""
+"
Error fetching user profile. Please clear the configuration and try "
+"again.
"
+msgstr "
Impossible d'obtenir le profil utilisateur. Merci de réinitialiser la configuration et de réessayer.
"
+
+#: appnet.php:164
+msgid "
You have two ways to connect to App.net.
"
+msgstr "
Vous avez deux possibilités pour vous connecter à App.net.
Première méthode: Enregistrer une application sur App.net [en] et entrez l'ID Client et le Secret Client. "
+
+#: appnet.php:167
+#, php-format
+msgid "Use '%s' as Redirect URI
Deuxième méthode: obtenez un jeton ur http://dev-lite.jonathonduerig.com/ [en]. "
+
+#: appnet.php:178
+msgid ""
+"Set these scopes: 'Basic', 'Stream', 'Write Post', 'Public Messages', "
+"'Messages'.
"
+msgstr "Cochez les \"scopes\" suivant: \"Basic\", \"Stream\", \"Write Post\", \"Public Messages\", \"Messages\"."
+
+#: appnet.php:180
+msgid "Token"
+msgstr "Jeton"
+
+#: appnet.php:192
+msgid "Sign in using App.net"
+msgstr "Se connecter avec App.net"
+
+#: appnet.php:197
+msgid "Clear OAuth configuration"
+msgstr "Effacer la configuration OAuth"
+
+#: appnet.php:204
+msgid "Save Settings"
+msgstr "Sauvegarder les paramètres"
diff --git a/appnet/lang/fr/strings.php b/appnet/lang/fr/strings.php
new file mode 100644
index 00000000..ef9fc9e2
--- /dev/null
+++ b/appnet/lang/fr/strings.php
@@ -0,0 +1,29 @@
+ 1);;
+}}
+;
+$a->strings["Permission denied."] = "Autorisation refusée";
+$a->strings["You are now authenticated to app.net. "] = "Vous êtes maintenant authentifié sur app.net";
+$a->strings["
Error fetching token. Please try again.
"] = "
Impossible d'obtenir le jeton, merci de réessayer.
";
+$a->strings["return to the connector page"] = "revenir à la page du connecteur";
+$a->strings["Post to app.net"] = "Publier sur app.net";
+$a->strings["App.net Export"] = "Export App.net";
+$a->strings["Currently connected to: "] = "Actuellement connecté à :";
+$a->strings["Enable App.net Post Plugin"] = "Activer le plugin de publication app.net";
+$a->strings["Post to App.net by default"] = "Publier sur App.net par défaut";
+$a->strings["Import the remote timeline"] = "Importer la timeline distante";
+$a->strings["
Error fetching user profile. Please clear the configuration and try again.
"] = "
Impossible d'obtenir le profil utilisateur. Merci de réinitialiser la configuration et de réessayer.
";
+$a->strings["
You have two ways to connect to App.net.
"] = "
Vous avez deux possibilités pour vous connecter à App.net.
Deuxième méthode: obtenez un jeton ur http://dev-lite.jonathonduerig.com/ [en]. ";
+$a->strings["Set these scopes: 'Basic', 'Stream', 'Write Post', 'Public Messages', 'Messages'.
"] = "Cochez les \"scopes\" suivant: \"Basic\", \"Stream\", \"Write Post\", \"Public Messages\", \"Messages\".";
+$a->strings["Token"] = "Jeton";
+$a->strings["Sign in using App.net"] = "Se connecter avec App.net";
+$a->strings["Clear OAuth configuration"] = "Effacer la configuration OAuth";
+$a->strings["Save Settings"] = "Sauvegarder les paramètres";
diff --git a/appnet/lang/it/messages.po b/appnet/lang/it/messages.po
new file mode 100644
index 00000000..17b933fe
--- /dev/null
+++ b/appnet/lang/it/messages.po
@@ -0,0 +1,118 @@
+# ADDON appnet
+# Copyright (C)
+# This file is distributed under the same license as the Friendica appnet addon package.
+#
+#
+# Translators:
+# fabrixxm , 2014
+msgid ""
+msgstr ""
+"Project-Id-Version: friendica\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 11:47+0200\n"
+"PO-Revision-Date: 2014-09-10 10:18+0000\n"
+"Last-Translator: fabrixxm \n"
+"Language-Team: Italian (http://www.transifex.com/Friendica/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"
+
+#: appnet.php:39
+msgid "Permission denied."
+msgstr "Permesso negato."
+
+#: appnet.php:73
+msgid "You are now authenticated to app.net. "
+msgstr "Sei autenticato su app.net"
+
+#: appnet.php:77
+msgid "
Error fetching token. Please try again.
"
+msgstr "
Errore recuperando il token. Prova di nuovo
"
+
+#: appnet.php:80
+msgid "return to the connector page"
+msgstr "ritorna alla pagina del connettore"
+
+#: appnet.php:94
+msgid "Post to app.net"
+msgstr "Invia ad app.net"
+
+#: appnet.php:125 appnet.php:129
+msgid "App.net Export"
+msgstr "Esporta App.net"
+
+#: appnet.php:142
+msgid "Currently connected to: "
+msgstr "Al momento connesso con:"
+
+#: appnet.php:144
+msgid "Enable App.net Post Plugin"
+msgstr "Abilita il plugin di invio ad App.net"
+
+#: appnet.php:149
+msgid "Post to App.net by default"
+msgstr "Invia sempre ad App.net"
+
+#: appnet.php:153
+msgid "Import the remote timeline"
+msgstr "Importa la timeline remota"
+
+#: appnet.php:159
+msgid ""
+"
Error fetching user profile. Please clear the configuration and try "
+"again.
"
+msgstr "
Errore recuperando il profilo utente. Svuota la configurazione e prova di nuovo.
Registrare un'applicazione su https://account.app.net/developer/apps/ e inserire Client ID e Client Secret."
+
+#: appnet.php:167
+#, php-format
+msgid "Use '%s' as Redirect URI
Oppure puoi recuperare un token su http://dev-lite.jonathonduerig.com/."
+
+#: appnet.php:178
+msgid ""
+"Set these scopes: 'Basic', 'Stream', 'Write Post', 'Public Messages', "
+"'Messages'.
"
+msgstr "Imposta gli ambiti 'Basic', 'Stream', 'Scrivi Post', 'Messaggi Pubblici', 'Messaggi'."
+
+#: appnet.php:180
+msgid "Token"
+msgstr "Token"
+
+#: appnet.php:192
+msgid "Sign in using App.net"
+msgstr "Autenticati con App.net"
+
+#: appnet.php:197
+msgid "Clear OAuth configuration"
+msgstr "Pulisci configurazione OAuth"
+
+#: appnet.php:204
+msgid "Save Settings"
+msgstr "Salva Impostazioni"
diff --git a/appnet/lang/it/strings.php b/appnet/lang/it/strings.php
new file mode 100644
index 00000000..01c56524
--- /dev/null
+++ b/appnet/lang/it/strings.php
@@ -0,0 +1,29 @@
+strings["Permission denied."] = "Permesso negato.";
+$a->strings["You are now authenticated to app.net. "] = "Sei autenticato su app.net";
+$a->strings["
Error fetching token. Please try again.
"] = "
Errore recuperando il token. Prova di nuovo
";
+$a->strings["return to the connector page"] = "ritorna alla pagina del connettore";
+$a->strings["Post to app.net"] = "Invia ad app.net";
+$a->strings["App.net Export"] = "Esporta App.net";
+$a->strings["Currently connected to: "] = "Al momento connesso con:";
+$a->strings["Enable App.net Post Plugin"] = "Abilita il plugin di invio ad App.net";
+$a->strings["Post to App.net by default"] = "Invia sempre ad App.net";
+$a->strings["Import the remote timeline"] = "Importa la timeline remota";
+$a->strings["
Error fetching user profile. Please clear the configuration and try again.
"] = "
Errore recuperando il profilo utente. Svuota la configurazione e prova di nuovo.
Oppure puoi recuperare un token su http://dev-lite.jonathonduerig.com/.";
+$a->strings["Set these scopes: 'Basic', 'Stream', 'Write Post', 'Public Messages', 'Messages'.
"] = "Imposta gli ambiti 'Basic', 'Stream', 'Scrivi Post', 'Messaggi Pubblici', 'Messaggi'.";
+$a->strings["Token"] = "Token";
+$a->strings["Sign in using App.net"] = "Autenticati con App.net";
+$a->strings["Clear OAuth configuration"] = "Pulisci configurazione OAuth";
+$a->strings["Save Settings"] = "Salva Impostazioni";
diff --git a/appnet/lang/nl/messages.po b/appnet/lang/nl/messages.po
new file mode 100644
index 00000000..74653c76
--- /dev/null
+++ b/appnet/lang/nl/messages.po
@@ -0,0 +1,118 @@
+# ADDON appnet
+# Copyright (C)
+# This file is distributed under the same license as the Friendica appnet addon package.
+#
+#
+# Translators:
+# Jeroen S , 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: friendica\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 11:47+0200\n"
+"PO-Revision-Date: 2016-06-23 19:52+0000\n"
+"Last-Translator: Jeroen S \n"
+"Language-Team: Dutch (http://www.transifex.com/Friendica/friendica/language/nl/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: nl\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: appnet.php:39
+msgid "Permission denied."
+msgstr "Toegang geweigerd"
+
+#: appnet.php:73
+msgid "You are now authenticated to app.net. "
+msgstr "Je bent nu aangemeld bij app.net."
+
+#: appnet.php:77
+msgid "
Error fetching token. Please try again.
"
+msgstr "
Fout tijdens token fetching. Probeer het nogmaals.
"
+
+#: appnet.php:80
+msgid "return to the connector page"
+msgstr "ga terug naar de connector pagina"
+
+#: appnet.php:94
+msgid "Post to app.net"
+msgstr "Post naar app.net."
+
+#: appnet.php:125 appnet.php:129
+msgid "App.net Export"
+msgstr "App.net Export"
+
+#: appnet.php:142
+msgid "Currently connected to: "
+msgstr "Momenteel verbonden met:"
+
+#: appnet.php:144
+msgid "Enable App.net Post Plugin"
+msgstr "App.net Post Plugin inschakelen"
+
+#: appnet.php:149
+msgid "Post to App.net by default"
+msgstr "Naar App.net posten als standaard instellen"
+
+#: appnet.php:153
+msgid "Import the remote timeline"
+msgstr "The tijdlijn op afstand importeren"
+
+#: appnet.php:159
+msgid ""
+"
Error fetching user profile. Please clear the configuration and try "
+"again.
"
+msgstr "
Fout tijdens het ophalen van gebruikersprofiel. Leeg de configuratie en probeer het opnieuw.
"
+
+#: appnet.php:164
+msgid "
You have two ways to connect to App.net.
"
+msgstr "
Er zijn twee manieren om met App.net te verbinden.
"
+
+#: appnet.php:166
+msgid ""
+"
First way: Register an application at https://account.app.net/developer/apps/"
+" and enter Client ID and Client Secret. "
+msgstr ""
+
+#: appnet.php:167
+#, php-format
+msgid "Use '%s' as Redirect URI
Second way: fetch a token at http://dev-lite.jonathonduerig.com/. "
+msgstr ""
+
+#: appnet.php:178
+msgid ""
+"Set these scopes: 'Basic', 'Stream', 'Write Post', 'Public Messages', "
+"'Messages'.
"
+msgstr ""
+
+#: appnet.php:180
+msgid "Token"
+msgstr ""
+
+#: appnet.php:192
+msgid "Sign in using App.net"
+msgstr ""
+
+#: appnet.php:197
+msgid "Clear OAuth configuration"
+msgstr ""
+
+#: appnet.php:204
+msgid "Save Settings"
+msgstr ""
diff --git a/appnet/lang/nl/strings.php b/appnet/lang/nl/strings.php
new file mode 100644
index 00000000..ba72e364
--- /dev/null
+++ b/appnet/lang/nl/strings.php
@@ -0,0 +1,29 @@
+strings["Permission denied."] = "Toegang geweigerd";
+$a->strings["You are now authenticated to app.net. "] = "Je bent nu aangemeld bij app.net.";
+$a->strings["
Error fetching token. Please try again.
"] = "
Fout tijdens token fetching. Probeer het nogmaals.
";
+$a->strings["return to the connector page"] = "ga terug naar de connector pagina";
+$a->strings["Post to app.net"] = "Post naar app.net.";
+$a->strings["App.net Export"] = "App.net Export";
+$a->strings["Currently connected to: "] = "Momenteel verbonden met:";
+$a->strings["Enable App.net Post Plugin"] = "App.net Post Plugin inschakelen";
+$a->strings["Post to App.net by default"] = "Naar App.net posten als standaard instellen";
+$a->strings["Import the remote timeline"] = "The tijdlijn op afstand importeren";
+$a->strings["
Error fetching user profile. Please clear the configuration and try again.
"] = "
Fout tijdens het ophalen van gebruikersprofiel. Leeg de configuratie en probeer het opnieuw.
";
+$a->strings["
You have two ways to connect to App.net.
"] = "
Er zijn twee manieren om met App.net te verbinden.
";
+$a->strings["
First way: Register an application at https://account.app.net/developer/apps/ and enter Client ID and Client Secret. "] = "";
+$a->strings["Use '%s' as Redirect URI
Second way: fetch a token at http://dev-lite.jonathonduerig.com/. "] = "";
+$a->strings["Set these scopes: 'Basic', 'Stream', 'Write Post', 'Public Messages', 'Messages'.
"] = "";
+$a->strings["Token"] = "";
+$a->strings["Sign in using App.net"] = "";
+$a->strings["Clear OAuth configuration"] = "";
+$a->strings["Save Settings"] = "";
diff --git a/appnet/lang/pt-br/messages.po b/appnet/lang/pt-br/messages.po
new file mode 100644
index 00000000..c279c7dd
--- /dev/null
+++ b/appnet/lang/pt-br/messages.po
@@ -0,0 +1,119 @@
+# ADDON appnet
+# Copyright (C)
+# This file is distributed under the same license as the Friendica appnet addon package.
+#
+#
+# Translators:
+# Beatriz Vital , 2016
+# Calango Jr , 2014
+msgid ""
+msgstr ""
+"Project-Id-Version: friendica\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 11:47+0200\n"
+"PO-Revision-Date: 2016-08-19 20:37+0000\n"
+"Last-Translator: Beatriz Vital \n"
+"Language-Team: Portuguese (Brazil) (http://www.transifex.com/Friendica/friendica/language/pt_BR/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: pt_BR\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: appnet.php:39
+msgid "Permission denied."
+msgstr "Permissão negada."
+
+#: appnet.php:73
+msgid "You are now authenticated to app.net. "
+msgstr "Você está autenticado no app.net."
+
+#: appnet.php:77
+msgid "
Error fetching token. Please try again.
"
+msgstr "Erro ocorrido na obtenção do token. Tente novamente."
+
+#: appnet.php:80
+msgid "return to the connector page"
+msgstr "Volte a página de conectores."
+
+#: appnet.php:94
+msgid "Post to app.net"
+msgstr "Publicar no App.net"
+
+#: appnet.php:125 appnet.php:129
+msgid "App.net Export"
+msgstr "App.net exportar"
+
+#: appnet.php:142
+msgid "Currently connected to: "
+msgstr "Atualmente conectado em: "
+
+#: appnet.php:144
+msgid "Enable App.net Post Plugin"
+msgstr "Habilitar plug-in para publicar no App.net"
+
+#: appnet.php:149
+msgid "Post to App.net by default"
+msgstr "Publicar em App.net por padrão"
+
+#: appnet.php:153
+msgid "Import the remote timeline"
+msgstr "Importar a linha do tempo remota"
+
+#: appnet.php:159
+msgid ""
+"
Error fetching user profile. Please clear the configuration and try "
+"again.
"
+msgstr "Erro na obtenção do perfil do usuário. Confira as configurações e tente novamente."
+
+#: appnet.php:164
+msgid "
1º Método: Registre uma aplicação em https://account.app.net/developer/apps/ e entre o Client ID e Client Secret"
+
+#: appnet.php:167
+#, php-format
+msgid "Use '%s' as Redirect URI
2º Método: obtenha um token em http://dev-lite.jonathonduerig.com/. "
+
+#: appnet.php:178
+msgid ""
+"Set these scopes: 'Basic', 'Stream', 'Write Post', 'Public Messages', "
+"'Messages'.
"
+msgstr "Adicione valor as estas saídas: 'Basic', 'Stream', 'Write Post', 'Public Messages', 'Messages'."
+
+#: appnet.php:180
+msgid "Token"
+msgstr "Token"
+
+#: appnet.php:192
+msgid "Sign in using App.net"
+msgstr "Entre usando o App.net"
+
+#: appnet.php:197
+msgid "Clear OAuth configuration"
+msgstr "Limpar configuração OAuth"
+
+#: appnet.php:204
+msgid "Save Settings"
+msgstr "Salvar Configurações"
diff --git a/appnet/lang/pt-br/strings.php b/appnet/lang/pt-br/strings.php
new file mode 100644
index 00000000..b8e1112c
--- /dev/null
+++ b/appnet/lang/pt-br/strings.php
@@ -0,0 +1,29 @@
+ 1);;
+}}
+;
+$a->strings["Permission denied."] = "Permissão negada.";
+$a->strings["You are now authenticated to app.net. "] = "Você está autenticado no app.net.";
+$a->strings["
Error fetching token. Please try again.
"] = "Erro ocorrido na obtenção do token. Tente novamente.";
+$a->strings["return to the connector page"] = "Volte a página de conectores.";
+$a->strings["Post to app.net"] = "Publicar no App.net";
+$a->strings["App.net Export"] = "App.net exportar";
+$a->strings["Currently connected to: "] = "Atualmente conectado em: ";
+$a->strings["Enable App.net Post Plugin"] = "Habilitar plug-in para publicar no App.net";
+$a->strings["Post to App.net by default"] = "Publicar em App.net por padrão";
+$a->strings["Import the remote timeline"] = "Importar a linha do tempo remota";
+$a->strings["
Error fetching user profile. Please clear the configuration and try again.
"] = "Erro na obtenção do perfil do usuário. Confira as configurações e tente novamente.";
+$a->strings["
Prima modalitate: Înregistrați o cerere pe https://account.app.net/developer/apps/ şi introduceți ID Client şi Cheia Secretă Client."
+
+#: appnet.php:167
+#, php-format
+msgid "Use '%s' as Redirect URI
"
+msgstr "Utilizați '%s' ca URI de Redirecţionare
A doua cale: autorizați un indicativ de acces token de pe http://dev-lite.jonathonduerig.com/ ."
+
+#: appnet.php:178
+msgid ""
+"Set these scopes: 'Basic', 'Stream', 'Write Post', 'Public Messages', "
+"'Messages'.
Eroare la procesarea token-ului. Vă rugăm să reîncercați.
";
+$a->strings["return to the connector page"] = "revenire la pagina de conectare";
+$a->strings["Post to app.net"] = "Postați pe App.net";
+$a->strings["App.net Export"] = "Exportare pe App.net";
+$a->strings["Currently connected to: "] = "Conectat curent la:";
+$a->strings["Enable App.net Post Plugin"] = "Activare Modul Postare pe App.net";
+$a->strings["Post to App.net by default"] = "Postați implicit pe App.net";
+$a->strings["Import the remote timeline"] = "Importare cronologie la distanță";
+$a->strings["
Error fetching user profile. Please clear the configuration and try again.
"] = "
Eroare la procesarea profilului de utilizator. Vă rugăm să ștergeți configurarea şi apoi reîncercați.
Prima modalitate: Înregistrați o cerere pe https://account.app.net/developer/apps/ şi introduceți ID Client şi Cheia Secretă Client.";
+$a->strings["Use '%s' as Redirect URI
A doua cale: autorizați un indicativ de acces token de pe http://dev-lite.jonathonduerig.com/ .";
+$a->strings["Set these scopes: 'Basic', 'Stream', 'Write Post', 'Public Messages', 'Messages'.
"] = "Stabiliți aceste scopuri: 'De Bază', 'Flux', 'Scriere Postare', 'Mesaje Publice', 'Mesaje'.";
+$a->strings["Token"] = "Token";
+$a->strings["Sign in using App.net"] = "Autentificați-vă utilizând App.net";
+$a->strings["Clear OAuth configuration"] = "Ștergeți configurările OAuth";
+$a->strings["Save Settings"] = "Salvare Configurări";
diff --git a/appnet/lang/ru/messages.po b/appnet/lang/ru/messages.po
new file mode 100644
index 00000000..a5755caa
--- /dev/null
+++ b/appnet/lang/ru/messages.po
@@ -0,0 +1,118 @@
+# ADDON appnet
+# Copyright (C)
+# This file is distributed under the same license as the Friendica appnet addon package.
+#
+#
+# Translators:
+# Stanislav N. , 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: friendica\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 11:47+0200\n"
+"PO-Revision-Date: 2017-04-08 05:32+0000\n"
+"Last-Translator: Stanislav N. \n"
+"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: ru\n"
+"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
+
+#: appnet.php:39
+msgid "Permission denied."
+msgstr "Доступ запрещен."
+
+#: appnet.php:73
+msgid "You are now authenticated to app.net. "
+msgstr "Вы аутентифицированы на app.net"
+
+#: appnet.php:77
+msgid "
Error fetching token. Please try again.
"
+msgstr "
Ошибка получения токена. Попробуйте еще раз.
"
+
+#: appnet.php:80
+msgid "return to the connector page"
+msgstr "вернуться на страницу коннектора"
+
+#: appnet.php:94
+msgid "Post to app.net"
+msgstr "Отправить на app.net"
+
+#: appnet.php:125 appnet.php:129
+msgid "App.net Export"
+msgstr "Экспорт app.net"
+
+#: appnet.php:142
+msgid "Currently connected to: "
+msgstr "В настоящее время соединены с: "
+
+#: appnet.php:144
+msgid "Enable App.net Post Plugin"
+msgstr "Включить плагин App.net"
+
+#: appnet.php:149
+msgid "Post to App.net by default"
+msgstr "Отправлять сообщения на App.net по-умолчанию"
+
+#: appnet.php:153
+msgid "Import the remote timeline"
+msgstr "Импортировать удаленные сообщения"
+
+#: appnet.php:159
+msgid ""
+"
Error fetching user profile. Please clear the configuration and try "
+"again.
"
+msgstr "
Ошибка при получении профиля пользователя. Сбросьте конфигурацию и попробуйте еще раз.
Первый способ: зарегистрируйте приложение на https://account.app.net/developer/apps/ и введите Client ID и Client Secret"
+
+#: appnet.php:167
+#, php-format
+msgid "Use '%s' as Redirect URI
";
+$a->strings["return to the connector page"] = "вернуться на страницу коннектора";
+$a->strings["Post to app.net"] = "Отправить на app.net";
+$a->strings["App.net Export"] = "Экспорт app.net";
+$a->strings["Currently connected to: "] = "В настоящее время соединены с: ";
+$a->strings["Enable App.net Post Plugin"] = "Включить плагин App.net";
+$a->strings["Post to App.net by default"] = "Отправлять сообщения на App.net по-умолчанию";
+$a->strings["Import the remote timeline"] = "Импортировать удаленные сообщения";
+$a->strings["
Error fetching user profile. Please clear the configuration and try again.
"] = "
Ошибка при получении профиля пользователя. Сбросьте конфигурацию и попробуйте еще раз.
Первый способ: зарегистрируйте приложение на https://account.app.net/developer/apps/ и введите Client ID и Client Secret";
+$a->strings["Use '%s' as Redirect URI
';
if ($access_token == "") {
@@ -208,12 +208,12 @@ function buffer_settings_post(&$a,&$b) {
if(x($_POST,'buffer-submit')) {
if(x($_POST,'buffer_delete')) {
- PConfig::set(local_user(),'buffer','access_token','');
- PConfig::set(local_user(),'buffer','post',false);
- PConfig::set(local_user(),'buffer','post_by_default',false);
+ set_pconfig(local_user(),'buffer','access_token','');
+ set_pconfig(local_user(),'buffer','post',false);
+ set_pconfig(local_user(),'buffer','post_by_default',false);
} else {
- PConfig::set(local_user(),'buffer','post',intval($_POST['buffer']));
- PConfig::set(local_user(),'buffer','post_by_default',intval($_POST['buffer_bydefault']));
+ set_pconfig(local_user(),'buffer','post',intval($_POST['buffer']));
+ set_pconfig(local_user(),'buffer','post_by_default',intval($_POST['buffer_bydefault']));
}
}
}
@@ -224,11 +224,11 @@ function buffer_post_local(&$a,&$b) {
return;
}
- $buffer_post = intval(PConfig::get(local_user(),'buffer','post'));
+ $buffer_post = intval(get_pconfig(local_user(),'buffer','post'));
$buffer_enable = (($buffer_post && x($_REQUEST,'buffer_enable')) ? intval($_REQUEST['buffer_enable']) : 0);
- if ($b['api_source'] && intval(PConfig::get(local_user(),'buffer','post_by_default'))) {
+ if ($b['api_source'] && intval(get_pconfig(local_user(),'buffer','post_by_default'))) {
$buffer_enable = 1;
}
@@ -243,34 +243,24 @@ function buffer_post_local(&$a,&$b) {
$b['postopts'] .= 'buffer';
}
-function buffer_send(App $a, &$b)
-{
- if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
- return;
- }
+function buffer_send(&$a,&$b) {
- if(! strstr($b['postopts'],'buffer')) {
+ if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited']))
return;
- }
- if($b['parent'] != $b['id']) {
+ if(! strstr($b['postopts'],'buffer'))
return;
- }
- // Dont't post if the post doesn't belong to us.
- // This is a check for forum postings
- $self = dba::selectFirst('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
- if ($b['contact-id'] != $self['id']) {
+ if($b['parent'] != $b['id'])
return;
- }
// if post comes from buffer don't send it back
//if($b['app'] == "Buffer")
// return;
- $client_id = Config::get("buffer", "client_id");
- $client_secret = Config::get("buffer", "client_secret");
- $access_token = PConfig::get($b['uid'], "buffer","access_token");
+ $client_id = get_config("buffer", "client_id");
+ $client_secret = get_config("buffer", "client_secret");
+ $access_token = get_pconfig($b['uid'], "buffer","access_token");
if ($access_token) {
$buffer = new BufferApp($client_id, $client_secret, $callback_url, $access_token);
@@ -309,7 +299,7 @@ function buffer_send(App $a, &$b)
break;
case 'twitter':
$send = ($b["extid"] != NETWORK_TWITTER);
- $limit = 280;
+ $limit = 140;
$markup = false;
$includedlinks = true;
$htmlmode = 8;
@@ -372,7 +362,7 @@ function buffer_send(App $a, &$b)
elseif ($profile->service == "google")
$post["text"] .= html_entity_decode(" ", ENT_QUOTES, 'UTF-8'); // Send a special blank to identify the post through the "fromgplus" addon
- $message = [];
+ $message = array();
$message["text"] = $post["text"];
$message["profile_ids[]"] = $profile->id;
$message["shorten"] = false;
diff --git a/buffer/bufferapp.php b/buffer/bufferapp.php
index a222b23e..7215175d 100644
--- a/buffer/bufferapp.php
+++ b/buffer/bufferapp.php
@@ -12,7 +12,7 @@
public $ok = false;
- private $endpoints = [
+ private $endpoints = array(
'/user' => 'get',
'/profiles' => 'get',
@@ -37,9 +37,9 @@
'/info/configuration' => 'get',
- ];
+ );
- public $errors = [
+ public $errors = array(
'invalid-endpoint' => 'The endpoint you supplied does not appear to be valid.',
'403' => 'Permission denied.',
@@ -77,7 +77,7 @@
'1042' => 'User did not save successfully.',
'1050' => 'Client could not be found.',
'1051' => 'No authorization to access client.',
- ];
+ );
function __construct($client_id = '', $client_secret = '', $callback_url = '', $access_token = '') {
if ($client_id) $this->set_client_id($client_id);
@@ -110,7 +110,7 @@
if (!$ok) return $this->error('invalid-endpoint');
}
- if (!$data || !is_array($data)) $data = [];
+ if (!$data || !is_array($data)) $data = array();
$data['access_token'] = $this->access_token;
$method = $this->endpoints[$done_endpoint]; //get() or post()
@@ -130,17 +130,17 @@
}
function error($error) {
- return (object) ['error' => $this->errors[$error]];
+ return (object) array('error' => $this->errors[$error]);
}
function create_access_token_url() {
- $data = [
+ $data = array(
'code' => $this->code,
'grant_type' => 'authorization_code',
'client_id' => $this->client_id,
'client_secret' => $this->client_secret,
'redirect_uri' => $this->callback_url,
- ];
+ );
$obj = $this->post($this->access_token_url, $data);
$this->access_token = $obj->access_token;
@@ -150,15 +150,15 @@
function req($url = '', $data = '', $post = true) {
if (!$url) return false;
- if (!$data || !is_array($data)) $data = [];
+ if (!$data || !is_array($data)) $data = array();
- $options = [CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false];
+ $options = array(CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false);
if ($post) {
- $options += [
+ $options += array(
CURLOPT_POST => $post,
CURLOPT_POSTFIELDS => $data
- ];
+ );
} else {
$url .= '?' . http_build_query($data);
}
diff --git a/buffer/lang/it/messages.po b/buffer/lang/it/messages.po
index f74d2cfa..6f4c94c2 100644
--- a/buffer/lang/it/messages.po
+++ b/buffer/lang/it/messages.po
@@ -4,15 +4,15 @@
#
#
# Translators:
-# fabrixxm , 2014
+# fabrixxm , 2014,2018
# Sandro Santilli , 2015
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-06-22 13:18+0200\n"
-"PO-Revision-Date: 2015-11-01 11:05+0000\n"
-"Last-Translator: Sandro Santilli \n"
+"PO-Revision-Date: 2018-03-19 13:21+0000\n"
+"Last-Translator: fabrixxm \n"
"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -62,7 +62,7 @@ msgstr "Autentica la tua connessione a Buffer"
#: buffer.php:146
msgid "Enable Buffer Post Addon"
-msgstr "Abilita il addon di invio a Buffer"
+msgstr "Abilita il componente aggiuntivo di invio a Buffer"
#: buffer.php:151
msgid "Post to Buffer by default"
diff --git a/buffer/lang/it/strings.php b/buffer/lang/it/strings.php
index d0c01770..02fa328b 100644
--- a/buffer/lang/it/strings.php
+++ b/buffer/lang/it/strings.php
@@ -15,7 +15,7 @@ $a->strings["return to the connector page"] = "ritorna alla pagina del connettor
$a->strings["Post to Buffer"] = "Invia a Buffer";
$a->strings["Buffer Export"] = "Esporta Buffer";
$a->strings["Authenticate your Buffer connection"] = "Autentica la tua connessione a Buffer";
-$a->strings["Enable Buffer Post Addon"] = "Abilita il addon di invio a Buffer";
+$a->strings["Enable Buffer Post Addon"] = "Abilita il componente aggiuntivo di invio a Buffer";
$a->strings["Post to Buffer by default"] = "Invia sempre a Buffer";
$a->strings["Check to delete this preset"] = "Seleziona per eliminare questo preset";
$a->strings["Posts are going to all accounts that are enabled by default:"] = "I messaggi andranno a tutti gli account che sono abilitati:";
diff --git a/buglink/lang/it/messages.po b/buglink/lang/it/messages.po
index 63e643ea..de10cb94 100644
--- a/buglink/lang/it/messages.po
+++ b/buglink/lang/it/messages.po
@@ -10,7 +10,7 @@ msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-06-22 13:18+0200\n"
-"PO-Revision-Date: 2014-09-10 10:27+0000\n"
+"PO-Revision-Date: 2017-09-20 06:07+0000\n"
"Last-Translator: fabrixxm \n"
"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n"
"MIME-Version: 1.0\n"
diff --git a/cal/LICENSE b/cal/LICENSE
new file mode 100644
index 00000000..2c696e9a
--- /dev/null
+++ b/cal/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2013 Tobias Diekershoff
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/cal/README.md b/cal/README.md
new file mode 100644
index 00000000..cb7501cd
--- /dev/null
+++ b/cal/README.md
@@ -0,0 +1,29 @@
+Calendar Export
+===============
+
+This addon makes it possible to export the events posted by your users,
+so they can be imported into other calendar applications.
+
+Exporting a calendar is an _opt-in_ feature which has to be activated by each
+of the users in the _addon settings_. As the admin you can only provide the
+service but should not force it upon your users.
+
+The calendars are exported at
+
+ http://example.com/cal/username/export/format
+
+currently the following formats are supported
+
+* ical
+* csv.
+
+Author
+------
+
+This addon is developed by [Tobias Diekershoff](https://f.diekershoff.de/profile/tobias).
+
+License
+-------
+
+This addon is licensed under the [MIT](http://opensource.org/licenses/MIT)
+license, see also the LICENSE file in the addon directory.
diff --git a/cal/cal.php b/cal/cal.php
new file mode 100644
index 00000000..5c2f1021
--- /dev/null
+++ b/cal/cal.php
@@ -0,0 +1,200 @@
+
+ * License: MIT
+ * Status: Unsupported
+ * ******************************************************************/
+
+
+function cal_install()
+{
+ register_hook('plugin_settings', 'addon/cal/cal.php', 'cal_addon_settings');
+ register_hook('plugin_settings_post', 'addon/cal/cal.php', 'cal_addon_settings_post');
+}
+function cal_uninstall()
+{
+ unregister_hook('plugin_settings', 'addon/cal/cal.php', 'cal_addon_settings');
+ unregister_hook('plugin_settings_post', 'addon/cal/cal.php', 'cal_addon_settings_post');
+}
+function cal_module()
+{
+}
+/* pathes
+ * /cal/$user/export/$format
+ * currently supported formats are ical (iCalendar) and CSV
+ */
+function cal_content()
+{
+ $a = get_app();
+ $o = "";
+ if ($a->argc == 1) {
+ $o .= "
".t('Event Export')."
".t('You can download public events from: ').$a->get_baseurl()."/cal/username/export/ical
";
+ } elseif ($a->argc==4) {
+ // get the parameters from the request we just received
+ $username = $a->argv[1];
+ $do = $a->argv[2];
+ $format = $a->argv[3];
+ // check that there is a user matching the requested profile
+ $r = q("SELECT uid FROM user WHERE nickname='".$username."' LIMIT 1;");
+ if (count($r))
+ {
+ $uid = $r[0]['uid'];
+ } else {
+ killme();
+ }
+ // if we shall do anything other then export, end here
+ if (! $do == 'export' )
+ killme();
+ // check if the user allows us to share the profile
+ $enable = get_pconfig( $uid, 'cal', 'enable');
+ if (! $enable == 1) {
+ info(t('The user does not export the calendar.'));
+ return;
+ }
+ // we are allowed to show events
+ // get the timezone the user is in
+ $r = q("SELECT timezone FROM user WHERE uid=".$uid." LIMIT 1;");
+ if (count($r))
+ $timezone = $r[0]['timezone'];
+ // does the user who requests happen to be the owner of the events
+ // requested? then show all of your events, otherwise only those that
+ // don't have limitations set in allow_cid and allow_gid
+ if (local_user() == $uid) {
+ $r = q("SELECT `start`, `finish`, `adjust`, `summary`, `desc`, `location` FROM `event` WHERE `uid`=".$uid." and `cid`=0;");
+ } else {
+ $r = q("SELECT `start`, `finish`, `adjust`, `summary`, `desc`, `location` FROM `event` WHERE `allow_cid`='' and `allow_gid`='' and `uid`='".$uid."' and `cid`='0';");
+ }
+ // we have the events that are available for the requestor
+ // now format the output according to the requested format
+ $res = cal_format_output($r, $format, $timezone);
+ if (! $res=='')
+ info($res);
+ } else {
+ // wrong number of parameters
+ killme();
+ }
+ return $o;
+}
+
+function cal_format_output ($r, $f, $tz)
+{
+ $res = t('This calendar format is not supported');
+ switch ($f)
+ {
+ // format the exported data as a CSV file
+ case "csv":
+ header("Content-type: text/csv");
+ $o = '"Subject", "Start Date", "Start Time", "Description", "End Date", "End Time", "Location"' . PHP_EOL;
+ foreach ($r as $rr) {
+// TODO the time / date entries don't include any information about the
+// timezone the event is scheduled in :-/
+ $tmp1 = strtotime($rr['start']);
+ $tmp2 = strtotime($rr['finish']);
+ $time_format = "%H:%M:%S";
+ $date_format = "%Y-%m-%d";
+ $o .= '"'.$rr['summary'].'", "'.strftime($date_format, $tmp1) .
+ '", "'.strftime($time_format, $tmp1).'", "'.$rr['desc'] .
+ '", "'.strftime($date_format, $tmp2) .
+ '", "'.strftime($time_format, $tmp2) .
+ '", "'.$rr['location'].'"' . PHP_EOL;
+ }
+ echo $o;
+ killme();
+
+ case "ical":
+ header("Content-type: text/ics");
+ $o = 'BEGIN:VCALENDAR'. PHP_EOL
+ . 'VERSION:2.0' . PHP_EOL
+ . 'PRODID:-//friendica calendar export//0.1//EN' . PHP_EOL;
+// TODO include timezone informations in cases were the time is not in UTC
+// see http://tools.ietf.org/html/rfc2445#section-4.8.3
+// . 'BEGIN:VTIMEZONE' . PHP_EOL
+// . 'TZID:' . $tz . PHP_EOL
+// . 'END:VTIMEZONE' . PHP_EOL;
+// TODO instead of PHP_EOL CRLF should be used for long entries
+// but test your solution against http://icalvalid.cloudapp.net/
+// also long lines SHOULD be split at 75 characters length
+ foreach ($r as $rr) {
+ if ($rr['adjust'] == 1) {
+ $UTC = 'Z';
+ } else {
+ $UTC = '';
+ }
+ $o .= 'BEGIN:VEVENT' . PHP_EOL;
+ if ($rr[start]) {
+ $tmp = strtotime($rr['start']);
+ $dtformat = "%Y%m%dT%H%M%S".$UTC;
+ $o .= 'DTSTART:'.strftime($dtformat, $tmp).PHP_EOL;
+ }
+ if ($rr['finish']) {
+ $tmp = strtotime($rr['finish']);
+ $dtformat = "%Y%m%dT%H%M%S".$UTC;
+ $o .= 'DTEND:'.strftime($dtformat, $tmp).PHP_EOL;
+ }
+ if ($rr['summary'])
+ $tmp = $rr['summary'];
+ $tmp = str_replace(PHP_EOL, PHP_EOL.' ',$tmp);
+ $tmp = addcslashes($tmp, ',;');
+ $o .= 'SUMMARY:' . $tmp . PHP_EOL;
+ if ($rr['desc'])
+ $tmp = $rr['desc'];
+ $tmp = str_replace(PHP_EOL, PHP_EOL.' ',$tmp);
+ $tmp = addcslashes($tmp, ',;');
+ $o .= 'DESCRIPTION:' . $tmp . PHP_EOL;
+ if ($rr['location']) {
+ $tmp = $rr['location'];
+ $tmp = str_replace(PHP_EOL, PHP_EOL.' ',$tmp);
+ $tmp = addcslashes($tmp, ',;');
+ $o .= 'LOCATION:' . $tmp . PHP_EOL;
+ }
+ $o .= 'END:VEVENT' . PHP_EOL;
+ }
+ $o .= 'END:VCALENDAR' . PHP_EOL;
+ echo $o;
+ killme();
+ }
+ return $res;
+}
+
+function cal_addon_settings_post ( &$a, &$b )
+{
+ if (! local_user())
+ return;
+
+ if (!x($_POST,'cal-submit'))
+ return;
+
+ set_pconfig(local_user(),'cal','enable',intval($_POST['cal-enable']));
+}
+function cal_addon_settings ( &$a, &$s )
+{
+ if (! local_user())
+ return;
+
+ $enabled = get_pconfig(local_user(), 'cal', 'enable');
+ $checked = (($enabled) ? ' checked="checked" ' : '');
+ $url = $a->get_baseurl().'/cal/'.$a->user['nickname'].'/export/format';
+
+ $s .= '';
+ $s .= '
'.t('Export Events').'
';
+ $s .= '';
+ $s .= '
';
+ $s .= '';
+ $s .= '
'.t('Export Events').'
';
+ $s .= '';
+
+ $s .= '
';
+ $s .= '
'.t('If this is enabled, your public events will be available at').' '.$url.'
';
+ $s .= '
'.t('Currently supported formats are ical and csv.').'
';
+}
+
+?>
diff --git a/cal/lang/C/messages.po b/cal/lang/C/messages.po
new file mode 100644
index 00000000..91883299
--- /dev/null
+++ b/cal/lang/C/messages.po
@@ -0,0 +1,54 @@
+# ADDON cal
+# Copyright (C)
+# This file is distributed under the same license as the Friendica cal addon package.
+#
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 13:18+0200\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"
+
+#: cal.php:33
+msgid "Event Export"
+msgstr ""
+
+#: cal.php:33
+msgid "You can download public events from: "
+msgstr ""
+
+#: cal.php:53
+msgid "The user does not export the calendar."
+msgstr ""
+
+#: cal.php:83
+msgid "This calendar format is not supported"
+msgstr ""
+
+#: cal.php:181 cal.php:185
+msgid "Export Events"
+msgstr ""
+
+#: cal.php:189
+msgid "If this is enabled, your public events will be available at"
+msgstr ""
+
+#: cal.php:190
+msgid "Currently supported formats are ical and csv."
+msgstr ""
+
+#: cal.php:191
+msgid "Enable calendar export"
+msgstr ""
+
+#: cal.php:193
+msgid "Save Settings"
+msgstr ""
diff --git a/cal/lang/C/strings.php b/cal/lang/C/strings.php
new file mode 100644
index 00000000..a72dc119
--- /dev/null
+++ b/cal/lang/C/strings.php
@@ -0,0 +1,12 @@
+strings["Event Export"] = "";
+$a->strings["You can download public events from: "] = "";
+$a->strings["The user does not export the calendar."] = "";
+$a->strings["This calendar format is not supported"] = "";
+$a->strings["Export Events"] = "";
+$a->strings["If this is enabled, your public events will be available at"] = "";
+$a->strings["Currently supported formats are ical and csv."] = "";
+$a->strings["Enable calendar export"] = "";
+$a->strings["Submit"] = "";
diff --git a/cal/lang/cs/messages.po b/cal/lang/cs/messages.po
new file mode 100644
index 00000000..28fcb4f9
--- /dev/null
+++ b/cal/lang/cs/messages.po
@@ -0,0 +1,56 @@
+# ADDON cal
+# Copyright (C)
+# This file is distributed under the same license as the Friendica cal addon package.
+#
+#
+# Translators:
+# Michal Šupler , 2014
+msgid ""
+msgstr ""
+"Project-Id-Version: friendica\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 13:18+0200\n"
+"PO-Revision-Date: 2014-09-07 11:04+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"
+
+#: cal.php:33
+msgid "Event Export"
+msgstr "Export událostí"
+
+#: cal.php:33
+msgid "You can download public events from: "
+msgstr "Veřejné události si můžete stánout z:"
+
+#: cal.php:53
+msgid "The user does not export the calendar."
+msgstr "Uživatel kalenář neexportuje."
+
+#: cal.php:83
+msgid "This calendar format is not supported"
+msgstr "Tento kalendářový formát není podporován."
+
+#: cal.php:181 cal.php:185
+msgid "Export Events"
+msgstr "Export událostí"
+
+#: cal.php:189
+msgid "If this is enabled, your public events will be available at"
+msgstr "Pokud je toto povoleno, vaše veřejné události budou viditelné na"
+
+#: cal.php:190
+msgid "Currently supported formats are ical and csv."
+msgstr "Aktuálně podporované formáty jsou ical a csv."
+
+#: cal.php:191
+msgid "Enable calendar export"
+msgstr "Povolit export kalendáře"
+
+#: cal.php:193
+msgid "Save Settings"
+msgstr "Uložit Nastavení"
diff --git a/cal/lang/cs/strings.php b/cal/lang/cs/strings.php
new file mode 100644
index 00000000..9a99079d
--- /dev/null
+++ b/cal/lang/cs/strings.php
@@ -0,0 +1,16 @@
+=2 && $n<=4) ? 1 : 2;;
+}}
+;
+$a->strings["Event Export"] = "Export událostí";
+$a->strings["You can download public events from: "] = "Veřejné události si můžete stánout z:";
+$a->strings["The user does not export the calendar."] = "Uživatel kalenář neexportuje.";
+$a->strings["This calendar format is not supported"] = "Tento kalendářový formát není podporován.";
+$a->strings["Export Events"] = "Export událostí";
+$a->strings["If this is enabled, your public events will be available at"] = "Pokud je toto povoleno, vaše veřejné události budou viditelné na";
+$a->strings["Currently supported formats are ical and csv."] = "Aktuálně podporované formáty jsou ical a csv.";
+$a->strings["Enable calendar export"] = "Povolit export kalendáře";
+$a->strings["Save Settings"] = "Uložit Nastavení";
diff --git a/cal/lang/de/messages.po b/cal/lang/de/messages.po
new file mode 100644
index 00000000..29f6b601
--- /dev/null
+++ b/cal/lang/de/messages.po
@@ -0,0 +1,56 @@
+# ADDON cal
+# Copyright (C)
+# This file is distributed under the same license as the Friendica cal addon package.
+#
+#
+# Translators:
+# bavatar , 2014
+msgid ""
+msgstr ""
+"Project-Id-Version: friendica\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 13:18+0200\n"
+"PO-Revision-Date: 2014-09-28 10:39+0000\n"
+"Last-Translator: bavatar \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"
+
+#: cal.php:33
+msgid "Event Export"
+msgstr "Ereignis Export"
+
+#: cal.php:33
+msgid "You can download public events from: "
+msgstr "Du kannst öffentliche Ereignisse hier herunterladen;"
+
+#: cal.php:53
+msgid "The user does not export the calendar."
+msgstr "Diese_r Nutzer_in exportiert den Kalender nicht."
+
+#: cal.php:83
+msgid "This calendar format is not supported"
+msgstr "Dieses Kalenderformat wird nicht unterstützt."
+
+#: cal.php:181 cal.php:185
+msgid "Export Events"
+msgstr "Exportiere Ereignisse"
+
+#: cal.php:189
+msgid "If this is enabled, your public events will be available at"
+msgstr "Wenn dies aktiviert ist, werden alle öffentliche Ereignisse unter folgender URL verfügbar sein"
+
+#: cal.php:190
+msgid "Currently supported formats are ical and csv."
+msgstr "Derzeit werden die Formate ical und csv unterstützt."
+
+#: cal.php:191
+msgid "Enable calendar export"
+msgstr "Kalenderexport aktivieren"
+
+#: cal.php:193
+msgid "Save Settings"
+msgstr "Einstellungen speichern"
diff --git a/cal/lang/de/strings.php b/cal/lang/de/strings.php
new file mode 100644
index 00000000..39359271
--- /dev/null
+++ b/cal/lang/de/strings.php
@@ -0,0 +1,16 @@
+strings["Event Export"] = "Ereignis Export";
+$a->strings["You can download public events from: "] = "Du kannst öffentliche Ereignisse hier herunterladen;";
+$a->strings["The user does not export the calendar."] = "Diese_r Nutzer_in exportiert den Kalender nicht.";
+$a->strings["This calendar format is not supported"] = "Dieses Kalenderformat wird nicht unterstützt.";
+$a->strings["Export Events"] = "Exportiere Ereignisse";
+$a->strings["If this is enabled, your public events will be available at"] = "Wenn dies aktiviert ist, werden alle öffentliche Ereignisse unter folgender URL verfügbar sein";
+$a->strings["Currently supported formats are ical and csv."] = "Derzeit werden die Formate ical und csv unterstützt.";
+$a->strings["Enable calendar export"] = "Kalenderexport aktivieren";
+$a->strings["Save Settings"] = "Einstellungen speichern";
diff --git a/cal/lang/es/messages.po b/cal/lang/es/messages.po
new file mode 100644
index 00000000..65b2a322
--- /dev/null
+++ b/cal/lang/es/messages.po
@@ -0,0 +1,55 @@
+# ADDON cal
+# Copyright (C)
+# This file is distributed under the same license as the Friendica cal addon package.
+#
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: friendica\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 13:18+0200\n"
+"PO-Revision-Date: 2016-10-10 20:48+0000\n"
+"Last-Translator: Athalbert\n"
+"Language-Team: Spanish (http://www.transifex.com/Friendica/friendica/language/es/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: es\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: cal.php:33
+msgid "Event Export"
+msgstr "Exportación de evento"
+
+#: cal.php:33
+msgid "You can download public events from: "
+msgstr "Puede descargar eventos públicos desde:"
+
+#: cal.php:53
+msgid "The user does not export the calendar."
+msgstr "El usuario no exporta el calendario."
+
+#: cal.php:83
+msgid "This calendar format is not supported"
+msgstr "No se soporta este formato de calendario"
+
+#: cal.php:181 cal.php:185
+msgid "Export Events"
+msgstr "Exportar Eventos"
+
+#: cal.php:189
+msgid "If this is enabled, your public events will be available at"
+msgstr "Si esto está habilitado, sus eventos públicos estarán permitidos en"
+
+#: cal.php:190
+msgid "Currently supported formats are ical and csv."
+msgstr "Los formatos soportados actualmente son ical y csv."
+
+#: cal.php:191
+msgid "Enable calendar export"
+msgstr "Habilitar exportar calendario"
+
+#: cal.php:193
+msgid "Save Settings"
+msgstr "Guardar Ajustes"
diff --git a/cal/lang/es/strings.php b/cal/lang/es/strings.php
new file mode 100644
index 00000000..29c9cc93
--- /dev/null
+++ b/cal/lang/es/strings.php
@@ -0,0 +1,16 @@
+strings["Event Export"] = "Exportación de evento";
+$a->strings["You can download public events from: "] = "Puede descargar eventos públicos desde:";
+$a->strings["The user does not export the calendar."] = "El usuario no exporta el calendario.";
+$a->strings["This calendar format is not supported"] = "No se soporta este formato de calendario";
+$a->strings["Export Events"] = "Exportar Eventos";
+$a->strings["If this is enabled, your public events will be available at"] = "Si esto está habilitado, sus eventos públicos estarán permitidos en";
+$a->strings["Currently supported formats are ical and csv."] = "Los formatos soportados actualmente son ical y csv.";
+$a->strings["Enable calendar export"] = "Habilitar exportar calendario";
+$a->strings["Save Settings"] = "Guardar Ajustes";
diff --git a/cal/lang/fr/messages.po b/cal/lang/fr/messages.po
new file mode 100644
index 00000000..1b33c119
--- /dev/null
+++ b/cal/lang/fr/messages.po
@@ -0,0 +1,56 @@
+# ADDON cal
+# Copyright (C)
+# This file is distributed under the same license as the Friendica cal addon package.
+#
+#
+# Translators:
+# Tubuntu , 2014
+msgid ""
+msgstr ""
+"Project-Id-Version: friendica\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 13:18+0200\n"
+"PO-Revision-Date: 2014-09-07 09:24+0000\n"
+"Last-Translator: Tubuntu \n"
+"Language-Team: French (http://www.transifex.com/projects/p/friendica/language/fr/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: fr\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: cal.php:33
+msgid "Event Export"
+msgstr "Exportation d'événement"
+
+#: cal.php:33
+msgid "You can download public events from: "
+msgstr "Vous pouvez télécharger les événements publiques de :"
+
+#: cal.php:53
+msgid "The user does not export the calendar."
+msgstr "L'utilisateur n'exporte pas le calendrier."
+
+#: cal.php:83
+msgid "This calendar format is not supported"
+msgstr "Ce format de calendrier n'est pas pris en charge"
+
+#: cal.php:181 cal.php:185
+msgid "Export Events"
+msgstr "Exporter les événements"
+
+#: cal.php:189
+msgid "If this is enabled, your public events will be available at"
+msgstr "Si activé, vos événements publiques seront disponible à"
+
+#: cal.php:190
+msgid "Currently supported formats are ical and csv."
+msgstr "Les formats actuellement pris en charge sont ical et csv."
+
+#: cal.php:191
+msgid "Enable calendar export"
+msgstr "Activer l'export de calendrier"
+
+#: cal.php:193
+msgid "Save Settings"
+msgstr "Sauvegarder les paramètres"
diff --git a/cal/lang/fr/strings.php b/cal/lang/fr/strings.php
new file mode 100644
index 00000000..b3517062
--- /dev/null
+++ b/cal/lang/fr/strings.php
@@ -0,0 +1,16 @@
+ 1);;
+}}
+;
+$a->strings["Event Export"] = "Exportation d'événement";
+$a->strings["You can download public events from: "] = "Vous pouvez télécharger les événements publiques de :";
+$a->strings["The user does not export the calendar."] = "L'utilisateur n'exporte pas le calendrier.";
+$a->strings["This calendar format is not supported"] = "Ce format de calendrier n'est pas pris en charge";
+$a->strings["Export Events"] = "Exporter les événements";
+$a->strings["If this is enabled, your public events will be available at"] = "Si activé, vos événements publiques seront disponible à";
+$a->strings["Currently supported formats are ical and csv."] = "Les formats actuellement pris en charge sont ical et csv.";
+$a->strings["Enable calendar export"] = "Activer l'export de calendrier";
+$a->strings["Save Settings"] = "Sauvegarder les paramètres";
diff --git a/cal/lang/it/messages.po b/cal/lang/it/messages.po
new file mode 100644
index 00000000..f2aa1cbb
--- /dev/null
+++ b/cal/lang/it/messages.po
@@ -0,0 +1,56 @@
+# ADDON cal
+# Copyright (C)
+# This file is distributed under the same license as the Friendica cal addon package.
+#
+#
+# Translators:
+# fabrixxm , 2014
+msgid ""
+msgstr ""
+"Project-Id-Version: friendica\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 13:18+0200\n"
+"PO-Revision-Date: 2014-09-10 10:30+0000\n"
+"Last-Translator: fabrixxm \n"
+"Language-Team: Italian (http://www.transifex.com/Friendica/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"
+
+#: cal.php:33
+msgid "Event Export"
+msgstr "Esporta Evento"
+
+#: cal.php:33
+msgid "You can download public events from: "
+msgstr "Puoi scaricare gli eventi publici da:"
+
+#: cal.php:53
+msgid "The user does not export the calendar."
+msgstr "L'utente non esporta il calendario."
+
+#: cal.php:83
+msgid "This calendar format is not supported"
+msgstr "Il formato del calendario non è supportato"
+
+#: cal.php:181 cal.php:185
+msgid "Export Events"
+msgstr "Esporta Eventi"
+
+#: cal.php:189
+msgid "If this is enabled, your public events will be available at"
+msgstr "Se abilitato, i tuoi eventi pubblici saranno disponibili a"
+
+#: cal.php:190
+msgid "Currently supported formats are ical and csv."
+msgstr "I formati supportati sono ical e csv."
+
+#: cal.php:191
+msgid "Enable calendar export"
+msgstr "Abilita esporazione calendario"
+
+#: cal.php:193
+msgid "Save Settings"
+msgstr "Salva Impostazioni"
diff --git a/cal/lang/it/strings.php b/cal/lang/it/strings.php
new file mode 100644
index 00000000..c7f228bb
--- /dev/null
+++ b/cal/lang/it/strings.php
@@ -0,0 +1,16 @@
+strings["Event Export"] = "Esporta Evento";
+$a->strings["You can download public events from: "] = "Puoi scaricare gli eventi publici da:";
+$a->strings["The user does not export the calendar."] = "L'utente non esporta il calendario.";
+$a->strings["This calendar format is not supported"] = "Il formato del calendario non è supportato";
+$a->strings["Export Events"] = "Esporta Eventi";
+$a->strings["If this is enabled, your public events will be available at"] = "Se abilitato, i tuoi eventi pubblici saranno disponibili a";
+$a->strings["Currently supported formats are ical and csv."] = "I formati supportati sono ical e csv.";
+$a->strings["Enable calendar export"] = "Abilita esporazione calendario";
+$a->strings["Save Settings"] = "Salva Impostazioni";
diff --git a/cal/lang/pt-br/messages.po b/cal/lang/pt-br/messages.po
new file mode 100644
index 00000000..7defc7d5
--- /dev/null
+++ b/cal/lang/pt-br/messages.po
@@ -0,0 +1,57 @@
+# ADDON cal
+# Copyright (C)
+# This file is distributed under the same license as the Friendica cal addon package.
+#
+#
+# Translators:
+# John Brazil, 2015
+# Sérgio Lima , 2014
+msgid ""
+msgstr ""
+"Project-Id-Version: friendica\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 13:18+0200\n"
+"PO-Revision-Date: 2015-01-31 01:24+0000\n"
+"Last-Translator: John Brazil\n"
+"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/friendica/language/pt_BR/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: pt_BR\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: cal.php:33
+msgid "Event Export"
+msgstr "Exportar Evento"
+
+#: cal.php:33
+msgid "You can download public events from: "
+msgstr "Você pode baixar eventos públicos de:"
+
+#: cal.php:53
+msgid "The user does not export the calendar."
+msgstr "O usuário não exportou o calendário."
+
+#: cal.php:83
+msgid "This calendar format is not supported"
+msgstr "Esse formato de calendário não é suportado."
+
+#: cal.php:181 cal.php:185
+msgid "Export Events"
+msgstr "Exporta Eventos"
+
+#: cal.php:189
+msgid "If this is enabled, your public events will be available at"
+msgstr "Se isso estiver habiltiado, seus eventos públicos estarão disponíveis"
+
+#: cal.php:190
+msgid "Currently supported formats are ical and csv."
+msgstr "Os formatos disponíveis atualmente são ical e csv."
+
+#: cal.php:191
+msgid "Enable calendar export"
+msgstr "Habilite exportar calendário"
+
+#: cal.php:193
+msgid "Save Settings"
+msgstr "Salvar as Configurações"
diff --git a/cal/lang/pt-br/strings.php b/cal/lang/pt-br/strings.php
new file mode 100644
index 00000000..69e35ea5
--- /dev/null
+++ b/cal/lang/pt-br/strings.php
@@ -0,0 +1,16 @@
+ 1);;
+}}
+;
+$a->strings["Event Export"] = "Exportar Evento";
+$a->strings["You can download public events from: "] = "Você pode baixar eventos públicos de:";
+$a->strings["The user does not export the calendar."] = "O usuário não exportou o calendário.";
+$a->strings["This calendar format is not supported"] = "Esse formato de calendário não é suportado.";
+$a->strings["Export Events"] = "Exporta Eventos";
+$a->strings["If this is enabled, your public events will be available at"] = "Se isso estiver habiltiado, seus eventos públicos estarão disponíveis";
+$a->strings["Currently supported formats are ical and csv."] = "Os formatos disponíveis atualmente são ical e csv.";
+$a->strings["Enable calendar export"] = "Habilite exportar calendário";
+$a->strings["Save Settings"] = "Salvar as Configurações";
diff --git a/cal/lang/ro/messages.po b/cal/lang/ro/messages.po
new file mode 100644
index 00000000..c0cd3f87
--- /dev/null
+++ b/cal/lang/ro/messages.po
@@ -0,0 +1,56 @@
+# ADDON cal
+# Copyright (C)
+# This file is distributed under the same license as the Friendica cal addon package.
+#
+#
+# Translators:
+# Doru DEACONU , 2014
+msgid ""
+msgstr ""
+"Project-Id-Version: friendica\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 13:18+0200\n"
+"PO-Revision-Date: 2014-11-27 14:13+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"
+
+#: cal.php:33
+msgid "Event Export"
+msgstr "Exportare Eveniment"
+
+#: cal.php:33
+msgid "You can download public events from: "
+msgstr "Puteți descărca evenimente publice de la:"
+
+#: cal.php:53
+msgid "The user does not export the calendar."
+msgstr "Utilizatorul nu își exportă calendarul."
+
+#: cal.php:83
+msgid "This calendar format is not supported"
+msgstr "Acest format de calendar nu este acceptat"
+
+#: cal.php:181 cal.php:185
+msgid "Export Events"
+msgstr "Exportați Evenimente"
+
+#: cal.php:189
+msgid "If this is enabled, your public events will be available at"
+msgstr "Dacă este activat, evenimente dvs publice vor fi disponibile pe"
+
+#: cal.php:190
+msgid "Currently supported formats are ical and csv."
+msgstr "Formate acceptate în prezent sunt ical şi csv."
+
+#: cal.php:191
+msgid "Enable calendar export"
+msgstr "Activați exportarea calendarului"
+
+#: cal.php:193
+msgid "Save Settings"
+msgstr "Salvare Configurări"
diff --git a/cal/lang/ro/strings.php b/cal/lang/ro/strings.php
new file mode 100644
index 00000000..8e328e98
--- /dev/null
+++ b/cal/lang/ro/strings.php
@@ -0,0 +1,16 @@
+19)||(($n%100==0)&&($n!=0)))?2:1));;
+}}
+;
+$a->strings["Event Export"] = "Exportare Eveniment";
+$a->strings["You can download public events from: "] = "Puteți descărca evenimente publice de la:";
+$a->strings["The user does not export the calendar."] = "Utilizatorul nu își exportă calendarul.";
+$a->strings["This calendar format is not supported"] = "Acest format de calendar nu este acceptat";
+$a->strings["Export Events"] = "Exportați Evenimente";
+$a->strings["If this is enabled, your public events will be available at"] = "Dacă este activat, evenimente dvs publice vor fi disponibile pe";
+$a->strings["Currently supported formats are ical and csv."] = "Formate acceptate în prezent sunt ical şi csv.";
+$a->strings["Enable calendar export"] = "Activați exportarea calendarului";
+$a->strings["Save Settings"] = "Salvare Configurări";
diff --git a/cal/lang/ru/messages.po b/cal/lang/ru/messages.po
new file mode 100644
index 00000000..155cba8e
--- /dev/null
+++ b/cal/lang/ru/messages.po
@@ -0,0 +1,56 @@
+# ADDON cal
+# Copyright (C)
+# This file is distributed under the same license as the Friendica cal addon package.
+#
+#
+# Translators:
+# Stanislav N. , 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: friendica\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 13:18+0200\n"
+"PO-Revision-Date: 2017-04-08 17:06+0000\n"
+"Last-Translator: Stanislav N. \n"
+"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: ru\n"
+"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
+
+#: cal.php:33
+msgid "Event Export"
+msgstr "Экспорт событий"
+
+#: cal.php:33
+msgid "You can download public events from: "
+msgstr "Вы можете скачать публичные события из:"
+
+#: cal.php:53
+msgid "The user does not export the calendar."
+msgstr "Пользователь не экспортировал календарь."
+
+#: cal.php:83
+msgid "This calendar format is not supported"
+msgstr "Этот формат календарей не поддерживается"
+
+#: cal.php:181 cal.php:185
+msgid "Export Events"
+msgstr "Экспорт событий"
+
+#: cal.php:189
+msgid "If this is enabled, your public events will be available at"
+msgstr "Если эта настройка включена, то ваши публичные события будут доступны на:"
+
+#: cal.php:190
+msgid "Currently supported formats are ical and csv."
+msgstr "Текущие поддерживаемые форматы ical и csv."
+
+#: cal.php:191
+msgid "Enable calendar export"
+msgstr "Включить экспорт календаря"
+
+#: cal.php:193
+msgid "Save Settings"
+msgstr "Сохранить настройки"
diff --git a/cal/lang/ru/strings.php b/cal/lang/ru/strings.php
new file mode 100644
index 00000000..d2ab1418
--- /dev/null
+++ b/cal/lang/ru/strings.php
@@ -0,0 +1,16 @@
+=2 && $n%10<=4 && ($n%100<12 || $n%100>14) ? 1 : $n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)? 2 : 3);;
+}}
+;
+$a->strings["Event Export"] = "Экспорт событий";
+$a->strings["You can download public events from: "] = "Вы можете скачать публичные события из:";
+$a->strings["The user does not export the calendar."] = "Пользователь не экспортировал календарь.";
+$a->strings["This calendar format is not supported"] = "Этот формат календарей не поддерживается";
+$a->strings["Export Events"] = "Экспорт событий";
+$a->strings["If this is enabled, your public events will be available at"] = "Если эта настройка включена, то ваши публичные события будут доступны на:";
+$a->strings["Currently supported formats are ical and csv."] = "Текущие поддерживаемые форматы ical и csv.";
+$a->strings["Enable calendar export"] = "Включить экспорт календаря";
+$a->strings["Save Settings"] = "Сохранить настройки";
diff --git a/cal/lang/zh-cn/messages.po b/cal/lang/zh-cn/messages.po
new file mode 100644
index 00000000..15f34a47
--- /dev/null
+++ b/cal/lang/zh-cn/messages.po
@@ -0,0 +1,56 @@
+# ADDON cal
+# Copyright (C)
+# This file is distributed under the same license as the Friendica cal addon package.
+#
+#
+# Translators:
+# mytbk , 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: friendica\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-22 13:18+0200\n"
+"PO-Revision-Date: 2017-10-02 05:52+0000\n"
+"Last-Translator: mytbk \n"
+"Language-Team: Chinese (China) (http://www.transifex.com/Friendica/friendica/language/zh_CN/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: zh_CN\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: cal.php:33
+msgid "Event Export"
+msgstr "事件导出"
+
+#: cal.php:33
+msgid "You can download public events from: "
+msgstr "你可以从这里下载公开事件:"
+
+#: cal.php:53
+msgid "The user does not export the calendar."
+msgstr "这个用户没有导出日历。"
+
+#: cal.php:83
+msgid "This calendar format is not supported"
+msgstr "不支持这个日历格式"
+
+#: cal.php:181 cal.php:185
+msgid "Export Events"
+msgstr "导出事件"
+
+#: cal.php:189
+msgid "If this is enabled, your public events will be available at"
+msgstr "如果这个被启用,你的公开事件会在"
+
+#: cal.php:190
+msgid "Currently supported formats are ical and csv."
+msgstr "当前支持的格式是 ical 和 csv."
+
+#: cal.php:191
+msgid "Enable calendar export"
+msgstr "启用日历导出"
+
+#: cal.php:193
+msgid "Save Settings"
+msgstr "保存设置"
diff --git a/cal/lang/zh-cn/strings.php b/cal/lang/zh-cn/strings.php
new file mode 100644
index 00000000..e94fa51b
--- /dev/null
+++ b/cal/lang/zh-cn/strings.php
@@ -0,0 +1,16 @@
+strings["Event Export"] = "事件导出";
+$a->strings["You can download public events from: "] = "你可以从这里下载公开事件:";
+$a->strings["The user does not export the calendar."] = "这个用户没有导出日历。";
+$a->strings["This calendar format is not supported"] = "不支持这个日历格式";
+$a->strings["Export Events"] = "导出事件";
+$a->strings["If this is enabled, your public events will be available at"] = "如果这个被启用,你的公开事件会在";
+$a->strings["Currently supported formats are ical and csv."] = "当前支持的格式是 ical 和 csv.";
+$a->strings["Enable calendar export"] = "启用日历导出";
+$a->strings["Save Settings"] = "保存设置";
diff --git a/communityhome/README.md b/communityhome/README.md
index 91838d9f..61bbc99a 100644
--- a/communityhome/README.md
+++ b/communityhome/README.md
@@ -1,34 +1,17 @@
Community Home
--------------
-This addon overwrites the default home page shown to not logged users.
-On sidebar there are the login form, last ten users (if they have
-choosed to be in site directory), last ten public photos and last ten
-"likes" sent by a site user or about a site user's item
+This addon overwrites the default home page shown to anonymous users.
+On the sidebar there are the login form, last ten users (if they chose
+to be in the site directory), last ten public photos and last ten
+"likes" sent by a site user or about a site user's item.
-In main content is shown the community stream. This addon doesn't
-honour your community page visibility site setting: the community
+In the main content is shown the community stream. This addon doesn't
+honor your community page visibility site setting: the community
stream is shown also if you have choose to not show the community page.
-If 'home.html' is found in your friendica root, its content is inserted
+If 'home.html' is found in your friendica root, its content is inserted
before community stream
-Each elements can be show or not. At the moment, there is no admin page
-for settings, so this settings must be added to yout .htconfig.php
-
-
- $a->config['communityhome']['showcommunitystream'] = true;
- $a->config['communityhome']['showlastlike'] = true;
- $a->config['communityhome']['showlastphotos'] = true;
- $a->config['communityhome']['showactiveusers'] = true;
- $a->config['communityhome']['showlastusers'] = true;
-
-If you don't want to show something, set it to false.
-
-Note:
------
-
-- Default is "false". With no settings in .htconfig.php, nothing is
-shown, except login form and content of 'home.html'
-
-- Active users query can be heavy for db, and on some system don't work
+By default no features are enabled, you can edit this addon's settings
+through the admin panel.
\ No newline at end of file
diff --git a/communityhome/communityhome.php b/communityhome/communityhome.php
index 78d9fe8a..f2908ab0 100644
--- a/communityhome/communityhome.php
+++ b/communityhome/communityhome.php
@@ -1,40 +1,45 @@
+ * Status: Unsupported
*/
+
+use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Module\Login;
-require_once('mod/community.php');
+require_once 'mod/community.php';
-
-function communityhome_install() {
+function communityhome_install()
+{
Addon::registerHook('home_content', 'addon/communityhome/communityhome.php', 'communityhome_home');
logger("installed communityhome");
}
-function communityhome_uninstall() {
+function communityhome_uninstall()
+{
Addon::unregisterHook('home_content', 'addon/communityhome/communityhome.php', 'communityhome_home');
logger("removed communityhome");
}
-function communityhome_getopts() {
+function communityhome_getopts()
+{
return [
- 'hidelogin'=>L10n::t('Hide login form'),
- 'showlastusers'=>L10n::t('Show last new users'),
- 'showactiveusers'=>L10n::t('Show last active users'),
- 'showlastphotos'=>L10n::t('Show last photos'),
- 'showlastlike'=>L10n::t('Show last liked items'),
- 'showcommunitystream'=>L10n::t('Show community stream')
+ 'hidelogin' => L10n::t('Hide login form'),
+ 'showlastusers' => L10n::t('Show last new users'),
+ 'showlastphotos' => L10n::t('Show last photos'),
+ 'showlastlike' => L10n::t('Show last liked items'),
+ 'showcommunitystream' => L10n::t('Show community stream')
];
}
-function communityhome_addon_admin(&$a, &$o)
+function communityhome_addon_admin(App $a, &$o)
{
$tpl = get_markup_template('settings.tpl', 'addon/communityhome/');
@@ -45,37 +50,37 @@ function communityhome_addon_admin(&$a, &$o)
];
foreach ($opts as $k => $v) {
- $ctx['fields'][] = ['communityhome_'.$k, $v, Config::get('communityhome', $k)];
+ $ctx['fields'][] = ['communityhome_' . $k, $v, Config::get('communityhome', $k)];
}
$o = replace_macros($tpl, $ctx);
}
-function communityhome_addon_admin_post(&$a, &$b)
+function communityhome_addon_admin_post(App $a)
{
if (x($_POST, 'communityhome-submit')) {
$opts = communityhome_getopts();
foreach ($opts as $k => $v) {
- Config::set('communityhome', $k, x($_POST, 'communityhome_'.$k));
+ Config::set('communityhome', $k, x($_POST, 'communityhome_' . $k));
}
}
}
-
-function communityhome_home(&$a, &$o){
+function communityhome_home(App $a, &$o)
+{
// custom css
- $a->page['htmlhead'] .= '';
+ $a->page['htmlhead'] .= '';
- if (!Config::get('communityhome','hidelogin')){
+ if (!Config::get('communityhome', 'hidelogin')) {
$aside = [
'$tab_1' => L10n::t('Login'),
'$tab_2' => L10n::t('OpenID'),
- '$noOid' => Config::get('system','no_openid'),
+ '$noOid' => Config::get('system', 'no_openid'),
];
// login form
- $aside['$login_title'] = L10n::t('Login');
+ $aside['$login_title'] = L10n::t('Login');
$aside['$login_form'] = Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? false : true);
- } else {
+ } else {
$aside = [
//'$tab_1' => L10n::t('Login'),
//'$tab_2' => L10n::t('OpenID'),
@@ -84,70 +89,38 @@ function communityhome_home(&$a, &$o){
}
// last 12 users
- if (Config::get('communityhome','showlastusers')){
+ if (Config::get('communityhome', 'showlastusers')) {
$aside['$lastusers_title'] = L10n::t('Latest users');
$aside['$lastusers_items'] = [];
$sql_extra = "";
- $publish = (Config::get('system','publish_all') ? '' : " AND `publish` = 1 " );
+ $publish = (Config::get('system', 'publish_all') ? '' : " AND `publish` = 1 " );
$order = " ORDER BY `register_date` DESC ";
$r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`
FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
- WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d , %d ",
+ WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra $order LIMIT %d, %d ",
0,
12
);
- # $tpl = file_get_contents( dirname(__file__).'/directory_item.tpl');
- $tpl = get_markup_template( 'directory_item.tpl', 'addon/communityhome/' );
- if(count($r)) {
+ # $tpl = file_get_contents( dirname(__file__).'/directory_item.tpl');
+ $tpl = get_markup_template('directory_item.tpl', 'addon/communityhome/');
+ if (count($r)) {
$photo = 'thumb';
- foreach($r as $rr) {
+ foreach ($r as $rr) {
$profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
- $entry = replace_macros($tpl,[
+ $entry = replace_macros($tpl, [
'$id' => $rr['id'],
'$profile_link' => $profile_link,
- '$photo' => $rr[$photo],
+ '$photo' => $a->get_cached_avatar_image($rr[$photo]),
'$alt_text' => $rr['name'],
- ]);
+ ));
$aside['$lastusers_items'][] = $entry;
}
}
}
- // 12 most active users (by posts and contacts)
- // this query don't work on some mysql versions
- if (Config::get('communityhome','showactiveusers')){
- $r = q("SELECT `uni`.`contacts`,`uni`.`items`, `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname` FROM
- (SELECT COUNT(*) as `contacts`, `uid` FROM `contact` WHERE `self`=0 GROUP BY `uid`) AS `con`,
- (SELECT COUNT(*) as `items`, `uid` FROM `item` WHERE `item`.`changed` > DATE(NOW() - INTERVAL 1 MONTH) AND `item`.`wall` = 1 GROUP BY `uid`) AS `ite`,
- (
- SELECT `contacts`,`items`,`ite`.`uid` FROM `con` RIGHT OUTER JOIN `ite` ON `con`.`uid`=`ite`.`uid`
- UNION ALL
- SELECT `contacts`,`items`,`con`.`uid` FROM `con` LEFT OUTER JOIN `ite` ON `con`.`uid`=`ite`.`uid`
- ) AS `uni`, `user`, `profile`
- WHERE `uni`.`uid`=`user`.`uid`
- AND `uni`.`uid`=`profile`.`uid` AND `profile`.`publish`=1
- GROUP BY `uid`
- ORDER BY `items` DESC,`contacts` DESC
- LIMIT 0,10");
- if($r && count($r)) {
- $aside['$activeusers_title'] = L10n::t('Most active users');
- $aside['$activeusers_items'] = [];
- $photo = 'thumb';
- foreach($r as $rr) {
- $profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
- $entry = replace_macros($tpl,[
- '$id' => $rr['id'],
- '$profile_link' => $profile_link,
- '$photo' => $rr[$photo],
- '$photo_user' => sprintf("%s (%s posts, %s contacts)",$rr['name'], ($rr['items']?$rr['items']:'0'), ($rr['contacts']?$rr['contacts']:'0'))
- ]);
- $aside['$activeusers_items'][] = $entry;
- }
- }
- }
// last 12 photos
- if (Config::get('communityhome','showlastphotos')){
+ if (Config::get('communityhome', 'showlastphotos')) {
$aside['$photos_title'] = L10n::t('Latest photos');
$aside['$photos_items'] = [];
$r = q("SELECT `photo`.`id`, `photo`.`resource-id`, `photo`.`scale`, `photo`.`desc`, `user`.`nickname`, `user`.`username` FROM
@@ -155,31 +128,30 @@ function communityhome_home(&$a, &$o){
WHERE `profile`=0 AND `contact-id`=0 AND `album` NOT IN ('Contact Photos', '%s', 'Profile Photos', '%s')
AND `allow_cid`='' AND `allow_gid`='' AND `deny_cid`='' AND `deny_gid`='' GROUP BY `resource-id`) AS `t1`
INNER JOIN `photo` ON `photo`.`resource-id`=`t1`.`resource-id` AND `photo`.`scale` = `t1`.`maxscale`,
- `user`
+ `user`
WHERE `user`.`uid` = `photo`.`uid`
AND `user`.`blockwall`=0
AND `user`.`hidewall` = 0
ORDER BY `photo`.`edited` DESC
LIMIT 0, 12",
- dbesc(L10n::t('Contact Photos')),
- dbesc(L10n::t('Profile Photos'))
- );
+ dbesc(L10n::t('Contact Photos')),
+ dbesc(L10n::t('Profile Photos'))
+ );
- if(count($r)) {
- # $tpl = file_get_contents( dirname(__file__).'/directory_item.tpl');
- $tpl = get_markup_template( 'directory_item.tpl', 'addon/communityhome/' );
- foreach($r as $rr) {
+ if (count($r)) {
+ # $tpl = file_get_contents( dirname(__file__).'/directory_item.tpl');
+ $tpl = get_markup_template('directory_item.tpl', 'addon/communityhome/');
+ foreach ($r as $rr) {
$photo_page = $a->get_baseurl() . '/photos/' . $rr['nickname'] . '/image/' . $rr['resource-id'];
- $photo_url = $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['scale'] .'.jpg';
+ $photo_url = $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['scale'] . '.jpg';
- $entry = replace_macros($tpl,[
+ $entry = replace_macros($tpl, [
'$id' => $rr['id'],
'$profile_link' => $photo_page,
'$photo' => $photo_url,
- '$photo_user' => $rr['username'],
- '$photo_title' => $rr['desc']
- ]);
+ '$alt_text' => $rr['username']." : ".$rr['desc'],
+ ));
$aside['$photos_items'][] = $entry;
}
@@ -187,28 +159,29 @@ function communityhome_home(&$a, &$o){
}
// last 10 liked items
- if (Config::get('communityhome','showlastlike')){
+ if (Config::get('communityhome', 'showlastlike')) {
$aside['$like_title'] = L10n::t('Latest likes');
$aside['$like_items'] = [];
$r = q("SELECT `T1`.`created`, `T1`.`liker`, `T1`.`liker-link`, `item`.* FROM
(SELECT `parent-uri`, `created`, `author-name` AS `liker`,`author-link` AS `liker-link`
FROM `item` WHERE `verb`='http://activitystrea.ms/schema/1.0/like' GROUP BY `parent-uri` ORDER BY `created` DESC) AS T1
- INNER JOIN `item` ON `item`.`uri`=`T1`.`parent-uri`
+ INNER JOIN `item` ON `item`.`uri`=`T1`.`parent-uri`
WHERE `T1`.`liker-link` LIKE '%s%%' OR `item`.`author-link` LIKE '%s%%'
GROUP BY `uri`
ORDER BY `T1`.`created` DESC
LIMIT 0,10",
- $a->get_baseurl(),$a->get_baseurl()
- );
+ $a->get_baseurl(),
+ $a->get_baseurl()
+ );
foreach ($r as $rr) {
- $author = '' . $rr['liker'] . '';
- $objauthor = '' . $rr['author-name'] . '';
+ $author = '' . $rr['liker'] . '';
+ $objauthor = '' . $rr['author-name'] . '';
//var_dump($rr['verb'],$rr['object-type']); killme();
- switch($rr['verb']){
+ switch ($rr['verb']) {
case 'http://activitystrea.ms/schema/1.0/post':
- switch ($rr['object-type']){
+ switch ($rr['object-type']) {
case 'http://activitystrea.ms/schema/1.0/event':
$post_type = L10n::t('event');
break;
@@ -217,9 +190,10 @@ function communityhome_home(&$a, &$o){
}
break;
default:
- if ($rr['resource-id']){
+ if ($rr['resource-id']) {
$post_type = L10n::t('photo');
- $m=[]; preg_match("/\[url=([^]]*)\]/", $rr['body'], $m);
+ $m = [];
+ preg_match("/\[url=([^]]*)\]/", $rr['body'], $m);
$rr['plink'] = $m[1];
} else {
$post_type = L10n::t('status');
@@ -228,7 +202,6 @@ function communityhome_home(&$a, &$o){
$plink = '' . $post_type . '';
$aside['$like_items'][] = L10n::t('%1$s likes %2$s\'s %3$s', $author, $objauthor, $plink);
-
}
}
@@ -236,19 +209,16 @@ function communityhome_home(&$a, &$o){
$tpl = get_markup_template('communityhome.tpl', 'addon/communityhome/');
$a->page['aside'] = replace_macros($tpl, $aside);
- $o = '
';
$s .= '';
} else {
- /* * *
+ /***
* we have an OAuth key / secret pair for the user
* so let's give a chance to disable the postings to Twitter
*/
$connection = new TwitterOAuth($ckey, $csecret, $otoken, $osecret);
$details = $connection->get('account/verify_credentials');
+ $s .= '
'. t('If enabled all your public postings can be posted to the associated Twitter account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.') .'
';
+ if ($a->user['hidewall']) {
+ $s .= '
'. t('Note: Due your privacy settings (Hide your profile details from unknown viewers?) the link potentially included in public postings relayed to Twitter will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted.') .'
"
-
+
.htmlspecialchars('')
."";
-
+
return $o;
}
}
diff --git a/windowsphonepush/lang/it/messages.po b/windowsphonepush/lang/it/messages.po
index d51b5732..39e29279 100644
--- a/windowsphonepush/lang/it/messages.po
+++ b/windowsphonepush/lang/it/messages.po
@@ -4,13 +4,13 @@
#
#
# Translators:
-# fabrixxm , 2014
+# fabrixxm , 2014,2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-10-26 15:02+0100\n"
-"PO-Revision-Date: 2014-10-31 13:46+0000\n"
+"PO-Revision-Date: 2018-03-19 13:26+0000\n"
"Last-Translator: fabrixxm \n"
"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n"
"MIME-Version: 1.0\n"
@@ -29,7 +29,7 @@ msgstr "Impostazioni WindowsPhonePush"
#: windowsphonepush.php:117
msgid "Enable WindowsPhonePush Addon"
-msgstr "Abilita addon WindowsPhonePush"
+msgstr "Abilita componente aggiuntivo WindowsPhonePush"
#: windowsphonepush.php:122
msgid "Push text of new item"
diff --git a/windowsphonepush/lang/it/strings.php b/windowsphonepush/lang/it/strings.php
index ca76a09d..a45c2c7f 100644
--- a/windowsphonepush/lang/it/strings.php
+++ b/windowsphonepush/lang/it/strings.php
@@ -7,6 +7,6 @@ function string_plural_select_it($n){
;
$a->strings["WindowsPhonePush settings updated."] = "Impostazioni WindowsPhonePush aggiornate.";
$a->strings["WindowsPhonePush Settings"] = "Impostazioni WindowsPhonePush";
-$a->strings["Enable WindowsPhonePush Addon"] = "Abilita addon WindowsPhonePush";
+$a->strings["Enable WindowsPhonePush Addon"] = "Abilita componente aggiuntivo WindowsPhonePush";
$a->strings["Push text of new item"] = "Notifica il testo dei nuovi elementi";
$a->strings["Save Settings"] = "Salva Impostazioni";
diff --git a/windowsphonepush/windowsphonepush.php b/windowsphonepush/windowsphonepush.php
index 3aaf1d30..9c6ba898 100644
--- a/windowsphonepush/windowsphonepush.php
+++ b/windowsphonepush/windowsphonepush.php
@@ -1,26 +1,25 @@
- *
- *
+ *
+ *
* Pre-requisite: Windows Phone mobile device (at least WP 7.0)
* Friendica mobile app on Windows Phone
*
* When addon is installed, the system calls the addon
* 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
+ * If the addon is removed from the configuration list, the
* system will call the name_uninstall() function.
*
* Version history:
- * 1.1 : addon crashed on php versions >= 5.4 as of removed deprecated call-time
+ * 1.1 : addon crashed on php versions >= 5.4 as of removed deprecated call-time
* pass-by-reference used in function calls within function windowsphonepush_content
* 2.0 : adaption for supporting emphasizing new entries in app (count on tile cannot be read out,
- * so we need to retrieve counter through show_settings secondly). Provide new function for
+ * so we need to retrieve counter through show_settings secondly). Provide new function for
* calling from app to set the counter back after start (if user starts again before cronjob
* sets the counter back
* count only unseen elements which are not type=activity (likes and dislikes not seen as new elements)
@@ -39,6 +38,7 @@ function windowsphonepush_install()
/* Our addon will attach in three places.
* The first is within cron - so the push notifications will be
* sent every 10 minutes (or whatever is set in crontab).
+ *
*/
Addon::registerHook('cron', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_cron');
@@ -46,6 +46,7 @@ function windowsphonepush_install()
* settings post hook so that we can create and update
* user preferences. User shall be able to activate the addon and
* define whether he allows pushing first characters of item text
+ *
*/
Addon::registerHook('addon_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings');
Addon::registerHook('addon_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post');
@@ -53,10 +54,14 @@ function windowsphonepush_install()
logger("installed windowsphonepush");
}
-function windowsphonepush_uninstall()
-{
- /* uninstall unregisters any hooks created with register_hook
+
+function windowsphonepush_uninstall() {
+
+ /**
+ *
+ * uninstall unregisters any hooks created with register_hook
* during install. Don't delete data in table `pconfig`.
+ *
*/
Addon::unregisterHook('cron', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_cron');
Addon::unregisterHook('addon_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings');
@@ -65,54 +70,54 @@ function windowsphonepush_uninstall()
logger("removed windowsphonepush");
}
+
/* declare the windowsphonepush function so that /windowsphonepush url requests will land here */
-function windowsphonepush_module()
-{
+function windowsphonepush_module() {}
-}
-/* Callback from the settings post function.
+/**
+ *
+ * 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 windowsphonepush_settings_post($a, $post)
-{
- if (!local_user() || (!x($_POST, 'windowsphonepush-submit'))) {
+function windowsphonepush_settings_post($a,$post) {
+ if(! local_user() || (! x($_POST,'windowsphonepush-submit')))
return;
- }
$enable = intval($_POST['windowsphonepush']);
- PConfig::set(local_user(), 'windowsphonepush', 'enable', $enable);
+ set_pconfig(local_user(),'windowsphonepush','enable',$enable);
- if ($enable) {
- PConfig::set(local_user(), 'windowsphonepush', 'counterunseen', 0);
+ if($enable) {
+ set_pconfig(local_user(),'windowsphonepush','counterunseen', 0);
}
- PConfig::set(local_user(), 'windowsphonepush', 'senditemtext', intval($_POST['windowsphonepush-senditemtext']));
+ set_pconfig(local_user(),'windowsphonepush','senditemtext',intval($_POST['windowsphonepush-senditemtext']));
info(L10n::t('WindowsPhonePush settings updated.') . EOL);
}
/* Called from the Addon Setting form.
* Add our own settings info to the page.
+ *
*/
-function windowsphonepush_settings(&$a, &$s)
-{
- if (!local_user()) {
+function windowsphonepush_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 variables */
- $enabled = PConfig::get(local_user(), 'windowsphonepush', 'enable');
+ $enabled = get_pconfig(local_user(),'windowsphonepush','enable');
$checked_enabled = (($enabled) ? ' checked="checked" ' : '');
- $senditemtext = PConfig::get(local_user(), 'windowsphonepush', 'senditemtext');
+ $senditemtext = get_pconfig(local_user(), 'windowsphonepush', 'senditemtext');
$checked_senditemtext = (($senditemtext) ? ' checked="checked" ' : '');
- $device_url = PConfig::get(local_user(), 'windowsphonepush', 'device_url');
+ $device_url = get_pconfig(local_user(), 'windowsphonepush', 'device_url');
/* Add some HTML to the existing form */
$s .= '
';
-
+
return;
+
}
/* Cron function used to regularly check all users on the server with active windowsphonepushaddon and send
* notifications to the Microsoft servers and consequently to the Windows Phone device
+ *
*/
function windowsphonepush_cron()
{
// retrieve all UID's for which the addon windowsphonepush is enabled and loop through every user
$r = q("SELECT * FROM `pconfig` WHERE `cat` = 'windowsphonepush' AND `k` = 'enable' AND `v` = 1");
- if (count($r)) {
- foreach ($r as $rr) {
+ if(count($r)) {
+ foreach($r as $rr) {
// load stored information for the user-id of the current loop
- $device_url = PConfig::get($rr['uid'], 'windowsphonepush', 'device_url');
- $lastpushid = PConfig::get($rr['uid'], 'windowsphonepush', 'lastpushid');
+ $device_url = get_pconfig($rr['uid'], 'windowsphonepush', 'device_url');
+ $lastpushid = get_pconfig($rr['uid'], 'windowsphonepush', 'lastpushid');
- // pushing only possible if device_url (the URI on Microsoft server) is available or not "NA" (which will be sent
+ // pushing only possible if device_url (the URI on Microsoft server) is available or not "NA" (which will be sent
// by app if user has switched the server setting in app - sending blank not possible as this would return an update error)
if (( $device_url == "" ) || ( $device_url == "NA" )) {
// no Device-URL for the user availabe, but addon is enabled --> write info to Logger
logger("WARN: windowsphonepush is enable for user " . $rr['uid'] . ", but no Device-URL is specified for the user.");
} else {
- // retrieve the number of unseen items and the id of the latest one (if there are more than
+ // retrieve the number of unseen items and the id of the latest one (if there are more than
// one new entries since last poller run, only the latest one will be pushed)
- $count = q("SELECT count(`id`) as count, max(`id`) as max FROM `item` WHERE `unseen` = 1 AND `type` <> 'activity' AND `uid` = %d", intval($rr['uid']));
+ $count = q("SELECT count(`id`) as count, max(`id`) as max FROM `item` WHERE `unseen` = 1 AND `type` <> 'activity' AND `uid` = %d",
+ intval($rr['uid'])
+ );
- // send number of unseen items to the device (the number will be displayed on Start screen until
- // App will be started by user) - this update will be sent every 10 minutes to update the number to 0 if
+ // send number of unseen items to the device (the number will be displayed on Start screen until
+ // App will be started by user) - this update will be sent every 10 minutes to update the number to 0 if
// user has loaded the timeline through app or website
$res_tile = send_tile_update($device_url, "", $count[0]['count'], "");
switch (trim($res_tile)) {
case "Received":
- // ok, count has been pushed, let's save it in personal settings
- PConfig::set($rr['uid'], 'windowsphonepush', 'counterunseen', $count[0]['count']);
+ // ok, count has been pushed, let's save it in personal settings
+ set_pconfig($rr['uid'], 'windowsphonepush', 'counterunseen', $count[0]['count']);
break;
case "QueueFull":
// maximum of 30 messages reached, server rejects any further push notification until device reconnects
@@ -193,23 +202,25 @@ function windowsphonepush_cron()
if (intval($count[0]['max']) > intval($lastpushid)) {
// user can define if he wants to see the text of the item in the push notification
// this has been implemented as the device_url is not a https uri (not so secure)
- $senditemtext = PConfig::get($rr['uid'], 'windowsphonepush', 'senditemtext');
+ $senditemtext = get_pconfig($rr['uid'], 'windowsphonepush', 'senditemtext');
if ($senditemtext == 1) {
// load item with the max id
- $item = q("SELECT `author-name` as author, `body` as body FROM `item` where `id` = %d", intval($count[0]['max']));
+ $item = q("SELECT `author-name` as author, `body` as body FROM `item` where `id` = %d",
+ intval($count[0]['max'])
+ );
// as user allows to send the item, we want to show the sender of the item in the toast
- // toasts are limited to one line, therefore place is limited - author shall be in
+ // toasts are limited to one line, therefore place is limited - author shall be in
// max. 15 chars (incl. dots); author is displayed in bold font
$author = $item[0]['author'];
$author = ((strlen($author) > 12) ? substr($author, 0, 12) . "..." : $author);
// normally we show the body of the item, however if it is an url or an image we cannot
- // show this in the toast (only test), therefore changing to an alternate text
+ // show this in the toast (only test), therefore changing to an alternate text
// Otherwise BBcode-Tags will be eliminated and plain text cutted to 140 chars (incl. dots)
// BTW: information only possible in English
$body = $item[0]['body'];
- if (substr($body, 0, 4) == "[url") {
+ if (substr($body, 0, 4) == "[url")
$body = "URL/Image ...";
} else {
$body = BBCode::convert($body, false, 2, true);
@@ -217,82 +228,91 @@ function windowsphonepush_cron()
$body = ((strlen($body) > 137) ? substr($body, 0, 137) . "..." : $body);
}
} else {
- // if user wishes higher privacy, we only display "Friendica - New timeline entry arrived"
+ // if user wishes higher privacy, we only display "Friendica - New timeline entry arrived"
$author = "Friendica";
$body = "New timeline entry arrived ...";
}
- // only if toast push notification returns the Notification status "Received" we will update th settings with the
+ // only if toast push notification returns the Notification status "Received" we will update th settings with the
// new indicator max-id is checked against (QueueFull, Suppressed, N/A, Dropped shall qualify to resend
- // the push notification some minutes later (BTW: if resulting in Expired for subscription status the
+ // the push notification some minutes later (BTW: if resulting in Expired for subscription status the
// device_url will be deleted (no further try on this url, see send_push)
// further log information done on count pushing with send_tile (see above)
$res_toast = send_toast($device_url, $author, $body);
if (trim($res_toast) === 'Received') {
- PConfig::set($rr['uid'], 'windowsphonepush', 'lastpushid', $count[0]['max']);
- }
+ set_pconfig($rr['uid'], 'windowsphonepush', 'lastpushid', $count[0]['max']);
+ }
}
}
}
}
}
-/* Tile push notification change the number in the icon of the App in Start Screen of
+
+/*
+ *
+ * Tile push notification change the number in the icon of the App in Start Screen of
* a Windows Phone Device, Image could be changed, not used for App "Friendica Mobile"
+ *
*/
-function send_tile_update($device_url, $image_url, $count, $title, $priority = 1)
-{
+function send_tile_update($device_url, $image_url, $count, $title, $priority = 1) {
$msg = "" .
"" .
- "" .
- "" . $image_url . "" .
- "" . $count . "" .
- "" . $title . "" .
- " " .
+ "".
+ "" . $image_url . "" .
+ "" . $count . "" .
+ "" . $title . "" .
+ " " .
"";
- $result = send_push($device_url, [
+ $result = send_push($device_url, array(
'X-WindowsPhone-Target: token',
'X-NotificationClass: ' . $priority,
- ], $msg);
+ ), $msg);
return $result;
}
-/* Toast push notification send information to the top of the display
+/*
+ *
+ * Toast push notification send information to the top of the display
* if the user is not currently using the Friendica Mobile App, however
* there is only one line for displaying the information
+ *
*/
-function send_toast($device_url, $title, $message, $priority = 2)
-{
- $msg = "" .
+function send_toast($device_url, $title, $message, $priority = 2) {
+ $msg = "" .
"" .
- "" .
- "" . $title . "" .
- "" . $message . "" .
- "" .
- "" .
+ "" .
+ "" . $title . "" .
+ "" . $message . "" .
+ "" .
+ "" .
"";
- $result = send_push($device_url, [
+ $result = send_push($device_url, array(
'X-WindowsPhone-Target: toast',
- 'X-NotificationClass: ' . $priority,
- ], $msg);
+ 'X-NotificationClass: ' . $priority,
+ ), $msg);
return $result;
}
-// General function to send the push notification via cURL
-function send_push($device_url, $headers, $msg)
-{
+/*
+ *
+ * General function to send the push notification via cURL
+ *
+ */
+function send_push($device_url, $headers, $msg) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $device_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_HEADER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers + [
- 'Content-Type: text/xml',
- 'charset=utf-8',
- 'Accept: application/*',
- ]
- );
+ curl_setopt($ch, CURLOPT_HEADER, true);
+ curl_setopt($ch, CURLOPT_HTTPHEADER,
+ $headers + array(
+ 'Content-Type: text/xml',
+ 'charset=utf-8',
+ 'Accept: application/*',
+ )
+ );
curl_setopt($ch, CURLOPT_POSTFIELDS, $msg);
$output = curl_exec($ch);
@@ -302,31 +322,35 @@ function send_push($device_url, $headers, $msg)
// and log this fact
$subscriptionStatus = get_header_value($output, 'X-SubscriptionStatus');
if ($subscriptionStatus == "Expired") {
- PConfig::set(local_user(), 'windowsphonepush', 'device_url', "");
+ set_pconfig(local_user(),'windowsphonepush','device_url', "");
logger("ERROR: the stored Device-URL " . $device_url . "returned an 'Expired' error, it has been deleted now.");
}
- // the notification status shall be returned to windowsphonepush_cron (will
+ // the notification status shall be returned to windowsphonepush_cron (will
// update settings if 'Received' otherwise keep old value in settings (on QueuedFull. Suppressed, N/A, Dropped)
$notificationStatus = get_header_value($output, 'X-NotificationStatus');
return $notificationStatus;
-}
+ }
-// helper function to receive statuses from webresponse of Microsoft server
-function get_header_value($content, $header)
-{
+/*
+ * helper function to receive statuses from webresponse of Microsoft server
+ */
+function get_header_value($content, $header) {
return preg_match_all("/$header: (.*)/i", $content, $match) ? $match[1][0] : "";
}
-/* reading information from url and deciding which function to start
+
+/*
+ *
+ * reading information from url and deciding which function to start
* show_settings = delivering settings to check
* update_settings = set the device_url
* update_counterunseen = set counter for unseen elements to zero
+ *
*/
-function windowsphonepush_content(App $a)
-{
+function windowsphonepush_content(&$a) {
// Login with the specified Network credentials (like in api.php)
- windowsphonepush_login($a);
+ windowsphonepush_login();
$path = $a->argv[0];
$path2 = $a->argv[1];
@@ -338,14 +362,14 @@ function windowsphonepush_content(App $a)
break;
case "update_settings":
$ret = windowsphonepush_updatesettings($a);
- header("Content-Type: application/json; charset=utf-8");
- echo json_encode(['status' => $ret]);
- killme();
+ header("Content-Type: application/json; charset=utf-8");
+ echo json_encode(array('status' => $ret));
+ killme();
break;
case "update_counterunseen":
$ret = windowsphonepush_updatecounterunseen();
header("Content-Type: application/json; charset=utf-8");
- echo json_encode(['status' => $ret]);
+ echo json_encode(array('status' => $ret));
killme();
break;
default:
@@ -354,44 +378,42 @@ function windowsphonepush_content(App $a)
}
}
-// return settings for windowsphonepush addon to be able to check them in WP app
-function windowsphonepush_showsettings()
-{
- if (!local_user()) {
+/*
+ * return settings for windowsphonepush addon to be able to check them in WP app
+ */
+function windowsphonepush_showsettings(&$a) {
+ if(! local_user())
return;
- }
- $enable = PConfig::get(local_user(), 'windowsphonepush', 'enable');
- $device_url = PConfig::get(local_user(), 'windowsphonepush', 'device_url');
- $senditemtext = PConfig::get(local_user(), 'windowsphonepush', 'senditemtext');
- $lastpushid = PConfig::get(local_user(), 'windowsphonepush', 'lastpushid');
- $counterunseen = PConfig::get(local_user(), 'windowsphonepush', 'counterunseen');
+ $enable = get_pconfig(local_user(), 'windowsphonepush', 'enable');
+ $device_url = get_pconfig(local_user(), 'windowsphonepush', 'device_url');
+ $senditemtext = get_pconfig(local_user(), 'windowsphonepush', 'senditemtext');
+ $lastpushid = get_pconfig(local_user(), 'windowsphonepush', 'lastpushid');
+ $counterunseen = get_pconfig(local_user(), 'windowsphonepush', 'counterunseen');
$addonversion = "2.0";
- if (!$device_url) {
+ if (!$device_url)
$device_url = "";
- }
- if (!$lastpushid) {
+ if (!$lastpushid)
$lastpushid = 0;
- }
- header("Content-Type: application/json");
- echo json_encode(['uid' => local_user(),
- 'enable' => $enable,
- 'device_url' => $device_url,
- 'senditemtext' => $senditemtext,
- 'lastpushid' => $lastpushid,
- 'counterunseen' => $counterunseen,
- 'addonversion' => $addonversion]);
+ header ("Content-Type: application/json");
+ echo json_encode(array('uid' => local_user(),
+ 'enable' => $enable,
+ 'device_url' => $device_url,
+ 'senditemtext' => $senditemtext,
+ 'lastpushid' => $lastpushid,
+ 'counterunseen' => $counterunseen,
+ 'addonversion' => $addonversion));
}
-/* update_settings is used to transfer the device_url from WP device to the Friendica server
+/*
+ * update_settings is used to transfer the device_url from WP device to the Friendica server
* return the status of the operation to the server
*/
-function windowsphonepush_updatesettings()
-{
- if (!local_user()) {
+function windowsphonepush_updatesettings(&$a) {
+ if(! local_user()) {
return "Not Authenticated";
}
@@ -408,31 +430,32 @@ function windowsphonepush_updatesettings()
return "No valid Device-URL specified";
}
- // check if sent url is already stored in database for another user, we assume that there was a change of
+ // check if sent url is already stored in database for another user, we assume that there was a change of
// the user on the Windows Phone device and that device url is no longer true for the other user, so we
- // et the device_url for the OTHER user blank (should normally not occur as App should include User/server
+ // et the device_url for the OTHER user blank (should normally not occur as App should include User/server
// in url request to Microsoft Push Notification server)
- $r = q("SELECT * FROM `pconfig` WHERE `uid` <> " . local_user() . " AND
- `cat` = 'windowsphonepush' AND
- `k` = 'device_url' AND
+ $r = q("SELECT * FROM `pconfig` WHERE `uid` <> " . local_user() . " AND
+ `cat` = 'windowsphonepush' AND
+ `k` = 'device_url' AND
`v` = '" . $device_url . "'");
- if (count($r)) {
- foreach ($r as $rr) {
- PConfig::set($rr['uid'], 'windowsphonepush', 'device_url', '');
- logger("WARN: the sent URL was already registered with user '" . $rr['uid'] . "'. Deleted for this user as we expect to be correct now for user '" . local_user() . "'.");
+ if(count($r)) {
+ foreach($r as $rr) {
+ set_pconfig($rr['uid'], 'windowsphonepush', 'device_url', '');
+ logger("WARN: the sent URL was already registered with user '" . $rr['uid'] . "'. Deleted for this user as we expect to be correct now for user '" . local_user() . "'.");
}
}
- PConfig::set(local_user(), 'windowsphonepush', 'device_url', $device_url);
+ set_pconfig(local_user(),'windowsphonepush','device_url', $device_url);
// output the successfull update of the device URL to the logger for error analysis if necessary
logger("INFO: Device-URL for user '" . local_user() . "' has been updated with '" . $device_url . "'");
return "Device-URL updated successfully!";
}
-// update_counterunseen is used to reset the counter to zero from Windows Phone app
-function windowsphonepush_updatecounterunseen()
-{
- if (!local_user()) {
+/*
+ * update_counterunseen is used to reset the counter to zero from Windows Phone app
+ */
+function windowsphonepush_updatecounterunseen() {
+ if(! local_user()) {
return "Not Authenticated";
}
@@ -442,31 +465,40 @@ function windowsphonepush_updatecounterunseen()
return "Plug-in not enabled";
}
- PConfig::set(local_user(), 'windowsphonepush', 'counterunseen', 0);
+ set_pconfig(local_user(),'windowsphonepush','counterunseen', 0);
return "Counter set to zero";
}
-/* helper function to login to the server with the specified Network credentials
+/*
+ * helper function to login to the server with the specified Network credentials
* (mainly copied from api.php)
*/
-function windowsphonepush_login(App $a)
-{
+function windowsphonepush_login() {
if (!isset($_SERVER['PHP_AUTH_USER'])) {
- logger('API_login: ' . print_r($_SERVER, true), LOGGER_DEBUG);
- header('WWW-Authenticate: Basic realm="Friendica"');
- header('HTTP/1.0 401 Unauthorized');
- die('This api requires login');
+ logger('API_login: ' . print_r($_SERVER, true), LOGGER_DEBUG);
+ header('WWW-Authenticate: Basic realm="Friendica"');
+ header('HTTP/1.0 401 Unauthorized');
+ die('This api requires login');
}
- $user_id = User::authenticate($_SERVER['PHP_AUTH_USER'], trim($_SERVER['PHP_AUTH_PW']));
+ $user = $_SERVER['PHP_AUTH_USER'];
+ $encrypted = hash('whirlpool',trim($_SERVER['PHP_AUTH_PW']));
- if ($user_id) {
- $record = dba::selectFirst('user', [], ['uid' => $user_id]);
+ // check if user specified by app is available in the user table
+ $r = q("SELECT * FROM `user` WHERE ( `email` = '%s' OR `nickname` = '%s' )
+ AND `password` = '%s' AND `blocked` = 0 AND `account_expired` = 0 AND `account_removed` = 0 AND `verified` = 1 LIMIT 1",
+ dbesc(trim($user)),
+ dbesc(trim($user)),
+ dbesc($encrypted)
+ );
+
+ if(count($r)){
+ $record = $r[0];
} else {
- logger('API_login failure: ' . print_r($_SERVER, true), LOGGER_DEBUG);
- header('WWW-Authenticate: Basic realm="Friendica"');
- header('HTTP/1.0 401 Unauthorized');
- die('This api requires login');
+ logger('API_login failure: ' . print_r($_SERVER,true), LOGGER_DEBUG);
+ header('WWW-Authenticate: Basic realm="Friendica"');
+ header('HTTP/1.0 401 Unauthorized');
+ die('This api requires login');
}
require_once 'include/security.php';
@@ -474,3 +506,4 @@ function windowsphonepush_login(App $a)
$_SESSION["allow_api"] = true;
Addon::callHooks('logged_in', $a->user);
}
+
diff --git a/wppost/lang/it/messages.po b/wppost/lang/it/messages.po
index 00bed78a..85e2b317 100644
--- a/wppost/lang/it/messages.po
+++ b/wppost/lang/it/messages.po
@@ -4,13 +4,13 @@
#
#
# Translators:
-# fabrixxm , 2014-2015
+# fabrixxm , 2014-2015,2017-2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-24 21:06+0100\n"
-"PO-Revision-Date: 2017-02-10 08:18+0000\n"
+"PO-Revision-Date: 2018-03-19 13:26+0000\n"
"Last-Translator: fabrixxm \n"
"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n"
"MIME-Version: 1.0\n"
@@ -25,11 +25,11 @@ msgstr "Invia a Wordpress"
#: wppost.php:80 wppost.php:84
msgid "Wordpress Export"
-msgstr ""
+msgstr "Esporta a Wordpress"
#: wppost.php:87
msgid "Enable WordPress Post Addon"
-msgstr "Abilita il addon di invio a Wordpress"
+msgstr "Abilita il componente aggiuntivo di invio a Wordpress"
#: wppost.php:92
msgid "WordPress username"
@@ -55,19 +55,19 @@ msgstr "Inserisci un link al messaggio originale su Friendica"
msgid ""
"Text for the backlink, e.g. Read the original post and comment stream on "
"Friendica."
-msgstr ""
+msgstr "Testo per il backlink, p.e. Leggi il post originale e i commenti su Friendica."
#: wppost.php:121
msgid "Don't post messages that are too short"
-msgstr ""
+msgstr "Non inviare messaggi troppo corti"
#: wppost.php:127
msgid "Save Settings"
-msgstr ""
+msgstr "Salva Impostazioni"
#: wppost.php:206
msgid "Read the original post and comment stream on Friendica"
-msgstr ""
+msgstr "Leggi il messaggio originale e i commenti su Friendica"
#: wppost.php:269
msgid "Post from Friendica"
diff --git a/wppost/lang/it/strings.php b/wppost/lang/it/strings.php
index 8df1bd08..c982dbcd 100644
--- a/wppost/lang/it/strings.php
+++ b/wppost/lang/it/strings.php
@@ -6,15 +6,15 @@ function string_plural_select_it($n){
}}
;
$a->strings["Post to Wordpress"] = "Invia a Wordpress";
-$a->strings["Wordpress Export"] = "";
-$a->strings["Enable WordPress Post Addon"] = "Abilita il addon di invio a Wordpress";
+$a->strings["Wordpress Export"] = "Esporta a Wordpress";
+$a->strings["Enable WordPress Post Addon"] = "Abilita il componente aggiuntivo di invio a Wordpress";
$a->strings["WordPress username"] = "Nome utente Wordpress";
$a->strings["WordPress password"] = "Password Wordpress";
$a->strings["WordPress API URL"] = "Indirizzo API Wordpress";
$a->strings["Post to WordPress by default"] = "Invia sempre a Wordpress";
$a->strings["Provide a backlink to the Friendica post"] = "Inserisci un link al messaggio originale su Friendica";
-$a->strings["Text for the backlink, e.g. Read the original post and comment stream on Friendica."] = "";
-$a->strings["Don't post messages that are too short"] = "";
-$a->strings["Save Settings"] = "";
-$a->strings["Read the original post and comment stream on Friendica"] = "";
+$a->strings["Text for the backlink, e.g. Read the original post and comment stream on Friendica."] = "Testo per il backlink, p.e. Leggi il post originale e i commenti su Friendica.";
+$a->strings["Don't post messages that are too short"] = "Non inviare messaggi troppo corti";
+$a->strings["Save Settings"] = "Salva Impostazioni";
+$a->strings["Read the original post and comment stream on Friendica"] = "Leggi il messaggio originale e i commenti su Friendica";
$a->strings["Post from Friendica"] = "Messaggio da Friendica";
diff --git a/wppost/wppost.php b/wppost/wppost.php
index a2c11293..2eec391c 100644
--- a/wppost/wppost.php
+++ b/wppost/wppost.php
@@ -40,9 +40,9 @@ function wppost_jot_nets(&$a,&$b) {
if(! local_user())
return;
- $wp_post = PConfig::get(local_user(),'wppost','post');
+ $wp_post = get_pconfig(local_user(),'wppost','post');
if(intval($wp_post) == 1) {
- $wp_defpost = PConfig::get(local_user(),'wppost','post_by_default');
+ $wp_defpost = get_pconfig(local_user(),'wppost','post_by_default');
$selected = ((intval($wp_defpost) == 1) ? ' checked="checked" ' : '');
$b .= '
'
. L10n::t('Post to Wordpress') . '
';
@@ -61,23 +61,23 @@ function wppost_settings(&$a,&$s) {
/* Get the current state of our config variables */
- $enabled = PConfig::get(local_user(),'wppost','post');
+ $enabled = get_pconfig(local_user(),'wppost','post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
- $def_enabled = PConfig::get(local_user(),'wppost','post_by_default');
- $back_enabled = PConfig::get(local_user(),'wppost','backlink');
- $shortcheck_enabled = PConfig::get(local_user(),'wppost','shortcheck');
+ $def_enabled = get_pconfig(local_user(),'wppost','post_by_default');
+ $back_enabled = get_pconfig(local_user(),'wppost','backlink');
+ $shortcheck_enabled = get_pconfig(local_user(),'wppost','shortcheck');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
$back_checked = (($back_enabled) ? ' checked="checked" ' : '');
$shortcheck_checked = (($shortcheck_enabled) ? ' checked="checked" ' : '');
- $wp_username = PConfig::get(local_user(), 'wppost', 'wp_username');
- $wp_password = PConfig::get(local_user(), 'wppost', 'wp_password');
- $wp_blog = PConfig::get(local_user(), 'wppost', 'wp_blog');
- $wp_backlink_text = PConfig::get(local_user(), 'wppost', 'wp_backlink_text');
+ $wp_username = get_pconfig(local_user(), 'wppost', 'wp_username');
+ $wp_password = get_pconfig(local_user(), 'wppost', 'wp_password');
+ $wp_blog = get_pconfig(local_user(), 'wppost', 'wp_blog');
+ $wp_backlink_text = get_pconfig(local_user(), 'wppost', 'wp_backlink_text');
/* Add some HTML to the existing form */
@@ -139,13 +139,13 @@ function wppost_settings_post(&$a,&$b) {
if(x($_POST,'wppost-submit')) {
- PConfig::set(local_user(),'wppost','post',intval($_POST['wppost']));
- PConfig::set(local_user(),'wppost','post_by_default',intval($_POST['wp_bydefault']));
- PConfig::set(local_user(),'wppost','wp_username',trim($_POST['wp_username']));
- PConfig::set(local_user(),'wppost','wp_password',trim($_POST['wp_password']));
- PConfig::set(local_user(),'wppost','wp_blog',trim($_POST['wp_blog']));
- PConfig::set(local_user(),'wppost','backlink',trim($_POST['wp_backlink']));
- PConfig::set(local_user(),'wppost','shortcheck',trim($_POST['wp_shortcheck']));
+ set_pconfig(local_user(),'wppost','post',intval($_POST['wppost']));
+ set_pconfig(local_user(),'wppost','post_by_default',intval($_POST['wp_bydefault']));
+ set_pconfig(local_user(),'wppost','wp_username',trim($_POST['wp_username']));
+ set_pconfig(local_user(),'wppost','wp_password',trim($_POST['wp_password']));
+ set_pconfig(local_user(),'wppost','wp_blog',trim($_POST['wp_blog']));
+ set_pconfig(local_user(),'wppost','backlink',trim($_POST['wp_backlink']));
+ set_pconfig(local_user(),'wppost','shortcheck',trim($_POST['wp_shortcheck']));
$wp_backlink_text = notags(trim($_POST['wp_backlink_text']));
$wp_backlink_text = BBCode::convert($wp_backlink_text, false, 8);
$wp_backlink_text = HTML::toPlaintext($wp_backlink_text, 0, true);
@@ -171,11 +171,11 @@ function wppost_post_local(&$a, &$b) {
return;
}
- $wp_post = intval(PConfig::get(local_user(),'wppost','post'));
+ $wp_post = intval(get_pconfig(local_user(),'wppost','post'));
$wp_enable = (($wp_post && x($_REQUEST,'wppost_enable')) ? intval($_REQUEST['wppost_enable']) : 0);
- if ($b['api_source'] && intval(PConfig::get(local_user(),'wppost','post_by_default'))) {
+ if ($b['api_source'] && intval(get_pconfig(local_user(),'wppost','post_by_default'))) {
$wp_enable = 1;
}
@@ -195,29 +195,20 @@ function wppost_post_local(&$a, &$b) {
function wppost_send(&$a,&$b) {
- if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
+ if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited']))
return;
- }
- if(! strstr($b['postopts'],'wppost')) {
+ if(! strstr($b['postopts'],'wppost'))
return;
- }
- if($b['parent'] != $b['id']) {
+ if($b['parent'] != $b['id'])
return;
- }
- // Dont't post if the post doesn't belong to us.
- // This is a check for forum postings
- $self = dba::selectFirst('contact', ['id'], ['uid' => $b['uid'], 'self' => true]);
- if ($b['contact-id'] != $self['id']) {
- return;
- }
- $wp_username = xmlify(PConfig::get($b['uid'],'wppost','wp_username'));
- $wp_password = xmlify(PConfig::get($b['uid'],'wppost','wp_password'));
- $wp_blog = PConfig::get($b['uid'],'wppost','wp_blog');
- $wp_backlink_text = PConfig::get($b['uid'],'wppost','wp_backlink_text');
+ $wp_username = xmlify(get_pconfig($b['uid'],'wppost','wp_username'));
+ $wp_password = xmlify(get_pconfig($b['uid'],'wppost','wp_password'));
+ $wp_blog = get_pconfig($b['uid'],'wppost','wp_blog');
+ $wp_backlink_text = get_pconfig($b['uid'],'wppost','wp_backlink_text');
if ($wp_backlink_text == '') {
$wp_backlink_text = L10n::t('Read the original post and comment stream on Friendica');
}
@@ -232,7 +223,7 @@ function wppost_send(&$a,&$b) {
// Is it a link to an aricle, a video or a photo?
if (isset($siteinfo["type"])) {
- if (in_array($siteinfo["type"], ["link", "audio", "video", "photo"])) {
+ if (in_array($siteinfo["type"], array("link", "audio", "video", "photo"))) {
$postentry = true;
}
}
@@ -286,7 +277,7 @@ function wppost_send(&$a,&$b) {
$post = $title.$post;
- $wp_backlink = intval(PConfig::get($b['uid'],'wppost','backlink'));
+ $wp_backlink = intval(get_pconfig($b['uid'],'wppost','backlink'));
if($wp_backlink && $b['plink']) {
$post .= EOL . EOL . ''
. $wp_backlink_text . '' . EOL . EOL;
diff --git a/xmpp/lang/de/strings.php b/xmpp/lang/de/strings.php
deleted file mode 100644
index a8785024..00000000
--- a/xmpp/lang/de/strings.php
+++ /dev/null
@@ -1,16 +0,0 @@
-strings["XMPP settings updated."] = "XMPP Einstellungen aktualisiert.";
-$a->strings["XMPP-Chat (Jabber)"] = "XMPP-Chat (Jabber)";
-$a->strings["Enable Webchat"] = "Aktiviere Webchat";
-$a->strings["Individual Credentials"] = "Individuelle Anmeldedaten";
-$a->strings["Jabber BOSH host"] = "Jabber BOSH Host";
-$a->strings["Save Settings"] = "Speichere Einstellungen";
-$a->strings["Use central userbase"] = "Nutze zentrale Nutzerbasis";
-$a->strings["If enabled, users will automatically login to an ejabberd server that has to be installed on this machine with synchronized credentials via the \"auth_ejabberd.php\" script."] = "Wenn aktiviert, werden die Nutzer automatisch auf dem EJabber Server, der auf dieser Maschine installiert ist, angemeldet und die Zugangsdaten werden über das \"auth_ejabberd.php\"-Script synchronisiert.";
-$a->strings["Settings updated."] = "Einstellungen aktualisiert.";
diff --git a/xmpp/lang/de/messages.po b/xmpp/lang/it/messages.po
similarity index 63%
rename from xmpp/lang/de/messages.po
rename to xmpp/lang/it/messages.po
index 252beb9b..5b5a6285 100644
--- a/xmpp/lang/de/messages.po
+++ b/xmpp/lang/it/messages.po
@@ -10,17 +10,17 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-27 09:30+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: Andreas H. , 2017\n"
-"Language-Team: German (https://www.transifex.com/Friendica/teams/12172/de/)\n"
+"Last-Translator: fabrixxm , 2018\n"
+"Language-Team: Italian (https://www.transifex.com/Friendica/teams/12172/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Language: de\n"
+"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: xmpp.php:38
msgid "XMPP settings updated."
-msgstr "XMPP Einstellungen aktualisiert."
+msgstr "Impostazioni XMPP aggiornate."
#: xmpp.php:63 xmpp.php:67
msgid "XMPP-Chat (Jabber)"
@@ -28,23 +28,23 @@ msgstr "XMPP-Chat (Jabber)"
#: xmpp.php:71
msgid "Enable Webchat"
-msgstr "Aktiviere Webchat"
+msgstr "Abilita chat web"
#: xmpp.php:76
msgid "Individual Credentials"
-msgstr "Individuelle Anmeldedaten"
+msgstr "Credenziali Individuali"
#: xmpp.php:82 xmpp.php:108
msgid "Jabber BOSH host"
-msgstr "Jabber BOSH Host"
+msgstr "Server Jabber BOSH"
#: xmpp.php:91 xmpp.php:107
msgid "Save Settings"
-msgstr "Speichere Einstellungen"
+msgstr "Salva Impostazioni"
#: xmpp.php:109
msgid "Use central userbase"
-msgstr "Nutze zentrale Nutzerbasis"
+msgstr "Usa base utenti centrale"
#: xmpp.php:109
msgid ""
@@ -52,10 +52,10 @@ msgid ""
" be installed on this machine with synchronized credentials via the "
"\"auth_ejabberd.php\" script."
msgstr ""
-"Wenn aktiviert, werden die Nutzer automatisch auf dem EJabber Server, der "
-"auf dieser Maschine installiert ist, angemeldet und die Zugangsdaten werden "
-"über das \"auth_ejabberd.php\"-Script synchronisiert."
+"Se abilitato, gli utenti verranno automaticamente autenticati con un server "
+"ejabber che deve essere installato su questa macchina, con le credenziali "
+"sincronizzate attraverso lo script \"auth_ejabberd.php\""
#: xmpp.php:119
msgid "Settings updated."
-msgstr "Einstellungen aktualisiert."
+msgstr "Impostazioni aggiornate."
diff --git a/xmpp/lang/it/strings.php b/xmpp/lang/it/strings.php
new file mode 100644
index 00000000..d0bebb7e
--- /dev/null
+++ b/xmpp/lang/it/strings.php
@@ -0,0 +1,16 @@
+strings["XMPP settings updated."] = "Impostazioni XMPP aggiornate.";
+$a->strings["XMPP-Chat (Jabber)"] = "XMPP-Chat (Jabber)";
+$a->strings["Enable Webchat"] = "Abilita chat web";
+$a->strings["Individual Credentials"] = "Credenziali Individuali";
+$a->strings["Jabber BOSH host"] = "Server Jabber BOSH";
+$a->strings["Save Settings"] = "Salva Impostazioni";
+$a->strings["Use central userbase"] = "Usa base utenti centrale";
+$a->strings["If enabled, users will automatically login to an ejabberd server that has to be installed on this machine with synchronized credentials via the \"auth_ejabberd.php\" script."] = "Se abilitato, gli utenti verranno automaticamente autenticati con un server ejabber che deve essere installato su questa macchina, con le credenziali sincronizzate attraverso lo script \"auth_ejabberd.php\"";
+$a->strings["Settings updated."] = "Impostazioni aggiornate.";
diff --git a/xmpp/lang/C/messages.po b/xmpp/lang/nl/messages.po
similarity index 55%
rename from xmpp/lang/C/messages.po
rename to xmpp/lang/nl/messages.po
index a37749d0..dabd4496 100644
--- a/xmpp/lang/C/messages.po
+++ b/xmpp/lang/nl/messages.po
@@ -1,8 +1,8 @@
# ADDON xmpp
-# Copyright (C)
+# Copyright (C)
# This file is distributed under the same license as the Friendica xmpp addon package.
#
-#
+#
#, fuzzy
msgid ""
msgstr ""
@@ -10,24 +10,25 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-27 09:30+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: LANGUAGE \n"
-"Language: \n"
+"Last-Translator: Karel Vandecandelaere , 2018\n"
+"Language-Team: Dutch (https://www.transifex.com/Friendica/teams/12172/nl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"Language: nl\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: xmpp.php:38
msgid "XMPP settings updated."
-msgstr ""
+msgstr "XMPP-instellingen bijgewerkt."
#: xmpp.php:63 xmpp.php:67
msgid "XMPP-Chat (Jabber)"
-msgstr ""
+msgstr "XMPP-chat (Jabber)"
#: xmpp.php:71
msgid "Enable Webchat"
-msgstr ""
+msgstr "Webchat inschakelen"
#: xmpp.php:76
msgid "Individual Credentials"
@@ -35,11 +36,11 @@ msgstr ""
#: xmpp.php:82 xmpp.php:108
msgid "Jabber BOSH host"
-msgstr ""
+msgstr "Jabber BOSH Server"
#: xmpp.php:91 xmpp.php:107
msgid "Save Settings"
-msgstr ""
+msgstr "Instellingen opslaan"
#: xmpp.php:109
msgid "Use central userbase"
@@ -47,11 +48,14 @@ msgstr ""
#: xmpp.php:109
msgid ""
-"If enabled, users will automatically login to an ejabberd server that has to "
-"be installed on this machine with synchronized credentials via the "
+"If enabled, users will automatically login to an ejabberd server that has to"
+" be installed on this machine with synchronized credentials via the "
"\"auth_ejabberd.php\" script."
msgstr ""
+"Wanneer ingeschakeld zullen gebruikers automatisch inloggen op een ejabberd-"
+"server die op deze server moet geïnstalleerd staan, met dezelfde "
+"gebruikersnaam en wachtwoord, via het \"auth_ejabberd.php\" script."
#: xmpp.php:119
msgid "Settings updated."
-msgstr ""
+msgstr "Instellingen bijgewerkt."
diff --git a/xmpp/lang/nl/strings.php b/xmpp/lang/nl/strings.php
new file mode 100644
index 00000000..aba58673
--- /dev/null
+++ b/xmpp/lang/nl/strings.php
@@ -0,0 +1,16 @@
+strings["XMPP settings updated."] = "XMPP-instellingen bijgewerkt.";
+$a->strings["XMPP-Chat (Jabber)"] = "XMPP-chat (Jabber)";
+$a->strings["Enable Webchat"] = "Webchat inschakelen";
+$a->strings["Individual Credentials"] = "";
+$a->strings["Jabber BOSH host"] = "Jabber BOSH Server";
+$a->strings["Save Settings"] = "Instellingen opslaan";
+$a->strings["Use central userbase"] = "";
+$a->strings["If enabled, users will automatically login to an ejabberd server that has to be installed on this machine with synchronized credentials via the \"auth_ejabberd.php\" script."] = "Wanneer ingeschakeld zullen gebruikers automatisch inloggen op een ejabberd-server die op deze server moet geïnstalleerd staan, met dezelfde gebruikersnaam en wachtwoord, via het \"auth_ejabberd.php\" script.";
+$a->strings["Settings updated."] = "Instellingen bijgewerkt.";
diff --git a/xmpp/xmpp.php b/xmpp/xmpp.php
index bd5adb57..422c6277 100644
--- a/xmpp/xmpp.php
+++ b/xmpp/xmpp.php
@@ -31,10 +31,9 @@ function xmpp_addon_settings_post()
{
if (!local_user() || (!x($_POST, 'xmpp-settings-submit'))) {
return;
- }
- PConfig::set(local_user(), 'xmpp', 'enabled', intval($_POST['xmpp_enabled']));
- PConfig::set(local_user(), 'xmpp', 'individual', intval($_POST['xmpp_individual']));
- PConfig::set(local_user(), 'xmpp', 'bosh_proxy', $_POST['xmpp_bosh_proxy']);
+ set_pconfig(local_user(),'xmpp','enabled',intval($_POST['xmpp_enabled']));
+ set_pconfig(local_user(),'xmpp','individual',intval($_POST['xmpp_individual']));
+ set_pconfig(local_user(),'xmpp','bosh_proxy',$_POST['xmpp_bosh_proxy']);
info(L10n::t('XMPP settings updated.') . EOL);
}
@@ -43,7 +42,6 @@ function xmpp_addon_settings(App $a, &$s)
{
if (!local_user()) {
return;
- }
/* Add our stylesheet to the xmpp so we can make our settings look nice */
@@ -51,13 +49,13 @@ function xmpp_addon_settings(App $a, &$s)
/* Get the current state of our config variable */
- $enabled = intval(PConfig::get(local_user(), 'xmpp', 'enabled'));
+ $enabled = intval(get_pconfig(local_user(),'xmpp','enabled'));
$enabled_checked = (($enabled) ? ' checked="checked" ' : '');
- $individual = intval(PConfig::get(local_user(), 'xmpp', 'individual'));
+ $individual = intval(get_pconfig(local_user(),'xmpp','individual'));
$individual_checked = (($individual) ? ' checked="checked" ' : '');
- $bosh_proxy = PConfig::get(local_user(), "xmpp", "bosh_proxy");
+ $bosh_proxy = get_pconfig(local_user(),"xmpp","bosh_proxy");
/* Add some HTML to the existing form */
$s .= '';
@@ -92,11 +90,10 @@ function xmpp_addon_settings(App $a, &$s)
$s .= '';
}
-function xmpp_login()
-{
+function xmpp_login($a,$b) {
if (!$_SESSION["allow_api"]) {
- $password = random_string(16);
- PConfig::set(local_user(), "xmpp", "password", $password);
+ $password = substr(random_string(),0,16);
+ set_pconfig(local_user(), "xmpp", "password", $password);
}
}
@@ -120,47 +117,40 @@ function xmpp_addon_admin_post()
info(L10n::t('Settings updated.') . EOL);
}
-function xmpp_script(App $a)
-{
- xmpp_converse($a);
+function xmpp_script(&$a,&$s) {
+ xmpp_converse($a,$s);
}
-function xmpp_converse(App $a)
-{
- if (!local_user()) {
+function xmpp_converse(&$a,&$s) {
+ if (!local_user())
return;
- }
- if ($_GET["mode"] == "minimal") {
+ if ($_GET["mode"] == "minimal")
return;
- }
- if ($a->is_mobile || $a->is_tablet) {
+ if ($a->is_mobile || $a->is_tablet)
return;
- }
- if (!PConfig::get(local_user(), "xmpp", "enabled")) {
+ if (!get_pconfig(local_user(),"xmpp","enabled"))
return;
- }
- if (in_array($a->query_string, ["admin/federation/"])) {
+ if (in_array($a->query_string, array("admin/federation/")))
return;
- }
- $a->page['htmlhead'] .= '' . "\n";
- $a->page['htmlhead'] .= '' . "\n";
+ $a->page['htmlhead'] .= ''."\n";
+ $a->page['htmlhead'] .= ''."\n";
- if (Config::get("xmpp", "central_userbase") && !PConfig::get(local_user(), "xmpp", "individual")) {
- $bosh_proxy = Config::get("xmpp", "bosh_proxy");
+ if (get_config("xmpp", "central_userbase") && !get_pconfig(local_user(),"xmpp","individual")) {
+ $bosh_proxy = get_config("xmpp", "bosh_proxy");
- $password = PConfig::get(local_user(), "xmpp", "password", '', true);
+ $password = get_pconfig(local_user(), "xmpp", "password");
if ($password == "") {
- $password = random_string(16);
- PConfig::set(local_user(), "xmpp", "password", $password);
+ $password = substr(random_string(),0,16);
+ set_pconfig(local_user(), "xmpp", "password", $password);
}
- $jid = $a->user["nickname"] . "@" . $a->get_hostname() . "/converse-" . random_string(5);
+ $jid = $a->user["nickname"]."@".$a->get_hostname()."/converse-".substr(random_string(),0,5);;
$auto_login = "auto_login: true,
authentication: 'login',
@@ -168,20 +158,18 @@ function xmpp_converse(App $a)
password: '$password',
allow_logout: false,";
} else {
- $bosh_proxy = PConfig::get(local_user(), "xmpp", "bosh_proxy");
+ $bosh_proxy = get_pconfig(local_user(), "xmpp", "bosh_proxy");
$auto_login = "";
}
- if ($bosh_proxy == "") {
+ if ($bosh_proxy == "")
return;
- }
- if (in_array($a->argv[0], ["manage", "logout"])) {
+ if (in_array($a->argv[0], array("manage", "logout")))
$additional_commands = "converse.user.logout();\n";
- } else {
+ else
$additional_commands = "";
- }
$on_ready = "";
@@ -218,3 +206,4 @@ function xmpp_converse(App $a)
});
";
}
+?>
diff --git a/yourls/lang/it/messages.po b/yourls/lang/it/messages.po
index d11f2797..033ffd04 100644
--- a/yourls/lang/it/messages.po
+++ b/yourls/lang/it/messages.po
@@ -10,7 +10,7 @@ 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-08-31 10:30+0000\n"
+"PO-Revision-Date: 2017-09-20 06:09+0000\n"
"Last-Translator: fabrixxm \n"
"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n"
"MIME-Version: 1.0\n"
diff --git a/yourls/lang/nl/messages.po b/yourls/lang/nl/messages.po
new file mode 100644
index 00000000..ab06d2d1
--- /dev/null
+++ b/yourls/lang/nl/messages.po
@@ -0,0 +1,48 @@
+# ADDON yourls
+# Copyright (C)
+# This file is distributed under the same license as the Friendica yourls addon package.
+#
+#
+# Translators:
+# Karel Vandecandelaere , 2018
+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: 2018-03-20 13:29+0000\n"
+"Last-Translator: Karel Vandecandelaere \n"
+"Language-Team: Dutch (http://www.transifex.com/Friendica/friendica/language/nl/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: nl\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: yourls.php:55
+msgid "YourLS Settings"
+msgstr "YourLS-instellingen"
+
+#: yourls.php:57
+msgid "URL: http://"
+msgstr "URL: http://"
+
+#: yourls.php:62
+msgid "Username:"
+msgstr "Gebruikersnaam:"
+
+#: yourls.php:67
+msgid "Password:"
+msgstr "Wachtwoord:"
+
+#: yourls.php:72
+msgid "Use SSL "
+msgstr "Gebruik SSL"
+
+#: yourls.php:76
+msgid "Submit"
+msgstr "Toepassen"
+
+#: yourls.php:92
+msgid "yourls Settings saved."
+msgstr "YourLS-instellingen bijgewerkt."
diff --git a/yourls/lang/nl/strings.php b/yourls/lang/nl/strings.php
new file mode 100644
index 00000000..e894de4a
--- /dev/null
+++ b/yourls/lang/nl/strings.php
@@ -0,0 +1,14 @@
+strings["YourLS Settings"] = "YourLS-instellingen";
+$a->strings["URL: http://"] = "URL: http://";
+$a->strings["Username:"] = "Gebruikersnaam:";
+$a->strings["Password:"] = "Wachtwoord:";
+$a->strings["Use SSL "] = "Gebruik SSL";
+$a->strings["Submit"] = "Toepassen";
+$a->strings["yourls Settings saved."] = "YourLS-instellingen bijgewerkt.";
diff --git a/yourls/yourls.css b/yourls/yourls.css
index 53743650..cfd09c97 100644
--- a/yourls/yourls.css
+++ b/yourls/yourls.css
@@ -15,7 +15,7 @@ yourls-url {
.yourls {
text-align: left;
- width: 100%;
+ width 100%;
margin-top: 25px;
font-size: 20px;
}
diff --git a/yourls/yourls.php b/yourls/yourls.php
index c5cd12ac..10155b95 100644
--- a/yourls/yourls.php
+++ b/yourls/yourls.php
@@ -42,15 +42,15 @@ function yourls_addon_settings(&$a,&$s) {
$a->page['htmlhead'] .= '' . "\r\n";
- $yourls_url = Config::get('yourls','url1');
- $yourls_username = Config::get('yourls','username1');
- $yourls_password = Config::get('yourls', 'password1');
- $ssl_enabled = Config::get('yourls','ssl1');
+ $yourls_url = get_config('yourls','url1');
+ $yourls_username = get_config('yourls','username1');
+ $yourls_password = get_config('yourls', 'password1');
+ $ssl_enabled = get_config('yourls','ssl1');
$ssl_checked = (($ssl_enabled) ? ' checked="checked" ' : '');
- $yourls_ssl = Config::get('yourls', 'ssl1');
+ $yourls_ssl = get_config('yourls', 'ssl1');
$s .= '';
$s .= '