]> git.mxchange.org Git - friendica.git/commitdiff
Remove wall to wall checking base on @ tags, too heavy for the database.
authorDomovoy <domovoy@errlock.org>
Fri, 24 Aug 2012 03:53:45 +0000 (05:53 +0200)
committerDomovoy <domovoy@errlock.org>
Fri, 24 Aug 2012 03:53:45 +0000 (05:53 +0200)
This should be done when we store the item (https://social.errlock.org/display/domovoy/26698)

object/Item.php

index 120497b365f7d1234f36e8df607f1fa7d8b4af9b..c7b40070d92cffc78e00f48e47a01b63b1d6db4e 100644 (file)
@@ -589,33 +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
-                               $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`,`forum` FROM `contact` WHERE `url`='%s' LIMIT 1",
-                                               dbesc($uri)
-                                       );
-
-                                       if(count($r) && (intval($r[0]['forum']) == 1)) {
-                                               $this->owner_url = zrl($r[0]['url']);
-                                               $this->owner_name = $r[0]['name'];
-                                               $this->owner_photo = $r[0]['photo'];
-                                               $this->wall_to_wall = true;
-                                               $this->set_template('wall2wall');
-                                               break;
-                                       }
-                               }
-                       }
-               }
-
                if(!$this->wall_to_wall) {
                        $this->set_template('wall');
                        $this->owner_url = '';