]> git.mxchange.org Git - friendica.git/blobdiff - include/conversation.php
Merge remote-tracking branch 'upstream/develop' into 1701-index-again
[friendica.git] / include / conversation.php
index 08350ac89aa03da84422d76f6c5e31c6aa0c9439..571e2facedfb1a89b0a803bf7bb4ff9b08e0552e 100644 (file)
@@ -78,7 +78,7 @@ function item_redir_and_replace_images($body, $images, $cid) {
        $newbody .= $origbody;
 
        $cnt = 0;
-       foreach($images as $image) {
+       foreach ($images as $image) {
                // We're depending on the property of 'foreach' (specified on the PHP website) that
                // it loops over the array starting from the first element and going sequentially
                // to the last element
@@ -109,7 +109,7 @@ function localize_item(&$item){
                $r = q("SELECT * from `item`,`contact` WHERE
                                `item`.`contact-id`=`contact`.`id` AND `item`.`uri`='%s';",
                                 dbesc($item['parent-uri']));
-               if(!dbm::is_result($r)) return;
+               if (!dbm::is_result($r)) return;
                $obj=$r[0];
 
                $author  = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
@@ -245,7 +245,7 @@ function localize_item(&$item){
                $r = q("SELECT * from `item`,`contact` WHERE
                `item`.`contact-id`=`contact`.`id` AND `item`.`uri`='%s';",
                 dbesc($item['parent-uri']));
-               if(!dbm::is_result($r)) return;
+               if (!dbm::is_result($r)) return;
                $obj=$r[0];
 
                $author  = '[url=' . zrl($item['author-link']) . ']' . $item['author-name'] . '[/url]';
@@ -294,7 +294,7 @@ function localize_item(&$item){
                                        dbesc($obj->id),
                                        intval($item['uid'])
                        );
-                       if(dbm::is_result($r) && $r[0]['plink']) {
+                       if (dbm::is_result($r) && $r[0]['plink']) {
                                $target = $r[0];
                                $Bname = $target['author-name'];
                                $Blink = $target['author-link'];
@@ -324,11 +324,13 @@ function localize_item(&$item){
        // add sparkle links to appropriate permalinks
 
        $x = stristr($item['plink'],'/display/');
-       if($x) {
+       if ($x) {
                $sparkle = false;
                $y = best_link_url($item,$sparkle,true);
-               if(strstr($y,'/redir/'))
+
+               if (strstr($y,'/redir/')) {
                        $item['plink'] = $y . '?f=&url=' . $item['plink'];
+               }
        }
 
 
@@ -464,7 +466,7 @@ function item_condition() {
  */
 
 if(!function_exists('conversation')) {
-function conversation(&$a, $items, $mode, $update, $preview = false) {
+function conversation(App $a, $items, $mode, $update, $preview = false) {
 
        require_once('include/bbcode.php');
        require_once('include/Contact.php');
@@ -864,7 +866,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
        }
 
        $o = replace_macros($page_template, array(
-               '$baseurl' => $a->get_baseurl($ssl_state),
+               '$baseurl' => App::get_baseurl($ssl_state),
                '$return_path' => $a->query_string,
                '$live_update' => $live_update_div,
                '$remove' => t('remove'),
@@ -1183,7 +1185,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
        $tpl = get_markup_template('jot-header.tpl');
        $a->page['htmlhead'] .= replace_macros($tpl, array(
                '$newpost' => 'true',
-               '$baseurl' => $a->get_baseurl(true),
+               '$baseurl' => App::get_baseurl(true),
                '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
                '$geotag' => $geotag,
                '$nickname' => $x['nickname'],
@@ -1201,7 +1203,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
        $tpl = get_markup_template('jot-end.tpl');
        $a->page['end'] .= replace_macros($tpl, array(
                '$newpost' => 'true',
-               '$baseurl' => $a->get_baseurl(true),
+               '$baseurl' => App::get_baseurl(true),
                '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
                '$geotag' => $geotag,
                '$nickname' => $x['nickname'],
@@ -1267,7 +1269,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
                '$ptyp' => (($notes_cid) ? 'note' : 'wall'),
                '$content' => $x['content'],
                '$post_id' => $x['post_id'],
-               '$baseurl' => $a->get_baseurl(true),
+               '$baseurl' => App::get_baseurl(true),
                '$defloc' => $x['default_location'],
                '$visitor' => $x['visitor'],
                '$pvisit' => (($notes_cid) ? 'none' : $x['visitor']),