We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24166
    • 11 Posts
    This snippet based on phpFreeChat

    1. First - download phpfreechat-x.x.zip
    2. Next - unzip all folders in /assets/snippets/phpfreechat/
    3. Give the write rights to /phpfreechat/data/public and /phpfreechat/data/private directories (CHMOD 777)
    4. Create New snippet and call it "PhpFreeChat"
    insert following code:
    require_once "<...>/assets/snippets/phpfreechat/src/phpfreechat.class.php";
    $params = array();
    global $modx;
    $params["nick"] = ($modx->getLoginUserID()) ? $modx->getLoginUserName() : "guest".rand(1,10); // setup the intitial nickname
    //$params["language"] = "ru_RU"; // english by default
    $params["clock"] = false; // true by default
    $params["showwhosonline"] = false; // true by default
    $params["showsmileys"] = false; // true by default
    $params["title"] = "My Chat";
    $params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
    $chat = new phpFreeChat( $params );
    $js = $chat->printJavascript(1);
    $st = $chat->printStyle(1);
    $ch = $chat->printChat(1);
    return $js.$st.$ch;


    5. On any page insert "[!PhpFreeChat!]" or "[[PhpFreeChat]]"

    See example

    PS: sorry for my English
      • 17883
      • 1,039 Posts
      Cool, thanks for sharing!
        • 18397
        • 3,250 Posts
        Awesome! Great work!

        P.S. Your English is fine smiley
          • 33337
          • 3,975 Posts
          Thanks for sharing nice work!

          regards,

          zi
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link
            • 10816
            • 28 Posts
            That’s great!
            Thank you!!
              • 33175
              • 711 Posts
              Great snippet !!

              Thanks for this smiley
                Sorry for my english. I&#39;m french... My dictionary is near me, but it&#39;s only a dictionary !
                • 2762
                • 1,198 Posts
                cool! thanks for sharing!
                  Free MODx Graphic resources and Templates www.tattoocms.it
                  -----------------------------------------------------

                  MODx IT  www.modx.it
                  -----------------------------------------------------

                  bubuna.com - Web & Multimedia Design
                  • 7923
                  • 4,213 Posts
                  Has people been using this? If it’s working alright, please put it to the resource repository.. Thanks!


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 16732
                    • 592 Posts
                    Hi,
                    I tryed to use this snippet but I always have this error :
                    
                    « MODx Parse Error »
                    MODx encountered the following error while attempting to parse the requested resource:
                    « PHP Parse Error »
                     
                    PHP error debug
                      Error: 	unlink(/homepages/XX/d18XXXXXX/htdocs/assets/snippets/phpfreechat/src/../data/private/cache/pfcglobalconfig_c7019df98c3d8191006c7c575328d336) [function.unlink]: No such file or directory	 
                      Error type/ Nr.: 	Warning - 2	 
                      File: 	/homepages/XX/d18XXXXXX/htdocs/assets/snippets/phpfreechat/src/pfcglobalconfig.class.php	 
                      Line: 	156	 
                      Line 156 source:
                    


                    With this snippet :
                    require_once $modx->config['base_path']."/assets/snippets/phpfreechat/src/phpfreechat.class.php";
                    $params = array();
                    
                    $params["nick"] = ($modx->getLoginUserID()) ? $modx->getLoginUserName() : "guest".rand(1,10); // setup the intitial nickname
                    //$params["language"] = "ru_RU"; // english by default
                    $params["clock"] = false; // true by default
                    $params["showwhosonline"] = false; // true by default
                    $params["showsmileys"] = false; // true by default
                    $params["title"] = "My Chat";
                    $params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
                    $chat = new phpFreeChat( $params );
                    $js = $chat->printJavascript(1);
                    $st = $chat->printStyle(1);
                    $ch = $chat->printChat(1);
                    return $js.$st.$ch;
                    


                    and /phpfreechat/data/public and /phpfreechat/data/private directories with CHMOD 777

                    I’m using phpfreechat-1.0-beta8 and MODx 0.9.5 RC3
                    If I test /phpfreechat/index.php or /phpfreechat/demo/demoXX... it’s working undecided
                      • 16732
                      • 592 Posts
                      No idea of what causes this problem :’(