Ejemplo n.º 1
0
             echo json_encode(responseXmlToObject($content));
         }
     }
     break;
     //
     // get comments
     //
 //
 // get comments
 //
 case "co":
     if (!isset($_GET["id"])) {
         showApiError(200);
     }
     $users->addApiRequest($uid, $_SERVER['REQUEST_URI'], $hosthash);
     $data = $rc->getCommentsByGuid($_GET["id"]);
     if ($data) {
         $reldata = $data;
     } else {
         $reldata = array();
     }
     $page->smarty->assign('comments', $reldata);
     $page->smarty->assign('rsstitle', "API Comments");
     $page->smarty->assign('rssdesc', "API Comments");
     $page->smarty->assign('rsshead', $page->smarty->fetch('rssheader.tpl'));
     $content = trim($page->smarty->fetch('apicomments.tpl'));
     if ($outputtype == "xml") {
         header("Content-type: text/xml");
         echo $content;
     } else {
         header('Content-type: application/json');