hallo,
ich habe ein kleine joomla problem. ich würde gerne versch. usern versch. content anzeigen. nun bin ich über das script mosif gestolpert. hiermit gehts eigentlich ganz gut, ich kann untersch. usern, usergruppen usw. versch. content anzeigen. nun würde ich jedoch gerne den content von der domain abhängig machen, von der der user die seite aufgerufen hat. sprich ich habe eine seite, auf die z.b. 3 domains verlinken und jede domain soll ihren eigenen content haben. leider konnte mir der porgrammiere auch nciht wirklich weiterhlefen und meine eigenen versuche sind gescheitert....vielleicht hat ja einer von euch eine idee?!

so sieht das scribt aus, die variable DOMAIN war einer meiner versuche:

<?php
/**
* MosIf 1.11
* Conditional mambot.
* MosIf can control entire sections of your document based on certain criterias.
* (C) Martin Larsen 2005
* See readme.txt and homepage for details
* http://www.kreacom.dk/mambots/mosif.html
**/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

$_MAMBOTS->registerFunction( 'onPrepareContent', 'mosIf' );


function mosIf( $published, &$row, &$params, $page ) {
if(!$published) return true;
//print_r($row);
global $mosif_author;
$mosif_author = $row->author;
//$regex = "#{mosif +(\w+) *(!?(?:=|<|>|&gt;|&lt;|gt|lt)) *([^}]+)}(.*?)(?:{else}(.*?))?{endif}|{mosif (\w+)}#i";
$regex = "#{(?:mosif|if)((?:\.\S*)?) +(\w+) *(!?(?:=|<|>|&gt;|&lt;|gt|lt)) *([^}]+)}(.*?)(?:{else\\1}(.*?))?{endif\\1}|{mosif (\w+)}#is";
global $mosif_matchfound;
do { // Get all nested mosif's
$mosif_matchfound=false;
$row->text = preg_replace_callback($regex, "mosif_callback", $row->text);
} while ($mosif_matchfound) ;


//$row->text = preg_replace_callback($regex, "mosif_callback", $row->text);

return true;
}

function testIt($a, $b, $op="="){
$a=strtolower($a);
$b=strtolower($b);
//echo "b: $b<br>";
if($op=="=" && (strpos($b, "*")!==false||strpos($b, "?")!==false||strpos($b, ",")) ) {
//echo "regex, $op<br>";
// We have an asterisk, question mark or a comma (here comma acts like an OR operator), so use RegEx!
$wildcards = array(" , ", ", ", " ,", ",", "\?", "\*");
$regex = array("|" , "|" , "|" , "|", "." , ".*");
$b="/^(".str_replace($wildcards, $regex, preg_quote($b)).")$/i"; // Convert string to simple regex pattern

//echo"regex: $a&nbsp; &nbsp;&nbsp; $b<br>".preg_match($b,$a)."<br><br>";

return preg_match($b,$a);
}
//else return strcasecmp($a,$b)==0; // Perform simple case insensitive comparison
else {
//echo $op."<br>";
switch($op){
case ">":
case "&gt;":
case "gt":
return $a>$b;
case "<":
case "&lt;":
case "lt":
return $a<$b;
default:
return $a==$b;
}
}
};

function help(){
$s = printf("ip: %s<br>author: %s<br>username: %s<br>usergroup: %s<br>usertype: %s<br>language: %s<br>weekday: : %s<br>date: %s<br>time: %s<br>datetime: %s<br>", $_SERVER['REMOTE_ADDR'], $mosif_author, $my->username, $groups[$my->gid], $my->usertype, _LANGUAGE, date('l', time()), date('Y.m.d', time()), date('H.i.s', time()), date('Y.m.d H.i.s', time()) );
}

function mosif_callback(&$matches){
global $my, $mosif_author, $mosif_matchfound;
$mosif_matchfound=true;
$groups = array("public","registered","special");

$condition=strtolower($matches[2]);
if(!$condition) $condition=strtolower($matches[7]);
$operator=strtolower($matches[3]);
$negated=$operator[0]=="!";
if($negated) $operator = substr($operator,1);
//echo "negated: $negated<br>";
$expression=$matches[4];
$content=$matches[5];
$else=$matches[6];

if(substr($condition,0,7)=="cookie_") {
$cookie = substr($condition, 7);
$condition="cookie_";
//echo "\$cookie: $cookie = $_COOKIE[$cookie]<br>";
}

if (phpversion() <= "4.2.1") {
$agent = getenv( "HTTP_USER_AGENT" );
$domain = gethostbyaddr( getenv( "REMOTE_ADDR" ) );
} else {
$agent = $_SERVER['HTTP_USER_AGENT'];
$domain = gethostbyaddr( $_SERVER['REMOTE_ADDR'] );
}
$browser = mosGetBrowser( $agent );

//echo "\$condition: $condition<br>\$operator: $operator<br>\$expression: $expression<br>\$content: $content<br>\$else: $else<br><br><br>";

switch ($condition) {
case "debug":
$content = sprintf("<div style='font-weight:bold'>CURRENT MOSIF VALUES ARE:<br>ip: %s<br>browser: %s<br>author: %s<br>username: %s<br>usergroup: %s<br>usertype: %s<br>language: %s<br>weekday: %s<br>date: %s<br>time: %s<br>datetime: %s<br>(Cookie values are not shown)</div>", $_SERVER['REMOTE_ADDR'], $browser, $mosif_author, $my->username, $groups[$my->gid], $my->usertype, _LANGUAGE, date('l', time()), date('Y.m.d', time()), date('H.i.s', time()), date('Y.m.d H.i.s', time()) );
$showContent = true;
break;
case "ip":
$showContent = testIt($_SERVER['REMOTE_ADDR'], $expression, $operator);
break;
case "browser":
$showContent = testIt($browser, $expression, $operator);
break;
case "author":
$showContent = testIt($mosif_author, $expression, $operator);
break;
case "username":
$showContent = testIt($my->username, $expression, $operator);
break;
case "usergroup":
$showContent = testIt($groups[$my->gid], $expression, $operator);
break;
case "usertype":
$showContent = testIt($my->usertype, $expression, $operator);
break;
case "domain":
$showContent = testIt($_SERVER['HTTP_REFERER'], $expression, $operator);
break;
case "language":
$showContent = testIt(_LANGUAGE, $expression, $operator);
break;
case "cookie_":
$showContent = testIt($_COOKIE[$cookie], $expression, $operator);
break;
case "weekday":
$showContent = testIt(date('l', time()), $expression, $operator);
break;
case "date":
$showContent = testIt(date('Y.m.d', time()), $expression, $operator);
break;
case "time":
$showContent = testIt(date('H.i.s', time()), $expression, $operator);
break;
case "datetime":
$showContent = testIt(date('Y.m.d H.i.s', time()), $expression, $operator);
//echo date('Y.m.d H.i.s', time())."<br>";
break;
default:
$showContent = false;
$else = "<span style='color:red;font-weight:bold'>'$condition' is not recognized by mosIf!</span>";
};
if ($negated) $showContent=!$showContent;
if ($showContent)
return $content;
else
return $else;

}
?>

hoffe einer von euch kann mir helfen, den "stein ins rollen" zu bringen?!

danke!