Skip to content

Instantly share code, notes, and snippets.

@lianglee
Created October 9, 2015 09:44
Show Gist options
  • Select an option

  • Save lianglee/4aaef29752111e17ed2c to your computer and use it in GitHub Desktop.

Select an option

Save lianglee/4aaef29752111e17ed2c to your computer and use it in GitHub Desktop.
Multiple Ossn websites on one domain
<?php
/**
* Open Source Social Network
*
* @packageOpen Source Social Network
* @author Informatikon Core Team <info@informatikon.com>
* @copyright 2014 iNFORMATIKON TECHNOLOGIES
* @license General Public Licence http://www.opensource-socialnetwork.org/licence
* @link http://www.informatikon.com/
*/
//replace website1 with websitex , or website2, website3, website4
session_name("Website1");
session_start();
global $Ossn;
if (!isset($Ossn)) {
$Ossn = new stdClass;
}
include_once(dirname(dirname(__FILE__)) . '/libraries/ossn.lib.route.php');
if (!is_file(ossn_route()->configs . 'ossn.config.site.php') && !is_file(ossn_route()->configs . 'ossn.config.db.php')) {
header("Location: installation");
exit;
}
include_once(ossn_route()->configs . 'libraries.php');
include_once(ossn_route()->configs . 'classes.php');
include_once(ossn_route()->configs . 'ossn.config.site.php');
include_once(ossn_route()->configs . 'ossn.config.db.php');
foreach ($Ossn->classes as $class) {
if (!include_once(ossn_route()->classes . "Ossn{$class}.php")) {
throw new exception('Cannot include all classes');
}
}
foreach ($Ossn->libraries as $lib) {
if (!include_once(ossn_route()->libs . "ossn.lib.{$lib}.php")) {
throw new exception('Cannot include all libraries');
}
}
ossn_trigger_callback('ossn', 'init');
//need to update user last_action
// @note why its here?
update_last_activity();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment