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

This Month's Specials

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

   







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

Reply
 
Thread Tools Display Modes
  #1  
Old December 6th, 2003, 02:02 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 PHP Help Needed

So I am trying to spruce up my image mod mirror page... I am running into problems with trying to sort the files to be in alphabetical order (and hopefully be able to include options to sort in other methods as well). No, I am not going to write this to use a database. It does not sort properly, and I have no idea how to make it do so. Yes, there is a lot of theoretical code commented out. The sorting portion begins at this like:

// Sorting that doesn't work. :'S

Here is the code:

http://imagemod.spaceempires.net/indexmda.txt

And here is the script running:

http://imagemod.spaceempires.net/indexmda.php
__________________
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
  #2  
Old December 6th, 2003, 02: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

Will check now.

Edit1:

This is an included file, right.
As I get errors for missing definition of index, numitems, full etc....

Will check further..

Edit2:

Copying the script to my server and the files in the directory (to be sorted) and removing inclusions of header and footer, gives too many errors to even start debugging.
If I'll dig into I ought to have more...
I'll skip all else and just look at the sorting.

[ December 06, 2003, 00:55: Message edited by: Ruatha ]
Reply With Quote
  #3  
Old December 6th, 2003, 02:53 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

I don't get any errors about missing definitions... that, and I don't think it is necessary to explicitly define variables separately to just using them in PHP.

The file is not included in anything.

[ December 06, 2003, 00:54: Message edited by: Imperator Fyron ]
__________________
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
  #4  
Old December 6th, 2003, 02:59 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

Note how there are no errors when it is running under a Linux environment (on the se.net server)...
__________________
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
  #5  
Old December 6th, 2003, 03:05 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

Ok, then I can't explain all the errors.
Anyway, this sorts the names right It seems;

http://pbw.ath.cx/sort.txt

test

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


And that's kind of strange as I haven't altered anything significant.
Can it be the multiarray that messes things up??

Edit: Ahh, I run win server...

[ December 06, 2003, 01:07: Message edited by: Ruatha ]
Reply With Quote
  #6  
Old December 6th, 2003, 03:08 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

Sorting a normal array is not a problem. I could just call the asort() function if that were the case. The problem is in sorting a 2D array.
__________________
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
  #7  
Old December 6th, 2003, 03:09 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

What I've done is to define filenames[array] at the same time as Filearray in the beginning.
And started the counter at 1 instead of zero.

As this work I can't be of any help in rooting out your problem, sorry.

[ December 06, 2003, 01:10: Message edited by: Ruatha ]
Reply With Quote
  #8  
Old December 6th, 2003, 03:10 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

Quote:
Edit: Ahh, I run win server...
Windows and Linux treat code rather differently at times.
__________________
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
  #9  
Old December 6th, 2003, 03:11 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

Quote:
Originally posted by Ruatha:
What I've done is to define filenames[array] at the same time as Filearray in the beginning.
And started the counter at 1 instead of zero.

As this work I can't be of any help in rooting out your problem, sorry.
That does not work, because each filename has 4 other variables that go along with it that must be kept lined up.
__________________
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
  #10  
Old December 6th, 2003, 03:11 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:
Sorting a normal array is not a problem. I could just call the asort() function if that were the case. The problem is in sorting a 2D array.
Yeah, that's what I meant with Multiarray, instead of simple array, my own vocabulary I guess....

How about making a simple 1D array also with only filenamess, and then sort that and let the multiarray (2D) follow in the sorting at the same time;

Define multiarray[1..10][1..10]
filenames_only[1..10]

Sort:
If filename[1]>Filename[2]
{
max=[1]
}

loop it and sort it
{
first filename is filename[max]
first multiarray is multiarray[max]
}


?

[ December 06, 2003, 01:15: Message edited by: Ruatha ]
Reply With Quote
Reply

Bookmarks

Thread Tools
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 On

Forum Jump


All times are GMT -4. The time now is 10:19 AM.


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