You are not logged in.
Pages: 1
couldnt find any other threads or info about this but is there any way to have the gallery list appear in whatever order you choose rather than alphabetically?
Offline
couldnt find any other threads or info about this but is there any way to have the gallery list appear in whatever order you choose rather than alphabetically?
file: /data/modules/albums/pages_site/albums_include.php
Find $dir_handle
Now create manulay your albums list like:
$albums = arrayy( 'data/settings/modules/albums/name1', 'data/settings/modules/albums/name2'...).
Then:
foreach ($albums as $dir) {
?>
(here your div claass="album")
<?php
}
end of file
A_Bach
Offline
foreach ($albums as $dir) {
?>(here your div claass="album")
<?php
}
hey thanks for replying, still not 100% sure where that stuff goes??
i've currently got
*/
//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();
}
//Open the module-folder
$dir_handle = @opendir('data/settings/modules/albums') or die('Unable to open data/modules. Check if it\'s readable.');
//Loop through dirs
while ($dir = readdir($albums = arrayy( 'data/settings/modules/albums/Weddings', 'data/settings/modules/albums/Cards and Occasions', 'data/settings/modules/albums/Vintage') {
if(file_exists('data/settings/modules/albums/'.$dir.'/thumb/image1.jpg')) {
?>
<div class="album2" style="margin: 1px; padding: 1px; ">
<table>
<tr>
<td><img alt="<?php echo $dir; ?>" src="data/modules/albums/pages_admin/albums_getimage.php?image=<?php echo $dir; ?>/thumb/image1.jpg" /></td>
<td>
<span style="font-size: 12pt">
<a href="?module=albums&page=viewalbum&album=<?php echo $dir; ?>&pageback=<?php echo $current_page_filename; ?>"><?php echo $dir; ?></a>
</span>
</td>
</tr>
</table>
</div>
<?php
}
}
?>
Offline
adamu
a_back was telling you to go to the albums_include.php file by following the folder structure he had stated, he even gave you the order to find it.
This is the folders he told you - in this order you will get to the file to make the changes
data/modules/albums/pages_site/albums_include.php
bob
Last edited by rfuller (25-08-2010 22:00:08)
Offline
*/
//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();
}
$albums = arrayy( 'name1', 'name2', 'name3');
foreach ($albums as $dir) {
if(file_exists('data/settings/modules/albums/'.$dir.'/thumb/image1.jpg')) {
?>
<div class="album2" style="margin: 1px; padding: 1px; ">
<table>
<tr>
<td><img alt="<?php echo $dir; ?>" src="data/modules/albums/pages_admin/albums_getimage.php?image=<?php echo $dir; ?>/thumb/image1.jpg" /></td>
<td>
<span style="font-size: 12pt">
<a href="?module=albums&page=viewalbum&album=<?php echo $dir; ?>&pageback=<?php echo $current_page_filename; ?>"><?php echo $dir; ?></a>
</span>
</td>
</tr>
</table>
</div>
<?php
}
}
?>Last edited by a_bach (01-09-2010 21:15:47)
Offline
thanks bob, i had already found the file, i even posted the contents of it.
a_bach, i'm getting an error now after using that code above you posted
Fatal error: Call to undefined function arrayy() in /home/fhlinux010/a/arbeecards.co.uk/user/htdocs/arbeecards/data/modules/albums/pages_site/albums_include.php on line 23
any idea why this is?
thanks
Offline
thanks bob, i had already found the file, i even posted the contents of it.
a_bach, i'm getting an error now after using that code above you posted
Fatal error: Call to undefined function arrayy() in /home/fhlinux010/a/arbeecards.co.uk/user/htdocs/arbeecards/data/modules/albums/pages_site/albums_include.php on line 23
any idea why this is?
thanks
My mistake - one letter too much. Should be array(
With only one 'y'.
A_Bach
Offline
groovy i'll give that a go thanks!
Offline
As an alternative, cause my server for some reason does not return the list correctly i use:
//Open the module-folder
$dir_handle = @opendir('data/settings/modules/albums') or die('Unable to open data/modules. Check if it\'s readable.');
$albumfolders = scandir('data/settings/modules/albums') or die('Unable to open data/modules. Check if it\'s readable.');
//Loop through dirs
foreach($albumfolders as $dir) {
if(file_exists('data/settings/modules/albums/'.$dir.'/thumb/image1.jpg')) {
?>scandir() has option for ascending or descending order
Offline
Hi, we change the code of the album module to order alphabetically the albums.
You can download the new code here:
http://www.box.net/shared/rpztxc3dfp
Access in GitHUB code
https://github.com/serinformaticos/Pluck-Album-Module
Last edited by ferarg (19-09-2011 09:01:34)
Offline
Pages: 1