Yeah, just tossing around ideas for my php archives for tifreakware.. I have been trying to come up with something, without much success. :/

Anyways.. I was thinking about listing the directories in a database, and then simply recall them via ASCENDING.


Code:
ID     NAME    Calc    lang    cat


I was considering using something like this in the db, though levels was something I was not quite sure how to deal with...
That would work nicely, because then you could filter by cat, by calc, etc. For a multiple-level system, such as the one I have here, you could add an additional column, depth, and for displaying folders only pick ones that have the same depth. So for /, display any folders with depth 0 and parent /. For say, /83plus/, display any folders with depth 1 and parent /83plus/, which might end up being /83plus/asm/ and /83plus/basic or something along those lines.
Hmm... I would need some explaining on that... How would you suggest adding a levels section, something like 68k/asm/games/mariolevels ?
tifreak8x wrote:
Hmm... I would need some explaining on that... How would you suggest adding a levels section, something like 68k/asm/games/mariolevels ?
By levels I meant how deep you are into the filesystem, like / is 0th-level, /73/ or /89/ is first level, /82/basic/ is second level, /86/basic/games is third level, etc.
Well, my thoughts on the above syntax was something like this:


Code:
1     TI-73 Basic Games     TI-73     BASIC     Games


and etc.. though that looks a little redundant, I guess...
Oh I see, you're building a three-level system right there. That works fine, and I was about to say that I don't see how you're going to do directory listings, but I think it should work out quite nicely. The one real shortcoming to that is you're stuck with a three-level (only) system.
I was going to do some archives for my site and this has been really helpful. Though I think Kerm's idea of using levels would be better than without, that way you would get much more flexibility in the future.
That is why I am tossing these ideas around, trying to get the feel for some stuff. As to Kerm's idea, I would need to see the table in action for me to understand it. I hate having to learn like that... >.<
I think that you are actually confused about how to display it. Because adding in the levels is a very simple concept. You would simply have to create a function that accepts let's say, a 0 and the function would call out all directories at level 0, and then 1, and so on. After that things would get more specific such as individual programs and then that is what you would use the id's for. I hope this post makes sense. Razz
From main/archives_fldsys:

Code:
foldID depth toppath fullpath description

12    0    /win     /win     Windows Programs
13    1    /basic    /73/basic    TI-73 BASIC Programs
14    2    /games    /73/basic/games    TI-73 BASIC Games
15    2    /math    /73/basic/math    TI-73 BASIC Math Programs
16    1    /basic    /82/basic    TI-82 BASIC Programs
17    2    /graphics    /82/basic/graphics    TI-82 BASIC Graphics Programs
18    2    /games    /82/basic/games    TI-82 BASIC Games
19    2    /programs    /82/basic/programs    TI-82 Miscellaneous Programs
20    1    /asm    /83/asm    TI-83 Assembly Programs
21    2    /games    /83/asm/games    TI-83 Assembly Games
22    2    /graphics    /83/asm/graphics    TI-83 Assembly Graphics Programs
23    2    /media    83/asm/media    TI-83 Assembly Media
24    3    /images    /83/asm/media/images    TI-83 Assembly Images
Ah, I see, that makes some sense.. I can set that up in the data base fairly easily. And then, just telling it there is a level 3 for mario 68k levels should allow for it to work easier, yes?
tifreak8x wrote:
Ah, I see, that makes some sense.. I can set that up in the data base fairly easily. And then, just telling it there is a level 3 for mario 68k levels should allow for it to work easier, yes?
Exactly, level 3, toppath /mario, fullpath /89/asm/levels/mario.
tifreak8x wrote:
And then, just telling it there is a level 3 for mario 68k levels should allow for it to work easier, yes?


All you have to do is have the folder for Mario 68k with level 3 on it so that would be at /Games/ASM/Mario 68k levels and you could send simple information like that using the $_GET[''] variable. That way you can also send the id of the folder or program that just got clicked on.
Mexi1010 wrote:
tifreak8x wrote:
And then, just telling it there is a level 3 for mario 68k levels should allow for it to work easier, yes?


All you have to do is have the folder for Mario 68k with level 3 on it so that would be at /Games/ASM/Mario 68k levels and you could send simple information like that using the $_GET[''] variable. That way you can also send the id of the folder or program that just got clicked on.
Argh, no, don't send information like that with a GET variable, that's an awesome way to get hacked. Identify this stuff by foldID instead.

Edit: On second thought that wouldn't really be a security hole as long as you didn't allow direct filesystem access that way. Carry on.
and then recalling the list would be as easy as recalling description in ASCENDING... I think I might see about setting up the table, at any rate... Razz
How do you hack over GET variables? All you have to do is check the variable before you use it to make sure that someone is not trying to send information through.

Edit by Kerm: Your post is irrelevant because I beat you to the edit. Wink
So, I get that all put together, would you mind assisting me through the construction of it?
I'll help, but I think you mean Kerm. Oh well, but if you DO need help i am pretty able in PHP and setting up SQL tables.
Mexi1010 wrote:
How do you hack over GET variables? All you have to do is check the variable before you use it to make sure that someone is not trying to send information through.

Edit by Kerm: Your post is irrelevant because I beat you to the edit. Wink


Your post is irrelevant because it doesn't make any a sense. The entire point of a GET parameter is to pass data back to the server, so what the hell is the point of making sure that "someone is not trying to send information through" - what the ELSE would they be doing with a GET parameter? The ONLY thing you can do with it is send information.

Kerm fails because he meant to say "validate your input, n00bs", not whatever he did say.
I thought what Kerm was trying to say is that if someone types in something for the get variable in the address bar that might get sent over the SQL query, then they could try and hack the site. I am just saying check it to make sure it is an number and not something that you would not want them sending through.
  
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement