TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 08:10:48 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 203
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online

Manual Shoutbox Refresh Button

Started by anunlike, March 09, 2006, 05:03:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

anunlike

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.

IchBin

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. :)

anunlike

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

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:
<!--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

bloc

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

The Shoutbox in TP is all you need for Shouts, if you wanna chat get FlashChat..it's *Free*

anunlike

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!

anunlike

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

bloc