First way: Register an application at https://account.app.net/developer/apps/ and enter Client ID and Client Secret. ');
@@ -245,7 +245,7 @@ function appnet_settings(&$a,&$s) {
$s .= ''.t("Sign in using App.net").'';
}
- if (($app_clientId != '') OR ($app_clientSecret != '') OR ($token !='')) {
+ if (($app_clientId != '') || ($app_clientSecret != '') || ($token !='')) {
$s .= '
';
$s .= '';
@@ -278,7 +278,7 @@ function appnet_settings_post(&$a,&$b) {
if (isset($_POST["clientid"]))
set_pconfig(local_user(),'appnet','clientid', $_POST['clientid']);
- if (isset($_POST["token"]) AND ($_POST["token"] != ""))
+ if (isset($_POST["token"]) && ($_POST["token"] != ""))
set_pconfig(local_user(),'appnet','token', $_POST['token']);
set_pconfig(local_user(), 'appnet', 'post', intval($_POST['appnet']));
@@ -375,12 +375,12 @@ function appnet_create_entities($a, $b, $postdata) {
$start = $pos + 1;
}
- if (isset($postdata["url"]) AND isset($postdata["title"]) AND ($postdata["type"] != "photo")) {
+ if (isset($postdata["url"]) && isset($postdata["title"]) && ($postdata["type"] != "photo")) {
$postdata["title"] = shortenmsg($postdata["title"], 90);
$max = 256 - strlen($postdata["title"]);
$text = shortenmsg($text, $max);
$text .= "\n[".$postdata["title"]."](".$postdata["url"].")";
- } elseif (isset($postdata["url"]) AND ($postdata["type"] != "photo")) {
+ } elseif (isset($postdata["url"]) && ($postdata["type"] != "photo")) {
$postdata["url"] = short_link($postdata["url"]);
$max = 240;
$text = shortenmsg($text, $max);
@@ -421,7 +421,7 @@ function appnet_send(&$a,&$b) {
logger("appnet_send: parameter ".print_r($b, true), LOGGER_DATA);
// Looking if its a reply to an app.net post
- if ((substr($b["parent-uri"], 0, 5) != "adn::") AND (substr($b["extid"], 0, 5) != "adn::") AND (substr($b["thr-parent"], 0, 5) != "adn::")) {
+ if ((substr($b["parent-uri"], 0, 5) != "adn::") && (substr($b["extid"], 0, 5) != "adn::") && (substr($b["thr-parent"], 0, 5) != "adn::")) {
logger("appnet_send: no app.net post ".$b["parent"]);
return;
}
@@ -443,18 +443,18 @@ function appnet_send(&$a,&$b) {
$nicknameplain = "@".$nicknameplain;
logger("appnet_send: comparing ".$nickname." and ".$nicknameplain." with ".$b["body"], LOGGER_DEBUG);
- if ((strpos($b["body"], $nickname) === false) AND (strpos($b["body"], $nicknameplain) === false))
+ if ((strpos($b["body"], $nickname) === false) && (strpos($b["body"], $nicknameplain) === false))
$b["body"] = $nickname." ".$b["body"];
logger("appnet_send: parent found ".print_r($orig_post, true), LOGGER_DATA);
} else {
$iscomment = false;
- if($b['private'] OR !strstr($b['postopts'],'appnet'))
+ if($b['private'] || !strstr($b['postopts'],'appnet'))
return;
}
- if (($b['verb'] == ACTIVITY_POST) AND $b['deleted'])
+ if (($b['verb'] == ACTIVITY_POST) && $b['deleted'])
appnet_action($a, $b["uid"], substr($orig_post["uri"], 5), "delete");
if($b['verb'] == ACTIVITY_LIKE) {
@@ -542,7 +542,7 @@ function appnet_send(&$a,&$b) {
"value" => $attached_data
);
- if (isset($post["url"]) AND !isset($post["title"]) AND ($post["type"] != "photo")) {
+ if (isset($post["url"]) && !isset($post["title"]) && ($post["type"] != "photo")) {
$display_url = str_replace(array("http://www.", "https://www."), array("", ""), $post["url"]);
$display_url = str_replace(array("http://", "https://"), array("", ""), $display_url);
@@ -725,7 +725,7 @@ function appnet_fetchstream($a, $uid) {
$lastid = $post["id"];
- if (($item != 0) AND ($postarray['contact-id'] != $me["id"]) AND !function_exists("check_item_notification")) {
+ if (($item != 0) && ($postarray['contact-id'] != $me["id"]) && !function_exists("check_item_notification")) {
$r = q("SELECT `thread`.`iid` AS `parent` FROM `thread`
INNER JOIN `item` ON `thread`.`iid` = `item`.`parent` AND `thread`.`uid` = `item`.`uid`
WHERE `item`.`id` = %d AND `thread`.`mention` LIMIT 1", dbesc($item));
@@ -788,7 +788,7 @@ function appnet_fetchstream($a, $uid) {
$parent_id = 0;
logger('appnet_fetchstream: User '.$uid.' posted mention item '.$item);
- if ($item AND function_exists("check_item_notification"))
+ if ($item && function_exists("check_item_notification"))
check_item_notification($item, $uid, NOTIFY_TAGSELF);
} else {
@@ -797,7 +797,7 @@ function appnet_fetchstream($a, $uid) {
}
// Fetch the parent and id
- if (($parent_id == 0) AND ($postarray['uri'] != "")) {
+ if (($parent_id == 0) && ($postarray['uri'] != "")) {
$r = q("SELECT `id`, `parent` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($postarray['uri']),
intval($uid)
@@ -811,8 +811,8 @@ function appnet_fetchstream($a, $uid) {
$lastid = $post["id"];
- //if (($item != 0) AND ($postarray['contact-id'] != $me["id"])) {
- if (($item != 0) AND !function_exists("check_item_notification")) {
+ //if (($item != 0) && ($postarray['contact-id'] != $me["id"])) {
+ if (($item != 0) && !function_exists("check_item_notification")) {
require_once('include/enotify.php');
notification(array(
'type' => NOTIFY_TAGSELF,
@@ -886,7 +886,7 @@ function appnet_createpost($a, $uid, $post, $me, $user, $ownid, $createuser, $th
return($r[0]);
}
- if (isset($post["reply_to"]) AND ($post["reply_to"] != "")) {
+ if (isset($post["reply_to"]) && ($post["reply_to"] != "")) {
$postarray['thr-parent'] = "adn::".$post["reply_to"];
// Complete the thread (if the parent doesn't exists)
@@ -937,7 +937,7 @@ function appnet_createpost($a, $uid, $post, $me, $user, $ownid, $createuser, $th
$postarray['object-type'] = ACTIVITY_OBJ_NOTE;
}
- if (($post["user"]["id"] != $ownid) OR ($postarray['thr-parent'] == $postarray['uri'])) {
+ if (($post["user"]["id"] != $ownid) || ($postarray['thr-parent'] == $postarray['uri'])) {
$postarray['owner-name'] = $post["user"]["name"];
$postarray['owner-link'] = $post["user"]["canonical_url"];
$postarray['owner-avatar'] = $post["user"]["avatar_image"]["url"];
@@ -1015,7 +1015,7 @@ function appnet_createpost($a, $uid, $post, $me, $user, $ownid, $createuser, $th
if (is_array($content["annotations"])) {
$photo = appnet_expand_annotations($a, $content["annotations"]);
- if (($photo["large"] != "") AND ($photo["url"] != ""))
+ if (($photo["large"] != "") && ($photo["url"] != ""))
$page_info = "\n[url=".$photo["url"]."][img]".$photo["large"]."[/img][/url]";
elseif ($photo["url"] != "")
$page_info = "\n[img]".$photo["url"]."[/img]";
@@ -1034,7 +1034,7 @@ function appnet_createpost($a, $uid, $post, $me, $user, $ownid, $createuser, $th
if (trim($page_info) != "") {
$removedlink = preg_replace("/\[url\=".$url."\](.*?)\[\/url\]/ism", '', $postarray['body']);
- if (($removedlink == "") OR strstr($postarray['body'], $removedlink))
+ if (($removedlink == "") || strstr($postarray['body'], $removedlink))
$postarray['body'] = $removedlink;
}
}
@@ -1075,7 +1075,7 @@ function appnet_expand_entities($a, $body, $entities) {
foreach ($entities["links"] AS $links) {
$url = "[url=".$links["url"]."]".$links["text"]."[/url]";
- if (isset($links["amended_len"]) AND ($links["amended_len"] > $links["len"]))
+ if (isset($links["amended_len"]) && ($links["amended_len"] > $links["len"]))
$replace[$links["pos"]] = array("pos"=> $links["pos"], "len"=> $links["amended_len"], "replace"=> $url);
else
$replace[$links["pos"]] = array("pos"=> $links["pos"], "len"=> $links["len"], "replace"=> $url);
@@ -1100,7 +1100,7 @@ function appnet_expand_entities($a, $body, $entities) {
function appnet_expand_annotations($a, $annotations) {
$photo = array("url" => "", "large" => "");
foreach ($annotations AS $annotation) {
- if (($annotation[type] == "net.app.core.oembed") AND
+ if (($annotation[type] == "net.app.core.oembed") &&
($annotation["value"]["type"] == "photo")) {
if ($annotation["value"]["url"] != "")
$photo["url"] = $annotation["value"]["url"];
@@ -1108,7 +1108,7 @@ function appnet_expand_annotations($a, $annotations) {
if ($annotation["value"]["thumbnail_large_url"] != "")
$photo["large"] = $annotation["value"]["thumbnail_large_url"];
- //if (($annotation["value"]["thumbnail_large_url"] != "") AND ($annotation["value"]["url"] != ""))
+ //if (($annotation["value"]["thumbnail_large_url"] != "") && ($annotation["value"]["url"] != ""))
// $embedded = "\n[url=".$annotation["value"]["url"]."][img]".$annotation["value"]["thumbnail_large_url"]."[/img][/url]";
//elseif ($annotation["value"]["url"] != "")
// $embedded = "\n[img]".$annotation["value"]["url"]."[/img]";
@@ -1128,13 +1128,13 @@ function appnet_fetchcontact($a, $uid, $contact, $me, $create_user) {
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `alias` = '%s' LIMIT 1",
intval($uid), dbesc("adn::".$contact["id"]));
- if(!count($r) AND !$create_user)
+ if(!count($r) && !$create_user)
return($me["id"]);
if ($contact["canonical_url"] == "")
return($me["id"]);
- if (count($r) AND ($r[0]["readonly"] OR $r[0]["blocked"])) {
+ if (count($r) && ($r[0]["readonly"] || $r[0]["blocked"])) {
logger("appnet_fetchcontact: Contact '".$r[0]["nick"]."' is blocked or readonly.", LOGGER_DEBUG);
return(-1);
}
@@ -1278,7 +1278,7 @@ function appnet_prepare_body(&$a,&$b) {
$nickname = "@[url=".$orig_post["author-link"]."]".$nicknameplain."[/url]";
$nicknameplain = "@".$nicknameplain;
- if ((strpos($item["body"], $nickname) === false) AND (strpos($item["body"], $nicknameplain) === false))
+ if ((strpos($item["body"], $nickname) === false) && (strpos($item["body"], $nicknameplain) === false))
$item["body"] = $nickname." ".$item["body"];
}
diff --git a/buffer/buffer.php b/buffer/buffer.php
index 89000c1f..0b92144b 100644
--- a/buffer/buffer.php
+++ b/buffer/buffer.php
@@ -339,14 +339,14 @@ function buffer_send(&$a,&$b) {
// Seems like a bug to me
// Buffer doesn't add links to Twitter and App.net (but pictures)
- //if ($includedlinks AND isset($post["url"]))
- if (($profile->service == "twitter") AND isset($post["url"]) AND ($post["type"] != "photo"))
+ //if ($includedlinks && isset($post["url"]))
+ if (($profile->service == "twitter") && isset($post["url"]) && ($post["type"] != "photo"))
$post["text"] .= " ".$post["url"];
- elseif (($profile->service == "appdotnet") AND isset($post["url"]) AND isset($post["title"]) AND ($post["type"] != "photo")) {
+ elseif (($profile->service == "appdotnet") && isset($post["url"]) && isset($post["title"]) && ($post["type"] != "photo")) {
$post["title"] = shortenmsg($post["title"], 90);
$post["text"] = shortenmsg($post["text"], $limit - (24 + strlen($post["title"])));
$post["text"] .= "\n[".$post["title"]."](".$post["url"].")";
- } elseif (($profile->service == "appdotnet") AND isset($post["url"]) AND ($post["type"] != "photo"))
+ } elseif (($profile->service == "appdotnet") && isset($post["url"]) && ($post["type"] != "photo"))
$post["text"] .= " ".$post["url"];
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
@@ -363,7 +363,7 @@ function buffer_send(&$a,&$b) {
if (isset($post["description"]))
$message["media[description]"] = $post["description"];
- if (isset($post["url"]) AND ($post["type"] != "photo"))
+ if (isset($post["url"]) && ($post["type"] != "photo"))
$message["media[link]"] = $post["url"];
if (isset($post["image"])) {
diff --git a/buffer/bufferapp.php b/buffer/bufferapp.php
index 31250336..7215175d 100644
--- a/buffer/bufferapp.php
+++ b/buffer/bufferapp.php
@@ -85,7 +85,7 @@
if ($callback_url) $this->set_callback_url($callback_url);
if ($access_token) $this->access_token = $access_token;
- if (isset($_GET['code']) AND $_GET['code']) {
+ if (isset($_GET['code']) && $_GET['code']) {
$this->code = $_GET['code'];
$this->create_access_token_url();
}
diff --git a/diaspora/diaspora.php b/diaspora/diaspora.php
index aed80b88..09d8f114 100755
--- a/diaspora/diaspora.php
+++ b/diaspora/diaspora.php
@@ -142,7 +142,7 @@ function diaspora_settings(&$a,&$s) {
$aspects = false;
- if ($handle AND $password) {
+ if ($handle && $password) {
$conn = new Diaspora_Connection($handle, $password);
$conn->logIn();
$aspects = $conn->getAspects();
diff --git a/facebook/facebook.php b/facebook/facebook.php
index 66f52af3..f2e965c4 100644
--- a/facebook/facebook.php
+++ b/facebook/facebook.php
@@ -13,15 +13,15 @@
* Detailed instructions how to use this plugin can be found at
* https://github.com/friendica/friendica/wiki/How-to:-Friendica%E2%80%99s-Facebook-connector
*
- * Vidoes and embeds will not be posted if there is no other content. Links
- * and images will be converted to a format suitable for the Facebook API and
- * long posts truncated - with a link to view the full post.
+ * Vidoes and embeds will not be posted if there is no other content. Links
+ * and images will be converted to a format suitable for the Facebook API and
+ * long posts truncated - with a link to view the full post.
*
* Facebook contacts will not be able to view private photos, as they are not able to
- * authenticate to your site to establish identity. We will address this
+ * authenticate to your site to establish identity. We will address this
* in a future release.
*/
-
+
/** TODO
* - Implement a method for the administrator to delete all configuration data the plugin has created,
* e.g. the app_access_token
@@ -260,7 +260,7 @@ function fb_get_friends_sync_parsecontact($uid, $contact) {
$contact->link = 'http://facebook.com/profile.php?id=' . $contact->id;
// If its a page then set the first name from the username
- if (!$contact->first_name and $contact->username)
+ if (!$contact->first_name && $contact->username)
$contact->first_name = $contact->username;
// check if we already have a contact
@@ -495,9 +495,9 @@ function facebook_post(&$a) {
}
info( t('Settings updated.') . EOL);
- }
+ }
- return;
+ return;
}
// Facebook settings form
@@ -534,7 +534,7 @@ function facebook_content(&$a) {
$fb_limited = get_config('facebook','restrict');
$o = '';
-
+
$fb_installed = false;
if (get_pconfig(local_user(),'facebook','post')) {
$access_token = get_pconfig(local_user(),'facebook','access_token');
@@ -546,7 +546,7 @@ function facebook_content(&$a) {
}
}
}
-
+
$appid = get_config('facebook','appid');
if(! $appid) {
@@ -559,10 +559,10 @@ function facebook_content(&$a) {
$o .= '