
Virtual Folders
Working with ‘AXE’ (DoPaul).. I have noticed recently that everything is harder working with virual volders.
The organization is great, the idea behind it is great, and the benefits of it are great..
But the actual process of handling information with it.. is really a pain in the butt.
The basic organization of the folders table is like this:
table: folder
id (int) primary_key // unique folder ID
title (varchar) // title of the folder (images, documents, etc)
parent (int) // parent ID that it belongs to (folder id)
user (int) // user ID of the user it belongs to
Now, that may seem simple enough to look at, and maybe simple enough for you to understand.. but it seems that it always comes down to a reccuring programming loop when things need done.
It took me two days to figure out a solution to the backing up of root folders. That means that comes down to looping through each and every folder, seeing if it has child folders (sub levels.. images/blah/blah).. since DoPaul’s folder system does not have a maximum level.. it could go on forever.
It just seems to always come back down to this ‘loop’ when working with these virtual folders. It’s constantly having to figure out the children of a folder, the parents of a folder.. whether it’s for making a simple breadcrumb for navigating through the virtual filesystem..
Or when it comes down to a more ‘complicated’ solution such as the drag and drop folder system..

All in all, this is something new for me, and quite a learning experience when it comes down to it.
I think a lot of my previous experience in filesytems and uploading have helped in developing this system, simple or not, the theory is quite complicated when it comes down to it.
I did a ‘similar’ system to this on TehUpload with single-level albums.. with sort of a similar SQL structure to the table I posted below.. but this by far is more techinical and logicial then that.
I feel that this experience is good for me, and will hopefully advance me more in my knowledge, and help me to be a better coder alltogether.
Last.FM
Twitter
caleb@tehupload.com
caleb@tehupload.com
Dentafrice