You are not logged in.
Pages: 1
Hello
I have small problem with orfer of album list.
http://foto-dalux.com/4.okladki.php
At the bottom of page you can see list of active albums
changed in albums_include.php:
//Loop through dirs
while ($dir = readdir($dir_handle)) {
if(file_exists('data/settings/modules/albums/'.$dir.'/thumb/image1.jpg')) {
?>
<div class="album">
<span class="album-info">
<a href="albums,<?php echo $dir; ?>,<?php echo $current_page_filename; ?>" title="album <?php echo $dir; ?>"><?php echo $dir; ?></a>
</span>
</div>
<?php
}
}And this list on page have wrong order. How to fix it ?
Offline
You will have to read the albums with read_dir_contents, use natsort on the dirs, and loop thought and display them with foreach.
Offline
You will have to read the albums with read_dir_contents, use natsort on the dirs, and loop thought and display them with foreach.
I made it... but little in diffrent way.
file pages_site/albums_include.php
<?php
/*
* This file is part of pluck, the easy content management system
* Copyright (c) somp (www.somp.nl)
* http://www.pluck-cms.org
* Pluck is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* See docs/COPYING for the complete license.
*/
//Make sure the file isn't accessed directly
if((!ereg('index.php', $_SERVER['SCRIPT_FILENAME'])) && (!ereg('admin.php', $_SERVER['SCRIPT_FILENAME'])) && (!ereg('install.php', $_SERVER['SCRIPT_FILENAME'])) && (!ereg('login.php', $_SERVER['SCRIPT_FILENAME']))){
//Give out an "access denied" error
echo 'access denied';
//Block all other code
exit();
}
//Loop through dirs
$temp = scandir('data/settings/modules/albums');
natsort($temp);
foreach ($temp as $tempes) {
if(file_exists('data/settings/modules/albums/'.$tempes.'/thumb/image1.jpg')) {
?>
<div class="album">
<span class="album-info">
<a href="albums,<?php echo $tempes; ?>,<?php echo $current_page_filename; ?>" title="album <?php echo $tempes; ?>"><?php echo $tempes; ?></a>
</span>
</div>
<?php
}
}
?>And site http://foto-dalux.com/4.okladki.php is working good.
This work with pluck 4.6.2
A_Bach
Offline
Pages: 1