]> git.mxchange.org Git - friendica.git/blobdiff - include/conversation.php
Degrade priority step by step
[friendica.git] / include / conversation.php
index a737c98c5f153ef715a28e27a63a9ecb024dd2f2..e58df19f16cc03908d0c71174fc569750b4530ff 100644 (file)
@@ -1,9 +1,10 @@
 <?php
 
+use Friendica\App;
+
 require_once "include/bbcode.php";
 require_once "include/acl_selectors.php";
 
-
 /*
  * Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
  * is identical to the code in mod/message.php for 'item_extract_images' and
@@ -392,7 +393,7 @@ function visible_activity($item) {
         */
        $hidden_activities = array(ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE);
        foreach ($hidden_activities as $act) {
-               if (activity_match($item['verb'],$act)) {
+               if (activity_match($item['verb'], $act)) {
                        return false;
                }
        }
@@ -410,8 +411,8 @@ function visible_activity($item) {
  * @brief SQL query for items
  */
 function item_query() {
-       return "SELECT ".item_fieldlists()." FROM `item` ".
-               item_joins()." WHERE ".item_condition();
+       return "SELECT " . item_fieldlists() . " FROM `item` " .
+               item_joins() . " WHERE " . item_condition();
 }
 
 /**
@@ -711,7 +712,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
                                        $profile_link = zrl($profile_link);
                                }
 
-                               if (!x($item, 'author-thumb') OR ($item['author-thumb'] == "")) {
+                               if (!x($item, 'author-thumb') || ($item['author-thumb'] == "")) {
                                        $author_contact = get_contact_details_by_url($item['author-link'], $profile_owner);
                                        if ($author_contact["thumb"]) {
                                                $item['author-thumb'] = $author_contact["thumb"];
@@ -720,7 +721,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
                                        }
                                }
 
-                               if (!isset($item['owner-thumb']) OR ($item['owner-thumb'] == "")) {
+                               if (!isset($item['owner-thumb']) || ($item['owner-thumb'] == "")) {
                                        $owner_contact = get_contact_details_by_url($item['owner-link'], $profile_owner);
                                        if ($owner_contact["thumb"]) {
                                                $item['owner-thumb'] = $owner_contact["thumb"];
@@ -1012,7 +1013,7 @@ function item_photo_menu($item) {
                        $menu[t("Poke")] = $poke_link;
                }
 
-               if ((($cid == 0) OR ($rel == CONTACT_IS_FOLLOWER)) AND
+               if ((($cid == 0) || ($rel == CONTACT_IS_FOLLOWER)) &&
                        in_array($item['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA))) {
                        $menu[t('Connect/Follow')] = 'follow?url=' . urlencode($item['author-link']);
                }
@@ -1209,7 +1210,7 @@ function format_like($cnt, array $arr, $type, $id) {
        return $o;
 }}
 
-function status_editor($a,$x, $notes_cid = 0, $popup = false) {
+function status_editor(App $a, $x, $notes_cid = 0, $popup = false) {
        $o = '';
 
        $geotag = (x($x, 'allow_location') ? replace_macros(get_markup_template('jot_geotag.tpl'), array()) : '');
@@ -1250,7 +1251,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup = false) {
 
        // Private/public post links for the non-JS ACL form
        $private_post = 1;
-       if ($_REQUEST['public']) {
+       if (x($_REQUEST, 'public')) {
                $private_post = 0;
        }
 
@@ -1415,14 +1416,14 @@ function conv_sort($arr, $order) {
                }
        }
 
-       if (stristr($order,'created')) {
-               usort($parents,'sort_thr_created');
-       } elseif (stristr($order,'commented')) {
-               usort($parents,'sort_thr_commented');
+       if (stristr($order, 'created')) {
+               usort($parents, 'sort_thr_created');
+       } elseif (stristr($order, 'commented')) {
+               usort($parents, 'sort_thr_commented');
        }
 
        if (count($parents)) {
-               foreach ($parents as $i=>$_x) {
+               foreach ($parents as $i => $_x) {
                        $parents[$i]['children'] = get_item_children($arr, $_x);
                }
        }
@@ -1532,19 +1533,19 @@ function get_responses($conv_responses, $response_verbs, $ob, $item) {
 function get_response_button_text($v, $count) {
        switch ($v) {
                case 'like':
-                       return tt('Like','Likes', $count,'noun');
+                       return tt('Like', 'Likes', $count, 'noun');
                        break;
                case 'dislike':
-                       return tt('Dislike','Dislikes', $count,'noun');
+                       return tt('Dislike', 'Dislikes', $count, 'noun');
                        break;
                case 'attendyes':
-                       return tt('Attending','Attending', $count,'noun');
+                       return tt('Attending', 'Attending', $count, 'noun');
                        break;
                case 'attendno':
-                       return tt('Not Attending','Not Attending', $count,'noun');
+                       return tt('Not Attending', 'Not Attending', $count, 'noun');
                        break;
                case 'attendmaybe':
-                       return tt('Undecided','Undecided', $count,'noun');
+                       return tt('Undecided', 'Undecided', $count, 'noun');
                        break;
        }
 }