Added statuses/show parameter ?conversation=true

This commit is contained in:
Max Weller 2012-06-21 10:53:48 +02:00
parent 53c9ea7606
commit 0f5a6bfcdb

View file

@ -864,6 +864,8 @@
logger('API: api_statuses_show: '.$id); logger('API: api_statuses_show: '.$id);
//$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false); //$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false);
//$sql_extra = "";
if ($_GET["conversation"] == "true") $sql_extra .= " AND `item`.`parent` = %d"; else $sql_extra .= " AND `item`.`id` = %d";
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`, $r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
@ -874,19 +876,24 @@
AND `contact`.`id` = `item`.`contact-id` AND `contact`.`id` = `item`.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra $sql_extra
AND `item`.`id`=%d", ",
intval($id) intval($id)
); );
//var_dump($r);
$ret = api_format_items($r,$user_info); $ret = api_format_items($r,$user_info);
//var_dump($ret);
$data = array('$status' => $ret[0]); if ($_GET["conversation"] == "true") {
/*switch($type){ $data = array('$statuses' => $ret);
case "atom": return api_apply_template("timeline", $type, $data);
case "rss": } else {
$data = api_rss_extra($a, $data, $user_info); $data = array('$status' => $ret[0]);
}*/ /*switch($type){
return api_apply_template("status", $type, $data); case "atom":
case "rss":
$data = api_rss_extra($a, $data, $user_info);
}*/
return api_apply_template("status", $type, $data);
}
} }
api_register_func('api/statuses/show','api_statuses_show', true); api_register_func('api/statuses/show','api_statuses_show', true);