Hallo, Gast! (Registrieren)

Letzte Ankündigung: MyBB 1.8.37 veröffentlicht (04.11.23)


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste
Ajax Chat /team Command
#1
Ich mal wieder mit nem Problem beim Ajax Chat und zwar folgendes:

Man kann ja costum Commands einfügen, funktioniert auch alles, nun brauch ich aber ein /team Command wo das Team, also Admins und Moderatoren flüstern können also Team-Talk quasi, so das aber die normalen User nichts sehen. Ich habe nun mal null peil was ich da tun muss, ich versuche immer aus dem vorhanden Codes herrauszulesen was da passiert aber diesmal funzt nichts... Es ist quasi ja die flüste Funktion nur das es diesmal nicht an eine einzelne Person geht sondern an die User die mods und Admins sind... Naja ich bekomm das irgendwie nicht hin vieleicht könnt ihr mir helfen, denn der Support ist leider echt schlecht.


Hier mal meine bisherigen Commands und der VERSUCH dess /team commands:
also /away und /comment funktionieren. /team leider nicht, ihr seht auch mit sicherheit das ich da echt hilflos bin. Die away Funktion habe ich modifiziert, es gibt da bestimmt ne bessere lösung aber naja hauptsache es funzt.

CustomAJAXChat.php
PHP-Code:
function parseCustomCommands($text$textParts) { 
        switch(
$textParts[0]) { 
            
// Away Melden
            
case '/away'
                
// Set the userName: 
                
$oldUserName $this->getUserName(); 
                
$klammer1 '(';
                
$klammer2 ')';
                
$this->setUserName('<AFK>_'.$this->getUserName()); 
                
// Update the online user table: 
                
$this->updateOnlineList(); 
                
// Add info message to update the client-side stored userName: 
                
$this->addInfoMessage($this->getUserName(), 'userName'); 
                
// Store AFK status as session variable: 
                
$this->setSessionVar('AwayFromKeyboard'true); 

if(
count($textParts) == 1) {                

// Info : 
$this->insertChatBotMessage(
$this->getChannel(), 
$oldUserName.' meldet sich ab.'
);
 }
else {    
$text $klammer1.' '.$textParts[1].' '.$textParts[2].' '.$textParts[3].' '.$textParts[4].' '.$textParts[5].' '.$textParts[6].' '.$textParts[7].' '.$textParts[8].' '.$textParts[9].' '.$textParts[10].' '.$textParts[11].' '.$textParts[12].' '.$textParts[13].' '.$textParts[14].' '.$textParts[15].' '.$textParts[16].' '.$textParts[17].' '.$textParts[18].' '.$textParts[19].' '.$textParts[20].' '.$textParts[21].' '.$textParts[22].' '.$textParts[23].' '.$textParts[24].' '.$textParts[25].' '.$textParts[26].' '.$textParts[27].' '.$textParts[28].' '.$textParts[29].' '.$textParts[30].''.$klammer2;
$this->insertChatBotMessage(
$this->getChannel(), 
$oldUserName.' meldet sich ab'.' '.$text
); }
                return 
true
             
        } 
            if(
$this->getUserRole() == AJAX_CHAT_ADMIN || $this->getUserRole() == AJAX_CHAT_MODERATOR) {  
        switch(
$textParts[0]) {              
            case 
'/comment':
            
$this->insertChatBotMessage$this->getChannel(), $text );  
            
        } 

        
 }
if(
$this->getUserRole() == AJAX_CHAT_ADMIN || $this->getUserRole() == AJAX_CHAT_MODERATOR) {
        switch(
$textParts[0]) {          
        case 
'/team':
        
        
$oldUserName $this->getUserName();
$userID $this->getUserID(1310);
$this->insertCustomMessage($this->getPrivateMessageID($userID),'TeamMessage:'.'('.$oldUserName.')'.$text );  
            
    }

return 
text;
}
}



    function 
onNewMessage($text) { 
        
// Away Status zurücksetzen nach Eingabe: 
        
if($this->getSessionVar('AwayFromKeyboard')) { 
            
$this->setUserName($this->subString($this->getUserName(), 6)); 
            
$this->updateOnlineList(); 
            
$this->addInfoMessage($this->getUserName(), 'userName'); 
            
$this->setSessionVar('AwayFromKeyboard'false); 
// Add info message:
$oldUserName $this->getUserName();  
$this->insertChatBotMessage
$this->getChannel(), 
$oldUserName.' ist wieder da.' 
); 
            
}   
        return 
true
    } 
Zitieren


Möglicherweise verwandte Themen…
Thema Verfasser Antworten Ansichten Letzter Beitrag
  Ajax Chat Umlaute Lulz 1 1.124 12.11.2012, 12:53
Letzter Beitrag: Raphael
  Ajax Chat, Umlaute in Datenbank Sonnenblume 4 2.497 17.04.2009, 19:04
Letzter Beitrag: Sonnenblume
  Ajax Chat Problem n00by2k 1 1.864 12.07.2008, 15:40
Letzter Beitrag: StefanT