pluck
pluck 4.7 out now, download it today!

pluck support forums

for all your questions about the easiest CMS on the planet

You are not logged in.

Announcement

New registrations are disabled for some spam problems. New registrations will be avaliable soon. If you want to help to keep forum away from spam - contact us.
Please post your bug reports on Launchpad.

#1 22-08-2010 23:10:12

adamu
Member
Registered: 16-08-2009
Posts: 25

Album Order

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

#2 23-08-2010 06:56:54

a_bach
developer/module guru
From: Poland
Registered: 24-11-2008
Posts: 439
Website

Re: Album Order

adamu wrote:

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

#3 25-08-2010 21:38:14

adamu
Member
Registered: 16-08-2009
Posts: 25

Re: Album Order

a_bach wrote:

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&amp;page=viewalbum&amp;album=<?php echo $dir; ?>&amp;pageback=<?php echo $current_page_filename; ?>"><?php echo $dir; ?></a>
                </span>
            </td>
        </tr>
    </table>
</div>
<?php
    }
}
?>

Offline

#4 25-08-2010 21:57:21

rfuller
Member
Registered: 27-01-2010
Posts: 49

Re: Album Order

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

#5 26-08-2010 06:21:48

a_bach
developer/module guru
From: Poland
Registered: 24-11-2008
Posts: 439
Website

Re: Album Order

*/

//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&amp;page=viewalbum&amp;album=<?php echo $dir; ?>&amp;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

#6 30-08-2010 16:02:33

adamu
Member
Registered: 16-08-2009
Posts: 25

Re: Album Order

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

#7 30-08-2010 18:05:09

a_bach
developer/module guru
From: Poland
Registered: 24-11-2008
Posts: 439
Website

Re: Album Order

adamu wrote:

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

#8 01-09-2010 21:01:42

adamu
Member
Registered: 16-08-2009
Posts: 25

Re: Album Order

groovy i'll give that a go thanks!

Offline

#9 23-09-2010 13:15:13

tsarmis
Member
Registered: 18-09-2010
Posts: 2

Re: Album Order

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

#10 29-03-2011 07:31:28

ferarg
Member
From: Valencia, Spain
Registered: 21-08-2008
Posts: 21
Website

Re: Album Order

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

Board footer

Powered by FluxBB