wstawiałem wszystko do szablonów .tpl wykorzystując {php} i {literal} , tylko tyle.
kod:
<?php require_once('cfg.inc.php'); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>ShoutBox</title> <link rel="stylesheet" href="css/ShoutBox.css" type="text/css" /> <!--[if IE]> <link rel="stylesheet" type="text/css" href="css/ShoutBox_ie6.css" /> <![endif]--> <script type="text/javascript" src="scripts/ShoutBox.js"></script> <script type="text/javascript" src="scripts/ShoutBox_<?php echo $cfg_shoutbox['ajax_lib']; ?>.js"></script> </head> <body> <?php require_once('libs/ShoutBox.class.php'); require_once('libs/ShoutBoxDBMysql.class.php'); else if (!empty($_SESSION['nick']) || $cfg_shoutbox['guest_read']){//jesli jestesmy zalogowani lub jestemy gosciem i goscie moga czytac ?> <div id="sb_main"> <div id="sb_body"></div> <?php if (!empty($_SESSION['nick']) || $cfg_shoutbox['guest_write']){ //jesli jestesmy zalogowani lub goscie i goscie mogą pisac echo '<input type="text" id="sb_nick" maxlength="64" value="nick" onfocus="if (this.value=='nick')this.value='';"/> <input type="text" id="sb_message" class="short" maxlength="255" value="wiadomość" onfocus="if (this.value=='wiadomość')this.value='';"/>'; } else echo '<input type="submit" id="sb_submit" value="Wyślij" /> </form>'; } ?> </div> <div id="sb_footer"><div id="sb_wait"></div><a href="http://nospor.pl/shoutbox.html">ShoutBox 1.2</a> © Robert (nospor) Nodzewski</div> <script language="javascript"> <?php echo "var sb = new ShoutBox('sb', $cfg_shoutbox[refresh_time],'$cfg_shoutbox[link]','$cfg_shoutbox[type]');"; ?> sb.getMessages(); /*sb.bind('message',{par1:'wartosc1', par2:'wartosc2'},function(data){ alert(data.par1 + ' ' + data.par2); alert(data.params.actionName); //jakis nasz kod return true; });*/ </script> <?php } ?> </body> </html>