Bit surprised to see no auto-refresh option on the shoutbox? Is there a way to activate it or isn't there this option available? Only way people can see any answer is by refreshing the screen.
Umm yes this confuses me too. I am guessing you have RC2? Cause I could have sworn there was a autorefresh or something similiar. I thought there were alot more options too but maybe I wasnt using the regular shoutbox when I had it.
Bloc have allready answerd this question in an other thread.. ;)
if you really want another Shoutbox with AUTO refresh I can hook you up with one?..let me know.
Sure - auto refresh is really important in my opinion as I can watch my forum whilst playing my gettarrr :) without having to refesh all the time. Where is an alternative shoutbox to be had?
http://www.cj-design.com/demos/cjtagboardv3/index.php
Quote from: Mitch on February 23, 2006, 08:55:03 PM
Umm yes this confuses me too. I am guessing you have RC2? Cause I could have sworn there was a autorefresh or something similiar. I thought there were alot more options too but maybe I wasnt using the regular shoutbox when I had it.
Your prolly talking about SMF..UltimateShoutBox mod
Like the look of that CJ Tag Board V3.0. See if I can rig something up in a popup window maybe. Can't see how to create any auto refresh on the Tiny shoutbox as the code isn't isolated. If it was in a seperate file - like a Joomla module - or something I might have been able to do it. Don't know enough about coding to alter it otherwise. Oh well where there is a will there is a way nodoubt :).
Didn't take too long to sort out that shoutbox. I took out the Key Stats box from the index.template.php file - I am using a 7Dana template which I have altered to suit my site. Then I put an iframe where the code for the Key Stats Box was showing, which is showing the new shoutbox - CJ Tag Board V3.0. I have altered various bits of the Tag Board again to blend into my site. Next I added some silent refresh code into the display.php file that Tag Board uses which I have set to every 10 seconds. Dead simple to alter this. Viola - auto refreshing shoutbox that I can hide out of the way with smilies too boot :). Looks pretty good to me and seems to work perfectly. Ok you have to enter a name now but I dont' suppose you can have everything. Pity though. Oh well. I have made the Header collapse on first loading of the site for neatness but I might change this now. If you want to test and see the shoutbox load my site up then click on the furthest left arrow next to the Home button. If you want the code for the silent auto-refresh then I can easily post it.
Next job is to show it in a neat popup option.
Regards
MKJ
Can I see?
You can see the shoutbox by clicking on the very left arrow next to the red Home button.
Thanks, it is a good code snippet, And I will move it there.
Quote from: MKJ on February 24, 2006, 03:24:19 AM
The new shoutbox script is the bizz really. No need for my auto refresh code as it has it built in. Was set on a few minutes so I wasn't aware of it. Me rushing into things again. Altered the script and my site now so that it is looking ok and working ok too. This bit of code for silent refresh of pages or scripts I found quite a long time ago and really is very useful. No clicking on refresh and no mention of anything on the task bar. Nothing that would annoy anyone infact. Here is the code. Dead simple to alter the timer as you should be able to see.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Timer</title>
</head>
<body>
<!--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()", 5*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()">
<script language="JavaScript">
<!--
// we put this here so we can see something change
document.write('<b>' + (new Date).toLocaleString() + '</b>');
//-->
</script>
</body>
</html>
Just create a new page with the above code and watch the refresh timer work silently. You can enter this code into pages you want to refresh. Very neat code if you ask me.
Regards.
A little update on this. I will use this shoutbox throughout my site so there could be multiple instances running if someone - like me - runs a few windows at the same time. Noticed today that the refresh that works with the script does click and shows on the task bar. I have now disabled the refresh in the config.php file and added the silent refresh code to the display.php file - right at the bottom. I have set it to 30 seconds refresh which should be ok for most users including dial up. Much better without any annoying clicks. I should be able to put a link outside of the box too so that manual refresh could be used.
You could have put C-J Tagboard in a HTML box using the htmlcode.dat, but anyway you like it...do you like the Xtra's? :)
Yeah - very neat script. I am adding it to my weblogs now so everyone can chat away. Getting good this. Will also be updating the weblogs so that users can have their own galleries and file updates - along with a Media Player (though I have to ask my internet host provider about this as the player can show mp3 etc which they are not keen on hosting).
By the way because I am showing this shoutbox in an iframe it can be used on anyone's site. Be able to chat away between websites.