21
sockmonkey
Re: Testing: Multisite Module 1.17 RC for XOOPS 2.3
  • 2009/4/3 0:17

  • sockmonkey

  • Just popping in

  • Posts: 21

  • Since: 2008/6/4 1


Quote:

wishcraft wrote:

Could you give me your server specs sockmonkey... It was developed on WAMP Server 2, which as far as I can tell is the specifications for writting XOOPS modules...

Sounds like a really strange error...

Certainly. My apologies, I should have started with this info.

XOOPS version: 2.3.3
Apache version: 2.2.11 (Unix)
PHP version: 5.2.8
MySQL version: 5.1.30
Operating system: Linux

22
deka87
Re: Testing: Multisite Module 1.17 RC for XOOPS 2.3
  • 2009/4/3 11:36

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


Guys, im totally lost. I've linked the new subdomain i've created to the same website, right. Then I've installed a module and set up blocks, langs and prefs. They I am editing mainfile and header to get it working right? But I have no clue on what to do with mainfile and header and how do get domains working. Should I use the code on the first page of this topic? There is no readme in the archive... Please explain or at least point out which lines were edited in the mainfile.php.
Mind anchors

23
btesec
Re: Testing: Multisite Module 1.17 RC for XOOPS 2.3
  • 2009/4/3 15:03

  • btesec

  • Friend of XOOPS

  • Posts: 623

  • Since: 2007/2/20


A brief guide would really help.

24
wishcraft
Re: Testing: Multisite Module 1.17 RC for XOOPS 2.3

Ok it is with your sockmonkey that the URL has to be URL Encoded with the php function http://au2.php.net/manual/en/function.urlencode.php on the domain=http://www.sample.com part of your url it will look something like domain=http:%22%22www.sample.com

You can download the fix off my server while I am using the HTTP Server if you want http://wishcraft.thruhere.net/xoops233/modules/multisite_r1.18b.zip

This is because it is being trapped for URL Injestion.. I will update it.

Thanks

wishcraft

Quote:


sockmonkey wrote:
Quote:

wishcraft wrote:

Could you give me your server specs sockmonkey... It was developed on WAMP Server 2, which as far as I can tell is the specifications for writting XOOPS modules...

Sounds like a really strange error...

Certainly. My apologies, I should have started with this info.

XOOPS version: 2.3.3
Apache version: 2.2.11 (Unix)
PHP version: 5.2.8
MySQL version: 5.1.30
Operating system: Linux
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts

25
sockmonkey
Re: Testing: Multisite Module 1.17 RC for XOOPS 2.3
  • 2009/4/8 14:08

  • sockmonkey

  • Just popping in

  • Posts: 21

  • Since: 2008/6/4 1


Excellent! Version 1.18 cleared up my admin problems. I'm able to edit preferences, blocks, modules, etc. Thanks so much for the fix!

There's one final hurdle I can't seem to figure out. Although I'm setting a block as available in site 1, it is showing up in site 2 as well. Same thing with modules. I've set a module as available in site 1, but it shows up in both site 1 and site 2. Am I doing something wrong?

And just now I cleared my cache to see if that was the issue and now the theme set for site 2 is appearing for both site 1 and site 2. Any help you can offer is much appreciated.

26
wishcraft
Re: Testing: Multisite Module 1.17 RC for XOOPS 2.3

::This one is just for you sock monkey::

Resized Image

It is Multisite 1.18 : Download from - http://bin.chronolabs.org.au/xoops2.3_multisite_1.18.zip - 164 Kb
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts

27
dr-no
Re: Testing: Multisite Module 1.17 RC for XOOPS 2.3
  • 2009/5/1 15:58

  • dr-no

  • Just popping in

  • Posts: 4

  • Since: 2009/5/1 1


Quote:

sockmonkey wrote:
Excellent! Version 1.18 cleared up my admin problems. I'm able to edit preferences, blocks, modules, etc. Thanks so much for the fix!

There's one final hurdle I can't seem to figure out. Although I'm setting a block as available in site 1, it is showing up in site 2 as well. Same thing with modules. I've set a module as available in site 1, but it shows up in both site 1 and site 2. Am I doing something wrong?

And just now I cleared my cache to see if that was the issue and now the theme set for site 2 is appearing for both site 1 and site 2. Any help you can offer is much appreciated.


That is, what is happening to my installation also. Editing the settings of the different domains can be done easily, but changes have no effect. The default setting of xoops-system-modul is still active, the second domain shows up identically to the first domain. Could you please advice ? Are there any more hacks to do ?

28
lazyd
Re: Testing: Multisite Module 1.17 RC for XOOPS 2.3
  • 2009/5/8 17:55

  • lazyd

  • Just popping in

  • Posts: 27

  • Since: 2003/8/20


me too, with v 1.2

29
wishcraft
Re: Testing: Multisite Module 1.17 RC for XOOPS 2.3

There is a hack involved in the blocks..

You need to do the following.. in /class/xoopsblocks.php

This is an example from the 2.3.4 build of Multisite for XOOPS Lite edition.

function getAllBlocksByGroup($groupid$asobject true$side null$visible null$orderby "b.weight,b.bid"$isactive 1)
    {
        global 
$multisite_module;
        
$db = &XoopsDatabaseFactory::getDatabaseConnection();
        
$ret = array();
        if (! 
$asobject) {
            
$sql 'SELECT b.bid ';
        } else {
            
$sql 'SELECT b.* ';
        }
        
$sql .= "FROM " $db->prefix("newblocks") . " b LEFT JOIN " $db->prefix("group_permission") . " l ON l.gperm_itemid=b.bid WHERE gperm_name = 'block_read' AND gperm_modid = 1";
        if (
is_array($groupid)) {
            
$sql .= " AND (l.gperm_groupid=" $groupid[0] . "";
            
$size count($groupid);
            if (
$size 1) {
                for(
$i 1$i $size$i ++) {
                    
$sql .= " OR l.gperm_groupid=" $groupid[$i] . "";
                }
            }
            
$sql .= ")";
        } else {
            
$sql .= " AND l.gperm_groupid=" $groupid "";
        }
        
$sql .= " AND b.isactive=" $isactive;
        if (isset(
$side)) {
            
// get both sides in sidebox? (some themes need this)
            
if ($side == XOOPS_SIDEBLOCK_BOTH) {
                
$side "(b.side=0 OR b.side=1)";
            } elseif (
$side == XOOPS_CENTERBLOCK_ALL) {
                
$side "(b.side=3 OR b.side=4 OR b.side=5 OR b.side=7 OR b.side=8 OR b.side=9 )";
            } else {
                
$side "b.side=" $side;
            }
            
$sql .= " AND " $side;
        }
        if (isset(
$visible)) {
            
$sql .= " AND b.visible=$visible";
        }
        if (
$multisite_module->isActive())
             
$sql .= " AND (b.domains like '|all%' or b.domains like '%|".str_replace('www.','',strtolower($_SERVER['HTTP_HOST']))."%')";

        
$sql .= " ORDER BY $orderby";
        
$result $db->query($sql);
        
$added = array();
        while (
$myrow $db->fetchArray($result)) {
            if (! 
in_array($myrow['bid'], $added)) {
                if (! 
$asobject) {
                    
$ret[] = $myrow['bid'];
                } else {
                    
$ret[] = new XoopsBlock($myrow);
                }
                
array_push($added$myrow['bid']);
            }
        }
        return 
$ret;
    }

    
/**
     * XoopsBlock::getAllBlocks()
     *
     * @param string $rettype
     * @param mixed $side
     * @param mixed $visible
     * @param string $orderby
     * @param integer $isactive
     * @return
     */
    
function getAllBlocks($rettype "object"$side null$visible null$orderby "side,weight,bid"$isactive 1)
    {
        global 
$multisite_module;
        
$db = &XoopsDatabaseFactory::getDatabaseConnection();
        
$ret = array();
        
$where_query " WHERE isactive=" $isactive;
        if (isset(
$side)) {
            
// get both sides in sidebox? (some themes need this)
            
if ($side == 2) {
                
$side "(side=0 OR side=1)";
            } elseif (
$side == 6) {
                
$side "(side=3 OR side=4 OR side=5 OR side=7 OR side=8 OR side=9)";
            } else {
                
$side "side=" $side;
            }
            
$where_query .= " AND " $side;
        }
        if (isset(
$visible)) {
            
$where_query .= " AND visible=."$visible;
        }
        if (
$multisite_module->isActive())
             
$sql .= " AND (domains like '|all%' or domains like '%|".str_replace('www.','',strtolower($_SERVER['HTTP_HOST']))."%')";
             
        
$where_query .= " ORDER BY ".$orderby;
        switch (
$rettype) {
            case 
"object":
                
$sql "SELECT * FROM " $db->prefix("newblocks") . "" $where_query;
                
$result $db->query($sql);
                while (
$myrow $db->fetchArray($result)) {
                    
$ret[] = new XoopsBlock($myrow);
                }
                break;
            case 
"list":
                
$sql "SELECT * FROM " $db->prefix("newblocks") . "" $where_query;
                
$result $db->query($sql);
                while (
$myrow $db->fetchArray($result)) {
                    
$block = new XoopsBlock($myrow);
                    
$title $block->getVar("title");
                    
$title = empty($title) ? $block->getVar("name") : $title;
                    
$ret[$block->getVar("bid")] = $title;
                }
                break;
            case 
"id":
                
$sql "SELECT bid FROM " $db->prefix("newblocks") . "" $where_query;
                
$result $db->query($sql);
                while (
$myrow $db->fetchArray($result)) {
                    
$ret[] = $myrow['bid'];
                }
                break;
        }
        
//echo $sql;
        
return $ret;
    }

    
/**
     * XoopsBlock::getByModule()
     *
     * @param mixed $moduleid
     * @param mixed $asobject
     * @return
     */
    
function getByModule($moduleid$asobject true)
    {
        global 
$multisite_module;
        
$moduleid intval($moduleid);
        
$db = &XoopsDatabaseFactory::getDatabaseConnection();
        if (
$asobject == true) {
            
$sql $sql "SELECT * FROM " $db->prefix("newblocks") . " WHERE mid=" $moduleid;
        } else {
            
$sql "SELECT bid FROM " $db->prefix("newblocks") . " WHERE mid=" $moduleid;
        }
        if (
$multisite_module->isActive())
             
$sql .= " AND (domains like '|all%' or domains like '%|".str_replace('www.','',strtolower($_SERVER['HTTP_HOST']))."%')";

        
$result $db->query($sql);
        
$ret = array();
        while (
$myrow $db->fetchArray($result)) {
            if (
$asobject) {
                
$ret[] = new XoopsBlock($myrow);
            } else {
                
$ret[] = $myrow['bid'];
            }
        }
        return 
$ret;
    }



the part that needs to be added is:

$sql .= " AND (b.domains like '|all%' or b.domains like '%|".str_replace('www.','',strtolower($_SERVER['HTTP_HOST']))."


You will see where this is added (If you are doing a production machine the all you have to do is add this line where you see in the first code example.
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts

30
dr-no
Re: Testing: Multisite Module 1.17 RC for XOOPS 2.3 ==> 1.22+Patch
  • 2009/6/28 14:29

  • dr-no

  • Just popping in

  • Posts: 4

  • Since: 2009/5/1 1


Wishcraft provided me the link for the newest version of the module (http://cid-6580d2a11c091017.skydrive.live.com/self.aspx/XOOPS%20Modules/Multisite/Source/xoops2.3%7C_multisite%7C_1.22+Patch.zip), which he said, is not officially released, but it works for me better than the 1.17 version, since it comes with all the patches to the XOOPS core inside.

One bug I have already identified:

Parse error: syntax error, unexpected '}' in /.../htdocs/modules/multisite/class/domain.php on line 613

You just have to delete the very last parenthesis in domain.php.

After that everything is working fine, except for trying to set the system preferences for each domain:

http://www.example-domain1.xyz/modules/multisite/admin.php?fct=preferences&op=show&confcat_id=1&domain=http%3A%2F%2Fexample-domain1.xyz

results in the following:

Fatal error: Call to undefined method MultisiteDomainHandler::getDomainOptions() in /.../htdocs/modules/multisite/admin/preferences/main.php on line 438

I will try to resolve the bug ... since this is a great module Smile


Login

Who's Online

198 user(s) are online (109 user(s) are browsing Support Forums)


Members: 0


Guests: 198


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits