.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

Reply
 
Thread Tools Display Modes
  #21  
Old December 6th, 2003, 03:32 AM
Ruatha's Avatar

Ruatha Ruatha is offline
Major General
 
Join Date: May 2002
Location: Linghem, Östergötland, Sweden
Posts: 2,255
Thanks: 0
Thanked 0 Times in 0 Posts
Ruatha is on a distinguished road
Default Re: PHP Help Needed

Can there somwhow be a character zero involved in the sorting, as I guess the string of the filename starts with character one.
So if it tried to sort with a non existant character it would get a random one??

What if you try to define that it should sort by characters 1-3 in the filenmane?

Very Wild guess!!
Reply With Quote
  #22  
Old December 6th, 2003, 03:38 AM
Ruatha's Avatar

Ruatha Ruatha is offline
Major General
 
Join Date: May 2002
Location: Linghem, Östergötland, Sweden
Posts: 2,255
Thanks: 0
Thanked 0 Times in 0 Posts
Ruatha is on a distinguished road
Default Re: PHP Help Needed

How about case?
Transform all to lowercase first before sorting?

Edit:

array_multisort(StrToLower($fileArray));


Or rather make it to lowercase when reading in the files, as the above propably won't work.

[ December 06, 2003, 01:41: Message edited by: Ruatha ]
Reply With Quote
  #23  
Old December 6th, 2003, 03:46 AM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: PHP Help Needed

They are all lowercase to begin with.
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote
  #24  
Old December 6th, 2003, 04:15 AM
Ruatha's Avatar

Ruatha Ruatha is offline
Major General
 
Join Date: May 2002
Location: Linghem, Östergötland, Sweden
Posts: 2,255
Thanks: 0
Thanked 0 Times in 0 Posts
Ruatha is on a distinguished road
Default Re: PHP Help Needed

Here is the result from running the original file you posted on my server:

http://pbw.ath.cx/sort2.php

As you can see, it sorts them right but it doesn't display the Last file.
(Ignore all the errors and skip to the bottom)

(I've downloaded all the zip files.)

So it seems to perhaps be something with linux filesystem??

[ December 06, 2003, 02:20: Message edited by: Ruatha ]
Reply With Quote
  #25  
Old December 6th, 2003, 06:51 AM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: PHP Help Needed

Could be. I think all of those errors are due to misconfigurations in your PHP files... I only used standard PHP functions and such, and did not define anything with any names given by the errors.
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote
  #26  
Old December 6th, 2003, 09:53 AM
Ruatha's Avatar

Ruatha Ruatha is offline
Major General
 
Join Date: May 2002
Location: Linghem, Östergötland, Sweden
Posts: 2,255
Thanks: 0
Thanked 0 Times in 0 Posts
Ruatha is on a distinguished road
Default Re: PHP Help Needed

Quote:
Originally posted by Imperator Fyron:
Could be. I think all of those errors are due to misconfigurations in your PHP files... I only used standard PHP functions and such, and did not define anything with any names given by the errors.
I think it's the parameters in stristr that needs to be surrounded by quotes for the errors to disappear.
I have standrad settings for most PHP settings except file sizes and magic quotes.

[ December 06, 2003, 07:55: Message edited by: Ruatha ]
Reply With Quote
  #27  
Old December 6th, 2003, 09:57 AM
Asmala's Avatar

Asmala Asmala is offline
Captain
 
Join Date: Nov 2002
Location: Finland
Posts: 864
Thanks: 0
Thanked 0 Times in 0 Posts
Asmala is on a distinguished road
Default Re: PHP Help Needed

Quote:
Originally posted by Imperator Fyron:
I fail to see a problem with this line:

array_multisort($fileArray, SORT_ASC, SORT_STRING);
You have a wrong parameter. Array_multisort requires an array, not a multi-dimensional array. You have to modify $fileArray a bit. Now it's $fileArray[$counter][0], change it to $fileArray[0][$counter]. Then you can sort it easily. For example:

array_multisort($fileArray[0], SORT_ASC, SORT_STRING);//sorts by names.

Have you noticed when you use $file = readdir($dir_handle) you get first "." and then ".." and but then real filenames.
__________________
'The surest sign that there is intelligent life elsewhere in the universe is that none of it has tried to contact us.' Calvin and Hobbes
Are you tough enough to be the King of the Hill?
Reply With Quote
  #28  
Old December 7th, 2003, 02:56 AM
Ruatha's Avatar

Ruatha Ruatha is offline
Major General
 
Join Date: May 2002
Location: Linghem, Östergötland, Sweden
Posts: 2,255
Thanks: 0
Thanked 0 Times in 0 Posts
Ruatha is on a distinguished road
Default Re: PHP Help Needed

Quote:
Originally posted by Asmala:
quote:
Originally posted by Imperator Fyron:
I fail to see a problem with this line:

array_multisort($fileArray, SORT_ASC, SORT_STRING);
You have a wrong parameter. Array_multisort requires an array, not a multi-dimensional array. You have to modify $fileArray a bit. Now it's $fileArray[$counter][0], change it to $fileArray[0][$counter]. Then you can sort it easily. For example:

array_multisort($fileArray[0], SORT_ASC, SORT_STRING);//sorts by names.

Have you noticed when you use $file = readdir($dir_handle) you get first "." and then ".." and but then real filenames.

Yep, it's the current directory "." and the directory above ".."
as in ms dos;
CD..
Reply With Quote
  #29  
Old December 13th, 2003, 11:23 PM
Asmala's Avatar

Asmala Asmala is offline
Captain
 
Join Date: Nov 2002
Location: Finland
Posts: 864
Thanks: 0
Thanked 0 Times in 0 Posts
Asmala is on a distinguished road
Default Re: PHP Help Needed

Fyron, did you get the sorting working or did you lost interest to the whole thing?
__________________
'The surest sign that there is intelligent life elsewhere in the universe is that none of it has tried to contact us.' Calvin and Hobbes
Are you tough enough to be the King of the Hill?
Reply With Quote
Reply

Bookmarks


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 On

Forum Jump


All times are GMT -4. The time now is 05:42 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.