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:
Can you give a usage example?You should use the bundled class.filelist.php
<pre>
<?php
require_once(__CHV_PATH_CLASSES__.'class.filelist.php');
$mylist = new FileList();
print_r($mylist);
?>
</pre>
<?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(); ?>
<?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(); ?>
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(); ?>
.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;
}
<?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();
'contact' => array('live' => true, 'title' => 'Contact'),
'gallery' => array('live' => true, 'title' => 'Gallery'),
<?php if(is_viewer()) : ?>
<meta name="twitter:card" content="photo">
<meta name="twitter:image" content="<?php show_img_url(); ?>">
<?php endif; ?>
<link type="text/css" href="<?php print(__CHV_URL_THEME__); ?>gallery.css" rel="stylesheet" />
Awesome dude!! Looks great and works perfectly. This should be added to the topic start, faq etc 😀 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.
</form>
<?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>');
?>
__construct($type, $order_sort, $limit, $keyword)
__construct($type='', $order_sort='', $limit='', $keyword='')