Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] smarty i shoutbox pewnego forumowicza
Taifun
post
Post #1





Grupa: Zarejestrowani
Postów: 222
Pomógł: 2
Dołączył: 10.07.2007

Ostrzeżenie: (10%)
X----


Witam, Co trzeba zrobić any zaimplementować shoutbox do smarty? Próbowałem wszystkiego ale coś nie działa... pozostaje chyba iframe :/
wstawiałem wszystko do szablonów .tpl wykorzystując {php} i {literal} , tylko tyle.
kod:
  1. <?php
  2. require_once('cfg.inc.php');
  3. ?>
  4. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  5. <html>
  6. <head>
  7.    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  8.    <title>ShoutBox</title>
  9.    <link rel="stylesheet" href="css/ShoutBox.css" type="text/css" />
  10.    <!--[if IE]>
  11.    <link rel="stylesheet" type="text/css" href="css/ShoutBox_ie6.css" />
  12.    <![endif]-->
  13.    
  14.    <script type="text/javascript" src="scripts/ShoutBox.js"></script>
  15.    <script type="text/javascript" src="scripts/<?php echo $cfg_shoutbox['ajax_lib']; ?>.js"></script>
  16.    <script type="text/javascript" src="scripts/ShoutBox_<?php echo $cfg_shoutbox['ajax_lib']; ?>.js"></script>
  17. </head>
  18. <body>
  19. <?php
  20. require_once('libs/ShoutBox.class.php');
  21. require_once('libs/ShoutBoxDBMysql.class.php');
  22.  
  23. if (empty($_SESSION['nick']))
  24.    echo '<a href="sblogin.php">Zaloguj</a> się, by mieć dostęp do większej ilości opcji.';
  25. else
  26.    echo '<a href="sblogout.php">Wyloguj</a>';
  27.    
  28. if (!empty($_SESSION['nick']) || $cfg_shoutbox['guest_read']){//jesli jestesmy zalogowani lub jestemy gosciem i goscie moga czytac
  29. ?>
  30.  
  31. <div id="sb_main">
  32.    <div id="sb_body"></div>
  33. <?php
  34. if (!empty($_SESSION['nick']) || $cfg_shoutbox['guest_write']){ //jesli jestesmy zalogowani lub goscie i goscie mogą pisac
  35.    echo '<form onsubmit="sb.sendMessage();return false;">';
  36.    if (empty($_SESSION['nick'])){
  37.        echo '<input type="text" id="sb_nick" maxlength="64" value="nick" onfocus="if (this.value=='nick')this.value='';"/>
  38.        <input type="text" id="sb_message" class="short" maxlength="255" value="wiadomość" onfocus="if (this.value=='wiadomość')this.value='';"/>';
  39.    }
  40.    else
  41.        echo '<input type="text" id="sb_message" maxlength="255" />';
  42.    echo '<input type="submit" id="sb_submit" value="Wyślij" />
  43.    </form>';
  44. }    
  45. ?>    
  46. </div>
  47.  
  48. <div id="sb_footer"><div id="sb_wait"></div><a href="http://nospor.pl/shoutbox.html">ShoutBox 1.2</a> &copy; Robert (nospor) Nodzewski</div>
  49.  
  50.  
  51.  
  52.    <script language="javascript">
  53. <?php    
  54.        echo "var sb = new ShoutBox('sb', $cfg_shoutbox[refresh_time],'$cfg_shoutbox[link]','$cfg_shoutbox[type]');";
  55. ?>        
  56.        sb.getMessages();
  57. /*sb.bind('message',{par1:'wartosc1', par2:'wartosc2'},function(data){
  58.    alert(data.par1 + ' ' + data.par2);
  59.    alert(data.params.actionName);
  60.    //jakis nasz kod
  61.    return true;    
  62.    });*/
  63.        
  64.    </script>
  65. <?php
  66. }
  67. ?>    
  68. </body>
  69. </html>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




1) za co pomogl? Przeciez nic nie zrobilem (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) Usuwam sobie to pomogl, bo tylko wprowadza wblad, ze niby problem juz rozwiązany

2) Na jakiej podstawie twierdzisz ze cos sie gryzie? Jakies bledy masz? Pokaz wogole jak ty to wstawiasz do smartiego.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 16.10.2025 - 04:13