News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Use your forum in a different directory.

Started by Anguz, September 05, 2004, 07:31:34 PM

Previous topic - Next topic

Anguz

I thought this up the other day and now I realized more may find it useful, so here it is.

I wanted to have a forum in the webroot dir but not the files. The thing is there's other stuff, files and folders, there that I don't want mixed with the SMF ones, I wanted those in their own dir. So I fixed it in a way that the SMF files are in their own dir and the forum is shown in the webroot one. You can use this in any dir you want.

It's very simple to do this. Just install your SMF normally in a dir for it and after that's done, make a copy index.php and Settings.php. Open Settings.php with you text editor of choice and point $boardurl to the dir where you want the forum. Save the changes and put these copies in the new dir.

Let me know if you found this useful and how it went for you, if everything's fine or you found a flaw. (~_^)
Cristián Lávaque http://cristianlavaque.com

[Unknown]

Make sure $boarddir includes, ie. smf/, but $boardurl does not.

-[Unknown]

Anguz

#2
Quote from: [Unknown] on September 05, 2004, 08:12:44 PM
Make sure $boarddir includes, ie. smf/, but $boardurl does not.

-[Unknown]

Oh, SMF's dir has to be there in $boarddir? Then they don't need to touch it cause that'd be what it is after the installation. The funny thing is that I did remove it and the test seems to be working fine. What URL could I try to see if it breaks whithout it?
Cristián Lávaque http://cristianlavaque.com

[Unknown]

Well, the agreement for example is found with the $boarddir so it should point to where the agreement is, etc.

-[Unknown]

Anguz

Gotcha, fixed. Gonna update the first post.
Cristián Lávaque http://cristianlavaque.com

Anguz

#5
Someone asked me about something related to this, so I decided to expand my explanation of what you can do.

What I said so far, is that you can have SMF in one dir and actually use it in another one. What I'll say now is that you can do this from several places.

In other words, you can have your SMF files in one dir and use them from several other places, but not just the same forum, also different ones powered by the same files.

The difference would be in content, so what you need is a new set of tables in your database for each extra forum. You can create these using your install.php file. Use different databases or the same one, with different table prefixes in the latter case.

Since the databases are different, you can, for example, have different default themes for each, everything is stored separately from the other forums, even if they run off the same files.

Another advantage is that you only need update one set of files, like when you make modifications, and they'll show in every forum running off it.

You could exploit this even further, sharing some tables in your database between the forums, like explained in this topic by Spaceman-Spiff. I wrote a mod that could help you with it too: Share DB Tables.

I hope you find this information helpful. :)
Cristián Lávaque http://cristianlavaque.com

TLM

Just out of curiosity, does this work cross-subdomains, and could it be possible to set a subdomain to a certain theme on the forum?  If not on the latter, no big deal.

Anguz

Quote from: TLM on March 09, 2005, 03:23:59 PM
Just out of curiosity, does this work cross-subdomains, and could it be possible to set a subdomain to a certain theme on the forum? If not on the latter, no big deal.

I haven't done it, so I don't know, but you can give it a try and see if it works. :)
Cristián Lávaque http://cristianlavaque.com

TLM

#8
Quote from: Anguz on March 09, 2005, 05:00:08 PM
I haven't done it, so I don't know, but you can give it a try and see if it works. :)

It appears so.
http://forums.teamplayfirst.com/ - Source (.../public_html/forums/)
http://www.teamplayfirst.com/forum/ - Copy (.../public_html/forum/)

It seems I can logout and login, and go thru the forum perfectly fine.

Guess next thing would be to tackle getting diffrent themes to show based on the url/subdomain.
*edit*Just thought, what about maintaince mode, might not work but really, how often does a forum go into that.*/edit*

*edit 2*
Force a theme by editing line 136 with the theme ID #,

// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)
loadTheme(1);

*/edit 2*

Anguz

Cristián Lávaque http://cristianlavaque.com

Quinn

#10
Quote from: TLM on March 09, 2005, 08:32:49 PM
Quote from: Anguz on March 09, 2005, 05:00:08 PM
I haven't done it, so I don't know, but you can give it a try and see if it works. :)

It appears so.
http://forums.teamplayfirst.com/ - Source (.../public_html/forums/)
http://www.teamplayfirst.com/forum/ - Copy (.../public_html/forum/)

It seems I can logout and login, and go thru the forum perfectly fine.

Guess next thing would be to tackle getting diffrent themes to show based on the url/subdomain.
*edit*Just thought, what about maintaince mode, might not work but really, how often does a forum go into that.*/edit*

*edit 2*
Force a theme by editing line 136 with the theme ID #,

// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)
loadTheme(1);

*/edit 2*

This is a great idea! It works well unless you have ssi.php includes. If you do the ssi.php pathings need to be abosulte paths not relative (ie: coppermine display_randompics) on index.php

www.bs-raven.net/html
forums.bs-raven.net/backlot

This does add another concept too while using the loadTheme(1); and setting to a non default theme for visitors

Gwydion Frost

OK, here's a different variation on this idea I would like to implement on my boards.

Creating a plethora of RolePlaying Game Boards, with many different Genres represented.

Would love to have the ability to have the member register on the MAIN site with an "Out-Of-Character" identity as a MASTER PROFILE. Ex: Bob from Ohio.

Now, when the member would click on the link to the subdomains (each separate board for each game), they would be prompted to create a CHARACTER PROFILE specific to that game.

In the Fantasy game, "Bob from Ohio" would name his character "Elohas", the rest of the CHARACTER profile indicating that he's an Elf from Arcansbane.

Bob decides that he wants to play the superhero RPG...and clicking over to THAT board, Bob is prompted to create his CHARACTER PROFILE for THAT game.

Each Character Profile would post as the Character on the board it is designated to post on, but ADMINISTRATIVELY, I would be able to tell that Bob from Ohio was Elohas, Texas Pete, and SuperVulcan, etc etc.

Because of the size of each of these boards (each templated to it's own theme), and the amount of players that will be jumping on to play, you can see my hesitation to place them ALL on one single database...

The server would go nuts with the amount of queries.

The side effect would be to slow my site down to a crawl, even just to refresh the page.

Is there a way to SEPARATE the member data (along with all the usergroup permissions, etc) into a separate DB, and still have all the separate boards access the info?

Mind you, I have NOT installed SMF yet, as I am inquiring on how I can get it to do the things I want it to beforehand?

I haven't even approached the next half of this question...

ROUND #2: Is it possible to make the character profiles like a check list...pick a race, pick a region, etc etc, and have usergroups automatically assigned by doing so...(purpose for this? The Compendium is designed to be USER specific...an Elf from Country A has certain beliefs that an Elf from Country B doesn't...due to different cultures, etc...and therefore, the Compendium will be designed to show the player what his character would believe, versus revealing the whole TRUTH (which is only shown for the character's own species).

Make sense?

Advertisement: