X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FProfile_list.php;h=b60f4afffdc6d008886015a7ecc3154f7195e20a;hb=883ef2414fbf10797fb9799c5b4099b9f804c761;hp=0ad8106e3187d10b88da3dcfe0d45857d146c2f5;hpb=220b51d8be61e9bd316567f3ad03fffdbc4b7526;p=quix0rs-gnu-social.git diff --git a/classes/Profile_list.php b/classes/Profile_list.php index 0ad8106e31..b60f4afffd 100644 --- a/classes/Profile_list.php +++ b/classes/Profile_list.php @@ -21,20 +21,10 @@ * @license GNU Affero General Public License http://www.gnu.org/licenses/ */ -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} - -/** - * Table Definition for profile_list - */ -require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; +if (!defined('GNUSOCIAL')) { exit(1); } class Profile_list extends Managed_DataObject { - ###START_AUTOCODE - /* the code below is auto generated do not remove the above tag */ - public $__table = 'profile_list'; // table name public $id; // int(4) primary_key not_null public $tagger; // int(4) @@ -43,14 +33,11 @@ class Profile_list extends Managed_DataObject public $private; // tinyint(1) public $created; // datetime not_null default_0000-00-00%2000%3A00%3A00 public $modified; // timestamp not_null default_CURRENT_TIMESTAMP - public $uri; // varchar(255) unique_key - public $mainpage; // varchar(255) + public $uri; // varchar(191) unique_key not 255 because utf8mb4 takes more space + public $mainpage; // varchar(191) not 255 because utf8mb4 takes more space public $tagged_count; // smallint public $subscriber_count; // smallint - /* the code above is auto generated do not remove the tag below */ - ###END_AUTOCODE - public static function schemaDef() { return array( @@ -64,8 +51,8 @@ class Profile_list extends Managed_DataObject 'created' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date the tag was added'), 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date the tag was modified'), - 'uri' => array('type' => 'varchar', 'length' => 255, 'description' => 'universal identifier'), - 'mainpage' => array('type' => 'varchar', 'length' => 255, 'description' => 'page to link to'), + 'uri' => array('type' => 'varchar', 'length' => 191, 'description' => 'universal identifier'), + 'mainpage' => array('type' => 'varchar', 'length' => 191, 'description' => 'page to link to'), 'tagged_count' => array('type' => 'int', 'default' => 0, 'description' => 'number of people tagged with this tag by this user'), 'subscriber_count' => array('type' => 'int', 'default' => 0, 'description' => 'number of subscribers to this tag'), ), @@ -94,7 +81,7 @@ class Profile_list extends Managed_DataObject function getTagger() { - return Profile::getKV('id', $this->tagger); + return Profile::getByID($this->tagger); } /** @@ -145,7 +132,7 @@ class Profile_list extends Managed_DataObject $url = $this->mainpage; } else { $url = common_local_url('showprofiletag', - array('tagger' => $this->getTagger()->nickname, + array('nickname' => $this->getTagger()->nickname, 'tag' => $this->tag)); } } @@ -184,7 +171,9 @@ class Profile_list extends Managed_DataObject function getNotices($offset, $limit, $since_id=null, $max_id=null) { - $stream = new PeopletagNoticeStream($this); + // FIXME: Use something else than Profile::current() to avoid + // possible confusion between session user and queue processing. + $stream = new PeopletagNoticeStream($this, Profile::current()); return $stream->getNotices($offset, $limit, $since_id, $max_id); } @@ -659,7 +648,7 @@ class Profile_list extends Managed_DataObject $orig = clone($ptag); $user = User::getKV('id', $ptag->tagger); if(!empty($user)) { - $ptag->mainpage = common_local_url('showprofiletag', array('tag' => $ptag->tag, 'tagger' => $user->nickname)); + $ptag->mainpage = common_local_url('showprofiletag', array('tag' => $ptag->tag, 'nickname' => $user->getNickname())); } else { $ptag->mainpage = $uri; // assume this is a remote peopletag and the uri works }