Jump to content

Archived

This topic is now archived and is closed to further replies.

darkcarnival

displaying folders in a folder

Recommended Posts

hi,

I want to improve a gallery script i have and what i want to do is have each folder be its own category, but how do i do that?

thanks :)

Share this post


Link to post
Share on other sites
set it up in an array. and call the information, set a letter for each one, then you can call tehm at will or cycle them.

Share this post


Link to post
Share on other sites
I just got into arrays, you can set variables into an array and have each one be able to be called with a number, you could write a small program to have the program cycle through the arrays, like a loop function or something.

[a href=\"http://www.hudzilla.org/phpbook/read.php/5_2_0\" target=\"_blank\"]http://www.hudzilla.org/phpbook/read.php/5_2_0[/a]
this and the tutorial before and after this.

Share this post


Link to post
Share on other sites
ok i see your point ;)

my question i guess was more or less on how to find the folders than how to loop it all.

i mean i tried to do this but i only see a bunch of dots. any idea on how to get the folders in a folder would make my day :)

Share this post


Link to post
Share on other sites
copy and paste them into another folder I guess, not sure what you mean.

right one seperate function per folder, then create a main function and run them all into it.

Share this post


Link to post
Share on other sites
what i mean is, hers aan example:

.folder1
..sub-folder1
...sub-folder2
....sub-folder3
now the sub folders iwant to be categories in the gallery script, but how do i replacre those dots to be an actual folder name that will be of use for me.

cause just calling to view a folder will just display the dots which doesnt do me any good.

Share this post


Link to post
Share on other sites
I tried, but I can't figure anything out, sorry someone named dark carnival is reading this so he will probably answer in just a minute.

that was embarrasing you are dark carnival
Give me just a second to check something maybe I can help.

well let me ask you something. WHat exactly do you mean, did you want the folders to have different names, or do somethign with the php to rename the variables.

Share this post


Link to post
Share on other sites
no i ment each folder would be a category, the name of the folder is what that category would be called.

like if i named it funny dogs, that would appear as a cateogry but clicking on would tell the gallery to look in the funny dog folder, get what im saying now?

Share this post


Link to post
Share on other sites
yes. I have one idea.
Set each folder as a variable. Then have the value of the variable to be the url of the folder.
for instance

dog = "http://www.mysite.com/category1";
and so on
and then maybe when you call the variable it might create a link to the url
if that works then try creating an entire array, and set the array to have keys.
a
b
c
d
in place of abcd have it the name of the category, so the key is the category name, then have the values set to the specific urls of the folder. And then from there you can do whatever you want to with the array. That is if urls can be passed to variables.

i would test it out for you, but I just had my web host shut down my server, to switch it from php 4 to php5. So that is going to take the rest of my work night, adn I Won't have access, or else I would try it out and come up with something for you. I am 90% you can pass a url as a string variable, either way it's just text.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.