Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-04-2007, 01:21 PM
pinkish is offline pinkish
Registered User

Join Date: Dec 2007
Posts: 3

what is the order of the albums and pictures?

Hi,

I've installed and customized phAlbum (i am pretty good with HTML). The only thing I don't know how to do is to put the albums in a certain order.

I've tried renaming them:
01.Pics_blabla
02.Bla

but it doesn't seem to work.

What I can see is that the order in which the folders/images are picked up is NOT random, because it is the SAME order on every computer I've loaded it.

The question is: the order in which phAlbum reads and displays all the files and folders is based on what exactly?

Thank you!
Reply With Quote
  #2  
Old 12-04-2007, 08:11 PM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,919

To be honest, there is no exact order. To put the files in order you will have to change the code.... look for this bit of code (Starts near line 514):

PHP Code:
//Lets get some images!!

$dir=@opendir($full_server.$album);

//Loop through them all ;).

while($file=@readdir($dir)) { 
and replace it with this:

PHP Code:
//Lets get some images!!
$dir $full_server.$album.'*';

//Loop through them all ;).

foreach(glob($dir) as $file){
    
$file substr($filestrlen($dir)-1); 
That should order them alphabetically.
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #3  
Old 12-05-2007, 02:56 AM
pinkish is offline pinkish
Registered User

Join Date: Dec 2007
Posts: 3

Hey, man! I would like to thank you for your reply! It's absolutely fantastic for me to be able to use this software!

Again, thanx for the code!
Reply With Quote
  #4  
Old 12-05-2007, 03:07 AM
pinkish is offline pinkish
Registered User

Join Date: Dec 2007
Posts: 3

Based on your script, I can arrange them in any order, by doing this:

PHP Code:
$find=array("_","0","1","2","3","4","5","6","7","8","9");
$replace=array(" "," "," "," "," "," "," "," "," "," "," "); 
and then naming the folders like this:

0899_Folder_I_want_first
0900_Second_folder
0901_3rd_folder

I know it's a newbie thing but it works like a charm!

PS: i've also removed the code for the trailing directories, cos i didn't want that and they looked ugly with all the numbers

Last edited by pinkish; 12-05-2007 at 03:17 AM.
Reply With Quote
  #5  
Old 01-19-2008, 04:06 PM
Pirata is offline Pirata
Registered User

Join Date: Jan 2008
Posts: 1

Hey Scott, I tried your code but it doesn't work. When I want to view my photos or directories, I always get the same error: "No images to display in this album. Please pick another album."
Do you got any solution for this or do you have any other code that should work?

Thanks!

Pirata
Reply With Quote
  #6  
Old 03-05-2008, 04:34 PM
mushy is offline mushy
Registered User

Join Date: Mar 2008
Posts: 1

Quote:
Originally posted by pinkish
[B]Based on your script, I can arrange them in any order, by doing this:

PHP Code:
$find=array("_","0","1","2","3","4","5","6","7","8","9");
$replace=array(" "," "," "," "," "," "," "," "," "," "," "); 
This is cool for the folder names and images names. But the folder navigation at top doesn't replace it (i.e. .ucwords($folder[$i]). remain unaffected).


Can someone will help me with that please?
Reply With Quote
  #7  
Old 10-26-2013, 07:45 AM
merc07 is offline merc07
Registered User

Join Date: Oct 2013
Posts: 2

Is there a simple way to reverse the order so it will display the most recent images first when the file name is the image date / time ?

Thanks
Adam


Quote:
Originally Posted by Scott View Post
To be honest, there is no exact order. To put the files in order you will have to change the code.... look for this bit of code (Starts near line 514):

PHP Code:
//Lets get some images!!

$dir=@opendir($full_server.$album);

//Loop through them all ;).

while($file=@readdir($dir)) { 
and replace it with this:

PHP Code:
//Lets get some images!!
$dir $full_server.$album.'*';

//Loop through them all ;).

foreach(glob($dir) as $file){
    
$file substr($filestrlen($dir)-1); 
That should order them alphabetically.
Reply With Quote
  #8  
Old 10-26-2013, 08:21 AM
merc07 is offline merc07
Registered User

Join Date: Oct 2013
Posts: 2

Sorted it using rsort..

//Lets get some images!!
$dir = $full_server.$album.'*';
//Loop through them all .
$all_files = (glob($dir));
rsort($all_files);
foreach($all_files as $file){

Thanks
Adam


Quote:
Originally Posted by Scott View Post
To be honest, there is no exact order. To put the files in order you will have to change the code.... look for this bit of code (Starts near line 514):

PHP Code:
//Lets get some images!!

$dir=@opendir($full_server.$album);

//Loop through them all ;).

while($file=@readdir($dir)) { 
and replace it with this:

PHP Code:
//Lets get some images!!
$dir $full_server.$album.'*';

//Loop through them all ;).

foreach(glob($dir) as $file){
    
$file substr($filestrlen($dir)-1); 
That should order them alphabetically.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHAlbum modified to display all albums contents at once sixer phphq.Net Forums 0 03-02-2010 08:20 AM
Got 3 Albums Out Now! Troy General Chat 3 11-05-2007 04:49 PM
The Order is recruiting cyclops Gaming Talk 0 01-04-2005 04:27 AM
Big 'Order' Mr_ReAp Sigs and Graphics 4 05-26-2004 09:35 AM
upgrate on order... finally Steve Hardware and Software 23 04-14-2004 10:50 AM


All times are GMT -5. The time now is 02:30 PM.




Powered by vBulletin®