ホーム > フォーラム > Simple Xoops MultiSites (non OO) - sites (subdomains) using the same files, db, and domain

Simple Xoops MultiSites (non OO) - sites (subdomains) using the same files, db, and domain
投稿者: Mikhail | 投稿日時: 2005/12/2 9:52 | 閲覧: 10943回
Mikhail
database.php


function prefix($tablename='') {

if ($tablename == '') {
return $this->prefix;
}

elseif ($tablename == 'users') {
return 'same_users';
}

elseif ($tablename == 'groups_users_link') {
return 'same_groups_users_link';
}
elseif ( $tablename == 'priv_msgs' ) {
return 'same_priv_msgs';
}



---- to use the same files with diferent sites/subdomains, just replace the mainfile.php for:




<?php
if (!(isset($subdominio))) {
$subdominio = $HTTP_HOST;
$subdominio = str_replace("www.","",$subdominio); 
$subdominio = str_replace(".com","",$subdominio); 
$subdominio = str_replace(".net","",$subdominio); 
$subdominio = str_replace(".org","",$subdominio);
$subdominio = str_replace(".br","",$subdominio);
$subdominio = str_replace(".jp","",$subdominio);
} 

if (!(empty($subdominio))) {
include($subdominio."mainfile.php");
}

?>



So this will be the mainfile for the subdomain xoopscube.mydomain.com: xoopscube.mainfile.php

Is supersimple, but I dont know about how secure it is...

personal opinion (my way): I never use "mainfile.php" without rename it or... "others"... for security reasons.


TIP: better if used with changetheme module, that allow one interface for each module.

コメント(1)

Re: Simple Xoops MultiSites (non OO) - sites (subdomains) using the same files, db, and domain 
投稿者: sakimura | 投稿日時: 2005/12/6 22:40
sakimura
This is kind of interesting. I do the former now and then, but the later did not occur to me. That will solve a lot of problems for updating the sites. Of course, I guess I will need more regorous input check for the security reasons though.

    投票(0)

    新しいものから | 古いものから | RSS feed
     
    To Top