Quote:
Originally Posted by BirdOPrey5
If I read what you're saying, you mention different hosts... does this mean each domain has it's own database? If so that's very different then what this mod does. There is a lot of demand for stuff like this, you should consider releasing your code either way- you'd be a hero to many. 
|
Just one DB, the config.php file is the same, but I overwrite some settings in a global_start plugin (bb title, main site adress) and yes, I have 4 licences (as if 3.8 licences were worth something these days). Also, the 4 of them update from the same svn repo. This is just in order to keep every mod syncd.
The problem with releasing this as a product is I lack experience to do that. Most of the code is in the plugins and some conditionals on the templates. In those plugins my 4 hosts are hard coded.
The style for each host and the redirection if you're in the wrong domain (plugin in style_fetch hook)
Code:
$domain=$_SERVER['HTTP_HOST'];
$uri=$_SERVER['REQUEST_URI'];
$arrayfw=array(114, 5,10,224,52,51,115);
$arraychw=array(13,3,4,152,8,9,11,36,20,7,15,199,221);
$arraynb=array(6,120,381,81,237);
$arraymcu=array(273, 270,272,274,275,295, 321,317);
if (in_array($forumid, $arrayfw) || in_array($foruminfo['parentid'], $arrayfw)) {
if ($domain!='www.fayerwayer.com') header("Location: http://www.chw.net$uri",TRUE,301);
} else if (in_array($forumid, $arraynb) || in_array($foruminfo['parentid'],$arraynb)) {
if ($domain!='www.niubie.com') header("Location: http://www.niubie.com$uri",TRUE,301);
} else if ( in_array($forumid, $arraychw) || in_array($foruminfo['parentid'],$arraychw)) {
if ($domain!='www.chw.net') header("Location: http://www.chw.net$uri",TRUE,301);
} else if ( in_array($forumid, $arraymcu) || in_array($foruminfo['parentid'],$arraymcu)) ) {
if ($domain!='www.mobilecloseup.com') header("Location: http://www.mobilecloseup.com$uri",TRUE,301);
}
switch ($_SERVER['HTTP_HOST']) {
case 'www.fayerwayer.com':
$styleid=87;
break;
case 'www.niubie.com':
$styleid=89;
break;
case 'www.chw.net':
$styleid=81;
break;
case 'www.mobilecloseup.com':
$styleid=88;
break;
}
Which forum is shown in each host: a plugin in the cache_ordered_forums hook:
Code:
if (THIS_SCRIPT=='index') {
switch ($_SERVER['HTTP_HOST']) {
case 'www.fayerwayer.com':
$excludeforumid=array(6,10,13,3,4,152,8,9,11,36,20,7,15,199,221,263,259,248,242,273, 270,272,274,275,295, 321);
break;
case 'www.niubie.com':
$excludeforumid=array(5,114,10,13,3,4,152,8,9,11,36,20,7,15,199,221,224,273, 270,272,274,275,295, 321);
break;
case 'www.chw.net':
$excludeforumid=array(263,248,242,273, 274,275, 321);
break;
case 'www.mobilecloseup.com':
$excludeforumid=array(5,6,114,10,13,3,4,152,8,9,11,36,20,7,15,199,221,224,263,259,248,242);
break;
}
foreach ($excludeforumid AS $forumid)
{
$vbulletin->forumcache["$forumid"]['displayorder'] = 0;
}
}
and a change in config to display the right title and url (global_start hook)
Code:
switch ($_SERVER['HTTP_HOST']) {
case 'www.fayerwayer.com':
$vbulletin->options['homeurl']='http://www.fayerwayer.com/';
$vbulletin->options['hometitle']='FayerWayer';
$vbulletin->options['bburl']='http://www.fayerwayer.com/foro';
$vbulletin->options['bbtitle']='FW Foros';
break;
case 'www.niubie.com':
$vbulletin->options['homeurl']='http://www.niubie.com/';
$vbulletin->options['hometitle']='Niubie';
$vbulletin->options['bburl']='http://www.niubie.com/foro';
$vbulletin->options['bbtitle']='Niubie Foros';
break;
case 'www.mobilecloseup.com':
$vbulletin->options['homeurl']='http://www.wayerless.com/';
$vbulletin->options['hometitle']='Wayerless';
$vbulletin->options['bburl']='http://www.mobilecloseup.com/foro';
$vbulletin->options['bbtitle']='MobileCloseUp Foros';
break;
}
(I don't need to change anything for chw.net since it uses the default config.php values)
And that's pretty much everything.
|