Jump to content

Recommended Posts

Posted

Hi guys

 

Webman gave me a little php script that will display the contents of a folder in a nice gui (thanks for that webman).

 

When i use this on an Xampp install it works a treat when i use it on a IIS install i doesn't work.

 

I was wondering if anyone can point out as to why not. I have posted my php.ini file and a copy of the script.

 

Thanks allot

php.txt

index.txt

Posted
its probably due to webman's anti-windows tendancies.....:D

 

:D i would rather use apache myself but been forced into IIS.

Posted

Yer its installed (that is why i have attached the php config file) and the server running a Joomla site.

 

Thanks

 

Z

Posted

Nifty script btw - all the images are encoded inside it and generated on the fly.

 

Your fix:

 

in php.ini

short_open_tag = [Off to On]

 

tada.

Posted

@Domino - Oi! :D lol

 

Just to make it clear I didn't create the script; I found it a while ago somewhere on the web, and haven't been able to find or remember the original source.

Posted
Nifty script btw - all the images are encoded inside it and generated on the fly.

 

Your fix:

 

in php.ini

short_open_tag = [Off to On]

 

tada.

 

Thanks going to give that a try tomorrow.

 

@Domino - Oi! :D lol

 

Just to make it clear I didn't create the script; I found it a while ago somewhere on the web, and haven't been able to find or remember the original source.

 

Well thanks for forwarding it :)

Posted
Nifty script btw - all the images are encoded inside it and generated on the fly.

 

Your fix:

 

in php.ini

short_open_tag = [Off to On]

 

tada.

 

Worked a treat, thanks

 

Would anyone know how to change the order it lists the items in descending order?

 

Thanks

Posted
Errr, this relating to what? arrays? mysql? the ini file? some code snippet might be handy?

 

What? there is no datbase or anything the index.php file is as it is.

 

Z

Posted (edited)

Ah right, didn't spot that. I would simply traverse the array starting from the other way around.

 

Without actually installing or testing it I'd say you need to re-arrange the loop:

 

for(var i=a;i

 

Also while this is a nice little script, variable naming is pretty ugly and I cannot be bothered to decypher it.

O_o

 

You'dd need to make the predicate become the intialisation i=_files.length + _dirs.length and the addition become subtraction:

i-- and i>0

 

but not sure what the i

 

Thank god I rolled my own piece of PHP for doing this sort of thing :]

 

Edit:

Actually, from delving a little more seems he's already rolled a sort function for different fields (name, size, date e.t.c) in there. Why do you actually need to modify anything? or does it need to be descending by default? o_O

Edited by Friez
Posted
No prob, maybe I'm talking nonesense (just glanced over the code, not really tried it out). It looks like it's been obfusicated a bit, either that or he uses really horrific naming conventions so it's not that easy to pick apart in a rush (although I could probably totally figure it out if I sat down and actually looked at it).
Posted
Would anyone know how to change the order it lists the items in descending order?

 

Does PHP have an array.sort() or similar?

 

--

David Hicks

Posted
Does PHP have an array.sort() or similar?

 

--

David Hicks

 

Several!

 

sort Sort an array

rsort This function sorts an array in reverse order (highest to lowest).

 

asort Sort an array and maintain index association

arsort Sort an array in reverse order and maintain index association

 

ksort Sort an array by key

krsort Sort an array by key in reverse order

 

And if you want to roll your own:

 

uasort Sort an array with a user-defined comparison function and maintain index association

uksort Sort an array by keys using a user-defined comparison function

usort Sort an array by values using a user-defined comparison function

Posted

Thanks guys i am going to have a play tomorrow.

 

Just another question, does anyone know how to make it not display hidden folders?

 

Thanks

 

Z

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...