Simple Xoops MultiSites (non OO) - sites (subdomains) using the same files, db, and domain
投稿者: Mikhail | 投稿日時: 2005/12/2 9:52 | 閲覧: 11064回
database.php
---- to use the same files with diferent sites/subdomains, just replace the mainfile.php for:
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.
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