Ideal Site Structure

Rjs37

Member
Well I currently have a website which builds upon our vb installation (manually checks that you're logged in, creates pms through the database etc). I've been planning for a long time to do a re-code for the site as I wanted to make it OOP and even started something in that respect.

However I'm heavily considering using this xenforo license and interacting with that instead and using a proper framework (Zend would be the obvious choice considering that xenforo uses it). The thing I'm trying to work out at the moment is the best way to structure it. Currently we have a subdomain (forums) which just points at a sub directory. And then all the vBulletin code is in there.

I'd want to continue to do this (having a subdomain point at the forums) but structurally to me it doesn't make sense to put the libraries into this subdirectory seeing as I'd want to use those libraries for the rest of my site and it certainly doesn't make sense to have the Zend library twice lol.

Would it work moving everything except the library into a forum sub directory and leaving the library in my root? Or would this completely break the code? I'm not sure this is the right way to go though because then I can see upgrades being a pain in the ass. So yeah I'm open to suggestions at the moment. I want to get the structure right before starting the coding so that I don't need to go changing it down the line again. Apologies if this is seen as the wrong forum. I was debating between this and one of the support ones.

Thanks,
 
Fair enough, though there are other non add on related threads there so took it as a general development forum lol (wouldn't be a bad idea to have one). Hence why I couldn't decide between the two forums.
 
I guess I'll bump this thread with a simpler question.

Has anyone tried changing the structure of the code? i.e. I'd like to (as Zend actually recommend) move the Library code outside of my web root.

i.e.

/www/forums/index.php
/www/index.php
/library/Zend/
/library/XenForo/

I've had a bit of a try but been unsuccessful so far, just wondering if anyone else has attempted the same? My main problem so far has been that everything relates to the root directory whereas my library will reside above the root.
 
While I'm sure it's possible to change xenForo's directory structure I wouldn't recommend it.

The method I always use for external pages is to use chdir() to move the execution to the forum directory. That way you can do all necessary requires as if the page was inside of the forum directory. Then the only thing you have to worry about is links and image paths which you might have to change to use full paths or full URLs in some cases.

http://us3.php.net/manual/en/function.chdir.php

The subdomain just affects the cookie scope of the forum. Normally you would only use a subdomain if you want to keep the forum cookies separate from the rest of the site (from pages outside of the subdomain). So if you want the forum login to show on external pages then you should keep those pages on the same subdomain.
 
While I'm sure it's possible to change xenForo's directory structure I wouldn't recommend it.

Fair enough. Just seems strange to me for the developers to go against the recommendation to keep the library files outside of the web root. But fair enough. Seems to be more trouble than it's worth to change it anyway lol.

The subdomain just affects the cookie scope of the forum. Normally you would only use a subdomain if you want to keep the forum cookies separate from the rest of the site (from pages outside of the subdomain). So if you want the forum login to show on external pages then you should keep those pages on the same subdomain.

Nah we often use .domain.com for the cookie domain to keep it across the whole domain but as we have a whole website in the web root I just feel that a subdomain works better for the forums than having it as a sub directory. Neater that way imo, but each to their own.


.....and xenforo doesn't use the entire zend framework just bits and pieces .... So don't complicate things :D

Ah, didn't know that. So for my own coding it'd be better to have my own copy of the full framework (may as well put that outside of the web root as recommended lol) and work off that rather than working off Xen's version of the Zend Framework?
 
Ah, didn't know [Xenforo uses a subset of Zend Framework]. So for my own coding it'd be better to have my own copy of the full framework (may as well put that outside of the web root as recommended lol) and work off that rather than working off Xen's version of the Zend Framework?

Is there a suggestion for this question ?

I'd want to continue to do this (having a subdomain point at the forums) but structurally to me it doesn't make sense to put the libraries into this subdirectory seeing as I'd want to use those libraries for the rest of my site and it certainly doesn't make sense to have the Zend library twice.

Would it work moving everything except the library into a forum sub directory and leaving the library in my root?

I think the best place to install Xenforo is not in the root directory but in the /community directory ?
ie. create a directory off your root directory and upload the xenforo install there !

Install Xenforo to /community !
 
Top Bottom