Exemplo n.º 1
0
 /**
  * printChat must be called somewhere in the page
  * it inserts necessary html which will receive chat's data
  * usage:
  * <code>
  *   <?php $chat->printChat(); ?>
  * </code>
  */
 function printChat($return = false)
 {
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     $output = '';
     pfcI18N::SwitchOutputEncoding($c->output_encoding);
     $path = $c->getFilePathFromTheme('chat.js.tpl.php');
     $t = new pfcTemplate($path);
     $t->assignObject($u, "u");
     $t->assignObject($c, "c");
     $output .= $t->getOutput();
     pfcI18N::SwitchOutputEncoding();
     /*
     $output .= " // ]]>\n";
     $output .= "</script>\n";
     */
     if ($return) {
         return $output;
     } else {
         echo $output;
     }
 }
Exemplo n.º 2
0
 /**
  * printChat must be called somewhere in the page
  * it inserts necessary html which will receive chat's data
  * usage:
  * <code>
  *   <?php $chat->printChat(); ?>
  * </code>
  */
 function printChat($return = false)
 {
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     $output = '';
     if (count($c->getErrors()) > 0) {
         $output .= "<p>phpFreeChat cannot be initialized, please correct these errors:</p><ul>";
         foreach ($c->getErrors() as $e) {
             $output .= "<li>" . $e . "</li>";
         }
         $output .= "</ul>";
     } else {
         pfcI18N::SwitchOutputEncoding($c->output_encoding);
         $path = $c->getFilePathFromTheme('chat.js.tpl.php');
         $t = new pfcTemplate($path);
         $t->assignObject($u, "u");
         $t->assignObject($c, "c");
         $output .= $t->getOutput();
         pfcI18N::SwitchOutputEncoding();
     }
     if ($return) {
         return $output;
     } else {
         echo $output;
     }
 }