function galeria($dir, $lvl = '../', $fileTitle = '', $phptParams = array('w' => 138, 'q' => 50, 'h' => 74, 'zc' => 1), $footer = '')
{
    if (!is_dir($lvl . $dir)) {
        return;
    }
    $archivos = opendir($lvl . $dir);
    $all = array();
    while (($item = readdir($archivos)) !== false) {
        if ($item != '.' && $item != '..' && $item != 'Thumbs.db' && strlen($item) > 3) {
            $phpt = new PhpT();
            $phpt->fileName = $item;
            $phpt->fileTitle = $fileTitle;
            $phpt->fileSource = $footer;
            //$phpt->useTimThumb = true;
            $phpt->useLightbox = true;
            $phpt->lightboxCls = '';
            $phpt->params = $phptParams;
            $phpt->dir = $dir;
            $out[] = $phpt->getImgHtml();
        }
    }
    return join("", $out);
}
 private function video()
 {
     $this->canCrop = false;
     if ($this->results) {
         // ADD CLASS TO SUPERCONTAINER FOR SORT
         if ($this->canSort) {
             $sortCls = 'sortGalerias';
         } else {
             $sortCls = 'noSortGalerias';
         }
         if ($this->useSuperContainer) {
             $out[] = '<div class="superContainerMedia ' . $sortCls . ' ' . $this->superContainerCls . '" style="' . $this->superContainerStyle . '">';
         }
         foreach ($this->results as $item) {
             $this->AbsPath = ROOT . 'admin/uploads/' . $this->table . '/' . $item['nombre'];
             $this->RelPath = $this->nivel . 'uploads/' . $this->table . '/' . $item['nombre'];
             if ($this->titulo) {
                 $item['titulo'] = $this->titulo;
             }
             if ($this->nombre) {
                 $item['nombre'] = $this->nombre;
             }
             if (file_exists($this->RelPath) && $item['nombre'] != '') {
                 if ($this->useContainer) {
                     $out[] = '<div class="imagenes_galeria ' . $this->containerCls . '" style="' . $this->containerStyle . '" id="item_' . $item['id'] . '">';
                 }
                 $phpt = new PhpT();
                 $phpt->fileName = $item['fuente'];
                 if ($this->canCrop && $item['cropCords']) {
                     $c = explode(",", $item['cropCords']);
                     $phpt->params = array('sx' => $c[0], 'sy' => $c[1], 'sw' => $c[4], 'sh' => $c[5], 'w' => $this->phptParams['w'], 'h' => $this->phptParams['h'], 'aoe' => 1);
                 } else {
                     $phpt->params = $this->phptParams;
                 }
                 $phpt->folder = $item['tabla'];
                 $out[] = '<div class="playerContainer imageContainer" id="player_' . $item['id'] . '">';
                 // PAYER
                 $out[] = '<div id="s' . $item['id'] . '" class="player ' . $this->itemCls . '" style="' . $this->itemStyle . '"></div>';
                 $out[] = '<script type="text/javascript">';
                 $out[] = 'jwplayer("s' . $item['id'] . '").setup({';
                 $out[] = '"flashplayer": "plugins/jwplayer/player.swf",';
                 if ($item['fuente']) {
                     $out[] = '"image": "' . $phpt->getSrc() . $phpt->getParams() . '",';
                 }
                 $out[] = '"file": "' . $this->RelPath . '",';
                 $out[] = '"repeat": "true",';
                 $out[] = '"controlbar": "bottom",';
                 $out[] = '"width": "' . $this->playerWidth . '",';
                 $out[] = '"height": "' . $this->playerHeight . '"';
                 $out[] = '});';
                 $out[] = '</script>';
                 $out[] = '</div>';
                 $out[] = $this->buildButtons($item);
                 $out[] = $this->buildDisplayName($item);
                 if ($this->useContainer) {
                     $out[] = '</div>';
                 }
             } else {
                 if ($this->useContainer) {
                     $out[] = '<div class="imagenes_galeria ' . $this->containerCls . '" id="item_' . $item['id'] . '">';
                 }
                 $out[] = $this->RelPath;
                 $out[] = $this->buildButtons($item);
                 $out[] = $this->buildDisplayName($item);
                 if ($this->useContainer) {
                     $out[] = '</div>';
                 }
             }
         }
         $out[] = '<div style="clear: both;"></div>';
         if ($this->useSuperContainer) {
             $out[] = '</div>';
         }
         return join('', $out);
     }
 }
<?php

$items = q("select * from productos order by orden");
$out = array();
if ($items) {
    $out[] = '<h3>Productos</h3>';
    $x = 1;
    foreach ($items as $i) {
        $img = a("select * from files where item_id = " . $i['id'] . " and tabla = 'productos' and tipo = 'imagenes' order by orden");
        $imagen = '';
        if ($img) {
            $phpt = new PhpT();
            $phpt->fileName = $img['nombre'];
            $phpt->fileTitle = utf8_strtoupper($i['nombre']);
            //$phpt->useTimThumb = true;
            //$phpt->useLightbox = true;
            //$phpt->lightboxCls = 'ceebox';
            $phpt->params = array('w' => 161, 'h' => 123, 'zc' => 1);
            $phpt->folder = $img['tabla'];
            $imagen = $phpt->getImgHtml();
        } else {
            $imagen = '<img src="img/blank.gif" width="161" height="123" />';
        }
        $last = $x % 4 == 0 ? 'last' : '';
        $out[] = '<div class="prodHome ' . $last . '">';
        $out[] = '<a href="producto.php?id=' . $i['id'] . '">' . $imagen . '</a>';
        $out[] = '<div class="data">';
        $out[] = '<a href="producto.php?id=' . $i['id'] . '"><strong>' . cortar(utf8_strtoupper($i['nombre']), 24, array('ending' => '...')) . '</strong></a>';
        $out[] = '<p>' . cortar($i['resumen'], 80, array('ending' => '...')) . '</p>';
        $out[] = '</div>';
        $out[] = '</div>';
$out = array();
$out[] = '<h3>Productos » <i>' . utf8_ucfirst(utf8_strtolower($producto['nombre'])) . '</i></h3>';
$imagenes = array();
$thumbs = array();
$img = q("select * from files where item_id = " . $producto['id'] . " and tabla = 'productos' and tipo = 'imagenes' order by orden");
if ($img) {
    foreach ($img as $imm) {
        // IMG BIG
        $phpt = new PhpT();
        $phpt->fileName = $imm['nombre'];
        $phpt->fileTitle = utf8_strtoupper($producto['nombre']);
        $phpt->params = array('w' => 614, 'h' => 460, 'zc' => 1);
        $phpt->folder = $imm['tabla'];
        $imagenes[] = $phpt->getImgHtml();
        // THUMB FOR PAGER
        $phpt2 = new PhpT();
        $phpt2->fileName = $imm['nombre'];
        $phpt2->fileTitle = utf8_strtoupper($producto['nombre']);
        $phpt2->params = array('w' => 70, 'h' => 52, 'zc' => 1);
        $phpt2->folder = $imm['tabla'];
        $thumbs[] = $phpt2->getImgHtml();
    }
}
$highlight1 = new highlight(utf8_ucfirst(utf8_strtolower($producto['nombre'])), $words);
$hiTitulo = $highlight1->output_text;
$highlight2 = new highlight($producto['resumen'], $words);
$hiResumen = $highlight2->output_text;
$highlight3 = new highlight(fop($producto['descripcion']), $words);
$hiDescripcion = $highlight3->output_text;
$out[] = '<h4 class="small">» ' . $hiTitulo . '</h4>';
$out[] = '<div class="productoAmpliado">';
Exemple #5
0
$out = array();
//$_POST['termino'] = mb_convert_encoding($_POST['termino'], "ISO-8859-1", "UTF-8");
$arrayTerm = explode(" ", formatear_string($_POST['termino'], " ", true));
// PRODUCTOS
$query = '';
foreach ($arrayTerm as $keyword) {
    $query[] = " (nombre like '%" . $keyword . "%' or resumen like '%" . $keyword . "%' or descripcion like '%" . $keyword . "%') ";
}
$query = implode(" AND ", $query);
$items = q("select * from productos where " . $query . " order by nombre");
if ($items) {
    //$out .= '<h3><a href="#">Contenidos</a></h3>';
    foreach ($items as $item) {
        $foto = array();
        $img = a("select nombre, tabla from files where item_id = " . $item['id'] . " AND tipo = 'imagenes' and tabla = 'productos' order by orden");
        $phpt = new PhpT();
        $phpt->fileName = $img['nombre'];
        $phpt->fileTitle = $item['nombre'];
        $phpt->params = array('w' => 37, 'h' => 37, 'zc' => 1);
        $phpt->folder = $img['tabla'];
        $highlight1 = new highlight(cortar($item['nombre'], 40), $_POST['termino']);
        $hiTitulo = $highlight1->output_text;
        $hiTituloWords = $highlight1->output_words;
        $hiTituloWords = fs($hiTituloWords, ' ', '');
        $highlight2 = new highlight(cortar($item['resumen'], 80, array('ending' => '...', 'exact' => true, 'html' => false)), $_POST['termino']);
        $hiResumen = $highlight2->output_text;
        $foto[] = '<li class="foto">';
        if ($img) {
            $foto[] = '<a href="producto.php?id=' . $item['id'] . '&words=' . $hiTituloWords . '" title="' . $item['nombre'] . '">';
            $foto[] = $phpt->getImgHtml();
            $foto[] = '</a></li>';
<?php

$items = q("select *, DATE_FORMAT(date,'%d-%m-%Y') as df from noticias where id != " . $noticia['id'] . " order by date desc");
$chunks = array_chunk($items, ceil(count($items) / 2));
$out = array();
$images = q("select * from files where item_id = " . $noticia['id'] . " and tabla = 'noticias' and tipo = 'imagenes' order by orden");
$gal = array();
if ($images) {
    $x = 0;
    foreach ($images as $img) {
        $phpt = new PhpT();
        $phpt->fileName = $img['nombre'];
        $phpt->fileTitle = utf8_strtoupper($noticia['titulo']);
        $phpt->useLightbox = true;
        $phpt->lightboxCls = '';
        if ($x != 0) {
            $phpt->lightboxShowImg = false;
        }
        //$phpt->lightboxShowLink = true;
        $phpt->params = array('w' => 300, 'h' => 225, 'zc' => 1);
        $phpt->folder = $img['tabla'];
        $gal[] = $phpt->getImgHtml();
        $x++;
    }
}
$out[] = '<div class="noticiaAmpliada">';
$out[] = '<h4>' . $noticia['titulo'] . '</h4>';
$out[] = '<div class="ceebox">' . join("\n", $gal) . '</div>';
$out[] = '<span class="date">' . $noticia['df'] . '</span>';
$out[] = '<i>' . $noticia['resumen'] . '</i>';
$out[] = fop($noticia['body']);