function index()
 {
     App::import('Vendor', 'phpFreeChat', array('file' => 'phpfreechat' . DS . 'src' . DS . 'phpfreechat.class.php'));
     Configure::write('debug', '0');
     $this->layout = '2col_layout';
     $this->Group->id = $this->ZTAuth->user('group_id');
     $group = $this->Group->read();
     $params["serverid"] = md5(__FILE__);
     $params["theme"] = "animated";
     $params["theme_url"] = 'vendors/phpfreechat/themes/';
     $params["data_public_url"] = 'vendors/phpfreechat/data/public';
     $params["theme"] = 'msn';
     $params["language"] = 'ru_RU';
     $params["display_pfc_logo"] = false;
     $params["title"] = 'Бумер чат';
     $params["nick"] = $this->ZTAuth->user('username');
     $params["isadmin"] = $this->isAuthorized($this->ZTAuth->user('username'), $this->name, 'admin');
     $params["nickmeta"] = array('Статус' => $group['Group']['user_status']);
     $params["nickmarker"] = false;
     $params["frozen_nick"] = true;
     //        $params["debug"] = true;
     //        $params["server_script_path"] = '../../vendors/phpfreechat/chat.php';
     $chat = new phpFreeChat($params);
     $this->set('chat', $chat->printChat(true));
 }
Esempio n. 2
0
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>phpFreeChat demo</title>

    <?php 
$chat->printJavascript();
?>
    <?php 
$chat->printStyle();
?>

  </head>

  <body>
    <?php 
$chat->printChat();
?>

<?php 
// print the current file
echo "<h2>The source code</h2>";
$filename = __FILE__;
echo "<p><code>" . $filename . "</code></p>";
echo "<pre style=\"margin: 0 50px 0 50px; padding: 10px; background-color: #DDD;\">";
$content = file_get_contents($filename);
echo htmlentities($content);
echo "</pre>";
?>

  </body>
</html>
Esempio n. 3
0
/// Author: Rafał "Endzio" Enden
/// modules/chat/index.php
defined('KioCMS') || exit;
$lang = include_lang('modules/chat');
$chat = get_config('chat');
$title[] = 'Chat';
$module['columns'] = 2;
//file_exists(root_dir.'modules/chat/data/private/cache/'.md5(__FILE__).'.php') ? unlink(root_dir.'modules/chat/data/private/cache/'.md5(__FILE__).'.php') : '';
require_once root_dir . 'modules/chat/src/phpfreechat.class.php';
$params = array();
$params["title"] = "Quick chat";
$params["isadmin"] = strtolower($user['username']) == 'test' ? true : false;
// do not use it on production servers ;)
$params["serverid"] = md5(__FILE__);
// calculate a unique id for this chat
$params["nick"] = defined('LOGGED') ? $user['username'] : '******' . rand();
// setup the intitial nickname
$params["debug"] = false;
$params["max_msg"] = 0;
$params["frozen_nick"] = true;
$params["theme_url"] = local_dir . "modules/chat/data/public/themes";
$params["theme_default_url"] = local_dir . "modules/chat/data/public/themes";
$params["server_script_url"] = local_url . "chat/";
// Must ending with slash (/)
$params["client_script_path"] = root_dir . 'modules/chat/index.php';
$params["data_public_url"] = local_dir . "modules/chat/data/public";
$params["prototypejs_url"] = local_dir . "modules/chat/data/public/js/prototype.js";
$pfc = new phpFreeChat($params);
echo '<div style="text-align: left;">';
$pfc->printChat();
echo '</div>';
Esempio n. 4
0
global $CONFIG;
require_once dirname(__FILE__) . "/src/phpfreechat.class.php";
$params = array();
$params['title'] = elgg_echo('Chat');
$params['nick'] = $_SESSION['user']->username;
// setup the intitial nickname
$params['isadmin'] = isadminloggedin();
$params['serverid'] = 'phpfreechat';
// calculate a unique id for this chat
$params['debug'] = false;
if (get_plugin_setting('container_type', 'chat') == 'Mysql') {
    $params['container_type'] = 'Mysql';
    $params['container_cfg_mysql_host'] = $CONFIG->dbhost;
    $params['container_cfg_mysql_port'] = 3306;
    $params['container_cfg_mysql_database'] = $CONFIG->dbname;
    $params['container_cfg_mysql_table'] = $CONFIG->dbprefix . "phpfreechat";
    $params['container_cfg_mysql_username'] = $CONFIG->dbuser;
    $params['container_cfg_mysql_password'] = $CONFIG->dbpass;
}
$params['theme'] = get_plugin_setting('theme', 'chat');
$params['frozen_nick'] = get_plugin_setting('strict_access', 'chat') == 1;
$params['channels'] = explode(',', get_plugin_setting('channels', 'chat'));
$chat = new phpFreeChat($params);
if (get_plugin_setting('use_popup', 'chat')) {
    include dirname(dirname(__FILE__)) . '/popup.inc.php';
} else {
    // Format Page
    $body = elgg_view_layout('one_column', $chat->printChat(true));
    // Draw it
    echo page_draw(elgg_echo('Chat'), $body);
}
Esempio n. 5
0
 function render($mode, Doku_Renderer $renderer, $data)
 {
     global $conf, $USERINFO, $ID;
     if (auth_quickaclcheck($ID) >= AUTH_READ) {
         if ($mode == 'xhtml') {
             $renderer->info['cache'] = FALSE;
             ob_start();
             require_once DOKU_INC . 'lib/plugins/freechat/phpfreechat/src/phpfreechat.class.php';
             $params = array();
             $params['serverid'] = md5($conf['title']);
             if (isset($data['chatid']) && $data['chatid'] != '') {
                 $params['serverid'] = md5($data['chatid']);
             }
             $params['focus_on_connect'] = true;
             $params['language'] = $this->getConf('language');
             $params['theme'] = $this->getConf('template');
             $params['height'] = $this->getConf('height') . 'px';
             $params["title"] = $this->getConf('title');
             if (isset($data['rooms'])) {
                 $params["channels"] = explode(',', $data['rooms']);
             } else {
                 $params["channels"] = explode(',', $this->getConf('channels'));
             }
             $params['frozen_nick'] = $this->getConf('frozen_nick');
             $params['frozen_nick'] = !($params['frozen_nick'] == 'off' || $params['frozen_nick'] == 0);
             if (isset($data['locked'])) {
                 $params['frozen_channels'] = explode(',', $data['locked']);
             } else {
                 if ($this->getConf('frozen_channels') != '') {
                     $params['frozen_channels'] = explode(',', $this->getConf('frozen_channels'));
                 }
             }
             $params['isadmin'] = false;
             if ($this->getConf('admin_group') != '' && isset($USERINFO['grps'])) {
                 $temp = explode(',', $this->getConf('admin_group'));
                 foreach ($temp as $item) {
                     if (in_array(trim($item), $USERINFO['grps'])) {
                         $params['isadmin'] = true;
                     }
                 }
             }
             $params['startwithsound'] = false;
             $params['display_pfc_logo'] = true;
             $params['showsmileys'] = false;
             $params['nick'] = isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'] : "******" . rand(1, 1000);
             if ($this->getConf('fullname')) {
                 if (isset($USERINFO['name']) && !empty($USERINFO['name'])) {
                     $params['nick'] = $USERINFO['name'];
                 }
             }
             //          $params['channels'] =  array('Generale');
             $params['data_public_path'] = DOKU_INC . 'data/cache/public';
             $params['data_public_url'] = DOKU_URL . 'data/cache/public';
             $params['data_public_path'] = DOKU_INC . 'lib/plugins/freechat/phpfreechat/data/public';
             $params['data_public_url'] = DOKU_URL . 'lib/plugins/freechat/phpfreechat/data/public';
             //        $params['data_public_path']   = DOKU_INC.'data/tmp';
             //        $params['data_public_url']    = DOKU_URL.'data/tmp';
             $params['data_private_path'] = DOKU_INC . 'data/cache/freechat/private';
             $params['server_script_path'] = DOKU_INC . 'lib/plugins/freechat/backend.php';
             $params['server_script_url'] = DOKU_URL . 'lib/plugins/freechat/backend.php';
             //        $params['debug']  = true;
             // store in session the parameters list for the backend script
             @session_start();
             $_SESSION['freechat_params_list'] = $params;
             $pfc = new phpFreeChat($params);
             $pfc->printChat();
             $content = ob_get_contents();
             ob_end_clean();
             $renderer->doc .= $content;
             /*
             echo "<pre>";
             print_r($params);
             echo "</pre>";
             */
             return true;
         }
     }
     return false;
 }