get posts to show up
This commit is contained in:
parent
a56c0425e6
commit
3c04676a32
@ -441,6 +441,10 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
|
|||||||
else
|
else
|
||||||
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($thumb));
|
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($thumb));
|
||||||
|
|
||||||
|
$profile_avatar = $item['author']['xchan_photo'];
|
||||||
|
$profile_link = zrl($item['author']['xchan_profile']);
|
||||||
|
$profile_name = $item['author']['xchan_name'];
|
||||||
|
|
||||||
$locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
|
$locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
|
||||||
call_hooks('render_location',$locate);
|
call_hooks('render_location',$locate);
|
||||||
$location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate));
|
$location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate));
|
||||||
@ -615,7 +619,7 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
|
|||||||
'body' => template_escape($body),
|
'body' => template_escape($body),
|
||||||
'text' => strip_tags(template_escape($body)),
|
'text' => strip_tags(template_escape($body)),
|
||||||
'id' => $item['item_id'],
|
'id' => $item['item_id'],
|
||||||
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
|
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_link),
|
||||||
'olinktitle' => sprintf( t('View %s\'s profile @ %s'), $owner_name, ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])),
|
'olinktitle' => sprintf( t('View %s\'s profile @ %s'), $owner_name, ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])),
|
||||||
'to' => t('to'),
|
'to' => t('to'),
|
||||||
'wall' => t('Wall-to-Wall'),
|
'wall' => t('Wall-to-Wall'),
|
||||||
@ -649,6 +653,7 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
|
|||||||
'thread_level' => $thread_level,
|
'thread_level' => $thread_level,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
logger('tmp_item: ' . print_r($tmp_item,true));
|
||||||
$arr = array('item' => $item, 'output' => $tmp_item);
|
$arr = array('item' => $item, 'output' => $tmp_item);
|
||||||
call_hooks('display_item', $arr);
|
call_hooks('display_item', $arr);
|
||||||
|
|
||||||
@ -1197,6 +1202,13 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
|
|||||||
else
|
else
|
||||||
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($thumb));
|
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($thumb));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$profile_avatar = $item['author']['xchan_photo'];
|
||||||
|
$profile_link = zrl($item['author']['xchan_profile']);
|
||||||
|
$profile_name = $item['author']['xchan_name'];
|
||||||
|
|
||||||
|
|
||||||
$like = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : '');
|
$like = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : '');
|
||||||
$dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : '');
|
$dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : '');
|
||||||
|
|
||||||
|
@ -1687,4 +1687,37 @@ function ids_to_querystr($arr,$idx = 'id') {
|
|||||||
foreach($arr as $x)
|
foreach($arr as $x)
|
||||||
$t[] = $x[$idx];
|
$t[] = $x[$idx];
|
||||||
return(implode(',', $t));
|
return(implode(',', $t));
|
||||||
|
}
|
||||||
|
|
||||||
|
function xchan_query(&$items) {
|
||||||
|
$arr = array();
|
||||||
|
if($items && count($items)) {
|
||||||
|
foreach($items as $item) {
|
||||||
|
if($item['owner_xchan'] && (! in_array($item['owner_xchan'],$arr)))
|
||||||
|
$arr[] = "'" . dbesc($item['owner_xchan']) . "'";
|
||||||
|
if($item['author_xchan'] && (! in_array($item['author_xchan'],$arr)))
|
||||||
|
$arr[] = "'" . dbesc($item['author_xchan']) . "'";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(count($arr)) {
|
||||||
|
$chans = q("select * from xchan where xchan_hash in (" . implode(',', $arr) . ")");
|
||||||
|
}
|
||||||
|
if($items && count($items) && $chans && count($chans)) {
|
||||||
|
for($x = 0; $x < count($items); $x ++) {
|
||||||
|
$items[$x]['owner'] = find_xchan_in_array($items[$x]['owner_xchan'],$chans);
|
||||||
|
$items[$x]['author'] = find_xchan_in_array($items[$x]['author_xchan'],$chans);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function find_xchan_in_array($xchan,$arr) {
|
||||||
|
if(count($arr)) {
|
||||||
|
foreach($arr as $x) {
|
||||||
|
if($x['xchan_hash'] === $xchan) {
|
||||||
|
return $x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return array();
|
||||||
}
|
}
|
@ -602,7 +602,7 @@ function network_content(&$a, $update = 0, $load = false) {
|
|||||||
|
|
||||||
if($nouveau && $load) {
|
if($nouveau && $load) {
|
||||||
// "New Item View" - show all items unthreaded in reverse created date order
|
// "New Item View" - show all items unthreaded in reverse created date order
|
||||||
|
/*
|
||||||
$items = q("SELECT `item`.*, `item`.`id` AS `item_id`,
|
$items = q("SELECT `item`.*, `item`.`id` AS `item_id`,
|
||||||
o.xchan_name as oname, o.xchan_photo as ophoto, o.xchan_profile as ourl,
|
o.xchan_name as oname, o.xchan_photo as ophoto, o.xchan_profile as ourl,
|
||||||
a.xchan_name as aname, a.xchan_photo as aphoto, a.xchan_profile as aurl,
|
a.xchan_name as aname, a.xchan_photo as aphoto, a.xchan_profile as aurl,
|
||||||
@ -614,7 +614,7 @@ function network_content(&$a, $update = 0, $load = false) {
|
|||||||
ORDER BY `item`.`received` DESC $pager_sql ",
|
ORDER BY `item`.`received` DESC $pager_sql ",
|
||||||
intval($_SESSION['uid'])
|
intval($_SESSION['uid'])
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
$items = fetch_post_tags($items);
|
$items = fetch_post_tags($items);
|
||||||
@ -632,7 +632,7 @@ function network_content(&$a, $update = 0, $load = false) {
|
|||||||
// Fetch a page full of parent items for this page
|
// Fetch a page full of parent items for this page
|
||||||
|
|
||||||
if($update && (! $load)) {
|
if($update && (! $load)) {
|
||||||
$r = q("SELECT `parent` AS `item_id`, `contact`.`uid` AS `contact_uid`
|
/* $r = q("SELECT `parent` AS `item_id`, `contact`.`uid` AS `contact_uid`
|
||||||
FROM `item` 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
|
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND
|
||||||
(`item`.`deleted` = 0 OR item.verb = '" . ACTIVITY_LIKE ."' OR item.verb = '" . ACTIVITY_DISLIKE . "')
|
(`item`.`deleted` = 0 OR item.verb = '" . ACTIVITY_LIKE ."' OR item.verb = '" . ACTIVITY_DISLIKE . "')
|
||||||
@ -641,7 +641,7 @@ function network_content(&$a, $update = 0, $load = false) {
|
|||||||
$sql_extra3 $sql_extra $sql_nets ",
|
$sql_extra3 $sql_extra $sql_nets ",
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
}
|
*/ }
|
||||||
else {
|
else {
|
||||||
|
|
||||||
$r = q("SELECT `item`.`id` AS `item_id`
|
$r = q("SELECT `item`.`id` AS `item_id`
|
||||||
@ -660,11 +660,7 @@ function network_content(&$a, $update = 0, $load = false) {
|
|||||||
|
|
||||||
$parents_str = ids_to_querystr($r,'item_id');
|
$parents_str = ids_to_querystr($r,'item_id');
|
||||||
|
|
||||||
$items = q("SELECT `item`.*, `item`.`id` AS `item_id`,
|
$items = q("SELECT `item`.*, `item`.`id` AS `item_id` FROM `item`
|
||||||
o.xchan_name as oname, o.xchan_photo as ophoto, o.xchan_profile as ourl,
|
|
||||||
a.xchan_name as aname, a.xchan_photo as aphoto, a.xchan_profile as aurl,
|
|
||||||
FROM `item` left join xchan as o on xchan_hash = owner_xchan left join xchan as a
|
|
||||||
on xchan_hash = author_xchan
|
|
||||||
WHERE `item`.`uid` = %d AND `item`.`item_restrict` = 0
|
WHERE `item`.`uid` = %d AND `item`.`item_restrict` = 0
|
||||||
AND `item`.`parent` IN ( %s )
|
AND `item`.`parent` IN ( %s )
|
||||||
$sql_extra ",
|
$sql_extra ",
|
||||||
@ -672,10 +668,14 @@ function network_content(&$a, $update = 0, $load = false) {
|
|||||||
dbesc($parents_str)
|
dbesc($parents_str)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
xchan_query($items);
|
||||||
|
|
||||||
$items = fetch_post_tags($items);
|
$items = fetch_post_tags($items);
|
||||||
|
|
||||||
$items = conv_sort($items,$ordering);
|
$items = conv_sort($items,$ordering);
|
||||||
|
|
||||||
|
logger('items: ' . print_r($items,true));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$items = array();
|
$items = array();
|
||||||
|
@ -132,12 +132,17 @@ class Item extends BaseObject {
|
|||||||
else
|
else
|
||||||
$profile_link = zrl($profile_link);
|
$profile_link = zrl($profile_link);
|
||||||
|
|
||||||
|
$profile_link = zrl($item['author']['xchan_profile']);
|
||||||
|
|
||||||
|
|
||||||
$normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
|
$normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
|
||||||
if(($normalised != 'mailbox') && (x($a->contacts,$normalised)))
|
if(($normalised != 'mailbox') && (x($a->contacts,$normalised)))
|
||||||
$profile_avatar = $a->contacts[$normalised]['thumb'];
|
$profile_avatar = $a->contacts[$normalised]['thumb'];
|
||||||
else
|
else
|
||||||
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($this->get_data_value('thumb')));
|
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($this->get_data_value('thumb')));
|
||||||
|
|
||||||
|
$profile_avatar = $item['author']['xchan_photo'];
|
||||||
|
|
||||||
$locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
|
$locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
|
||||||
call_hooks('render_location',$locate);
|
call_hooks('render_location',$locate);
|
||||||
$location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate));
|
$location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate));
|
||||||
|
Reference in New Issue
Block a user