Bugfix for failed events page and api
This commit is contained in:
parent
b81a1fde09
commit
0c310db23d
|
@ -2344,6 +2344,9 @@
|
||||||
* dislikes => int count
|
* dislikes => int count
|
||||||
*/
|
*/
|
||||||
function api_format_items_activities(&$item, $type = "json") {
|
function api_format_items_activities(&$item, $type = "json") {
|
||||||
|
|
||||||
|
$a = get_app();
|
||||||
|
|
||||||
$activities = array(
|
$activities = array(
|
||||||
'like' => array(),
|
'like' => array(),
|
||||||
'dislike' => array(),
|
'dislike' => array(),
|
||||||
|
@ -2521,9 +2524,9 @@
|
||||||
|
|
||||||
// Retweets are only valid for top postings
|
// Retweets are only valid for top postings
|
||||||
// It doesn't work reliable with the link if its a feed
|
// It doesn't work reliable with the link if its a feed
|
||||||
#$IsRetweet = ($item['owner-link'] != $item['author-link']);
|
//$IsRetweet = ($item['owner-link'] != $item['author-link']);
|
||||||
#if ($IsRetweet)
|
//if ($IsRetweet)
|
||||||
# $IsRetweet = (($item['owner-name'] != $item['author-name']) OR ($item['owner-avatar'] != $item['author-avatar']));
|
// $IsRetweet = (($item['owner-name'] != $item['author-name']) OR ($item['owner-avatar'] != $item['author-avatar']));
|
||||||
|
|
||||||
|
|
||||||
if ($item["id"] == $item["parent"]) {
|
if ($item["id"] == $item["parent"]) {
|
||||||
|
|
|
@ -206,7 +206,7 @@ function bbtoevent($s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sort_by_date(App $a) {
|
function sort_by_date($a) {
|
||||||
|
|
||||||
usort($a,'ev_compare');
|
usort($a,'ev_compare');
|
||||||
return $a;
|
return $a;
|
||||||
|
@ -510,7 +510,7 @@ function event_by_id($owner_uid = 0, $event_params, $sql_extra = '') {
|
||||||
// query for the event by event id
|
// query for the event by event id
|
||||||
$r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`,
|
$r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`,
|
||||||
`item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event`
|
`item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event`
|
||||||
STRAIGHT_JOIN `item` ON `item`.`event-id` = `event`.`id` AND `item`.`uid` = `event`.`uid`
|
LEFT JOIN `item` ON `item`.`event-id` = `event`.`id` AND `item`.`uid` = `event`.`uid`
|
||||||
WHERE `event`.`uid` = %d AND `event`.`id` = %d $sql_extra",
|
WHERE `event`.`uid` = %d AND `event`.`id` = %d $sql_extra",
|
||||||
intval($owner_uid),
|
intval($owner_uid),
|
||||||
intval($event_params["event_id"])
|
intval($event_params["event_id"])
|
||||||
|
@ -543,7 +543,7 @@ function events_by_date($owner_uid = 0, $event_params, $sql_extra = '') {
|
||||||
// query for the event by date
|
// query for the event by date
|
||||||
$r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`,
|
$r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`,
|
||||||
`item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event`
|
`item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event`
|
||||||
STRAIGHT_JOIN `item` ON `item`.`event-id` = `event`.`id` AND `item`.`uid` = `event`.`uid`
|
LEFT JOIN `item` ON `item`.`event-id` = `event`.`id` AND `item`.`uid` = `event`.`uid`
|
||||||
WHERE `event`.`uid` = %d AND event.ignore = %d
|
WHERE `event`.`uid` = %d AND event.ignore = %d
|
||||||
AND ((`adjust` = 0 AND (`finish` >= '%s' OR (nofinish AND start >= '%s')) AND `start` <= '%s')
|
AND ((`adjust` = 0 AND (`finish` >= '%s' OR (nofinish AND start >= '%s')) AND `start` <= '%s')
|
||||||
OR (`adjust` = 1 AND (`finish` >= '%s' OR (nofinish AND start >= '%s')) AND `start` <= '%s'))
|
OR (`adjust` = 1 AND (`finish` >= '%s' OR (nofinish AND start >= '%s')) AND `start` <= '%s'))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user