'; }else{ $permissions = ' '; } // Function to input a text line in the database include "write_line_inc.php"; // Check if chatter is kicked $result=mysqli_query($db_handle,"SELECT Nick FROM chat_data WHERE Nick = '$nick' AND Passwort= '$SPERRPASSWORT'"); if($result && mysqli_num_rows($result)==1) { echo "$MSG_INVITE"; echo "
"; echo "
$MSG_KICKED
"; echo "
"; } else { /** * Deletes a chatter from group * * @param string $nick * @param string $chatter_to_del * @param string $group * @global $db_handle * @author Michael Oertel */ function del_chatter($nick,$chatter_to_del,$group){ global $db_handle; //delete a chatter from the group of invited chatter if($group=="invited_chatter"){ //get all of the already invited chatter of nickname $result=mysql_query("SELECT Allow, id FROM channels WHERE Name = '$nick'",$db_handle); if(mysql_num_rows($result)==1){ /** * Invited chatter * * contains a list of invited chatter seperated by "|" * * @var string $invited_chatter */ $invited_chatter = mysql_result($result,0,"Allow"); $channelid = mysql_result($result,0,'id'); } mysql_free_result($result); $invited_chatter = str_replace("|$chatter_to_del|","|",$invited_chatter); $result = mysql_query("DELETE from channels_allowed where channel_id = $channelid and nick = '".mysql_real_escape_string($chatter_to_del)."'", $db_handle); if($invited_chatter=="|"){ $result=mysql_query("UPDATE channels SET Allow='' WHERE name='$nick'",$db_handle); }else{ $result=mysql_query("UPDATE channels SET Allow='$invited_chatter' WHERE name='$nick'",$db_handle); } return TRUE; } return FALSE; } /** * Adds a chatter to group * * @param string $nick * @param string $chatter_to_add * @param string $group * @global $db_handle * @author Michael Oertel */ function add_chatter($nick,$chatter_to_add,$group){ global $db_handle; //add a chatter from the group of invited chatter if($group=="invited_chatter"){ //get all of the already invited chatter of nickname $result=mysql_query("SELECT id, Allow FROM channels WHERE Name = '$nick'",$db_handle); if(mysql_num_rows($result)==1){ /** * Invited chatter * * contains a list of invited chatter seperated by "|" * * @var string $invited_chatter */ $invited_chatter = mysql_result($result,0,"Allow"); $channelid = mysql_result($result, 0, 'id'); } mysql_free_result($result); if($invited_chatter==""){ $invited_chatter="|"; } $invited_chatter = "|$chatter_to_add$invited_chatter"; $result = mysql_query("insert into channels_allowed (channel_id, nick) values ($channelid, '".mysql_real_escape_string($chatter_to_add)."')", $db_handle); if($_SESSION['nick']=='Supermann'){ echo mysql_error(); } $result=mysql_query("UPDATE channels SET Allow='$invited_chatter' WHERE name='$nick'",$db_handle); return TRUE; } return FALSE; } //this makes this all working together with the context menu if($_GET['silent']){ $result = mysql_query("select Allow from channels where Name = '$nick'",$db_handle); $s_result = mysql_result($result,0,'Allow'); if(!preg_match('/\|'.$_GET['chatter'].'/',$s_result)){ //chatter is not already invited $rein = '<--'; $austritt = $_GET['chatter']; echo ''; }else{ $raus= '-->'; $eintritt = $_GET['chatter']; echo ''; } } //get invited chatter $result=mysql_query("SELECT Allow FROM channels WHERE Name = '$nick'",$db_handle); if(mysql_num_rows($result)==1){ /** * Invited chatter * * contains a list of invited chatter seperated by "|" * * @var string $invited_chatter */ $invited_chatter = mysql_result($result,0,"Allow"); } mysql_free_result($result); //all of not invited chatter $nick_result=mysql_query("SELECT Nick FROM chat WHERE Nick <> '$nick' ORDER BY Nick",$db_handle); $select_of_all_chatters = "\n\t\t\t\t\t"; while($i=mysql_fetch_array($nick_result)){ // check, if already invited $temp=$i["Nick"]; if((!preg_match('/'.$temp.'/',$invited_chatter) && $temp!=$austritt) || $temp==$eintritt){ $select_of_all_chatters .= "\n\t\t\t\t\t\t"; $select_of_not_invited .= "\n\t\t\t\t\t\t"; } } $select_of_all_chatters .= "\n\t\t\t\t\t"; $select_of_not_invited .= "\n\t\t\t\t\t"; $result=mysql_query("SELECT Allow FROM channels WHERE Name = '$nick'",$db_handle); if(mysql_num_rows($result)>0){$kick = mysql_result($result,0,"Allow");} if(($raus)&&($eintritt)){ //del a chatter from the list of already invited chatters if(!del_chatter($nick,$eintritt,"invited_chatter")){ echo "Error while deleting a chatter from the group of invited users."; exit; } if($eintritt){ if($eintritt_result = mysql_query("SELECT Raum FROM chat WHERE Nick='$eintritt'",$db_handle)){ $channel=mysql_result($eintritt_result,0,"Raum"); } } schreib_zeile(" $eintritt $IS_DISCHARGED.",$channel); } if(($rein)&&($austritt)){ //add a chatter to the list of already invited chatters if(!add_chatter($nick,$austritt,"invited_chatter")){ echo "Error while adding a chatter from the group of invited users."; exit; } $channel=@mysql_result(mysql_query("SELECT Raum FROM chat WHERE Nick='$austritt'",$db_handle),0,"Raum"); schreib_zeile(" $austritt $IS_INVITED",$channel); } $result=mysql_query("SELECT Allow FROM channels WHERE Name='$nick'",$db_handle); if(mysqli_num_rows($result)>0){ $tmp=mysql_result($result,0,"Allow"); } mysql_free_result($result); mysql_close($db_handle); //selection of all invited chatter $option_value = explode("|",$tmp); $i=1; $select_of_invited_chatter = "\n\t\t\t\t\t"; if(!$_GET['silent']) include("invite_tpl.php"); } ?>