Skocz do zawartości

Problem z shout boxem napisanym w AJAXie


Rogal

Recommended Posts

W sumie grzebałem nieco w ustawieniach forum, ale...cholera no. Odinstalowałem Shoutbox, po czym wysypało mi się conieco, następnie znowu go zainstalowałem i....wszyscy na forum mogą pisać, a ja nie :D Skrypt forumowy to ostatnia (aktualna) wersja Simple Machines Forum.

Help, help, help :)

Odnośnik do komentarza
Udostępnij na stronach

Ok to tak: instalujesz SB po czym na skinie który ma go wyświetlać sprawdzasz:

1. Plik index.template.php:

znajdujesz:

echo '
   <link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0" />';

wstawiasz po tym: (tego brakowało Tobie)

// YSHOUT HERE - <head> code
   global $boardurl,$shoutFile;
   $shoutFile='home';
   $scripturlparsed = parse_url($scripturl);
   $scriptpath=isset($scripturlparsed['path'])?$scripturlparsed['path']:'/';
   $args='';
   foreach($_GET as $key => $value) // passthrough $_GET
      $args.='&'.urlencode($key).'='.urlencode($value);
   echo '
   <script src="',$boardurl,'/yshout/js/moo.ajax.js" type="text/javascript"></script>
   <script src="',$boardurl,'/yshout/settings.js" type="text/javascript"></script>
   <script type="text/javascript"><!-- // --><![CDATA[
   if (window.addEventListener){
      window.addEventListener("load", function(){loadChat();}, false);
   } else if (window.attachEvent){
      window.attachEvent("onload", function(){loadChat();});
   }
   var shoutFile="',$shoutFile,'";
   var yshout_php="',$scriptpath,'?yshout',$args,'";
   // ]]></script>
   <script src="',$boardurl,'/yshout/js/yshout.js?July062008" type="text/javascript"></script>
   <style type="text/css">
      #yshout {
         font-size: 10px;
         overflow: hidden;
      }
      #yshout #yshout-toollinks { /* tool links (History, Commands, etc.) */
      }
      #yshout #shouts { /* main shouts area */
      }
      #yshout #shouts .shout { /* one shout */
         float: none;
         margin: 0 0 0; /* Top Bottom Linespacing */
         line-height: 1;
      }
      #yshout .shout-timestamp {
         font-style: normal;
         font-weight: normal;
      }
      #yshout .shout-adminlinks { /* del and ban buttons */
         font-size: 6pt;
         color: #141414;
      }
      #yshout #shout-form {
         margin: 0;
         padding: 0;
      }
      #yshout #shout-form fieldset {
         border: none;
      }
      #yshout #forum-name {
         color: #666666;
         width: 70px;
         margin-right: 5px;
      }
      #yshout #shout-text {
         width: 310px;
         margin-right: 5px;
      }
      #yshout #shout-button {
         width: 55px;
      }
      #yshout .shout-invalid { /* invalid shout (shout textbox) */
         background: #FFFDD1;
      }
   </style>';
   // YSHOUT END - <head> code

2. Następnie w pliku boardindex.template.php

po linii

function template_info_center()
{
   global $context, $settings, $options, $txt, $scripturl, $modSettings;

wklejasz

// YSHOUT HERE - shoutbox code
   global $txt,$context,$boarddir;
   if(allowedTo('yshout_view'))
   {
      echo '
      <span class="clear upperframe"><span></span></span>
      <div class="roundframe"><div class="innerframe">';
      echo '<br clear="all" /><b>',$txt['yshout_shoutbox'],'</b><br /><br />';
      echo '<div id="yshout">';
      include_once($boarddir.'/yshout/yshout.php');
      echo '</div>';
      echo '</div></div>
      <span class="clear lowerframe"><span></span></span>';
   }
   elseif($context['user']['is_guest'])
      echo $txt['yshout_no_guests'];
   // YSHOUT END - shoutbox code

i po sprawie. Oczywiście nie wszystkie skiny posiadają własny boardindex.template.php i korzystają wtedy z tego zawartego w skinie Curve(domyślny)

Domyślnie SB jest w tym pliku w innym miejscu, ale moim zdaniem wtedy wygląda to bez sensu i nie wyświetla się na dodatkowych skórkach

Odnośnik do komentarza
Udostępnij na stronach

Gość
Ten temat jest zamknięty i nie można dodawać odpowiedzi.
×
×
  • Dodaj nową pozycję...