session_start(); require_once 'config.php'; if (isset($_SESSION['sbnc_isloggedin'], $_SESSION['sbnc_user'], $_SESSION['sbnc_pass']) && $_SESSION['sbnc_isloggedin']) { require_once 'class/itype.php'; require_once 'class/sbnc.php'; require_once 'class/irctohtml.php'; $sbnc = new SBNC(HOST, PORT, $_SESSION['sbnc_user'], $_SESSION['sbnc_pass']); if ($sbnc) { if ($sbnc->Call('commands') != 'RPC_INVALIDUSERPASS') { $smarty->append('breadcrumb', $lang['menu_log']); if (isset($_POST['erase'])) { $sbnc->Call('erasemainlog'); $smarty->assign('deleted', true); } $log = $sbnc->Call('getmainlog', array('0', 'end')); $irc2html = new IRCtoHTML(''); if (is_array($log)) { foreach ($log as $line) { $irc2html->IRCtoHTML(utf8_decode($line)); $line = $irc2html->getHTML(); $smarty->append('log', $line); } } $smarty->assign('file', 'log.tpl'); $smarty->display('site.tpl'); $sbnc->Destroy(); exit; } $sbnc->Destroy(); } }
?> <form action="user_log.php" method="post"> <fieldset> <legend><?php echo $LANG['log_prompt']; ?> </legend> <input type="submit" name="erase" value="<?php echo $LANG['log_prompt']; ?> " class="submit" /> </fieldset> </form> <div class="awaylog"> <?php foreach ($log as $line) { $irc2html = new IRCtoHTML(utf8_decode($line)); ?> <p><?php echo $irc2html->GetHTML(); ?> </p> <?php } ?> </div> <?php } require_once 'templates/footer.html';
public static function gen($text) { $i = new IRCtoHTML($text); return $i->getHTML(); }