]> git.mxchange.org Git - friendica.git/commitdiff
Revert wall to wall detection based on @ tags (@ can also target a user, not only...
authorDomovoy <domovoy@errlock.org>
Fri, 24 Aug 2012 03:11:39 +0000 (05:11 +0200)
committerDomovoy <domovoy@errlock.org>
Fri, 24 Aug 2012 03:11:39 +0000 (05:11 +0200)
include/conversation.php
object/Item.php

index e74eb6b96bab853e72c4d8372bba419add761fdf..93532dfcc2e44fb9591699c520671ff58b11ebbf 100644 (file)
@@ -490,42 +490,6 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
                                                        $owner_url = zrl($owner_url);
                                        }
                                }
-                               if($commentww != 'ww') {
-                                       // Fallback, check if can find a @ tag
-                                       $tags = $item['tag'];
-                                       if(strpos($tags, '@[url') !== FALSE) {
-                                               // We have at least one @ tag
-                                               $template = $wallwall_template;
-                                               
-                                               $matches = array();
-                                               preg_match_all('/\@\[url=([^\]]+)\]([^\[]+)\[\/url\]/', $tags, $matches, PREG_SET_ORDER);
-
-                                               $r = null;
-                                               foreach($matches as $wall) {
-                                                       $uri = $wall[1];
-                                                       $r = q("SELECT `url`,`name`,`photo` FROM `contact` WHERE `url`='%s' LIMIT 1",
-                                                               dbesc($uri)
-                                                       );
-
-                                                       if(count($r)) {
-                                                               $owner_url = zrl($r[0]['url']);
-                                                               $owner_name = $r[0]['name'];
-                                                               $owner_photo = $r[0]['photo'];
-                                                               $commentww = 'ww';
-                                                               break;
-                                                       }
-                                               }
-
-                                               if($commentww != 'ww') {
-                                                       // We found no matching contact in the database, just do the best we can (we'll only miss the photo)
-                                                       $owner_url = zrl($matches[0][1]);
-                                                       $owner_name = $matches[0][2];
-                                                       // Use the nosign
-                                                       $owner_photo = $a->get_baseurl() .'/images/nosign.jpg';
-                                                       $commentww = 'ww';
-                                               }
-                                       }
-                               }
                        }
                        if($profile_owner == local_user()) {
                                $isstarred = (($item['starred']) ? "starred" : "unstarred");
index f89dcdcc166559f53aa12c99ec4822b4c5d20bed..a8676260c999ac30552f1c759794a1e5df483ce8 100644 (file)
@@ -589,43 +589,6 @@ class Item extends BaseObject {
                        }
                }
 
-               if(!$this->wall_to_wall) {
-                       // Fallback, check if can find a @ tag
-                       $tags = $this->get_data_value('tag');
-                       if(strpos($tags, '@[url') !== FALSE) {
-                               // We have at least one @ tag
-                               $this->set_template('wall2wall');
-                               
-                               $matches = array();
-                               preg_match_all('/\@\[url=([^\]]+)\]([^\[]+)\[\/url\]/', $tags, $matches, PREG_SET_ORDER);
-
-                               $r = null;
-                               foreach($matches as $wall) {
-                                       $uri = $wall[1];
-                                       $r = q("SELECT `url`,`name`,`photo` FROM `contact` WHERE `url`='%s' LIMIT 1",
-                                               dbesc($uri)
-                                       );
-
-                                       if(count($r)) {
-                                               $this->owner_url = zrl($r[0]['url']);
-                                               $this->owner_name = $r[0]['name'];
-                                               $this->owner_photo = $r[0]['photo'];
-                                               $this->wall_to_wall = true;
-                                               break;
-                                       }
-                               }
-
-                               if(!$this->wall_to_wall) {
-                                       // We found no matching contact in the database, just do the best we can (we'll only miss the photo)
-                                       $this->owner_url = zrl($matches[0][1]);
-                                       $this->owner_name = $matches[0][2];
-                                       // Use the nosign
-                                       $this->owner_photo = $a->get_baseurl() .'/images/nosign.jpg';
-                                       $this->wall_to_wall = true;
-                               }
-                       }
-               }
-
                if(!$this->wall_to_wall) {
                        // Definitely not wall to wall
                        $this->set_template('wall');