ANSAYFA
mark( 'afterLoad' ) : null;
/**
* CREATE THE APPLICATION
*
* NOTE :
*/
$mainframe =& JFactory::getApplication('site');
$my = $mainframe->getUser();
$jConfig = new JConfig;
$db = & JFactory::getDBO();
$sql = "SELECT params"
. "n FROM ".$jConfig->dbprefix."modules"
. "n WHERE title = '123FlashChat'";
$db->setQuery($sql);
$row = null;
$params = $db->loadResult();
if(!empty($params))
{
$chat_config = explode("n",$params);
foreach($chat_config as $val)
{
parse_str($val);
}
}
if($extend_chat_server == 2 &&($swfname == "" || $init_host == "" || $init_port == "" || $init_group == ""))
{
$urlinfo = getHostParameters($client_location);
$swfname = basename($urlinfo['path']);
parse_str($urlinfo['query']);
}
$width = ($width < 700)?"700":$width;
$height = ($height < 500)?"500":$height;
switch($extend_chat_server)
{
case 0:
chat_free();
break;
case 1:
show_chat();
break;
case 2:
show_chat();
break;
}
function chat_free()
{
global $mainframe,$my,$chat_room_name,$width,$height;
echo pageheader();
echo '
';
echo pagefooter();
}
function show_chat()
{
global $client_location,$swfname,$init_host,$init_port,$init_group,$my,$width,$height;
$client_location = checkSlash($client_location);
$swfurl = $client_location.$swfname;
if(!empty($init_host)){
$swfurl .= (strpos($swfurl,"?"))?"&init_host=".$init_host:"?init_host=".$init_host;
}
if(!empty($init_port)){
$swfurl .= (strpos($swfurl,"?"))?"&init_port=".$init_port:"?init_port=".$init_port;
}
if(!empty($init_group)){
$swfurl .= (strpos($swfurl,"?"))?"&init_group=".$init_group:"?init_host=".$init_group;
}
if(!empty($my->username)){
$swfurl .= (strpos($swfurl,"?"))?"&init_user=".$my->username:"?init_user=".$my->username;
}
if(!empty($my->password)){
$swfurl .= (strpos($swfurl,"?"))?"&init_password=".$my->password:"?init_password=".$my->password;
}
echo pageheader();
echo '
';
echo pagefooter();
}
function getHostParameters($client_location)
{
$content = @file_get_contents($client_location);
if(!empty($content))
{
$pattern = '|var urlValue="(.*)"|U';
preg_match($pattern, $content, $matches);
if(!empty($matches[1]))
{
$url = $matches[1];
$urlinfo = parse_url($url);
return $urlinfo;
}
else
{
$pattern = '|PARAM NAME=movie VALUE="(.*)"|U';
preg_match($pattern, $content, $matches);
if(!empty($matches[1]))
{
$url = $matches[1];
$urlinfo = parse_url($url);
return $urlinfo;
}
}
return false;
}
}
function checkSlash($path)
{
if(substr($path,-1,1) != "/" && !empty($path)){
$path = $path."/";
}
return $path;
}
function pageheader()
{
echo '';
echo '';
echo '
Chat Room - Powered by 123FlashChat';
echo '';
echo '';
}
function pagefooter()
{
echo '';
echo '';
}
?>