FN-GM Posted August 11, 2008 Posted August 11, 2008 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 allotphp.txtindex.txt
Domino Posted August 11, 2008 Posted August 11, 2008 its probably due to webman's anti-windows tendancies.....
FN-GM Posted August 12, 2008 Author Posted August 12, 2008 its probably due to webman's anti-windows tendancies..... i would rather use apache myself but been forced into IIS.
Friez Posted August 14, 2008 Posted August 14, 2008 Is PHP installed for IIS is the obvious question? Acid test: <?php phpinfo(); ?>
FN-GM Posted August 14, 2008 Author Posted August 14, 2008 Yer its installed (that is why i have attached the php config file) and the server running a Joomla site. Thanks Z
kesomir Posted August 14, 2008 Posted August 14, 2008 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.
webman Posted August 14, 2008 Posted August 14, 2008 @Domino - Oi! 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.
FN-GM Posted August 14, 2008 Author Posted August 14, 2008 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! 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
FN-GM Posted August 15, 2008 Author Posted August 15, 2008 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
Friez Posted August 15, 2008 Posted August 15, 2008 Errr, this relating to what? arrays? mysql? the ini file? some code snippet might be handy?
FN-GM Posted August 15, 2008 Author Posted August 15, 2008 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
Friez Posted August 15, 2008 Posted August 15, 2008 (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 August 15, 2008 by Friez
FN-GM Posted August 15, 2008 Author Posted August 15, 2008 That post up there didn't mean to sound sharp
Friez Posted August 15, 2008 Posted August 15, 2008 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).
dhicks Posted August 15, 2008 Posted August 15, 2008 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
Friez Posted August 15, 2008 Posted August 15, 2008 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
FN-GM Posted August 19, 2008 Author Posted August 19, 2008 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now