4 Replies - 898 Views - Last Post: 21 February 2008 - 12:10 PM

#1 Mike007  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 7
  • View blog
  • Posts: 332
  • Joined: 30-August 07

Website's File System

Posted 20 February 2008 - 11:23 PM

Ok, this may seem trivial when you first begin a project the file system design, but as more and more lines of code and html pile up it becomes a bigger and bigger issue.
Some time ago I heard that some web designers tend to put some of their files inside folders and name them index so that the user can easily navigate to that part of the website just by typing a short address. E.g if i had a page called about.php i can move it to a folder about/index.php and rename it. So it sounded like a good idea at the time, still does abit. But if you think about it (or in my case try to do it :S), and your file system looks something like this (most websites have those pages):
/index.php
/about/index.php
/forums/[a forms system: phpbb, Invision Power Board, phpnuke, ect..]
/images/[all the common graphics used in the webiste]
/js/[all javascript scripts]
/news/index.php[and other files to add/edit/delete news]
/poll/[my own poll project]
/plug-ins/[smarty plug-ins to be used in the templates]
/templates/[all the templates, including header.tpl and footer.tpl]



You will realize that you cannot just use the same header.tpl and footer.tpl for all the pages on your website, because the relative paths don't work, unless you come-up with a work around to do it. Frankly, Iím kinda tired of coming up with these workarounds, and i thought there has got to be a better way to do this then to add another variable in the template-- $relative_path.
The problem is that i want to use some of the features (like the poll or display apart of the forum -- recent posts) on the main page /index.php. But at the same time I want to keep all the files packaged inside a folder so that they can be easily moved to another project if I need to use these features.

I thought of doing it maybe like some programs do it (e.g like eclipse downloads work), keep all the, letís say poll files inside a zip file poll.zip which will look like this inside:
/admin/
/classes/
/plug-ins/
/template/


And I would just extract it where on the website i need it and use it like that. But again it's not that simple, not as simple as a desktop application or at least that what it seems to me.

So what Iím asking is basically, how do you do it? And also can you please give me some guidance as for how to build a good file system for a website. Iím getting really lost here :).

P.S
I am using PHP 5, MySQL and Smarty for my website, but it can easily apply to ASP.net or other server side script languages/databases/templating engines. But if you have any advice regarding the use of the above technologies, i would appreciate it :). Hope you will understand what i'm talking about here, it is really hard to put into words.

This post has been edited by Mike007: 20 February 2008 - 11:24 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Website's File System

#2 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5412
  • View blog
  • Posts: 27,426
  • Joined: 10-May 07

Re: Website's File System

Posted 20 February 2008 - 11:30 PM

Wow... uhm, not really sure which direction to point you.

What I do when creating a new web environment for a client, is the following :

DomainName <-- root

/form/functions.inc.php <-- php functions, this is included on every page
/form/config.inc.php <-- gets included where ever mysql functionality is required.
/header.php
/footer.php
/style <-- contains any/all css
/gfx  <-- most of the images for the site, lots of sub directory structure to this directory too.
/thumbs <-- thumbnails for the gfx folder


& unless the site is more than just a few pages big, it all goes in the root for that site.
Was This Post Helpful? 0
  • +
  • -

#3 Mike007  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 7
  • View blog
  • Posts: 332
  • Joined: 30-August 07

Re: Website's File System

Posted 21 February 2008 - 12:01 AM

View Postno2pencil, on 20 Feb, 2008 - 11:30 PM, said:

Wow... uhm, not really sure which direction to point you.

What I do when creating a new web environment for a client, is the following :

DomainName <-- root

/form/functions.inc.php <-- php functions, this is included on every page
/form/config.inc.php <-- gets included where ever mysql functionality is required.
/header.php
/footer.php
/style <-- contains any/all css
/gfx  <-- most of the images for the site, lots of sub directory structure to this directory too.
/thumbs <-- thumbnails for the gfx folder


& unless the site is more than just a few pages big, it all goes in the root for that site.


Yeah but it's not simply functions that i need, it's more. Plug-ins is the best word to describe what i want to have. Like have the polls plugable into any new web enviroment, or news system or login system ect. It's alot more than a few simple functions.

Thanks for the help anyway B).
Was This Post Helpful? 0
  • +
  • -

#4 ap0c0lyps3  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 83
  • Joined: 19-June 07

Re: Website's File System

Posted 21 February 2008 - 09:33 AM

What kind of project is this? Maybe w
Was This Post Helpful? 0
  • +
  • -

#5 Mike007  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 7
  • View blog
  • Posts: 332
  • Joined: 30-August 07

Re: Website's File System

Posted 21 February 2008 - 12:10 PM

It's more of a CMS, just a website i'm building to teach myself how to build dynamic websites.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1