function subtext($name, $data, $pars)
 {
     return aux::subtext($data, $pars['length']);
 }
Example #2
0
 function display($data)
 {
     $length = 400;
     foreach ($data as $k => $v) {
         switch ($k) {
             case "body":
                 $this->template->setContent($k, aux::subtext($data[$k], $length) . " ...");
                 break;
             case "video":
                 if ($data[$k] != "") {
                     #$this->template->setContent("video","<span class=\"mediaicons\"><img src=\"img/grafica/icon_video.gif\" alt=\"Video: titolo_mainnews\"/><a href=\"javascript:openvideo('{$data['video']}','{$data['logo']}')\">video </a> </span>");
                     $this->template->setContent("video", "<img src=\"img/grafica/icon_video.gif\" alt=\"Video: titolo_mainnews\"/><a href=\"javascript:openvideo('{$data['video']}','{$data['logo']}')\">video </a>");
                 } else {
                     $this->template->setContent("video", "");
                 }
                 break;
             case "foto":
                 if ($data[$k] != 0) {
                     $length = 250;
                     $this->template->setContent("foto", "<a href=\"news.php?id={$data['id']}\"><img src=\"show.php?token=3bcda8f2aed2c8f1fdea1c020dadcf39&id={$data['id']}&width=52&height=60&thumb\" alt=\"{$data['title']}\"/></a>");
                 } else {
                     $this->template->setContent("foto", "");
                 }
                 break;
             case "data":
                 $this->template->setContent("data", aux::formatDate($v, STANDARD_PLUS));
                 break;
             default:
                 $this->template->setContent($k, $data[$k]);
                 break;
         }
     }
 }