<script type="text/javascript" src="js/jquery.ui/jquery-ui.js"></script>
<script type="text/javascript" src="js//jquery.form.js"></script>
<script type="text/javascript" src="js/jquery.tag.js"></script>
<!--Calendario -->
<script src="js/jquery.ui/ui.datepicker.js"></script>
<link href="/js/jquery.ui/themes/overcast/ui.all.css" rel="stylesheet" type="text/css" />
<link href="../../../www/css/backend/multimedia.css" rel="stylesheet" type="text/css" />
<link href="../../../www/css/tinyMCE.css" rel="stylesheet" type="text/css" />
<h2>Multimedia</h2>
<?php include("multimedia-menu.php"); ?>
<div class="gallery-general clearfix">
<div class="gallery-image">
<h3>Galería <?php echo getGalleryTitle(1) ?></h3>
<a href="/cms/multimedia/viewgallery/<?php echo getGalleryUrl(1) ?>/"><img src="<?php echo getImagesFile() ?>-m.jpg" alt="<?php echo getImagesDescription() ?>" rel="fotos" title="<?php echo getImagesTitle() ?>" /></a>
<p><em><a href="/cms/multimedia/addphotos/1/">subir</a> | <a href="/cms/multimedia/addgallery/1/">editar</a></em></p>
</div>
<div class="gallery-general-images">
<p>Últimas imágenes</p>
<ul class="all-images clearfix">
<?php foreach(getImageId("WHERE images_gallery=1 ORDER BY images_id DESC LIMIT 1, 5") as $ImagesId ): ?>
<li class="img-<?php echo $ImagesId ?>"><img src="<?php echo getImagesFile() ?>-m.jpg" alt="<?php echo getImagesDescription() ?>" rel="fotos" title="<?php echo getImagesTitle() ?>" />
<ul class="addedaction" style="display:none">
<li><img src="/img/backend/photo_up.png" alt="Agregar imagen"/></li>
<li><a class="img_edit showImgDialog" rel="<?php echo $ImagesId ?>" href="#" title="Editar imagen"><img src="/img/backend/photo_edit.png" alt="Editar imagen"/></a></li>
<li><a class="img_zoom" href="#" title="Ampliar imagen"><img src="/img/backend/photo_search.png" alt="Ampliar imagen"/></a></li>
<li><a class="img_remove" href="<?php echo "cms/delete/image/".$ImagesId."/" ?>" title="Eliminar imagen" rel="<?php echo $ImagesId ?>"><img src="/img/backend/photo_del.png" alt="Eliminar imagen"/></a></li>
</ul>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
<?php
require_once(REALPATH."/includes/classPaginator.php");
$limitPerPage = 12;
$gallery_id = getGalleryIds("WHERE gallery_type='Fotos' ORDER BY gallery_id DESC");
if($gallery_id){
$currentPage = getCurrentPage();
$number_items = getItems($gallery_id);
$StartItem = getStartItem($currentPage, $limitPerPage, $number_items);
$number_pages = getNumberPages($number_items, $limitPerPage);
foreach ($gallery_id as $gallery_id){
if (isset($gallery_id_query)){
$gallery_id_query .= ",";
}
$gallery_id_query.= "'".$gallery_id."'";
}
if (!$number_items){
$number_items=0;
}
$p = new pagination;
$p->Items($number_items);
$p->adjacents(1);
$p->limit($limitPerPage);
$p->target("/cms/multimedia/allgallery/");
$p->currentPage($currentPage);
$p->parameterName("page");
$p->nextLabel('<span>Siguiente</span>');//Texto siguiente
$p->prevLabel('<span>Anterior</span>');//Texto anterior
$p->nextIcon('');//Si desea poner a parte del texto una imagen
$p->prevIcon('');// "" "" ""
$ImgIds = getGalleryIds("WHERE gallery_type='Fotos' IN(".$gallery_id_query.") ORDER BY gallery_id DESC LIMIT 4".$StartItem.",".$limitPerPage);
?>
<div class="gallery-others-top clearfix">
<h3>Otras galerías</h3>
<div class="paginated">
<?php $p->show(); ?>
</div>
</div>
<?php $count = 0; if($MultimediaId = getGalleryIds("WHERE gallery_type='Fotos' AND gallery_id!=1 ORDER BY gallery_id DESC LIMIT 4")): ?>
<?php foreach($MultimediaId as $GalleryId): ?>
<?php $ImagesId = getImagesId("WHERE images_gallery=$GalleryId") ?>
<?php if ($count>0 && $count%2==0){?>
<hr class="line" />
<?php } ?>
<?php if($ImagesId): $count++; ?>
<div class="gallery-list <?php echo $GalleryId ?>">
<a href="/cms/multimedia/viewgallery/<?php echo getGalleryUrl() ?>/"><img src="<?php echo getImagesFile() ?>-m.jpg" width="146" height="74" alt="Galería de imágenes" rel="fotos"/></a>
<h4><?php echo getGalleryTitle() ?></h4>
<p><?php echo limitContentToShow(getGalleryDescription(), 80) ?></p>
<em><a href="/cms/multimedia/addphotos/<?php echo $GalleryId ?>/">subir</a> | <a href="/cms/multimedia/addgallery/<?php echo $GalleryId ?>/">editar</a> | <a href="<?php echo "cms/delete/gallery/".$GalleryId."/" ?>" title="Eliminar imagen" rel="<?php echo $GalleryId ?>" class="remove_gallery" >borrar</a></em>
</div>
<?php else: ?>
<div class="gallery-list <?php echo $GalleryId ?>">
<a href="/cms/multimedia/viewgallery/<?php echo getGalleryUrl() ?>/"><img src="/img/backend/i_upload_images_clear.png" width="146" height="74" alt="Galería de imágenes" rel="fotos"/></a>
<h4><?php echo getGalleryTitle() ?></h4>
<p><?php echo limitContentToShow(getGalleryDescription(), 80) ?></p>
<em><a href="/cms/multimedia/addphotos/<?php echo $GalleryId ?>/">subir</a> | <a href="/cms/multimedia/addgallery/<?php echo $GalleryId ?>/">editar</a> | <a href="<?php echo "cms/delete/gallery/".$GalleryId."/" ?>" title="Eliminar imagen" rel="<?php echo $GalleryId ?>" class="remove_gallery" >borrar</a></em>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<div class="gallery-pag second">
<div class="paginated">
<?php $p->show(); ?>
</div>
</div>
<?php } ?>
<div class="gallery-general-images">
</div>
<ul class="botones">
<li class="mas"><a href="#">Añadir imágenes</a></li>
<li class="del"><a href="#">Borrar galería</a></li>
</ul>
</form>
<script type="text/javascript">
function copyTags(){
var tags = $("#sendtags").val();
var tagsImg = $("#sendtagsimg").val();
var keytagsimg = tags + ',' + tagsImg;
keytagsimg = keytagsimg.replace( /\s+,+\s*/g, ',' ).replace( /,+/g, ',' ).replace( /,+\s+,+/g, ',' ).replace( /,+\s*$/g, '' ).replace( /^\s*,+/g, '' );
$("#keytagsimg").val(keytagsimg);
return false;
}
</script>