Ultimate Shoutbox

Started by Grudge, March 28, 2004, 09:11:20 AM

Previous topic - Next topic

Col

You probably have the shoutbox in a TD tag. Give the tag an ID, and create the new entry for that ID in the CSS file.

HTML

<td id="shoutstyle">
smfshout ();
echo '
</td>


CSS
#shoutstyle {
   font-size: small;
   font-family: verdana, sans-serif;
}


Something like that.

Grudge

Quote
Version 1.36:
1. Call the shoutbox form from the shoutbox template.
2. Fixed session checks on delete.
3. Verify guest names aren't already in use.
I'm only a half geek really...

StormLrd

http://stormlrdsreality.co.uk/rhcforum/index.php



double input and not getting the archieve page, on 1.36 was also not getting archieve on 1.35

Grudge

Ummm, are you sure you uninstalled 1.35 first? It looks like you have a mixed install as it has two input boxes.
I'm only a half geek really...

StormLrd

Quote from: Grudge on May 06, 2006, 11:43:11 AM
Ummm, are you sure you uninstalled 1.35 first? It looks like you have a mixed install as it has two input boxes.

I only replaced the shout.php and the shout.template.php from the 1.36 pack

Grudge

That won't do. You need to uninstall 1.35 and install 1.36.
I'm only a half geek really...

StormLrd

kk the original is 1.21 lmao

StormLrd

That worked bro, took a bit to unistall it i had to do it manually as I had recently updated to RC2 and TP 8.6

Here's a working preview Live:

http://stormlrdsreality.co.uk/rhcforum/index.php

Ive added a copywrite to the bottom of this theme I will do others later you should do this Ive had alot of requests for which Shoutbox Im using and i was one of the originals of your shoutbox back at the first release over a year ago lol. Add one to your code for keeping up with version number and where you want it linked to this one i linked to this mod thread here.

Thanks for a clean setup.

Storm

Teknomancer

Any help on how to collapse Shoutbox so that even after members log-off and log-back in it is remembered?
My SMF Forum:

edi67

Quote from: Grudge on May 06, 2006, 05:04:37 AM
Quote
Version 1.36:
1. Call the shoutbox form from the shoutbox template.
2. Fixed session checks on delete.
3. Verify guest names aren't already in use.

All work perfectly Grudge only i have a lot of these errors as in previous versions

Quotehttp://www.forumzone.net.ru/index.php?action=shout_archive 
8: Undefined index: url_direct
File: /home/forum@@@/www/Themes/default/shout.template.php
Linea: 25

shout.template.php

QuoteLine 23:      if (!empty($context['canDelete']))
Line 24:      echo '
Line 25:         <a href="', $scripturl, '?action=delete_shout;sesc=', $context['session_id'], ';sid=', $shout['id'], $context['url_direct'], '"><img src="', $settings['images_url'], '/deleteshout.gif" border="0" alt="X"></a>';
Line 26:      echo '
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Grudge

edi67 - fixed. Either redownload the package from here or otherwise just upload the attached file to your sources directory.
I'm only a half geek really...

edi67

Quote from: Grudge on May 07, 2006, 05:07:53 AM
edi67 - fixed. Either redownload the package from here or otherwise just upload the attached file to your sources directory.

excellent Grudge seems to be fixed, great, correct the package for other users

Great work Grudge  ;) thanx
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Grudge

I updated the package on the mod site already - just not going to bump the version number ;)
I'm only a half geek really...

Col

Hiya Grudge,

Thanks for the update, and bug fixes.

However, I've looked through the code, and can't see how I make separate calls for the shouts, and the form!

What am I missing?

Thanks.

Col

Hi Grudge,

I worked it out. I pulled a late one, and have it up working.

Anyone who's interested: I will post here instructions for getting Grudge's Shoutbox in the upshrinker tomorrow.

Col

#975
For Shoutbox version 1.36 only

For those interested, here's Grudges shoutbox in the upshrinker, for SMF 1.1, only (but will work with earlier versions, with a small adjustment or two). It is based upon the default theme.

I've removed the call for member avatar display, as I'm sure members understand what their own avatar looks like! ::) Another silly function, "Total Time Logged in" has also been removed. I've removed the call for the forum name, as I have a banner. I've also removed the SMF logo. I've rearranged the rest in a way that I think makes more sense. News is no longer in the upshrinker part of the header, and is now always displayed, so that members who have the upshrinker collapsed, do not miss important announcements.


Go to admin, and create a new forum template, a copy of the SMF default template. Continue to use your usual template for yourself, until you are finished.

Go to the modify template page for your new shoutbox upshrinker template, and replace the third section with the following:

// The main sub template above the content.
function template_main_above()
{
   global $context, $settings, $options, $scripturl, $txt, $modSettings;

   // Show right to left and the character set for ease of translating.
   echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
   <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
   <meta name="description" content="', $context['page_title'], '" />
   <meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
   <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?rc2p"></script>
   <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
      var smf_theme_url = "', $settings['theme_url'], '";
      var smf_images_url = "', $settings['images_url'], '";
      var smf_scripturl = "', $scripturl, '";
   // ]]></script>
   <title>', $context['page_title'], '</title>';

   // The ?rc2 part of this link is just here to make sure browsers don't cache it wrongly.
   echo '
   <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc2" />
   <link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?rc2" media="print" />';

   /* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
      Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
      Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
      Standards compliance mode happens when you use xhtml... */
   if ($context['browser']['needs_size_fix'])
      echo '
   <link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';

   // Show all the relative links, such as help, search, contents, and the like.
   echo '
   <link rel="help" href="', $scripturl, '?action=help" target="_blank" />
   <link rel="search" href="' . $scripturl . '?action=search" />
   <link rel="contents" href="', $scripturl, '" />';

   // If RSS feeds are enabled, advertise the presence of one.
   if (!empty($modSettings['xmlnews_enable']))
      echo '
   <link rel="alternate" type="application/rss+xml" title="', $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';

   // If we're viewing a topic, these should be the previous and next topics, respectively.
   if (!empty($context['current_topic']))
      echo '
   <link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
   <link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';

   // If we're in a board, or a topic for that matter, the index will be the board's index.
   if (!empty($context['current_board']))
      echo '
   <link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';

   // We'll have to use the cookie to remember the header...
   if ($context['user']['is_guest'])
      $options['collapse_header'] = !empty($_COOKIE['upshrink']);

   // Output any remaining HTML headers. (from mods, maybe?)
   echo $context['html_headers'], '

   <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
      var current_header = ', empty($options['collapse_header']) ? 'false' : 'true', ';

      function shrinkHeader(mode)
      {';

   // Guests don't have theme options!!
   if ($context['user']['is_guest'])
      echo '
         document.cookie = "upshrink=" + (mode ? 1 : 0);';
   else
      echo '
         smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';

   echo '
         document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

         document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
         document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

         current_header = mode;
      }
   // ]]></script>';

   // the routine for the info center upshrink
   echo '
      <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
         var current_header_ic = ', empty($options['collapse_header_ic']) ? 'false' : 'true', ';

         function shrinkHeaderIC(mode)
         {';

   if ($context['user']['is_guest'])
      echo '
            document.cookie = "upshrinkIC=" + (mode ? 1 : 0);';
   else
      echo '
            smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "', $context['session_id'], '");';

   echo '
            document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

            document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

            current_header_ic = mode;
         }
      // ]]></script>
</head>
<body>';

   echo '
   <div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' : '', '>
      <table width="100%" cellpadding="4" cellspacing="0" border="0">
         <tr id="welcome">
            <td class="catbg">';

   // display user name
   if($context['user']['is_logged'])
      echo '

               <span style="font-size: 150%;"> ', $txt['hello_member_ndt'], ' <b>', $context['user']['name'] , '</b></span>';

   // Otherwise they're a guest - send them a lovely greating...
   else
      echo $txt['welcome_guest'];

        echo '
            </td>

            <td align="right" class="catbg">';
           
   // If the user is logged in, display stuff like their name, new messages, etc.
   if ($context['user']['is_logged'])
{
      echo '
            <a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
            <a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';

      // Is the forum in maintenance mode?
      if ($context['in_maintenance'] && $context['user']['is_admin'])
         echo '
                        <b>', $txt[616], '</b><br />';

      // Are there any members waiting for approval?
      if (!empty($context['unapproved_members']))
         echo '
                        ', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '<br />';
   }

   // Otherwise they're a guest - this time ask them to either register or login - lazy bums...
   else
   {
      echo '
                        <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>

                        <form action="', $scripturl, '?action=login2" method="post" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
                           <input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
                           <select name="cookielength">
                              <option value="60">', $txt['smf53'], '</option>
                              <option value="1440">', $txt['smf47'], '</option>
                              <option value="10080">', $txt['smf48'], '</option>
                              <option value="302400">', $txt['smf49'], '</option>
                              <option value="-1" selected="selected">', $txt['smf50'], '</option>
                           </select>
                           <input type="submit" value="', $txt[34], '" /><br />
                           <span class="middletext">', $txt['smf52'], '</span>
                           <input type="hidden" name="hash_passwrd" value="" />
                        </form>';
   }
       echo '
            </td>
         </tr>
      </table>';

   echo '
      <table width="100%" class="titlebg2" cellpadding="4" cellspacing="0" border="0" style="padding: 0px 0px 0px 0px;">
         <tr>';

   // Show a random news item? (or you could pick one from news_lines...)
   if (!empty($settings['enable_news']))
      echo '
            <td align="left" rowspan="2">
               <span class="smalltext"><b>', $txt[102], '</b>: ', $context['random_news_line'], '</span>
            </td>';
   echo '
            <td align="right" nowrap="nowrap">
               <form action="', $scripturl, '?action=search2" method="post" style="margin: 0;">
                  <a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
                  <input type="text" name="search" value="" style="width: 190px;" />&nbsp;
                  <input type="submit" name="submit" value="', $txt[182], '" style="width: 11ex;" />
                  <input type="hidden" name="advanced" value="0" />';

   // Search within current topic?
   if (!empty($context['current_topic']))
      echo '
                  <input type="hidden" name="topic" value="', $context['current_topic'], '" />';

      // If we're on a certain board, limit it to this board ;).
   elseif (!empty($context['current_board']))
      echo '
                  <input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

      echo '
                  </form>
            </td>
        </tr>';

    // display the time
   echo '
   <tr><td align="right" valign="bottom">
               <span class="smalltext">' , $context['current_time'], '</span>';

   // this is the upshrink button for the user info section
   echo '
               <a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="margin: 0 1ex;" /></a>
            </td>
         </tr>
         <tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
            <td valign="top" colspan="2">
               <div class="upshrinkbox">
               <table id="upshrinkHeader2"', empty($options['collapse_header']) ? '' : ' style="display: none;"', 'width="100%" cellpadding="8" cellspacing="0" border="0";">';

       if (function_exists('smfshout'))
       smfshout();
   echo '
               </table>
              </div>
            </td>
         </tr>
      </table>
   </div>';

   // Show the menu here, according to the menu sub template.
   template_menu();

   // The main content should go here.
   echo '
   <div id="bodyarea" style="padding: 1ex 0px 2ex 0px;">';
}


Go to the CSS page for the shoutbox upshrinker template, and add the following:


/* Additional Header Code */

.upshrinkbox {
   background-color: #adadad;
   padding: 1px;
}

#welcome a:link {
text-decoration: underline;}

#welcome a:visited {
text-decoration: underline;}

#welcome a:hover {
text-decoration: underline;}



You need to modify the shout.template.php file. Create a backup, and then replace it with following:


<?php

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

echo '
<form action="'
, $scripturl, '?action=delete_shout', $context['url_direct'], '" method="post">
<table border="0" cellspacing="1" cellpadding="3" align="center" width="100%" class="borderclass">
<tr>
<td class="catbg" colspan="'
, !empty($context['canDelete']) ? 2 : 1, '" align="center">', $txt['shoutbox_1'], '</td>
</tr><tr>
<td class="titlebg" colspan="'
, !empty($context['canDelete']) ? 2 : 1, '" align="left">', $context['page_index'], '</td>
</tr>'
;

$alternate = false;
foreach ($context['arc_shouts'] as $shout)
{
echo '
<tr class="'
, $alternate ? 'windowbg' : 'windowbg2', '">
<td>'
;

if (!empty($context['canDelete']))
echo '
<a href="'
, $scripturl, '?action=delete_shout;sesc=', $context['session_id'], ';sid=', $shout['id'], $context['url_direct'], '"><img src="', $settings['images_url'], '/deleteshout.gif" border="0" alt="X"></a>';
echo '
<span>'
, $shout['time'], '</span> - ', $shout['link'], ' -' . $shout['message'];
echo '
</td>'
;

if (!empty($context['canDelete']))
echo '
<td width="4%" align="center">
<input type="checkbox" name="ind_delete[]" value="'
, $shout['id'], '" class="check" />
</td>'
;
echo '
</tr>'
;

$alternate = !$alternate;
}
echo '
<tr>
<td class="titlebg" colspan="'
, !empty($context['canDelete']) ? 2 : 1, '" align="left" width="100%">
<div style="float: left">'
, $context['page_index'], '</div>
<div style="float: right">
'
, $context['canDelete'] ? '<input type="submit" value="' . $txt['shout_delete_selected'] . '" name="delete_sel" />' : '', '
</div>
</td>
</tr>
<tr class="windowbg">
<td colspan="2">
<center>'
;

if ($modSettings['enablearchiveshout'] == 1 && $context['canPost'])
template_shout_form();

echo '
</center>
</td>
</tr>
</table>
<input type="hidden" name="sc" value="'
, $context['session_id'], '" />
</form>'
;

// Pull the delete options for the administrator
if (!empty($context['canDelete']))
echo '
<p><table border="0" cellspacing="1" cellpadding="4" align="center" width="100%">
<tr>
<td class="catbg" align="center" colspan="2">'
, $txt['shoutbox_42'], '
</td>
</tr>
<tr>
<td class="windowbg2" valign="top" width="50%">
<form action="'
, $scripturl, '?action=delete_shout_age" method="post">', $txt['shoutbox_2'], '
<input type="text" name="age" id="age" value="25" size="4" /> '
, $txt['shoutbox_3'], '
</td>
<td class="windowbg2" valign="top">
<input type="submit" name="submit" value="'
, $txt['shoutbox_5'], '" />
<input type="hidden" name="sc" value="'
, $context['session_id'], '" />
</form><br />
</td>
</tr><tr>
<td class="windowbg2" valign="top" width="50%">
<form action="'
, $scripturl, '?action=delete_all_shouts" method="post">', $txt['shoutbox_4'], ' ', $modSettings['shoutlimit'], '
</td>
<td class="windowbg2" valign="top">
<input type="submit" name="submit" value="'
, $txt['shoutbox_5'], '" />
<input type="hidden" name="sc" value="'
, $context['session_id'], '" />
</form>
</td>
</tr>
</table></p>'
;
}

function
template_shout_box()
{
global $context, $settings, $options, $txt, $user_info, $scripturl, $modSettings, $forum_version;

// Only do auto refresh if we have it enabled!
if (!empty($modSettings['shout_enableXML']))
{
// The code for handling auto refresh
if ($forum_version < 'SMF 1.1')
echo '
<script language="JavaScript" type="text/javascript" src="'
, $settings['default_theme_url'], '/script_shout.js?1.03"></script>';

echo '
<script language="JavaScript1.2" type="text/javascript"><!--
setTimeout("doAutoReload();", 5000);

function doAutoReload()
{
if (window.XMLHttpRequest)
{
getXMLDocument("'
, $scripturl, '?action=shout_xml;xml", onDocReceived);
setTimeout("doAutoReload();", 5000);
}
}
function onDocReceived(XMLDoc)
{
// Where we create our new shouts.
var insertData = \'\';
// Number of shouts.
var numShouts = XMLDoc.getElementsByTagName("shout").length;
// Useful vars.
var shoutID, shoutMemberName, shoutMemberID, shoutMemberEmail, shoutCanDelete, shoutTime, shoutLink, shoutMessage;

// Do each shout in turn.
for (i = 0; i < numShouts; i++)
{
shoutID = XMLDoc.getElementsByTagName("shout")[i].getAttribute("id");

// If this shout exists... continue.
if (document.getElementById("shout_" + shoutID))
continue;

shoutMemberName = XMLDoc.getElementsByTagName("shout")[i].getAttribute("member_name");
shoutMemberID = XMLDoc.getElementsByTagName("shout")[i].getAttribute("member_id");
shoutMemberEmail = XMLDoc.getElementsByTagName("shout")[i].getAttribute("member_email");
shoutCanDelete = XMLDoc.getElementsByTagName("shout")[i].getAttribute("can_delete");
shoutTime = XMLDoc.getElementsByTagName("shout")[i].getAttribute("time");
shoutMessage = XMLDoc.getElementsByTagName("shout")[i].getAttribute("message");
shoutLink = XMLDoc.getElementsByTagName("shout")[i].getAttribute("link");

insertData =
\'<div id="shout_\' + shoutID + \'">\';
if (shoutCanDelete)
insertData += \'<a href="'
, $scripturl, '?action=delete_shout;sesc=', $context['session_id'], ';sid=\' + shoutID + \'"><img src="', $settings['images_url'], '/deleteshout.gif" border="0" alt="X"></a> \';

insertData += shoutTime + \' \' + shoutLink + \' -\' + shoutMessage + \''
, $modSettings['shoutsep'], '</div>\';';

// Do the actual insert.
if ($modSettings['shoutdir'] == 0)
echo '
setOuterHTML(document.getElementById("new_shout"), \'<span id="new_shout"></span>\' + insertData);'
;
else
echo '
setOuterHTML(document.getElementById("new_shout"), insertData + \'<span id="new_shout"></span>\');'
;
echo '
}
}
//--></script>'
;
}


    echo '
    <tr class="titlebg">
    <td valign="middle" style="padding: 5px 5px 5px 10px;">Shoutbox</td>'
;

// Are we showing the shout form?

if ($context['show_shout_form'] && function_exists('shout_form'))
shout_form();

echo '
<td valign="middle" nowrap="nowrap" align="right" style="padding: 5px 10px 5px 5px; white-space: nowrap;"><a href="'
, $scripturl, '?action=shout_archive">', $txt['shoutbox_43'], '</a></td></tr>';

echo '
    <tr>
<td class="windowbg" colspan="3">
<center>'
;

// Scrolling?
if ($modSettings['enablescrollshout'] == 1)
echo '
<marquee direction="'
, $modSettings['shoutscrolldir'], '" width="', $modSettings['shoutscrollwidth'], '"
height="'
, $modSettings['shoutscrollheight'], '" scrollamount="', $modSettings['shoutscrollspeed'], '"
scrolldelay="'
, $modSettings['shoutscrolldelay'], '" onmouseover="this.stop()" onmouseout="this.start()">';

// Insert the shouts, top or bottom depending on direction.
if ($modSettings['shoutdir'] == 0)
echo '
<span id="new_shout"></span>'
;

// Loop through the shouts!
foreach ($context['shouts'] as $shout)
{
echo '
<div id="shout_'
, $shout['id'], '">';
// If it's an admin - they get the delete button...
if (!empty($context['canDelete']))
echo '
<a href="'
, $scripturl, '?action=delete_shout;sesc=', $context['session_id'], ';sid=', $shout['id'], $context['url_direct'], '"><img src="', $settings['images_url'], '/deleteshout.gif" border="0" alt="X"></a>';
echo '
'
, $shout['time'], ' ', $shout['link'], ' -', $shout['message'] . $modSettings['shoutsep'];
echo '
</div>'
;

}
// For inserting new shouts...
if ($modSettings['shoutdir'] != 0)
echo '
<span id="new_shout"></span>'
;

// End the marquee?
if ($modSettings['enablescrollshout'] == 1)
echo '
</marquee>'
;

echo '
</center>
</td>
</tr>'
;
}

function
template_shout_form()
{
global $context, $settings, $options, $txt, $user_info, $scripturl, $modSettings, $ID_MEMBER;

echo '
    <td valign="middle" style="padding: 0px 0px 0px 0px;"><center>
<form action="'
, $scripturl, '?action=shout" method="post" height="20" style="white-space: nowrap; padding: 0; border: 0; margin: 0;">
<input type="hidden" value="'
, $context['qstr'], '" name="qstr" />
<input type="hidden" value="" name="email" />'
;

if ($user_info['is_guest'])
{
echo '
<input type="hidden" value="0" name="memberID" />
<input type="text" value="'
, $txt['shoutbox_6'], '" name="displayname" maxlength="100" onfocus="this.value=\'\'" />';

if (empty($modSettings['shout_noGuestEmail']))
echo '
<input type="text" value="'
, $txt['shoutbox_7'], '" name="email" maxlength="100" onfocus="this.value=\'\'" />';
}
else
echo '
<input type="hidden" value="'
, $user_info['name'], '" name="displayname" />
<input type="hidden" value="'
, $ID_MEMBER, '" name="memberID" />';

echo '
<input type="text" value="'
, $txt['shoutbox_8'], '" name="message" maxlength="100" onfocus="if (this.value == \'', $txt['shoutbox_8'], '\')this.value=\'\'" />
<input type="submit" name="submit" value="'
, $txt['shoutbox_9'], '" />
<input type="hidden" name="sc" value="'
, $context['session_id'], '" />
</form>
</center>
        </td>'
;
}

// This template handles the xml refresh things...
function template_xml_shout()
{
global $context, $settings, $options, $txt, $modSettings;

echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
<smf>'
;
foreach ($context['shouts'] as $shout)
{
echo '
<shout id="'
, $shout['id'], '" can_delete="', $context['canDelete'], '" time="', $shout['time'], '" member_email="', $shout['email'], '" member_id="', $shout['memberID'], '" member_name="', $shout['displayname'], '" message="', $shout['message'], '" link="', $shout['link'], '" />';
}
echo '
</smf>'
;
}

?>



Go to Features and Options. Click the shoutbox tab. Where it says "Scroll box width (pixels)", enter "100%". Yes that's right, percent; ignore the "pixels" instruction. Go to the next box "Scroll box height (pixels)", and enter a suitable value (I'm using "80" pixels). You will probably find that you will need to set the the scrolling speed to "slowest" because of the wide shoutbox display.

Now, go to your profile, and check the preview of the shoutbox upshrinker template. If it looks good, go with it, try it out, and then make the new template the forum default template, and apply it to all members.

krustyop

#976
Hi Grudge,
Great Mod, works great,
If you want to, I'd be more than happy to give you my settings for having the shoutbox work in french also, so you can include it in the next mod distro for french users.
I did it manually(modifying mod language file of my theme)

I just noticed the following tho..

When using Safari, when another user posts in the shoutbox, the special characters translation don't display correctly,
I mean, they show as &aacute and &nbsp, until the page is refreshed completely, either by posting in the shoutbox, or accesing another section of the forum. Then it comes back to what it should be.

2nd thing, Safari doesn't seems to handle the max number of shout to display.I put the limit to 3 latest shouts, but shows all of them until you do a complete page refresh or post in the shoutbox from it.
linked to that, when an admin deletes a shout, from another browser, safari doesn't refresh the shoutbox removing the message, it stays there, still until you do a complete page refresh.

I know safari has some issues with some dynamic html contents on other aspects(rotative newsbar don't rotate under safari)

but do you think there is a quickfix?

I placed the Box in differents places on my forum and have the same results, for now i have it display in the user info section.

Tks,

Dom

Edit:Actually the box always keep adding messages and bypass the number of latest post to display in Firefox too, they add, but the old ones don't get removed until you post in the shout box...

Edit 2:It also seems that the XML refresh disturbs the current action reported in the who's online section, everytime it refreshes, it report an Unknown action..  Any ideas on this one too?

StormLrd

Ive noted a small bug in the archieve page, you cant shout from it, thanks in advance. Storm

devdevil

hey i installed 1.36 on SMF 1.0.7 the mod works fine but i hav a qyestion.. <mebbe a bug>
the shout box automatically keeps scrolling <lik a vertical marquee> in Opera browser though it doesnt in mozilla <not tried IE>.. 

Col

Quote from: StormLrd on May 09, 2006, 10:36:13 AM
Ive noted a small bug in the archieve page, you cant shout from it, thanks in advance. Storm

Storm,

Shouting from the archive page is an option. Admin >> Features & Options >> Shoutbox >> Allow people to shout from the archive page?  ;)

Advertisement: