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
This post has been edited by Mike007: 20 February 2008 - 11:24 PM

New Topic/Question
Reply



MultiQuote




|