News: When asking for support, it helps us and you, if you read the Posting Guidelines

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

September 22, 2019, 03:05:24 PM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 188947
  • Total Topics: 20756
  • Online Today: 109
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 0
Guests: 78
Total: 78

Author Topic: Manual Shoutbox Refresh Button  (Read 4637 times)

0 Members and 1 Guest are viewing this topic.

Offline anunlike

  • Friends
  • *
  • Posts: 560
Manual Shoutbox Refresh Button
« on: March 08, 2006, 10:03:45 PM »
I'm wondering if ...

1) Is it possible to create a single button to have just the shoutbox refresh when you click on it? I don't know the technical side of this, so I'm first asking if it's even possible.

I know that having an auto-refreshing shoutbox would basically reload the page, so I don't know if it's even possible to have only the shoutbox load at the click of a button.

2) If it's possible, could this be implemented?

With how nice it would be to have the shoutbox auto-refresh, I guess this would be the next best thing.

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Manual Shoutbox Refresh Button
« Reply #1 on: March 09, 2006, 08:39:15 AM »
Bloc has stated his opinion on the Shoutbox quite a few times. I don't think he's going to change anything. However, I think there have been a few hacks on the shoutbox where people have done just what you're asking if you search the forum. If you don't find anything, I'm sure we can come up with something. :)

Offline anunlike

  • Friends
  • *
  • Posts: 560
Re: Manual Shoutbox Refresh Button
« Reply #2 on: March 09, 2006, 09:18:18 AM »
Thanks.

I know plenty of people have asked about auto-refreshing the shoutbox. I did a search for the auto-refresh question and I quite agree with Bloc on that. I just didn't find anything about this specific suggestion. I'll search again and see if I can find anything else.

MKJ

  • Guest
Re: Manual Shoutbox Refresh Button
« Reply #3 on: March 09, 2006, 02:32:54 PM »
I overcame this but I couldn't see how to go about it using the shoutbox that came with TP.  I eventually used a shoutbox that came from here - cj tagboard.  I think I failed with the TP shoutbox because the code isn't isolated in it's own page.  Bit difficult to refresh as a result.  Anyway with the great versatality of the block creation with TP it isn't hard to use a different shoutbox.  Only problem really is the lack of control over who can post.  Again I don't really see this as a problem because I view the shoutbox as something that is seldom used as it lacks privacy.  I installed Flash Chat for serious chat and they both work together nicely.  All you really have to do is create a TP block with an iframe and source the cj tagboard script.  As it is an iframe you can build in manual refresh or use the cj tagboard auto-refresh or even use the 'silent refresh code' I use.  The silent refresh code doesn't cause any clicks or task bar alterations which is much prefered for sure.  All I did was to include the following code:
Code: [Select]
<!--compiled in <?=round(((time() + microtime()) - $GLOBALS['timer'])*1000)?> milliseconds-->
<noscript>
<!--
    We have the "refresh" meta-tag in case the user's browser does
    not correctly support JavaScript or has JavaScript disabled.

    Notice that this is nested within a "noscript" block.
-->
<meta http-equiv="refresh" content="2">

</noscript>

<script language="JavaScript">
<!--

var sURL = unescape(window.location.pathname);

function doLoad()
{
    // the timeout value should be the same as in the "refresh" meta-tag
    setTimeout( "refresh()", 30*1000 );
}

function refresh()
{
    //  This version of the refresh function will cause a new
    //  entry in the visitor's history.  It is provided for
    //  those browsers that only support JavaScript 1.0.
    //
    window.location.href = sURL;
}
//-->
</script>

<script language="JavaScript1.1">
<!--
function refresh()
{
    //  This version does NOT cause an entry in the browser's
    //  page view history.  Most browsers will always retrieve
    //  the document from the web-server whether it is already
    //  in the browsers page-cache or not.
    // 
    window.location.replace( sURL );
}
//-->
</script>

<script language="JavaScript1.2">
<!--
function refresh()
{
    //  This version of the refresh function will be invoked
    //  for browsers that support JavaScript version 1.2
    //
   
    //  The argument to the location.reload function determines
    //  if the browser should retrieve the document from the
    //  web-server.  In our example all we need to do is cause
    //  the JavaScript block in the document body to be
    //  re-evaluated.  If we needed to pull the document from
    //  the web-server again (such as where the document contents
    //  change dynamically) we would pass the argument as 'true'.
    // 
    window.location.reload( false );
}
//-->
</script>
</head>
<!--
    Use the "onload" event to start the refresh process.
-->
<body onload="doLoad()" bgcolor="#E1E1E1">

<script language="JavaScript">
<!--
    // we put this here so we can see something change
    document.write('<b>' + (new Date).toLocaleString() + '</b>');
//-->
</script>
just above the </body> tag in display.php of the tagboard script.  After disabling the auto-refresh of the cj tagboard I passed the refresh over to the script above. 

As the shoutbox is being shown in an iframe it opens up lots of different ways of displaying various site content.  The menu under my shoutbox now includes the links below:

Intro | Latest News | Shoutbox |...............powered by CJ
Offers/News: UK Shops | Software | Software Search
Forum: Top Topics | Recent Topics | Recent Replies
Who is online? | Board Stats

Each of them loads different content into the iframe.  On loading the site the iframe displays the fading intro script and then refreshes to show the shoutbox.  Lots of the other scripts are ssi driven with the 'Who is online?' also showing the people in the Flash Chat.  The way you can load the iframe is really upto your own imagination but sure helps keep things tidy.

Anyways some ideas for you hopefully.

By the way after I had installed the cj tagboard script and posted on their forum some nut followed the link to my site and hacked the board - the shoutbox.  I worked out how he was able to do this and I think I stopped him.  If you do use the cj tagboard script and this headcase finds you then I will tell you how to go about stopping the nonsense.

Regards
MKJ

Offline bloc

  • Founder
  • *
  • Posts: 5217
    • Bloc
Re: Manual Shoutbox Refresh Button
« Reply #4 on: March 10, 2006, 11:57:15 AM »
Its possible by the use of a special feature that also AJAX use. I can't say if and when this will be in though, I feel other things are more important.

crip

  • Guest
Re: Manual Shoutbox Refresh Button
« Reply #5 on: March 10, 2006, 12:16:02 PM »
The Shoutbox in TP is all you need for Shouts, if you wanna chat get FlashChat..it's *Free*

Offline anunlike

  • Friends
  • *
  • Posts: 560
Re: Manual Shoutbox Refresh Button
« Reply #6 on: March 10, 2006, 01:04:34 PM »
Well, it would just be nice to be able to refresh it, more conveniently. I definitely agree that it's not very important, just thought I'd ask.

I'm not asking about a chat type thing, just exploring options on how to make the refreshing of the shoutbox a bit more convenient.

Thanks all. Glad to hear your input, Bloc!

Offline anunlike

  • Friends
  • *
  • Posts: 560
Re: Manual Shoutbox Refresh Button
« Reply #7 on: March 10, 2006, 09:32:40 PM »
If you're ever interested, someone posted on the Simple Machines community forum that they've developed an AJAX shoutbox, not sure if s/he's going to release it or not, but I mentioned TP to him/her.

I have no idea about the technical side of it, but if you think it would work and would be interested. ...

http://www.simplemachines.org/community/index.php?topic=73422.0

Offline bloc

  • Founder
  • *
  • Posts: 5217
    • Bloc
Re: Manual Shoutbox Refresh Button
« Reply #8 on: March 11, 2006, 01:42:41 AM »
I'll take a look.