Show Users in Chat on Chat Login Page phpbb3

opera13
2011-09-02
2012-11-15
  • opera13

    opera13 - 2011-09-02

    Hi, I've seen threads on how to add a list of current chat users to the phpbb3 forum itself, but a lot of my users (including me) go straight to the chat to log in there, not visiting the forum first.  I want to show the list of current chat users below or next to the chat login form so people can see that their friends are there and be encouraged to log in.  How can I go about this?

    Thank you for your help

     
  • Buhu

    Buhu - 2011-09-02

    Hello,

    i create an iframe to display the chat user. Look on buhu.li/forum/chat

    Regards

     
  • Philip Nicolcev

    Philip Nicolcev - 2012-05-16

    This is actually a fairly good feature suggestion. It shouldn't be too difficult.
    The steps would be something like:

    1) add  to the loggedOut.html template file.
    2) Use the replaceCustomTemplateTags($tag, $tagContent) override inside CustomAjaxChat.php with  as the tag, and the content of the tag with the list of names from getOnlineUsers() Part 2) would depend a bit on what integration version you're using. If you're using a forum integration, you can already find replaceCustomTemplateTags inside CustomAjaxChat and see how it replaces things there. You need to handle the case when $tag = "ONLINE_USERLIST" and return the user list.
    Something really basic like:

    function replaceCustomTemplateTags($tag, $tagContent) { 
        global $user; 
        switch($tag) { 
            case 'ONLINE_USERLIST': 
                    return implode(', ', $this->getChatOnlineUsers()); 
    ...
    } 
    }
    
     
  • Phoenix psyhub

    Phoenix psyhub - 2012-09-03

    Is there a way to do this purely in javascript?
    I'd like to have a div which displays how many users are in which room as well.
    I assume this would be something like:

            ajaxChat.handleXML = function(xmlDoc) {
                    this.handleInfoMessages(xmlDoc.getElementsByTagName('info'));
                    this.handleOnlineUsers(xmlDoc.getElementsByTagName('user'));
                    this.handleChatMessages(xmlDoc.getElementsByTagName('message'));
                    this.channelSwitch = null;
                    this.setChatUpdateTimer();
                    this.refreshAjaxDiv(xmlDoc.getElementsByTagName('user'));
            }

    ajaxChat.refreshAjaxDiv = function(userStuff){
        if (userStuff.length) {
    …. some code to figure out how many users in each channel  from userStuff …..
                     document.getElementById('ajaxticker').innerHTML = showUsersInChannels;
       }
    }

    This would save an awful lot of server load added by each user, wouldn't it?

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks