• 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.

Instant Gallery ( Latest Uploads )

None of the codes here do not work for me. There may be a problem with the new version 2.5 and this codes ???
 
None of the codes here do not work for me. There may be a problem with the new version 2.5 and this codes ???
 
You should use the bundled class.filelist.php
Can you give a usage example?

EDIT: Nevermind! Usage example below:
PHP:
<pre>
    <?php
    require_once(__CHV_PATH_CLASSES__.'class.filelist.php');
    $mylist = new FileList();
    print_r($mylist);
    ?>
</pre>
 
Incase anyone else still wants to use this method to create a gallery page, create the gallery.php page as instructed in the first post but use the following as the content:

PHP:
<?php if(!defined('access') or !access) die('This file cannot be directly accessed.'); ?>
<?php include_theme_header(); ?>
    <div id="content" class="pages page_gallery">
    <?php
    require_once(__CHV_PATH_CLASSES__.'class.filelist.php');
    $myList = new FileList();
    $myList = $myList->filelist;
 
    foreach($myList as $myEntry){   
        print('<div class="thumbgall"><a href="'.$myEntry['image_shorturl'].'"><img src="'.$myEntry['image_thumb_url'].'" /></a></div>');       
    }
// Uncomment the following to display all possible values
/*
    print("<br><br><br>");
    foreach($myList as $myEntry){       
      foreach($myEntry as $key => $value){   
          print "<br />Array Key = $key :: Value = $value";             
      }           
    }
*/
    ?>
  </div>
<?php include_theme_footer(); ?>
 
Hi Guys,

I've been working on implementing a public gallery based off the look of the admin panel by duplicating the styles
I have a issue where the images on the gallery are limited, but would anyone know how I would go about making it an infinite scroll like the admin panel, or to paginate it?

Here's my working code so far
Code:
<?php if(!defined('access') or !access) die('This file cannot be directly accessed.'); ?>
<?php include_theme_header(); ?>
<link type="text/css" href="/content/themes/Peafowl/style.css" rel="stylesheet">
    <div id="content" class="pages page_gallery">
    <?php
    require_once(__CHV_PATH_CLASSES__.'class.filelist.php');
    $myList = new FileList();
    $myList = $myList->filelist;
 
    foreach($myList as $myEntry){
        print('<div class="list-item" style=""><a class="title link" href="'.$myEntry['image_shorturl'].'" target="_blank">'.$myEntry['image_name'].'.'.$myEntry['image_type'].'</a></span><div class="thumb"><a href="'.$myEntry['image_shorturl'].'"><img src="'.$myEntry['image_thumb_url'].'" alt="" width="110" height="99"><span class="attr">'.$myEntry['image_width'].'x'.$myEntry['image_height'].'</span><span class="size">'.$myEntry['image_size'].'</span></div><div class="date">'.$myEntry['image_date'].'</div></div>');
    }
// Uncomment the following to display all possible values
/*
    print("<br><br><br>");
    foreach($myList as $myEntry){
      foreach($myEntry as $key => $value){
          print "<br />Array Key = $key :: Value = $value";
      }
    }
*/
    ?>
  </div>
<?php include_theme_footer(); ?>
 
Anybody willing to update this code so it looks a bit better?

I would like it to be like the first image and not the 2nd. I did this with paint btw.

I also can't get the last uploaded images to show on the frontpage (index.php) as explained in the startpost. How to fix this with 2.5?

imgup2.png


imgup1.png
 
Incase anyone else still wants to use this method to create a gallery page, create the gallery.php page as instructed in the first post but use the following as the content:

PHP:
<?php if(!defined('access') or !access) die('This file cannot be directly accessed.'); ?>
<?php include_theme_header(); ?>
    <div id="content" class="pages page_gallery">
    <?php
    require_once(__CHV_PATH_CLASSES__.'class.filelist.php');
    $myList = new FileList();
    $myList = $myList->filelist;
 
    foreach($myList as $myEntry){ 
        print('<div class="thumbgall"><a href="'.$myEntry['image_shorturl'].'"><img src="'.$myEntry['image_thumb_url'].'" /></a></div>');     
    }
// Uncomment the following to display all possible values
/*
    print("<br><br><br>");
    foreach($myList as $myEntry){     
      foreach($myEntry as $key => $value){ 
          print "<br />Array Key = $key :: Value = $value";           
      }         
    }
*/
    ?>
  </div>
<?php include_theme_footer(); ?>





Does this list all images in the system or does it stop after so many?
 
Took me 10 minutes to create this :

eXlbZgc.png


Step 1

Create a file named gallery.css in content/your_theme/ and add the following into the file

Code:
.page_gallery .gallery-item {
    margin: 5px;
    padding: 5px;
    border: 1px solid #EEEEEE;
    box-shadow: 3px 3px 3px #888888;
    width: 100px;
    border-radius: 5px;
    float: left;
}
 
.page_gallery .gallery-item h2 {
    margin-top: 0;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
 
.page_gallery .gallery-item .dimension {
    float: left;
    font-size: 10px;
}
 
.page_gallery .gallery-item .size {
    float: right;
    font-size: 10px;
}

Step 2

Create a file named gallery.php in content/your_theme/pages and add the following into the file

PHP:
<?php if(!defined('access') or !access) die('This file cannot be directly accessed.'); ?>
<?php
    include_theme_header();
 
    require_once(__CHV_PATH_CLASSES__.'class.filelist.php');
    $lstImages = new FileList();
   
    print('<div id="content" class="pages page_gallery">
            <h1>Gallery</h1>');
    foreach($lstImages->filelist as $image)
    { 
        print('<div class="gallery-item">
                    <a href="'.$image['image_shorturl'].'">
                        <h2>'.$image['image_name'].'</h2>
                   
                        <img src="'.$image['image_thumb_url'].'" />
                       
                        <span class="dimension">1080x1023</span>
                        <span class="size">'.$image['image_size'].'</span>
                    </a>
                </div>');   
    }
    print('</div>');
   
    include_theme_footer();

Step 3

Open the pages_config.php file found into the content/your_theme/pages/ folder

AFTER
PHP:
'contact'    => array('live' => true, 'title' => 'Contact'),

ADD

PHP:
'gallery'    => array('live' => true, 'title' => 'Gallery'),



Step 4

Open the header.php file found into the content/your_theme/ folder

AFTER
PHP:
<?php if(is_viewer()) : ?>
<meta name="twitter:card" content="photo">
<meta name="twitter:image" content="<?php show_img_url(); ?>">
<?php endif; ?>

ADD

PHP:
<link type="text/css" href="<?php print(__CHV_URL_THEME__); ?>gallery.css" rel="stylesheet" />


AND YOU ARE DONE :)
 
Awesome dude!! Looks great and works perfectly. This should be added to the topic start, faq etc :D The only thing missing is the latest uploads feature, which the other gallery code had. This displayed a couple images on the bottom of the start/home page. See my site it shows latest uploads but no images. Any chance you could add that? Would like to display a couple images side by side (1 horizontal row and have it link to the gallery page)

Last but not least the only question/issue that I have left in order to have a fully 100% gallery site is :http://chevereto.com/community/threads/dutch-nl-layout-problem.3854/

Hoping you can assist with these last two points, seems like you are very good with coding etc.
 
Copy paste the code that you are using for last upload to look what you did.
 
Awesome dude!! Looks great and works perfectly. This should be added to the topic start, faq etc :D The only thing missing is the latest uploads feature, which the other gallery code had. This displayed a couple images on the bottom of the start/home page. See my site it shows latest uploads but no images. Any chance you could add that? Would like to display a couple images side by side (1 horizontal row and have it link to the gallery page)

Last but not least the only question/issue that I have left in order to have a fully 100% gallery site is :http://chevereto.com/community/threads/dutch-nl-layout-problem.3854/

Hoping you can assist with these last two points, seems like you are very good with coding etc.


Open the index.php file found into the content/your_theme/ folder


AFTER
Code:
</form>

ADD

PHP:
<?php
            require_once(__CHV_PATH_CLASSES__.'class.filelist.php');
            $lstImages = new FileList('all', 'date_desc', 5);
   
            print('<div class="page_gallery" style="margin: 20px auto; width: 610px;">
                    <h1>Recent Uploads</h1>');
            foreach($lstImages->filelist as $image)
            { 
                print('<div class="gallery-item">
                            <a href="'.__CHV_RELATIVE_ROOT__.'gallery">
                                <h2>'.$image['image_name'].'</h2>
                   
                                <img src="'.$image['image_thumb_url'].'" />
                       
                                <span class="dimension">1080x1023</span>
                                <span class="size">'.$image['image_size'].'</span>
                            </a>
                        </div>');   
            }
            print('</div>');
            ?>
 
I'm using the code Danny made and I'm getting this error:
f62a80be53cc9b720d87a4f9cb53e4d7.png

Also this error on the actual gallery.php page:
Warning: Missing argument 1 for FileList::__construct(), called in /var/www/html/content/themes/plain/pages/gallery.php on line 6 and defined in /var/www/html/includes/classes/class.filelist.php on line 38 Warning: Missing argument 2 for FileList::__construct(), called in /var/www/html/content/themes/plain/pages/gallery.php on line 6 and defined in /var/www/html/includes/classes/class.filelist.php on line 38 Warning: Missing argument 3 for FileList::__construct(), called in /var/www/html/content/themes/plain/pages/gallery.php on line 6 and defined in /var/www/html/includes/classes/class.filelist.php on line 38 Warning: Missing argument 4 for FileList::__construct(), called in /var/www/html/content/themes/plain/pages/gallery.php on line 6 and defined in /var/www/html/includes/classes/class.filelist.php on line 38
 
Hmm I believe that my constructor is wrong in includes/classes/class.filelist.php.

This:
PHP:
__construct($type, $order_sort, $limit, $keyword)

Should be this:
PHP:
__construct($type='', $order_sort='', $limit='', $keyword='')

And even better will be to call methods like $Filelist->setType("jpg") for instance. Well, try changing the construct and it will work for you. I will definitely improve this class for 3.0.
 
Back
Top