Esempio n. 1
0
function mobile_content_detail()
{
    $_id = func_arg(0) != "" ? func_arg(0) : "";
    $lilo_mongo = new LiloMongo();
    $lilo_mongo->selectDB('Articles');
    $lilo_mongo->selectCollection('ContentPage');
    $dt = $lilo_mongo->findOne(array("_id" => $lilo_mongo->mongoid($_id)));
    $output = array('title' => "No Title", 'text' => "no Text", 'alias' => "no alias", 'document_update' => date("Y-m-d H:i:s"), 'state_document' => "");
    if ($dt) {
        $tgl = "";
        if ($dt['document_update'] != "") {
            $tgl = date('Y-m-d H:i:s', $dt['document_update']->sec);
        }
        $title = !isset($dt['title']) ? "" : $dt['title'];
        $text = !isset($dt['text']) ? "" : $dt['text'];
        $alias = !isset($dt['alias']) ? "" : $dt['alias'];
        $state_document = !isset($dt['state_document']) ? "" : $dt['state_document'];
        $output = array('title' => $title, 'alias' => $alias, 'text' => replace_text_content(filter_text($text)), 'document_update' => $tgl, 'state_document' => $state_document);
    }
    return json_encode($output);
}
Esempio n. 2
0
function mobile_stream_news()
{
    $_id = func_arg(0) != "" ? func_arg(0) : "";
    $lilo_mongo = new LiloMongo();
    $lilo_mongo->selectDB('Articles');
    $lilo_mongo->selectCollection('ContentNews');
    $dt = $lilo_mongo->findOne(array("_id" => $lilo_mongo->mongoid($_id)));
    $output = array('title' => "No Title", 'text' => "no Text", 'update' => date("Y-m-d H:i:s"), 'state_document' => "");
    if ($dt) {
        $tgl = "";
        if ($dt['update'] != "") {
            $tgl = date('Y-m-d H:i:s', $dt['update']->sec);
        }
        $path_upload = URL_ASSET_IMAGE . "images/";
        $title = !isset($dt['title']) ? "" : $dt['title'];
        $text = !isset($dt['text']) ? "" : $dt['text'];
        $state_document = !isset($dt['state_document']) ? "" : $dt['state_document'];
        $picture = !isset($dt['picture']) ? "" : $dt['picture'];
        $output = array('title' => $title, 'text' => replace_text_content(filter_text($text)), 'update' => $tgl, 'imageName' => $picture, 'pathImage' => $path_upload, 'state_document' => $state_document);
    }
    return json_encode($output);
}