• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

[Beta] Gallery

Kkeith29!! Thanks for making that fix! If you can, please contact me, as there are a few other adjustments I would like to make to the gallery, and I would be more than pleased to hire you to do that!
 
I sent to the server file gallery.php and a few photos. Later I removed the photos and when I went to gallery.php were further these pictures as before, but when clicked on, any of it showed a message that the photo does not exist.
Is it possible to do so to this gallery, showed only those pictures that are on the server?

sorry for my English...
 
kingpin said:
thanks very good but where is gallery.php ? :)

It is in the first post. first code block, Here i quoted it.
3lit3 said:
Code:
<?
require('engine.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/url]">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?=LANG;?>" lang="<?=LANG;?>">
<head>
<meta name="generator" content="Chevereto <?=SC_VERSION;?>" /><!-- Dejar para estadisticas por favor! -->
<title><? echo $titulo.' '.APP_NAME;?> - <?=TAG_LINE;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="content-language" content="<?=LANG;?>" />
<link href="<?=URL_SCRIPT;?>estilo.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="<?=PATH_SCRIPT;?>favicon.ico" type="image/x-icon" />
</head>
<body>
<div id="top">
    <div id="logo">
      <a href="<?=URL_SCRIPT;?>"><img src="<?=PATH_SCRIPT;?>site-img/logo.png" alt="<?=APP_NAME;?>" /></a>
    </div>
    <div id="tagline"><?=TAG_LINE;?></div><div id="limite">JPG PNG BMP GIF <span>Max.<?=$max_mb;?>Mb</span></div>
</div>
<div id="contenido">
<div id="selector_up">
</div> 
<div align="center">
      <?php
      // credits to kkeith29
     // by desiboy aka 3lite
      $thispage = 'gallery.php';
      $imageDir = 'thumbs/';
      $perPage = 50; //total images to display per page
      $perRow = 5; //total images per row
      if ( isset( $_GET['reset'] ) ) {
      unset( $_SESSION['chunks'] );
      }
      if ( !isset( $_SESSION['chunks'] ) ) {
      if ( is_dir( $imageDir ) ) {
      if ( $dir = opendir( $imageDir ) ) {
      while ( ( $file = readdir( $dir ) ) !== false ) {
      if ( $file !== '.' && $file !== '..' ) {
      $images[] = $file;
      }
      }
      closedir( $dir );
      }
      else {
      die("Unable to read directory - {$imageDir}");
      }
      }
      shuffle( $images );
      $_SESSION['chunks'] = array_chunk( $images,$perPage );
      }
      $page = 1;
      if ( isset( $_GET['page'] ) && $_GET['page'] > 0 ) {
      $page = (int) $_GET['page'];
      }
       $images[] = $file;
      $chunk =& $_SESSION['chunks'];
      $total = count( $chunk );
      $images[] = $file;
      if ( isset( $chunk[$page-1] ) ) {
      $images = $chunk[$page-1];
      $html = "<table cellspacing=\"0\" cellpadding=\"3\">\n\t<tr>\n";
      $i = 0;
      foreach( $images as $image ) {
      if ( $i == $perRow ) {
      $html .= "\t</tr>\n\t<tr>\n";
      $i = 0;
      }
      $html .= "\t\t<td><a href=\"/?v={$image}\"><img src=\"{$imageDir}{$image}\" /></a></td>\n";
      $i++;
      }
      $html .= "\t<tr>\n";
      if ( $total > 1 ) {
      $nav = '';
      if ( $page > 1 ) {
      $nav .= "<a href=\"{$thispage}?page=1\">[FIRST]</a><a href=\"{$thispage}?page=" . ( $page - 1 ) . "\">[PREV]</a>";
      }
      $i = 1;
      while( $i < $total + 1 ) {
      $nav .= "<a href=\"{$thispage}?page={$i}\">[{$i}]</a>";
      $i++;
      }
      if ( $page < $total ) {
      $nav .= "<a href=\"{$thispage}?page=" . ( $page + 1 ) . "\">[NEXT]</a><a href=\"{$thispage}?page={$total}\">[LAST]</a>";
      }
      $html .= "\t<tr>\n\t\t<td colspan=\"{$perRow}\">{$nav}</td>\n\t</tr>\n";
      }
      $html .= "</table><br /><br /><a href=\"{$thispage}?reset=true\">Shuffle Images</a>";
      echo $html;
      }
      ?></div>
    
</div>

<div id="foot"><div class="foot-d2"><?=APP_NAME;?> - <a href="gallery.php">Gallery</a> - Powered by <a href="http://chevereto.com/" target="_blank">Chevereto</a></div></div>

</body>
</html>
 
right now when viewing my gallery all the images open, maybe i've missed something, but how can I get it to disply 10 images per page?
 
tenguna una pregunta edite este imagen per como y que tengo que editar para entrar en el menu Gallery porque no me aparece ?

tabsen.png



I want to put the button Gallery on the meniu of the script but i`dont know wath to edit pleas can you help me ?

 
Can someone attach a working copy of the gallery.php with the sorting code?

I can't make it work.

Thank you
 
I was really interested in having something like this on my main page. Either random images or the latest ones. It was actually quite easy to do. For those of you without the slightest bit of php sense, copy/paste this where you would like it to appear:

Code:
      <?php
      // credits to kkeith29
     // by desiboy aka 3lite
      $thispage = 'gallery.php';
      $imageDir = 'thumbs/';
      $perPage = 50; //total images to display per page
      $perRow = 5; //total images per row
      if ( isset( $_GET['reset'] ) ) {
      unset( $_SESSION['chunks'] );
      }
      if ( !isset( $_SESSION['chunks'] ) ) {
      if ( is_dir( $imageDir ) ) {
      if ( $dir = opendir( $imageDir ) ) {
      while ( ( $file = readdir( $dir ) ) !== false ) {
      if ( $file !== '.' && $file !== '..' ) {
      $images[] = $file;
      }
      }
      closedir( $dir );
      }
      else {
      die("Unable to read directory - {$imageDir}");
      }
      }
      shuffle( $images );
      $_SESSION['chunks'] = array_chunk( $images,$perPage );
      }
      $page = 1;
      if ( isset( $_GET['page'] ) && $_GET['page'] > 0 ) {
      $page = (int) $_GET['page'];
      }
       $images[] = $file;
      $chunk =& $_SESSION['chunks'];
      $total = count( $chunk );
      $images[] = $file;
      if ( isset( $chunk[$page-1] ) ) {
      $images = $chunk[$page-1];
      $html = "<table cellspacing=\"0\" cellpadding=\"3\">\n\t<tr>\n";
      $i = 0;
      foreach( $images as $image ) {
      if ( $i == $perRow ) {
      $html .= "\t</tr>\n\t<tr>\n";
      $i = 0;
      }
      $html .= "\t\t<td><a href=\"/?v={$image}\"><img src=\"{$imageDir}{$image}\" /></a></td>\n";
      $i++;
      }
      $html .= "\t<tr>\n";
      if ( $total > 1 ) {
      $nav = '';
      if ( $page > 1 ) {
      $nav .= "<a href=\"{$thispage}?page=1\">[FIRST]</a><a href=\"{$thispage}?page=" . ( $page - 1 ) . "\">[PREV]</a>";
      }
      $i = 1;
      while( $i < $total + 1 ) {
      $nav .= "<a href=\"{$thispage}?page={$i}\">[{$i}]</a>";
      $i++;
      }
      if ( $page < $total ) {
      $nav .= "<a href=\"{$thispage}?page=" . ( $page + 1 ) . "\">[NEXT]</a><a href=\"{$thispage}?page={$total}\">[LAST]</a>";
      }
      $html .= "\t<tr>\n\t\t<td colspan=\"{$perRow}\">{$nav}</td>\n\t</tr>\n";
      }
      $html .= "</table><br /><br /><a href=\"{$thispage}?reset=true\">Shuffle Images</a>";
      echo $html;
      }
      ?>

Dumb I know, cause anyone can figure it out. But it works like a charm. I updated it to only show 5 but this is for Random images. I'm using the code for the latest images.

All you literally have to do is copy the php code out of what they have and paste it in index.php whereever you like.
 
thanks for this one underthegun but how to delete the next and shuffle thing? i only need the 5 images to show in my index page.. hope you can help me.. :) and also how to resize the random image>?
 
Back
Top