Browse Source

Merge pull request #784 from annando/master

SQL performance in the profile, preparations to twitter integration
pull/789/head
Tobias Diekershoff 8 years ago
parent
commit
16c2c73f07
  1. 4
      include/bbcode.php
  2. 3
      include/contact_selectors.php
  3. 4
      mod/profile.php

4
include/bbcode.php

@ -349,6 +349,10 @@ function GetProfileUsername($profile, $username) {
if ($diaspora != $profile)
return($diaspora);
$twitter = preg_replace("=https?://twitter.com/(.*)=ism", "$1@twitter.com", $profile);
if ($twitter != $profile)
return($twitter);
$StatusnetHost = preg_replace("=https?://(.*)/user/(.*)=ism", "$1", $profile);
if ($StatusnetHost != $profile) {
$StatusnetUser = preg_replace("=https?://(.*)/user/(.*)=ism", "$2", $profile);

3
include/contact_selectors.php

@ -85,7 +85,8 @@ function network_to_name($s) {
NETWORK_MYSPACE => t('MySpace'),
NETWORK_MAIL2 => t('Email'),
NETWORK_GPLUS => t('Google+'),
NETWORK_PUMPIO => t('pump.io')
NETWORK_PUMPIO => t('pump.io'),
NETWORK_TWITTER => t('Twitter')
);
call_hooks('network_to_name', $nets);

4
mod/profile.php

@ -276,8 +276,10 @@ function profile_content(&$a, $update = 0) {
$pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
// FROM `item` FORCE INDEX (created, uid) LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
$r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact-uid`
FROM `item` FORCE INDEX (created, uid) LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
and `item`.`moderated` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 1

Loading…
Cancel
Save