Multisite
- Module: Multisite
- Version: 1.40
- Author: Simon Roberts Wishcraft
- Compatible: All Versions - 2.3.x to 2.5.x
- Download: xoops2.4_multisite_1.40.zip
- Mirror: xoops2.4_multisite_1.40.zip
ZIP CRC
xoops2.4_multisite_1.40.zip
- MD5: a5b794e7952f20ee262c4c964cc551bc
- SHA1: 4c7356537aeffaa4dbe42671bbe3720c12c63704
- RIPEMD160: be52cbb185d77397ad2cd369baacc102359f8806
- CRC32: b1f1f194
- Date: March 11, 2010, 3:45:57 PM
HashCalc
HashCalc is a SlavaSoft Tool for Calculating and checking file hashing and other functionalities of Textual Hashing, you can check your file hashing with this tool it is an easy-to-use hash calculator. It can compute message digests, checksums and HMACs for files, as well as for text and hex strings. It offers a choice of 13 of the most popular hash and checksum algorithms for calculations.
This is a quick guide to installing multisite
This XOOPS Module into your xoops frameworks will offer you a quick an easy guide to installing multisite. Follow this quick easy how to guide to install the multisite module.
This module allow multiple modules, if you want to adapt for example a module to multisite you would use the domain classes for config settings.
Core Changes in XOOPS 2.3.x
XOOPS Protocol Constant - mainfile.php
This has to be called in 2.3.0 above the XOOPS_URL clause.
// URL Association for SSL and Protocol Compatibility
$http = 'http://';
if (!empty($_SERVER['HTTPS'])) {
$http = ($_SERVER['HTTPS']=='on') ? 'https://' : 'http://';
}
define('XOOPS_PROT', $http);
Post/Pre Loaders - mainfile.php
The common loader has 3 lines additional, these can appear before or after the protector preloaders.
include_once XOOPS_ROOT_PATH."/modules/multisite/pre.load.php";
if (!isset($xoopsOption["nocommon"]) && XOOPS_ROOT_PATH != "") {
include XOOPS_ROOT_PATH."/include/common.php";
}
include_once XOOPS_ROOT_PATH."/modules/multisite/post.load.php";
include_once XOOPS_ROOT_PATH."/modules/multisite/post.define.load.php";
common.php changes
There is a part of common.php that looks like this somewhere up the top of the instanciations..
$GLOBALS['xoopsConfig'] = $config_handler->getConfigsByCat( XOOPS_CONF ); //or $xoopsConfig = $config_handler->getConfigsByCat( XOOPS_CONF );
You need to change it to this... This compaired to the multisite on drupal and joomla is VERY FAST.. Some have told me the multisite on drupal (3 options) is extremely slow in it operation and is more legacy..
Change the line above to the following code
/**
* Instanciates Multisite Module
**/
$module_handler =& xoops_gethandler('module');
$config_handler = &xoops_gethandler( 'config' );
$critera = new CriteriaCompo(new Criteria('dirname', "multisite"));
$installed = $module_handler->getCount($critera);
if ($installed!=0)
{
$GLOBALS['xoopsMultisite'] =& $module_handler->getByDirname('multisite');
if ($GLOBALS['xoopsMultisite']->isActive())
{
/**#@-*/
// Check Policies
$policy_handler =& xoops_getmodulehandler('policy', 'multisite');
$critera_p = new CriteriaCompo(new Criteria('domains', "%|".str_replace("www.","",strtolower($_SERVER['HTTP_HOST'])).'%', 'LIKE'), 'OR');
$critera_p->add(new Criteria('domains', "%|all%", 'like')) ;
$policies = $policy_handler->getObjects($critera_p);
foreach ($policies as $policy)
@$policy_handler->checkPolicy($policy);
// ################# Load Config Settings ##############
$domain_handler =& xoops_getmodulehandler('domain', 'multisite');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('dom_name', 'domain'));
$criteria->add(new Criteria('dom_value', strtolower($_SERVER['HTTP_HOST'])));
$domain = $domain_handler->getDomains($criteria);
if ($domain_handler->getDomainCount($criteria)>0)
{
$domain_handler->set_domain_id($domain[0]);
if (!defined("XOOPS_DOMAIN_ID"))
define("XOOPS_DOMAIN_ID", $domain_handler->get_domain_id());
}
$configcategory_handler = &xoops_gethandler( 'configcategory' );
$configcategory = $configcategory_handler->get( intval(XOOPS_CONF) );
if (is_object($configcategory)) {
$domaincategory_handler = &xoops_getmodulehandler( 'domaincategory', 'multisite' );
$domaincategory = $domaincategory_handler->getByName($configcategory->getVar('confcat_name'));
if (is_object($domaincategory))
$GLOBALS['xoopsConfig'] = $domain_handler->getDomainsByCat( $domaincategory->getVar('domcat_id') );
}
}
} else {
$GLOBALS['xooopsMultisite'] = new XoopsModule();
$GLOBALS['xooopsMultisite']->loadInfoAsVar('multisite');
$GLOBALS['xooopsMultisite']->setVar('isactive', false);
}
/**
* Create Instantance XoopsLogger Object Xoops
*/
if (empty($GLOBALS['xoopsConfig']))
$GLOBALS['xoopsConfig'] = $config_handler->getConfigsByCat( XOOPS_CONF );
SMARTY Template Name Bug (Fixed 2.4.0)
This function is found in /class/templates.php you will need to change the smarty template otherwise you will have templating and theme issues.
function setCompileId($module_dirname = null, $theme_set = null, $template_set = null)
{
.......
$this->compile_id = $module_dirname . '-' . $theme_set . '-' . $template_set;
.......
}
Needs to be changed to
function setCompileId($module_dirname = null, $theme_set = null, $template_set = null)
{
.......
$this->compile_id = urlencode(XOOPS_URL) . '%%' . $module_dirname . '-' . $theme_set . '-' . $template_set;
.......
}
XOOPS Cache Name Definer
This has been changed in 2.4.0 (Will need some cleaning processess done for 2.4.1) I suggest to all running multisite there is some changes you need to do first up:
In Xoops Cache found in /class/cache/ - you need to make the following changes to these functions, the change is on the first like on the function:
function write($key, $value, $duration = null)
{
$key .= '_'.urlencode(XOOPS_URL);
....
function read($key, $config = null)
{
$key .= '_'.urlencode(XOOPS_URL);
....
function delete($key, $config = null)
{
$key .= '_'.urlencode(XOOPS_URL);
....
Multisite Blocks
This will install multisite blocks in 2.4.x Series of XOOPS, there ARE AND CAN BE other changes for this with regards to modules.
/header.php
Change line 32 to read
include_once $GLOBALS['xoops']->path('modules/multisite/class/block.php');
/class/template.php
Change line 247 to read
$block_arr = MultisiteBlock::getByModule($mid);
/class/theme_block.php
Change line 25 to read
include_once $GLOBALS['xoops']->path('modules/multisite/class/block.php');
Change line 116 to read
$xoopsblock = new MultisiteBlock();
/include/old_functions.php
Change line 40 to read
$xoopsblock = new MultisiteBlock();
Change line 123 to read
$xoopsblock = new MultisiteBlock();
/modules/system/admin/blocksadmin/blocksadmin.php
Change line 32 to read
include_once XOOPS_ROOT_PATH.'/modules/multisite/class/block.php';
Change line 135 to read
$block_arr = MultisiteBlock::getNonGroupedBlocks($mod_block, $toponlyblock = false, $vis_block, $order_block, false);
Change line 138 to read
$block_arr = MultisiteBlock::getAllByGroupModule($grp_block, $mod_block, $toponlyblock = false, $vis_block, $order_block, false);
Change line 279 to read
$myblock = new MultisiteBlock();
Change line 343 to read
$myblock = new MultisiteBlock($bid);
Change line 369 to read
$myblock = new MultisiteBlock($bid);
Change line 464 to read
$myblock = new MultisiteBlock($bid);
Change line 474 to read
if (1 >= $count = MultisiteBlock::countSimilarBlocks($myblock->getVar('mid'), $myblock->getVar('func_num'), $myblock->getVar('show_func'))) {
Change line 485 to read
$myblock = new MultisiteBlock($bid);
Change line 500 to read
$myblock = new MultisiteBlock($bid);
Change line 522 to read
$myblock = new MultisiteBlock($bid);
Change line 552 to read
$block = new MultisiteBlock($bid);
Core Changes in XOOPS 2.4.x
The Preload structures allow for a complete integration to XOOPS without any core changes. There are extra structures in Multisite for feeding sitemaps & rss for dynamic backend.php based in structures like the X-Reaggregator from modules - you would have to integrate this.
Core Changes in XOOPS 2.5.x
The Preload structures allow for a complete integration to XOOPS without any core changes. There are extra structures in Multisite for feeding sitemaps & rss for dynamic backend.php based in structures like the X-Reaggregator from modules - you would have to integrate this.
ALL XOOPS VERSIONS - mainfile.php
Dynamic URLS
You need to change the XOOPS_URL to dynamically build the port..
// Correct XOOPS_URL define( 'XOOPS_URL', strtolower(XOOPS_PROT.$_SERVER['HTTP_HOST'].'') );
would appear like XOOPS_URL = http://www.yoursite.com
// Correct XOOPS_URL define( 'XOOPS_URL', strtolower(XOOPS_PROT.$_SERVER['HTTP_HOST'].'/xoops') );
would appear like XOOPS_URL = http://www.yoursite.com/xoops
ALL XOOPS VERSIONS - xoopsformloader.php
There are 2 additional lines to this file for the form objects for multisite. These two lines go at the bottom.
include_once XOOPS_ROOT_PATH . '/modules/multisite/class/formcheckboxdomains.php'; include_once XOOPS_ROOT_PATH . '/modules/multisite/class/formselectdomains.php';











![[Main Page]](/modules/mediawiki/images/mediawiki.png)


