Massively updated avatar handling
This commit is contained in:
parent
8762fb671f
commit
e512a83ecc
13 changed files with 169 additions and 108 deletions
|
@ -131,8 +131,7 @@ function community_getitems($start, $itemspage) {
|
|||
WHERE `thread`.`visible` AND NOT `thread`.`deleted` AND NOT `thread`.`moderated`
|
||||
AND NOT `thread`.`private` AND `thread`.`wall`
|
||||
ORDER BY `thread`.`received` DESC LIMIT %d, %d",
|
||||
item_fieldlist(), contact_fieldlist(),
|
||||
contact_condition(),
|
||||
item_fieldlist(), contact_fieldlist(), contact_condition(),
|
||||
intval($start), intval($itemspage)
|
||||
);
|
||||
|
||||
|
@ -142,14 +141,15 @@ function community_getitems($start, $itemspage) {
|
|||
|
||||
function community_getpublicitems($start, $itemspage) {
|
||||
|
||||
$r = q("SELECT %s, `author-name` AS `name`, `owner-avatar` AS `photo`,
|
||||
$r = q("SELECT %s, %s, `author-name` AS `name`, `owner-avatar` AS `photo`,
|
||||
`owner-link` AS `url`, `owner-avatar` AS `thumb`
|
||||
FROM `thread`
|
||||
INNER JOIN `item` ON `item`.`id` = `thread`.`iid`
|
||||
INNER JOIN `item` ON `item`.`id` = `thread`.`iid` %s
|
||||
WHERE `thread`.`uid` = 0
|
||||
ORDER BY `thread`.`created` DESC LIMIT %d, %d",
|
||||
item_fieldlist(), intval($start),
|
||||
intval($itemspage)
|
||||
item_fieldlist(), zcontact_fieldlist(),
|
||||
zcontact_join(),
|
||||
intval($start), intval($itemspage)
|
||||
);
|
||||
|
||||
return($r);
|
||||
|
|
|
@ -362,18 +362,15 @@ function display_content(&$a, $update = 0) {
|
|||
return '';
|
||||
}
|
||||
|
||||
$r = q("SELECT %s, %s FROM `item`
|
||||
INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s
|
||||
WHERE %s AND `item`.`uid` = %d
|
||||
$r = q(item_query()." AND `item`.`uid` = %d
|
||||
AND `item`.`parent` = (SELECT `parent` FROM `item` WHERE `id` = %d)
|
||||
$sql_extra
|
||||
ORDER BY `parent` DESC, `gravity` ASC, `id` ASC",
|
||||
item_fieldlist(), contact_fieldlist(),
|
||||
contact_condition(), item_condition(),
|
||||
intval($a->profile['uid']),
|
||||
intval($item_id)
|
||||
);
|
||||
|
||||
|
||||
if(!$r && local_user()) {
|
||||
// Check if this is another person's link to a post that we have
|
||||
$r = q("SELECT `item`.uri FROM `item`
|
||||
|
@ -385,13 +382,9 @@ function display_content(&$a, $update = 0) {
|
|||
if($r) {
|
||||
$item_uri = $r[0]['uri'];
|
||||
|
||||
$r = q("SELECT %s, %s FROM `item`
|
||||
INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s
|
||||
WHERE %s AND `item`.`uid` = %d
|
||||
$r = q(item_query()." AND `item`.`uid` = %d
|
||||
AND `item`.`parent` = (SELECT `parent` FROM `item` WHERE `uri` = '%s' AND uid = %d)
|
||||
ORDER BY `parent` DESC, `gravity` ASC, `id` ASC ",
|
||||
item_fieldlist(), contact_fieldlist(),
|
||||
contact_condition(), item_condition(),
|
||||
intval(local_user()),
|
||||
dbesc($item_uri),
|
||||
intval(local_user())
|
||||
|
@ -399,7 +392,6 @@ function display_content(&$a, $update = 0) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if($r) {
|
||||
|
||||
if((local_user()) && (local_user() == $a->profile['uid'])) {
|
||||
|
|
|
@ -720,14 +720,12 @@ function network_content(&$a, $update = 0) {
|
|||
$sql_order = "`item`.`received`";
|
||||
|
||||
// "New Item View" - show all items unthreaded in reverse created date order
|
||||
$items = q("SELECT %s, %s FROM $sql_table $sql_post_table
|
||||
INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s
|
||||
$items = q("SELECT %s FROM $sql_table $sql_post_table %s
|
||||
WHERE %s AND `item`.`uid` = %d
|
||||
$simple_update
|
||||
$sql_extra $sql_nets
|
||||
ORDER BY $sql_order DESC $pager_sql ",
|
||||
item_fieldlist(), contact_fieldlist(),
|
||||
contact_condition(), item_condition(),
|
||||
item_fieldlists(), item_joins(), item_condition(),
|
||||
intval($_SESSION['uid'])
|
||||
);
|
||||
|
||||
|
@ -806,14 +804,9 @@ function network_content(&$a, $update = 0) {
|
|||
$items = array();
|
||||
|
||||
foreach ($parents_arr AS $parents) {
|
||||
// $sql_extra ORDER BY `item`.`commented` DESC LIMIT %d",
|
||||
$thread_items = q("SELECT %s, %s FROM `item`
|
||||
INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s
|
||||
WHERE %s AND `item`.`uid` = %d
|
||||
$thread_items = q(item_query()." AND `item`.`uid` = %d
|
||||
AND `item`.`parent` = %d
|
||||
ORDER BY `item`.`commented` DESC LIMIT %d",
|
||||
item_fieldlist(), contact_fieldlist(),
|
||||
contact_condition(), item_condition(),
|
||||
intval(local_user()),
|
||||
intval($parents),
|
||||
intval($max_comments + 1)
|
||||
|
|
|
@ -108,7 +108,7 @@ function notes_content(&$a,$update = false) {
|
|||
$parents_arr[] = $rr['item_id'];
|
||||
$parents_str = implode(', ', $parents_arr);
|
||||
|
||||
$r = q("SELECT %s, %s FROM `item`
|
||||
$r = q("SELECT %s FROM `item`
|
||||
LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s
|
||||
WHERE %s AND `item`.`uid` = %d AND `item`.`parent` IN (%s)
|
||||
$sql_extra
|
||||
|
|
|
@ -303,13 +303,9 @@ function profile_content(&$a, $update = 0) {
|
|||
$parents_arr[] = $rr['item_id'];
|
||||
$parents_str = implode(', ', $parents_arr);
|
||||
|
||||
$items = q("SELECT %s, %s FROM `item`
|
||||
INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s
|
||||
WHERE %s AND `item`.`uid` = %d
|
||||
$items = q(item_query()." AND `item`.`uid` = %d
|
||||
AND `item`.`parent` IN (%s)
|
||||
$sql_extra ",
|
||||
item_fieldlist(), contact_fieldlist(),
|
||||
contact_condition(), item_condition(),
|
||||
intval($a->profile['profile_uid']),
|
||||
dbesc($parents_str)
|
||||
);
|
||||
|
|
|
@ -191,14 +191,12 @@ function search_content(&$a) {
|
|||
if($tag) {
|
||||
logger("Start tag search for '".$search."'", LOGGER_DEBUG);
|
||||
|
||||
$r = q("SELECT STRAIGHT_JOIN %s, %s
|
||||
$r = q("SELECT STRAIGHT_JOIN %s
|
||||
FROM `term`
|
||||
INNER JOIN `item` ON `item`.`id`=`term`.`oid`
|
||||
INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s
|
||||
INNER JOIN `item` ON `item`.`id`=`term`.`oid` %s
|
||||
WHERE %s AND (`term`.`uid` = 0 OR (`term`.`uid` = %d AND NOT `term`.`global`)) AND `term`.`otype` = %d AND `term`.`type` = %d AND `term`.`term` = '%s'
|
||||
ORDER BY term.created DESC LIMIT %d , %d ",
|
||||
item_fieldlist(), contact_fieldlist(),
|
||||
contact_condition(), item_condition(),
|
||||
item_fieldlists(), item_joins(), item_condition(),
|
||||
intval(local_user()),
|
||||
intval(TERM_OBJ_POST), intval(TERM_HASHTAG), dbesc(protect_sprintf($search)),
|
||||
intval($a->pager['start']), intval($a->pager['itemspage']));
|
||||
|
@ -211,14 +209,12 @@ function search_content(&$a) {
|
|||
$sql_extra = sprintf(" AND `item`.`body` REGEXP '%s' ", dbesc(protect_sprintf(preg_quote($search))));
|
||||
}
|
||||
|
||||
$r = q("SELECT STRAIGHT_JOIN %s, %s
|
||||
FROM `item`
|
||||
INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s
|
||||
$r = q("SELECT STRAIGHT_JOIN %s
|
||||
FROM `item` %s
|
||||
WHERE %s AND (`item`.`uid` = 0 OR (`item`.`uid` = %s AND NOT `item`.`global`))
|
||||
$sql_extra
|
||||
GROUP BY `item`.`uri` ORDER BY `item`.`id` DESC LIMIT %d , %d",
|
||||
item_fieldlist(), contact_fieldlist(),
|
||||
contact_condition(), item_condition(),
|
||||
item_fieldlists(), item_joins(), item_condition(),
|
||||
intval(local_user()),
|
||||
intval($a->pager['start']), intval($a->pager['itemspage']));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue