Solved a problem with author links that are different from what is provided in the contact

This commit is contained in:
Michael Vogel 2015-12-01 23:51:34 +01:00
parent c45b16d2a1
commit 7ed73a06ab

View file

@ -899,8 +899,10 @@ function contact_posts($a, $contact_id) {
if(get_config('system', 'old_pager')) { if(get_config('system', 'old_pager')) {
$r = q("SELECT COUNT(*) AS `total` FROM `item` $r = q("SELECT COUNT(*) AS `total` FROM `item`
WHERE `item`.`uid` = %d AND (`author-link` = '%s')", WHERE `item`.`uid` = %d AND `author-link` IN ('%s', '%s')",
intval(local_user()), dbesc($contact["url"])); intval(local_user()),
dbesc(normalise_link($contact["url"])),
dbesc(str_replace("http://", "https://", $contact["url"])));
$a->set_pager_total($r[0]['total']); $a->set_pager_total($r[0]['total']);
} }
@ -910,15 +912,19 @@ function contact_posts($a, $contact_id) {
`owner-link` AS `url`, `owner-avatar` AS `thumb` `owner-link` AS `url`, `owner-avatar` AS `thumb`
FROM `item` FORCE INDEX (uid_contactid_created) FROM `item` FORCE INDEX (uid_contactid_created)
WHERE `item`.`uid` = %d AND `contact-id` = %d WHERE `item`.`uid` = %d AND `contact-id` = %d
AND (`author-link` = '%s') AND `author-link` IN ('%s', '%s')
ORDER BY `item`.`created` DESC LIMIT %d, %d", ORDER BY `item`.`created` DESC LIMIT %d, %d",
intval(local_user()), intval(local_user()),
intval($contact_id), intval($contact_id),
dbesc($contact["url"]), dbesc(normalise_link($contact["url"])),
dbesc(str_replace("http://", "https://", $contact["url"])),
intval($a->pager['start']), intval($a->pager['start']),
intval($a->pager['itemspage']) intval($a->pager['itemspage'])
); );
if (!$r)
$o = $contact["url"]." - ".$contact_id;
$tab_str = contacts_tab($a, $contact_id, 1); $tab_str = contacts_tab($a, $contact_id, 1);
$header = $contact["name"]; $header = $contact["name"];