<?php 
// $Id: block-Who_is_Online_IrcChat.php,v 20.1 2004/01/13 10:56:11 KorschAl Exp $
// based on: block-Who_is_Online.php,v 1.6 2003/10/02 22:28:55 EllselAn Exp $
/**********************************************************************/
/* vkpMx 2.0  Content Management System Platform                      */
/* ================================================================== */
/* Copyright (C) 2003 by the vkpMx & pragmaMx Developer Team          */
/* email:         team@pragmamx.org                                   */
/* homepage:      http://www.maax-design.de                           */
/* further sites: http://www.pragmaMx.org, http://www.guggemahier.de, */
/*            http://www.marx-city.de, http://www.genutec-studios.de, */
/*            http://www.shiba-design.de, http://www.power-maax.de    */
/* ================================================================== */
/*   The vkpMx is distributed free of charge by maax-design.de.       */
/*   The use of this system is allowed until copyright information    */
/*   is shown perspicuous visible and correcty on all system pages.   */
/*   Sales, rent out and the use of single code parts from this       */
/*   system must be allowed by maax-design.de.                        */
/**********************************************************************/
/*																	*/
/* Module Co-Development and eggdrop enhancement by ircfreunde.de	*/
/*																	*/
/********************************************************************/

################# Einstell Variablen ############################################################################
$onlinelistsize  = 8; 	    # Hoehe des Selectfeld der Onlinuser (Online-Liste)
$onlinechatlistsize=8;       # Hoehe des Selectfeld der Chatuser (Online-Liste)
$showuserlistall = 0;     	# Wenn Online-Liste immer erscheinen soll, 1=Ja, 0=nein
$showbuddy       = 1;  			# Buddylink (Messenger) anzeigen , 1=Ja, 0=nein
$maxnewmember    = 3;  			# Wieviele neue Mitglieder anzeigen
        
# User, die nicht angezeigt werden sollen
# Namen mit Komma trennen!
$excludedusers ="Texsterdsgf, Knaxllerfgfd";
##################################################################################################################
$imagedir="images/maaxon";
$pm_module_name = "Private_Messages";
##################################################################################################################
#$checkpmtime=200000; # Intervall zum private Nachrichten abfragen, 0 wenn nicht abgefragt werden soll
$thisfile=basename(__file__);
if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");

$mxblockcache = FALSE;

global $prefix, $user_prefix, $bgcolor1, $bgcolor2, $bgcolor3, $txtcolor1, $txtcolor2; 

if(@file_exists("language/maaXoN/maaXoN-".$GLOBALS['currentlang'].".php")) {
	include_once("language/maaXoN/maaXoN-".$GLOBALS['currentlang'].".php");
	}
else {
	include_once("language/maaXoN/maaXoN-english.php");
	}
# Variablen initialisieren
if(substr(strtolower($GLOBALS['currentlang']), 0, 6) == "german"){	# Bilder fuer Buttons definieren (noch keine Bilder vorhanden!!)
	$pmimagepath="modules/$pm_module_name/images/buttons/german";
	}
else{
	$pmimagepath="modules/$pm_module_name/images/buttons/english";
	}

# Variablen initialisieren
$isseruser = 0;
$username = "";
if (mxIsUser()){
	$isseruser = 1;
	$cookie=mxGetUserSession();
	$username = $cookie[1];
	$uid = $cookie[0];
	}

$isseradmin = mxIsAdmin();
# SQL-bedingung fuer excluded Users erstellen
$exusers = explode (",", $excludedusers);
if(!$isseradmin){
	while (list($key, $val) = each($exusers)) {      
		$xexusers[]=trim($val);
		}
	}
$xexusers[] = $GLOBALS['anonymous'];
$excludedusers = "'".implode("','",$xexusers)."'";

# Anzahl aller User und hoechste uid ermitteln
$totalmembers=0;
$qry="select COUNT(uid), MAX(uid) from ${user_prefix}_users where user_stat=1;";
list($totalmembers, $lastuid) = sql_fetch_row(sql_query($qry));

# neusten User ermitteln
$lastuid = (empty($lastuid)) ? 0 : $lastuid;
$qry="select uname from ${user_prefix}_users where uid = $lastuid;";
$result = sql_query($qry);	# neusten User ermitteln
list($lastuser) = sql_fetch_row($result);

$past = time()- MX_SETINACTIVE_MINS ;
# Alle Gaeste ermitteln
$guest_online_num=0;
$result = sql_query("SELECT Count(ip) FROM ${prefix}_visitors WHERE time>".$past." AND uid=0;");
list($guest_online_num) = sql_fetch_row($result);

# Alle User ermitteln, evtl auflisten
$member_online_num = 0; 
$whoonlineselect = "";
$smallunmae = strtolower($username);


#$GLOBALS["mxSqlDebug"]      = 1;
#$result = sql_query("SELECT uname, uid, user_lastvisit FROM ${user_prefix}_users WHERE (user_lastvisit >= ".$past.") AND user_stat=1 order by uname");
/* $result = sql_query("SELECT u.uname
FROM ${user_prefix}_users As u LEFT JOIN ${prefix}_visitors AS v ON u.uid = v.uid
WHERE ((u.user_lastvisit >= ".$past.") AND (u.user_stat=1) AND (u.uname NOT IN ($excludedusers)) AND (v.uid=u.uid))
ORDER BY u.uname"); */
$result = sql_query("SELECT uname FROM ${user_prefix}_users
WHERE ((uname Not In (".$excludedusers.")) AND (user_lastvisit >= ".$past.") AND (user_stat=1) AND (user_lastmod<>'logout'))
ORDER BY uname");
#$GLOBALS["mxSqlDebug"]      = 0;
while (list($uname2) = sql_fetch_row($result)) {
	$sel = (strtolower($uname2) == $smallunmae) ? " selected " : "";
	$uname3 = mxCutString($uname2, 18, "..", "");	# Kurzen Usernamen erstellen
	$whoonlineselect.="<option value=\"".$uname2."\" ".$sel." title=\"".$uname2."\">".$uname3."</OPTION>\n"; # options fuer auswahlselect erstellen
	$member_online_num++;	# Anzahl User hochzaehlen
	}

# Private Nachrichten 
$countpm=0; $countpmunread=0; $sendpm=0;
if ($isseruser) { # Wenn aktueller User registriert ist (kein Gast)
	$pmactiv = (mxModuleAllowed($pm_module_name)) ? 1 : 0; # feststellen ob pm-modul aktiv ist
	if ($pmactiv){	# falls pm-modul aktiv ist
		$qry="SELECT read_msg, Count(msg_id) FROM ${prefix}_priv_msgs WHERE to_userid=".$uid." group by read_msg;";
		$result = sql_query($qry);
		while (list($read_msg, $nums) = sql_fetch_row($result)) {
	  	if ($read_msg==0) {	# wenn angemeldeter User
				$countpmunread=$nums;	# Anzahl ungelesene ermitteln
		  	}
			else{
				$countpm=$nums;	#++;	# Anzahl aller pm's ermitteln
				}
			}
		}
		$qry="SELECT read_msg, Count(msg_id) FROM ${prefix}_priv_msgs_send WHERE from_userid=".$uid." group by read_msg;";
		$result = sql_query($qry);
		while (list($read_msg, $nums) = sql_fetch_row($result)) {
	  	$sendpm=$nums;
	}
	#else{
		#$checkpmtime=0; # private Nachrichten nicht abfragen!
	#	}
	}

# Usergaestebuch
$content_ug = "";
if ($isseruser) { # Wenn aktueller User registriert ist (kein Gast)
	if (mxModuleAllowed("UserGuest")){	# falls gaestebuch vorhanden
		$qry="SELECT Count(gid) FROM ${prefix}_userguest WHERE touserid='".$uid."' AND touser = '".$username."' AND dummy=0;";
		$result = sql_query($qry);
		list($gbnewentries) = sql_fetch_row($result);
		# Usergaestebuch
		if(!empty($gbnewentries)){
			$content_ug .= "<div align=\"left\"><a href=\"modules.php?name=UserGuest&op=view&touser=$username\">
			<img src=\"$imagedir/tcake.gif\" width=\"19\" height=\"19\" border=\"0\" Alt=\""._BWOGUESTBOOK."\"></a> \n
			<b>$gbnewentries </b><a href=\"modules.php?name=UserGuest&op=view&touser=$username\">";
			if($gbnewentries==1){ 
				$content_ug .= ""._BWOGUESTBOOK1."";
				}
			else { 
				$content_ug .= ""._BWOGUESTBOOK2."";
				}
			$content_ug .= "</a></div>";
			}
		}
	}

# weitere Variablen initialisieren zur Zeitberechnung :(
//Creating SQL parameter
$gestern = mktime(0, 0, 0, date ("m") , date ("d")-1, date("Y"));
$heute = mktime(0, 0, 0, date ("m") , date ("d"), date("Y"));

# Heute neu angemeldete User ermitteln
$qry = "SELECT COUNT(uid) from ${user_prefix}_users WHERE user_regtime >= $heute and user_stat=1 and uname not in($excludedusers);";
list($userCount) = sql_fetch_row(sql_query($qry));

# Gestern neu angemeldete User ermitteln
$qry = "SELECT COUNT(uid) from ${user_prefix}_users WHERE user_regtime >= $gestern and user_regtime < $heute and user_stat=1 and uname not in($excludedusers);";
list($userCount2) = sql_fetch_row(sql_query($qry));

# Ausgabe ...................................
$content = "\n<!-- $thisfile output start -->\n<div id=\"boxcontentaccount\">\n";
$userinfo = mxGetUserData(); // gesamte Userdaten in Array lesen
$userinfo['avatar'] = mxIsAvatarUploaded($userinfo['uname']); //Avatar hochgeladen
if ($userinfo['avatar']) //ja Avatar vorhanden
	{
		$userinfo['avatar'] = "".MX_PATH_MEMBERAVATAR."/".$userinfo['avatar'].""; //Bildpfad setzen
	}
	else 
	{
		if (!empty($userinfo['user_avatar'])) //nein kein Avatar, scheuen ob er sich ein icon ausgesucht hat
		{
			$userinfo['avatar'] = "<img src=" . MX_PATH_AVATAR . "/" . $userinfo['user_avatar'] .""; //ja Icon ausgesucht, Pfad setzen
		}
		else // Auch kein Icon, dann blank.gif setzen
		{
			$userinfo['avatar'] = "<img src=" . MX_PATH_AVATAR . "/blank.gif"; //ja Icon ausgesucht, Pfad setzen
		}
	}

if ($isseruser) {

$content .= "Willkommen in Deiner Community, <br><font color=\"#ff0000\"><b><center>$username!</center></b></font><br>\n";
$content .= "<div><center><a href=\"modules.php?name=Your_Account\">".mxCreateImage($userinfo['avatar'])."</a><br>\n"; //Ausgabe des Avatar
$content .= "<b>..::[ <a href=\"modules.php?name=Your_Account\">Dein Account</a> ]::..</b><br>\n";
$content .= "(<a href=\"modules.php?name=Your_Account&amp;op=logout\">logout</a>)<br><br></center></div>\n";
}else{

$content .= "Hallo verehrter <b>Gast!</b><br>\n";
$content .= "<br><strong><big>&middot;</big></strong>&nbsp;<b><a href=\"modules.php?name=User_Registration\">Registrieren</a></b><br><strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=Your_Account\">Mitglieder Login</a><br><strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=Your_Account&amp;op=pass_lost\">Passwort vergessen?</a><br><strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=FAQ\">Hilfe!(FAQ)</a><br>
<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=Content&amp;pa=showpage&amp;pid=46\">Warum registrieren (Info)?</a><br><br>
<hr style=\"color:grey; background-color:black; height:2px;
  margin-right:0; text-align:right; border:1px solid grey;\">
<center><b>[ <a href=\"modules.php?name=IrcChat\">Ab in den Chat :)</a> ]</b><br>
<font class=\"tiny\">Auch als unregistriertes Mitglied kannst Du unseren Chat nutzen</font></center>
<hr style=\"color:grey; background-color:black; height:2px;
  margin-right:0; text-align:right; border:1px solid grey;\">
\n";
}

# private messages
	if (!empty($pmactiv) && $isseruser){
		# pm Liste
		include("modules/Private_Messages/inboxsize-conf.php");
		$erlaubtpm=$sentboxsize;
		$erlaubtgetpm=$inboxsize;
		if($countpm >= $erlaubtgetpm) {
			$countpm = "$countpm";
		}
		if($sendpm >= $erlaubtpm) {
			$sendpm = "$sendpm";
		}
		$content .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border: 0px; margin-bottom: 5px;\">\n";
		if ($countpm || $sendpm){
			$content .= "\n<tr>\n<td colspan=\"3\" align=\"center\" class=\"boxcontent\"><b><a href=\"modules.php?name=Private_Messages\">"._BWOPMSG."</a></b></td>\n</tr>\n";
			$content .= "\n<tr>\n<td align=\"center\" class=\"boxcontent\"><a href=\"modules.php?name=Private_Messages\"><img src=\"$imagedir/pmessage.gif\" width=\"19\" height=\"19\" border=\"0\" Alt=\""._BWOPMSG."\"></a></td>\n";
			$content .= "<td valign=\"top\" class=\"boxcontent\">"._BWOPMSGALL.":<br>\ngesendet:<br>\n"._BWOPMSGUNREAD.":</td>\n";
			$content .= "<td valign=\"top\" align=\"right\" class=\"boxcontent\"><b>".$countpm." </b>/<i>".$erlaubtgetpm."</i><br>\n";
			$content .= "&nbsp;<b>".$sendpm."</b> /<i>".$erlaubtpm."</i><BR>";
			$content .= ($countpmunread) ? "<img src=\"modules/eBoard/images/buttons/german_du/new.gif\" alt=\"\" width=\"38\" height=\"18\" border=\"0\">&nbsp;<b>".$countpmunread."</b>" : "<b>$countpmunread</b>";
			$content .= "</td>\n";
			$content .= "</tr>\n";
			}
		else{
			$content .= "<br><tr><td class=\"boxcontent\"><a href=\"modules.php?name=Private_Messages\"><img src=\"$imagedir/pmessage.gif\" width=\"19\" height=\"19\" border=\"0\" Alt=\""._BWOPMSG."\" hspace=\"0\"></a></td><td><a href=\"modules.php?name=Private_Messages\">"._BWOPMSG."</a></td></tr>\n";
			}
		$content .= "</table>\n";
	
			}

# Buddy
		if ($showbuddy && $isseruser){
			$themedir = MX_THEME_DIR."/images";
			$buddyimg = (@file_exists($themedir."/buddy.gif")) ? $themedir."/buddy.gif" : $imagedir."/buddy.gif";
			$buddyimg = mxCreateImage($buddyimg, _BWOBUDDIE, 0);
			$windowname=md5($GLOBALS['sitename']);
			$content .= "
<center><div style=\"background-color:$bgcolor2; color:#fff; width:150px; border:2px solid #ddd;\"><font style=\"color:#ffffff\">=*=&nbsp;<b><a style=\"font-size:12px; cursor:pointer; a:link { font-weight:bold; color:#ffffff; text-decoration:none; }; a:hover { font-weight:bold; color:red; text-decoration:none }\" href=\"#\" onClick=\"window.open('modules.php?name=Private_Messages&amp;file=buddy','$windowname','left=180, top=150, width=240,height=350,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,copyhistory=0'); return false;\">PM</a></b>&nbsp;=*=</div><hr style=\"color:grey; background-color:black; height:2px;
  margin-right:0; text-align:right; border:1px solid grey;\"></center>\n";
	
}
if ($isseruser || $isseradmin || $showuserlistall) {	# Wenn angemeldeter User oder Admin oder Liste immer erscheinen soll
	# Onlineliste anzeigen wenn User online sind


	if($member_online_num>0){
		if($onlinelistsize>=$member_online_num) {$onlinelistsize=$member_online_num+1;}
		if(!$isseruser || !$pmactiv){
			$script = "";

			}
		else{
			$script = " onDblClick=\"whob_clickit()\"";
			$content .= "<script language=\"JavaScript\">\n<!--\n";
			$content .= "function whob_clickit(){\n";
			$content .= "	var y=document.onlineuserinfo.uname.selectedIndex; \n";
			$content .= "	var x=document.onlineuserinfo.uname.options[y].value; \n";
			$content .= "	window.open('modules.php?name=$pm_module_name&file=buddy&op=compose&to='+x, '".md5(time())."','left=370,top=150,width=450,height=300,toolbar=no,location=no,menubar=no,scrollbars=yes,resizeable=yes,status=no');\n";
			$content .= "	return false;\n";
			$content .= "	}\n//-->\n";
			$content .= "</script>\n";
		}
	#background-color: #000000; font-size: 9px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: #ffffff; width: 90%; border: 0px $bgcolor1;
# Chatuser ermitteln
$chatrooms="";

//
// IrcChat-Enhancement
//
// disable ircchat html output by default
$chatrooms="";
$ircchat_active = false;
if(mxModuleAllowed("IrcChat")){
	include("modules/IrcChat/config.php");
	if($botconf['eggdrop'] == "true" && !empty($botconf['verzeich'])) {
		// enable html output
		$ircchat_active = true;
		// Wenn Admin wird Admin-Nic genommen
		if(mxIsAdmin())
		{
		  	extract(mxGetAdminSession());
			$thisuser = str_replace(array("SiteAdmin ", "SiteAssistant ", "Admin ", " "),array("","","","_"), $aid);
			
				if(count($chatroom['public']) > 0){
					for($i=0; $i < count($chatroom['public']); $i++) $chatrooms[] = $chatroom['public']["$i"]; 	
				}
				if(count($chatroom['user']) > 0){
					for($i=0; $i < count($chatroom['user']); $i++) $chatrooms[] = $chatroom['user']["$i"]; 	
				}	
				if(count($chatroom['admin']) > 0){
					for($i=0; $i < count($chatroom['admin']); $i++) $chatrooms[] = $chatroom['admin']["$i"]; 	
				}
		}
		// wenn User und nicht Admin wird User-Nic genommen
		elseif(mxIsUser()){
			$cookie = mxGetUserSession();
			$thisuser = str_replace(" ", "_", $cookie[1]);
				
				if(count($chatroom['public']) > 0){
					for($i=0; $i < count($chatroom['public']); $i++) $chatrooms[] = $chatroom['public']["$i"]; 	
				}
				if(count($chatroom['user']) > 0){
					for($i=0; $i < count($chatroom['user']); $i++) $chatrooms[] = $chatroom['user']["$i"]; 	
				}	
		// wenn Anonymous wird Nic hier zusammen gesetzt
		// (damit auch mehr als ein Gast im Chat sein kann)
		}else{
			$thisuser = _CHAT_GUEST."_".substr( time(), 6);
				if(count($chatroom['public']) > 0){
						for($i=0; $i < count($chatroom['public']); $i++) $chatrooms[] = $chatroom['public']["$i"]; 	
				}
		}
		$ChatPeople[]= "";
		$wio_chat_file_size= 0;
#		if(count($chatrooms) > 0){
#			for($i=0; $i < count($chatrooms); $i++)
#				if($chatrooms["$i"] != "" && $chatrooms["$i"] != "quizz")
#                        {
					  

                                               $onlinetext = "http://www.die-welt.net/~evgeni/gc.txt";                                        
                                        if(ereg('://', $onlinetext) && !ini_get('allow_url_fopen')){
                                                @ini_set("allow_url_fopen","1");
                                                $restore_ini = true;
                                        }else{
                                                $restore_ini = false;        
                                        }
                                        
                                        $wio_chat_file = fopen($onlinetext, "rt");
                                                        while ($CLine = fgets($wio_chat_file, 999)) {
                                        #                	echo "tt: ".$CLine;
                                                                $chatpe = str_replace("\n", "", $CLine);
                                        #                $teile=explode(chr(34),$CLine); 
                                        #				$name=$teile[1];
                                        
                                        #                if ($name!=$botconf['botname'] && $name!="Quizzy" && $name!="IRCFreund" && $name!="Statistiker") {
                                                        $ChatPeople[] .="\n".$chatpe."";
                                                        
                                                                
                                        #                        }
                                                       }
                                        fclose($wio_chat_file);
                                        if($restore_ini) @ini_set("allow_url_fopen","0");
#echo print_r($ChatPeople, true);


#			}
#		}

		$ChatPeople = array_unique($ChatPeople);

		#$wio_chat_file_size = count($ChatPeople);
		$sauber = "";
		foreach($ChatPeople as $value) {
			if($value !=""){
			 $sauber .= "$value"; 
			 $wio_chat_file_size++;
			}	
			
		}
		#echo $sauber;
		function xx($a,$b) { 
  return strcmp(strtolower($a),strtolower($b)) ;
} 

//$sauber .= "<BR>"; 
		$ChatPeople = substr($sauber,1);
		
		$sortierung = explode("\n", $ChatPeople);
	  usort($sortierung,xx);
//	  $ChatPeople = implode("\n", $sortierung);
		$ChatPeopleCount = count($sortierung);
	  
			if($wio_chat_file_size>0){
			
			if($onlinechatlistsize>=$wio_chat_file_size) {$onlinechatlistsize=$wio_chat_file_size+1;}
			
			$newPeopleList = '';
			foreach($sortierung AS $value) {
				$newPeopleList .= '<option value="'.$value.'" title="'.$value.'" font color="#ffffff">'.$value.'</OPTION>'."\n";
			}
			$ChatPeople = $newPeopleList;
			
		        } else {
		        $onlinechatlistsize=2;
		        $ChatPeople.="<option value=\"niemand\" title=\"niemand\" font color=\"#ffffff\">Kein User im Chat</OPTION>\n";
		        }
		
		
		
	} // end if eggdrop
	
	// Unset chat config.php values
	unset($chatsettings); unset($chatroom);	unset($chatconf); unset($styleconf); unset($guiconf); unset($botconf); unset($chatsmileys); unset($newPeopleList);
} // end if chat enabled and allowed

	$content .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border: 0px; margin-bottom: 5px;\">\n";
	$content .= "\n<tr>\n<td colspan=\"2\" align=\"center\" class=\"boxcontent\">\n";
	$content .= "<b><a href=\"/modules.php?name=mx_ma_useronline\">Jetzt online</a>:</b><br>\n";
	$content .= "</td>\n</tr>\n";
	$content .= "\n<tr>\n<td colspan=\"2\" align=\"center\">";	# select-options verwenden
	$content .= "<form action=\"modules.php?test\" name=\"onlineuserinfo\" method=\"get\" style=\"border: 0px; margin-bottom: 5px; margin-top: 0px;\">";
	$content .= "<input type=\"hidden\" name=\"name\" value=\"Your_Account\">";
	$content .= "<input type=\"hidden\" name=\"op\" value=\"userinfo\">";
	$content .= "<select name=\"uname\" size=\"$onlinelistsize\" style=\" background-color: $bgcolor1; font-size: 9px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: #ffffff; width: 90%; cursor: hand;	border: 1px solid $bgcolor2; text-decoration: none; padding-left: 1px; padding-top: 1px; padding-bottom: 1px;\" $script>".$whoonlineselect."</select>";
	$content .= "\n<input type=\"submit\" value=\"Profil anzeigen\" style=\"background-color:#303030; color:#fff; font-size:100%; font-weight:bold; color:#ffffff; width:150px; border:2px solid #ddd; cursor:pointer; a:link { font-weight:bold; color:#ffffff; text-decoration:none; }; a:hover { font-weight:bold; color:red; text-decoration:none }\"\">";
	$content .= "</form>\n";
# Buddy
		if ($showbuddy){
			$themedir = MX_THEME_DIR."/images";
			$buddyimg = (@file_exists($themedir."/buddy.gif")) ? $themedir."/buddy.gif" : $imagedir."/buddy.gif";
			$buddyimg = mxCreateImage($buddyimg, _BWOBUDDIE, 0);
			$windowname=md5($GLOBALS['sitename']);
			#$content .= "<center><a href=\"#\" onClick=\"window.open('modules.php?name=Private_Messages&amp;file=buddy','$windowname','left=180, top=150, width=240,height=350,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,copyhistory=0'); return false;\">".$buddyimg."</a><br></center>\n";
	$content .= "</td>\n</tr>\n";
			// only active when ircchat if-part was executed
	if($ircchat_active) {
//		echo $ChatPeople;
		$content .= "\n<tr>\n<td colspan=\"2\" align=\"center\" class=\"boxcontent\">\n";
		$content .= "<img src=\"$imagedir/guy_hand.gif\" width=\"19\" height=\"19\" border=\"0\" Alt=\""._BWOPICS."\" align=\"absmiddle\">\n<b>".$ChatPeopleCount." User im Chat aktiv:</b>\n<img src=\"$imagedir/girl_hand.gif\" width=\"19\" height=\"19\" border=\"0\" Alt=\""._BWOPICS."\" align=\"absmiddle\"><br>\n";
		$content .= "</td>\n</tr>\n";
		$content .= "\n<tr>\n<td colspan=\"2\" align=\"center\">";	# select-options verwenden
		$content .= "<form action=\"modules.php?test\" name=\"onlinechatuserinfo\" method=\"get\" style=\"border: 0px; margin-bottom: 5px; margin-top: 0px;\">";
		$content .= "<select name=\"ucname\" size=\"$onlinechatlistsize\" style=\" background-color: #000000; font-size: 9px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: #ffffff; width: 90%; cursor: hand;	border: 1px solid $bgcolor2; text-decoration: none; padding-left: 1px; padding-top: 1px; padding-bottom: 1px;\">".$ChatPeople."</select>";
		$content .= "</form><br><b>[ <a href=\"modules.php?name=IrcChat\">In den Chat</a> ]</b>\n";
		$content .= "</td>\n</tr>\n";
	
	}
       		}
	}
	$content .= "</table>\n";
	}
			
	# Usergaestebuch
	#$content .= $content_ug;
	 


# Usergaestebuch
	$content .= $content_ug;

if ($isseruser){
$content .= "<hr style=\"color:grey; background-color:black; height:2px;
  margin-right:0; text-align:right; border:1px solid grey;\">
\n";
}
$gesamt_online=($guest_online_num+$member_online_num);
// neuste User ermitteln
$content .= "<div style=\"border: 0px; margin-bottom: 5px;\">Die <b>{$maxnewmember}</b> neuesten Mitglieder<br></div>\n";
$dbr = sql_query("select uname from ".$user_prefix."_users WHERE user_stat=1 ORDER BY uid DESC LIMIT 0 , {$maxnewmember}");
while(list($lastuser) = sql_fetch_row($dbr)) {
$content .= "<strong><big>&middot;</big></strong>&nbsp;<A HREF=\"modules.php?name=Userinfo&amp;uname=$lastuser\">$lastuser</a><br>\n";
}

if ($isseruser){
$content .="<br><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border: 0px; margin-bottom: 5px;\">\n"
."\n<tr>\n<td class=\"boxcontent\">"._BWOTOTALMEMBERS."</td>\n<td align=\"right\" class=\"boxcontent\">\n<b>$totalmembers</b></td>\n</tr>\n"
."\n<tr>\n<td class=\"boxcontent\">"._BWOTODAYMEMBERS."</td>\n<td align=\"right\" class=\"boxcontent\">\n<b>$userCount</b></td>\n</tr>\n"
."\n<tr>\n<td class=\"boxcontent\">"._BWOYESTERDAYMEMBERS."</td>\n<td align=\"right\" class=\"boxcontent\">\n<b>$userCount2</b><br></td>\n</tr>\n"
."\n<tr>\n<td class=\"boxcontent\">"._BWOMEMBERS1."</td>\n<td align=\"right\" class=\"boxcontent\">\n<b>$member_online_num</b></td>\n</tr>\n"
."\n<tr>\n<td class=\"boxcontent\">"._BWOGUESTES."</td>\n<td align=\"right\" class=\"boxcontent\">\n<b>$guest_online_num</b></td>\n</tr>\n"
."\n<tr>\n<td class=\"boxcontent\">Gesamt online:</td>\n<td align=\"right\" class=\"boxcontent\">\n<b>$gesamt_online</b></td>\n</tr>\n"
."</table>\n";
}
if ($isseruser) {
$content .="<hr style=\"color:grey; background-color:black; height:2px;
  margin-right:0; text-align:right; border:1px solid grey;\"><strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=Members_List\">Mitgliederliste</a><br>\n";
$content .="<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=Usersuche\">Mitgliedersuche</a><br>\n";
}
if (!$isseruser) {	# Gast no user
	$content .= "<div align=\"justify\"><br>\n"._BWOASREGISTERED."</div>\n";
	}

if($isseruser && $checkpmtime>0 && $pmactiv){
	$checkpmfile="modules.php?name=$pm_module_name&file=buddy&amp;op=check&amp;ref_intervall=$checkpmtime";
	$content.= "<iframe name=\"who_checkpm_1\" src=\"$checkpmfile\" marginwidth=\"0\" marginheight=\"0\" width=\"0\" height=\"0\" scrolling=\"no\" frameborder=\"0\"></iframe>";
	}

$content .= "</div>\n<!-- $thisfile output end -->\n";
# Blocktitel aus Sprachdatei auslesen
#$blockfiletitle=_BWOMAAXONLINE;
/* CVS-Log:
$Log: block-Who_is_Online_IrcChat.php,v $
Revision 20.1  2004/01/13 10:56:11  KorschAl
PJIRC GPL-Code mit 20 importiert

Revision 1.4  2004/01/10 18:29:08  KorschAl
no message

Revision 1.3  2004/01/09 18:38:08  KorschAl
Online-Listen Fix für IrcChat

Revision 1.2  2004/01/09 18:29:42  KorschAl
Online-Listen Fix für IrcChat

Revision 1.6  2003/10/02 22:28:55  EllselAn
Zeilenumbruch nach scriptende entfernt

Revision 1.5  2003/10/01 12:00:51  EllselAn
problem mit file_exists bei safe_mode=on

Revision 1.4  2003/09/09 19:57:51  EllselAn
Abfrage des Usergästebuchs verändert

Revision 1.3  2003/09/01 14:49:24  EllselAn
function join() / implode() falsch verwendet


 */

?>