1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP Help Center Chat [Deleted]

Discussion in 'Add-on Releases' started by Daniel Hood, Jul 6, 2013.

  1. Daniel Hood

    Daniel Hood Well-Known Member

    Daniel Hood submitted a new resource:

    PHP Help Center Chat - An ajax powered chat addon for XenForo. Brought to you by PHP Help Center.

    Read more about this resource...
     
  2. Matthew Hawley

    Matthew Hawley Well-Known Member

    This looks awesome! Could you post screenshots?
     
  3. Matthew Hawley

    Matthew Hawley Well-Known Member

    I tried it on the demo page. Its awesome except it takes a little while for the chat to show up after you type.
     
  4. Daniel Hood

    Daniel Hood Well-Known Member

    Sorry, I will take a few screenshots. The messages were slow because I have it on up to a 1 second delay. This can be adjusted in the php file (I'll make it an option for the admin panel in an upcoming release). I did notice an issue, a person leaving the chat results in a jquery error. I'm about to fix this now.

    Daniel Hood updated PHP Help Center Chat with a new update entry:

    First Bug Fixes

    Read the rest of this update entry...
     
    Last edited: Jul 6, 2013
  5. Adam Howard

    Adam Howard Well-Known Member

    Tried your demo and while I could see what I typed.... I could not see anything submitted by myself or anyone else (see screen shot).

    Further, when leaving the chat and going to the forum.... Got some kind of error telling me if couldn't connect (though I did reach the forum)
     

    Attached Files:

  6. Daniel Hood

    Daniel Hood Well-Known Member

    Can I get your browser information? I've experienced the error saying couldn't connect. It's supposed to be for if the ajax cannot get the new messages or anything but sometimes happens on user abort (leaving the page).

    [Edit] I've tested on Chrome and IE9. I believe it's been tested on Firefox 22
     
  7. Matthew Hawley

    Matthew Hawley Well-Known Member

    Also when I type, my message comes up. But when I leave the chatroom, and come back my messages are gone. Could you fix this?
     
    Adam K M likes this.
  8. Daniel Hood

    Daniel Hood Well-Known Member

    That's intended for now. We were showing previous messages but it was buggy. A short message history when first entering the chat is intended.

    I think I figured out why it was displaying blank messages. I'll repackage in a few minutes. I had a typo on the default room id for the datawriter.
     
    Last edited: Jul 6, 2013
  9. Daniel Hood

    Daniel Hood Well-Known Member

    resonansER likes this.
  10. Alfa1

    Alfa1 Well-Known Member

    It would be very nice to have this as a Facebook like footer bar.
    Are 1to1 chats planned?
     
  11. Daniel Hood

    Daniel Hood Well-Known Member

    Personal Messages are already existing, they're just set up as room tabs right now. I do intend on having them site-wide and at the footer like Facebook for a later version though.

    Here's a screenshot of a private message room:

    [​IMG]
     
  12. time

    time Active Member

    Non-static method PHCchat_Install::_getDb() should not be called statically

    1. XenForo_Application::handlePhpError() in PHCchat/Install.php at line 29
    2. PHCchat_Install::_getDb() in PHCchat/Install.php at line 29
    3. PHCchat_Install::Install()
    4. call_user_func() in XenForo/Model/AddOn.php at line 214
    5. XenForo_Model_AddOn->installAddOnXml() in XenForo/Model/AddOn.php at line 169
    6. XenForo_Model_AddOn->installAddOnXmlFromFile() in XenForo/ControllerAdmin/AddOn.php at line 178
    7. XenForo_ControllerAdmin_AddOn->actionInstall() in XenForo/FrontController.php at line 313
    8. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
     
  13. Daniel Hood

    Daniel Hood Well-Known Member

    That's weird. What version of xF are you installing on?

    Try this: overwrite xf_root/library/PHCchat/Install.php with this. I had this as the file but when I went to install of xf 1.2 beta 5 it produced error messages.

    Code:
    <?php
    
    class PHCchat_Install
    {
        private static $_instance;
        protected $_db;
    
        public static final function getInstance()
        {
            if (!self::$_instance)
            {
                self::$_instance = new self;
            }
    
            return self::$_instance;
        }
    
        protected function _getDb()
        {
            if ($this->_db === null)
            {
                $this->_db = XenForo_Application::get('db');
            }
    
            return $this->_db;
        }
        public static function Install()
        {
            $this->_getDb()->query("CREATE TABLE `phcchat_users_online` (
                `user_id` int(10) NOT NULL,
                `enter_time` int(20) NOT NULL DEFAULT '0',
                `last_action_time` int(20) NOT NULL DEFAULT '0',
                PRIMARY KEY (`user_id`)
            ) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
           
            $this->_getDb()->query("CREATE TABLE `phcchat_messages` (
                `message_id` int(10) NOT NULL AUTO_INCREMENT,
                `user_id` int(10) NOT NULL DEFAULT '0',
                `to` varchar(40) NOT NULL DEFAULT 'room:1',
                `message` varchar(225) NOT NULL,
                `data` text NOT NULL,
                `likes` int(5) NOT NULL DEFAULT '0',
                `like_users` blob NOT NULL,
                PRIMARY KEY (`message_id`),
                KEY `likes` (`likes`)
            ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;");
           
            $this->_getDb()->query("INSERT INTO xf_content_type (content_type, addon_id) VALUES ('PHCchat_Message', 'PHCchat')");
           
            $this->_getDb()->query("DELETE FROM xf_data_registry WHERE data_key = 'contentTypes'");
        }
        public static function UnInstall()
        {
            $this->_getDb()->query("DELETE FROM xf_data_registry WHERE data_key = 'contentTypes'");
            $this->_getDb()->query("DELETE FROM xf_content_type WHERE addon_id = 'PHCchat'");
            $this->_getDb()->query("DROP TABLE phcchat_users_online");
            $this->_getDb()->query("DROP TABLE phcchat_messages'");
        }
    }
    
     
    time likes this.
  14. time

    time Active Member

    Fatal error: Using $this when not in object context in .../library/PHCchat/Install.php on line 29
    version 1.1.5
     
  15. Daniel Hood

    Daniel Hood Well-Known Member

    Sorry, I read the error message from the first file wrong. Try this:

    Code:
    <?php
    
    class PHCchat_Install
    {
        private static $_instance;
        protected static $_db;
    
        public static final function getInstance()
        {
            if (!self::$_instance)
            {
                self::$_instance = new self;
            }
    
            return self::$_instance;
        }
    
        protected static function _getDb()
        {
            if (self::$_db === null)
            {
                self::$_db = XenForo_Application::get('db');
            }
    
            return self::$_db;
        }
        public static function Install()
        {
            self::_getDb()->query("CREATE TABLE `phcchat_users_online` (
                `user_id` int(10) NOT NULL,
                `enter_time` int(20) NOT NULL DEFAULT '0',
                `last_action_time` int(20) NOT NULL DEFAULT '0',
                PRIMARY KEY (`user_id`)
            ) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
           
            self::_getDb()->query("CREATE TABLE `phcchat_messages` (
                `message_id` int(10) NOT NULL AUTO_INCREMENT,
                `user_id` int(10) NOT NULL DEFAULT '0',
                `to` varchar(40) NOT NULL DEFAULT 'room:1',
                `message` varchar(225) NOT NULL,
                `data` text NOT NULL,
                `likes` int(5) NOT NULL DEFAULT '0',
                `like_users` blob NOT NULL,
                PRIMARY KEY (`message_id`),
                KEY `likes` (`likes`)
            ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;");
           
            self::_getDb()->query("INSERT INTO xf_content_type (content_type, addon_id, fields) VALUES ('PHCchat_Message', 'PHCchat', '')");
           
            self::_getDb()->query("DELETE FROM xf_data_registry WHERE data_key = 'contentTypes'");
        }
        public static function UnInstall()
        {
            self::_getDb()->query("DELETE FROM xf_data_registry WHERE data_key = 'contentTypes'");
            self::_getDb()->query("DELETE FROM xf_content_type WHERE addon_id = 'PHCchat'");
            self::_getDb()->query("DROP TABLE phcchat_users_online");
            self::_getDb()->query("DROP TABLE phcchat_messages'");
        }
    }
    
     
    time likes this.
  16. time

    time Active Member

    @Daniel Hood

    The problem is after the content f5 deleted chat

    how to add a button to send the contents enter chat

    How to separate two people chat

    Add me to chat "messageUserInfo"
     
  17. Daniel Hood

    Daniel Hood Well-Known Member

    Currently leaving the chat or refreshing removes all message history. I will add some message history in an upcoming release.

    I'll add that button for sending messages for next release.

    Two person chats are initiated by scrolling over a person's message and clicking pm. I also plan to add a button to the sidebar under the user's name. Maybe a command also like /pm username

    I'm not sure what you're referring to with your last comment.
     
  18. time

    time Active Member

    My last comment:

    7-7-2013 10-52-22 PM.jpg 7-7-2013 10-55-16 PM.jpg 7-7-2013 10-56-25 PM.jpg

    And link pm only displayed when members online

    sorry @Daniel Hood my english is bad
     
  19. Daniel Hood

    Daniel Hood Well-Known Member

    Don't worry about it (the English). That part of it probably wont be added for a little while. the rest of your requests will be included in upcoming releases.
     
    time likes this.
  20. time

    time Active Member

    great (y)
     

Share This Page