News:

Join the Facebook Fan Page.

Main Menu

Multidomain SMF forum

Started by Pedja, May 15, 2007, 11:34:41 AM

Previous topic - Next topic

KGIII

This is really quite active for a tips/tricks post. I'm impressed.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Pedja

Well, I also had plan to expand this idea to allow that it is possible to move board to different category than in main forum and alos i can change child status of a board so board that is child in main forum, does not have to be child in virtual forum.

Actually I managed to do that, and it works fine, but I am not that familiar with SMF code to find and fix all isues that follow. So I am a bit stuck.

This modification seems to go to deep to be easily done as mod. This should be done in the core installation.

mdp

#22
Long message erased as requested!

Pedja

Ok, send me FTP access parameters, and url's of the forum, and erase these far too long messages here.

mdp

ok Pedja,

I have done as you requested!  I re-created the forum using subdomain and the forum is now located at http://forum.thunderontobaccoroad.com/index.php

This time, I went through your process one step at time instead of trying to finish all of this at once and have hard time finding error.  Everything was going ok until I got stuck with table error.  I don't know why it is showing "Table 'thunder_smforum.smf_domain_forums' doesn't exist" when the table should be 'smf_domains' instead of 'smf_domains_forums'??

mdp

Well, after tweaking with 'create table', it apparently that there are 2 tables to work with?  "domain_forums" and "domains_forums"  With both tables in phpMyAdmin, I was able to get page to load, but I am now getting:
QuoteFatal error: Call to undefined function: customdomainconfiguration() in /home/thunder/public_html/forum/Sources/Load.php on line 1399

mdp

When I removed


// multidomain feature
// adjust configuration according to custom domain settings
customDomainConfiguration();


The forum page load up just fine!

Also, where am I supposed to assign the main domain to secondary domain using the installed smf database?  Is that in Settings.php under "Database Info"?  I might have overlooked your comment but I am not sure if you mentioned this or not??

Pedja

Sorry, i was absent for few days so i could not respond. now iti s 3 am here so I am unable to think right.

On the first glance, tabel should be named domain_forums. If there is any reference to smf_domains_forums, that is type error. Replace it with smf_domain_forum.

You should not remove call to customDomainConfiguration() function. It is neccessary.

About making configuration:

You just have to popilate tables with apropriate data.

In smf_domains you set domains you want to handle (remmber, some fileds must not be null. If you want them empty, just type in somethng and then erase).

In smf_domain_categories you set order and eventualy rename categories

pongsak

#28
After follow every step, finally it errors as this.
1.
QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '​' at line 5
/home/med17/domains/med17.com/public_html/forum/Sources/Load.php
2475
Which i think it may be this part

$query = "SELECT DISTINCT *
FROM

{$db_prefix}domains
WHERE (INSTR('$smf_domain', domain) > 0)​";

$request = db_query($query, __FILE__, __LINE__);


No clue to correct it.
Don't know to do next. :(

2. When i copy your code from this page to edit in dreamwaver, i've not seen some special character inside inside  in some variable and it does errors always.But when i edit in noteplus , i see it  " ' " .

3. I think the code here is not correct
Quotefunction loadDomain() {
   global $db_prefix, $context;

   $smf_domain = $_SERVER['HTTP_HOST'];

   $query = "SELECT DISTINCT *
                                    FROM

{$db_prefix}domain_forums

it should not be {$db_prefix}domain_forums , but {$db_prefix}domains instead, there're 2 sites for this.
smf 1.1.2 with dilbermc themes.
> 50 mods installed.

Dejv

#29
Quote from: Pedja on May 15, 2007, 11:34:41 AM



elseif (!empty($board_info['theme']))
$ID_THEME = $board_info['theme'];
// The theme is the forum's default.
else
$ID_THEME = $modSettings['theme_guests'];




and replace with


elseif (!empty($board_info['theme']))
$ID_THEME = $board_info['theme'];
// The theme is the domain's default.
elseif (! empty ($context['custom_domain']['THEME_ID'])) {
$ID_THEME = $context['custom_domain']['THEME_ID'];
} else
$ID_THEME = $modSettings['theme_guests'];




Hi :)

great mod, but there are lots of things I dont want.
- I just need the second, third,... forum to use different default templates, which are in different folders, so far they use different sources, ...
- forums are completly in different folders but on same server, they share one database.

I think I have to change something in this quote in Load.php, am I right?

It would be great if they could share language and images sources but thats not so necessary.

I need different templates for each domain because of googlemaps mod

Thanks a lot!

David

edit...

I've just changed

// Load a theme, by ID.
function loadTheme($ID_THEME = 0, $initialize = true)

to
// Load a theme, by ID.
function loadTheme($ID_THEME = 4, $initialize = true)

I hope this is right, but it works so far

4 is the copied default theme with right theme_url and theme_dir
SMF 1.1.20

greyknight17

David, yes, replace the first quote box code with what's said in the second one in the Load.php file.

For those who want to share the same database on two or more forums, take a look here.

911

QuoteThis may look as lots of work but actualy it is not. It would be easier if this mod is realised aspackagebut I

do not know how to createpackage. If anyone is willing to makepackageof this, that would be great.

Any updates on this. Any chance to see a Mod Packadge for the guys who are not so familiar with php?

The Mod features sound awesome!

Thanks.

falguni1


capnken

Does this mod require mysql 4.1 or higher? The syntax for the 'smf_domains' table creation includes utf8, which gets kicked out in mysql 4.0. If there's a proper syntax for making that table in 4.0, I'd appreciate some help with that structure.

Mod worked great on a test site I set up (mysql 4.1), but porting everything over to my existing 4.0 forum gave me the table syntax errors and then the 'domain undefined' error when I took out the utf8 and latin1 parameters that made mysql 4.0 so angry.

Sarge

Quote from: capnken on January 01, 2008, 01:20:45 AM
Mod worked great on a test site I set up (mysql 4.1), but porting everything over to my existing 4.0 forum gave me the table syntax errors and then the 'domain undefined' error when I took out the utf8 and latin1 parameters that made mysql 4.0 so angry.

I'm not sure about the "domain undefined" error, but I think the following table structure definitions should work for pre-4.1 versions of MySQL:

For the smf_domains table (previously called smf_domain_forums):

CREATE TABLE `smf_domains` (
`domain_id` smallint(5) unsigned NOT NULL auto_increment,
`domain` varchar(35) NOT NULL default '',
`categories_show` varchar(35) NOT NULL default '',
`categories_hide` varchar(35) NOT NULL default '',
`boards_show` varchar(35) NOT NULL default '',
`boards_hide` varchar(35) NOT NULL default '',
`THEME_ID` tinyint(4) default NULL,
`header_logo_url` varchar(35) default NULL,
`forum_name` varchar(35) default NULL,
`keywords` text,
`description` text,
`wellcome` text,
PRIMARY KEY (`domain_id`)
) ENGINE=MyISAM AUTO_INCREMENT=8;


For the smf_domain_categories table:

CREATE TABLE `smf_domain_categories` (
`domain_id` smallint(5) unsigned NOT NULL default '0',
`ID_CAT` tinyint(4) unsigned NOT NULL default '0',
`catOrder` tinyint(4) unsigned NOT NULL default '0',
`name` tinytext,
PRIMARY KEY (`domain_id`,`ID_CAT`)
) ENGINE=MyISAM;


It seems a change was forgotten. In the first change to Load.php, find this (it appears twice!) in function loadDomains():

{$db_prefix}domain_forums


and replace it with:

{$db_prefix}domains


I repeat, there are two places in the function where domain_forums appears. You have to replace both occurrences with domains.

I hope I haven't missed anything.

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

capnken

Thanks, Sarge. I did end up getting the mod working and now I'm poking around with implementations. Challenge I'm working on now is making post/topic stats and user online information displays restrict themselves to the current domain. It'll be strange for users of the new Forum B see few posts and few users when it starts up and also see stats that say there are 100K posts, etc.

Gwydion Frost

Pedja, Sarge...

You two really should integrate your mods into one super mod.

Seriously.

cjexotic

QuoteYou two really should integrate your mods into one super mod.
I'd use that mod!

If  you guys could combine all that stuff as a mod and have it use TP
:o

Sarge

Quote from: cjexotic on February 17, 2008, 02:27:13 AM
QuoteYou two really should integrate your mods into one super mod.
I'd use that mod!

If  you guys could combine all that stuff as a mod and have it use TP
:o

My mod uses TP already. ;)

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

cjexotic

QuoteMy mod uses TP already.
Yeah I know I've been reading and rereading the thread on it.
Almost used it.
Liked it from your test forum

But I'm trying to use different domain names and their URLs  if possible.

Advertisement: