We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    I install PHPFreeChat at my site using iframe at the moment but I plan to see if I can use a snippet instead but you are welcome to try it out and here is the link:

    http://www.chanh.blogdns.com/modx/Chat.html

    What do you think?

    Thanks
      • 32241
      • 1,495 Posts
      I did a little integration into MODx.

      Use this code as a snippet
      <?php
      // Define default module path
      $modulePath = 'assets/modules/phpfreechat';
      
      // Include required file
      require_once rtrim($modulePath, '/')."/src/phpfreechat.class.php";
      
      // Define necessary parameters for phpFreeChat
      $params = array();
      $params["nick"] = "guest".rand(1,10);  // setup the intitial nickname
      $chat = new phpFreeChat($params);
      
      // Outputing necessary html to the page
      $modx->regClientStartupScript($chat->printJavascript(true), true);
      $modx->regClientStartupScript($chat->printStyle(true), true);
      $chat->printChat();
      ?>
      


      From the code itself, it’s a really flexible code, and we can easiliy integrate it into our MODx, but the only reason I haven’t, I’m waiting for the first stable release from them, and I also need to work on our users system first.

      Check back with me, I will make an update in this forum, when I got this thing started, but for now I will leave it postpone for a while, until I’m done with my job getting some other things done.

      FYI, I just remember that the script required version 0.7, or it won’t be able to work. Notice the last parameter for outputing the chat in return statement instead of echoing.

      Sincerely,
        Wendy Novianto
        [font=Verdana]PT DJAMOER Technology Media
        [font=Verdana]Xituz Media
        • 34162
        • 1 Posts
        I put this code into a snippet and create a document call this snippet and link it to the menu but when I click on this nothing happen.

        What am I missing here?

        Thanks
          • 32241
          • 1,495 Posts
          Quote from: chanh at Feb 24, 2006, 03:11 PM

          I put this code into a snippet and create a document call this snippet and link it to the menu but when I click on this nothing happen.

          What am I missing here?

          Thanks

          where did you put your phpfreechat?
          It’s set to load it from assets/modules/phpfreechat
          You can change the module path var on top of the code to locate your phpfreechat location.
            Wendy Novianto
            [font=Verdana]PT DJAMOER Technology Media
            [font=Verdana]Xituz Media
            • 6726
            • 7,075 Posts
            Thanks for sharing this Wendy, this is just *great* !

            When do you plan to release it on the public forums ?
            Need some testing ? Or maybe you want to improve it ?

            Anyway, another of your nice projects, really nice work smiley
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l&#39;outil id
              • 34162
              • 1 Posts
              I put the same place where your snippet specify except that I call it "chat" and I change the path to "chat" rather than "phpfreechat"
                • 32241
                • 1,495 Posts
                Ok, I actually not ready to release this yet though, but because I started the reply, so I will make this little thing to work at least. grin

                I think the problem is because you don’t have your regclientscript fixed. It’s a bugs from MODx v0.9.1, where the regClientScript and etc is not working, and I’m using that API for this snippet/module.

                Check out this forum to fix it.
                http://modxcms.com/forums/index.php/topic,1942.msg18261.html#msg18261

                Read the whole thread, so you know what needs to be fixed wink

                Sincerely,
                  Wendy Novianto
                  [font=Verdana]PT DJAMOER Technology Media
                  [font=Verdana]Xituz Media
                  • 32241
                  • 1,495 Posts
                  Quote from: davidm at Feb 24, 2006, 03:33 PM

                  Thanks for sharing this Wendy, this is just *great* !

                  When do you plan to release it on the public forums ?
                  Need some testing ? Or maybe you want to improve it ?

                  Anyway, another of your nice projects, really nice work smiley

                  It’s not ready for its prime time yet. I’m having problem for being too perfectionist sometime. I still want to wait for the current user system on MODx to be fixed first, so I will have the user based on MODx to act as the user based on this chat system. I’m also waiting for the stable release of this chat system. For version 1.0, it will comes with private chat system, to allow private msg between user, instead of using public chat. So by that time comes, we will have a more usable chat system.

                  Btw, I can’t admit that this is one of my work though, because most of the things had been done from the phpfreechat side, all I need just to put it inside MODx wink But I do help them to make a better chat system, by giving features request, reporting bugs, asking for faster release, and etc, but no coding tongue lol grin Heheheee... (It’s a joke though, in case you guys don’t get it )
                    Wendy Novianto
                    [font=Verdana]PT DJAMOER Technology Media
                    [font=Verdana]Xituz Media
                    • 34162
                    • 1 Posts
                    I read through the thread and tried to apply the fixes but still not able to get it to work.

                    I am a little confuse to follow that thread with all of those fixes after fixes.
                      • 32241
                      • 1,495 Posts
                      Check this out http://test.djamoer.net/phpfreechat/

                      When you view source, you should see all those javascript inside your head tag, if not, then you’re not applying the right fix.

                      Could you give a link of your sample page with phpfreechat installed using the snippet?
                        Wendy Novianto
                        [font=Verdana]PT DJAMOER Technology Media
                        [font=Verdana]Xituz Media