NESSAholics.com
=> FAQ / Board Issues => Topic started by: tylor2000 on March 19, 2003, 07:31:07 pm
-
umm...is there a way to make the current page you're on automatically refresh? If not just figured I'd ask because I like to work that way while my hands are doing something else and every once in a while glance at the screen.....I probably should just get another e-mail address but this is not my computer...university....
tylor
-
I imagined there would be settings within browsers to handle auto-refresh, but I couldn't find one in mozilla. So I coded a simple php script to do it. You're welcome to use it to.
Beware, it's a bit of a hack job (like everything I do :-\) and it's never been tested in IE (or any other browser).
http://www.kev.nu/vc/refresh.php
Hope it works.
-Kev
Instructions.
1) Enter the refresh rate in seconds and hit 'Go'
2) The page will refresh every X seconds
3) To stop the refreshing, hit 'Stop'
4) To start the refreshing again, hit 'Start'
5) You can't refresh and individual thread or forum, just the main page [because I'm too lazy to make it good])
-
is it safe to use on this public computer or will you get into trouble.
LOL
-
Hah, yeah it's safe. Nothing trouble worthy ;-)
-
thanks man...too cool.....I didn't even click the link before you answered...
I'll use it next time....gotta run...
tylor
-
Okay, but don't get your hopes up. It's crap to the point of being unusable :-/ And like I said it might not even work in IE (at the least the frame/scroll bars will be messed up). But, give it a go, you never know ;-) I still use it on occasion.
-Kev
-
worked for me on IE kev... you uber-stud
-katia
-
yep worked for me also just before I left.....uber-stud...hehe
-
Erm... thanks?
Heh. Glad it works.
-Kev
-
[because I'm too lazy to make it good])
Post the source and let someone else finish the job, in true open source style :wink:.
-
Okay, but I warn you. It aint pretty.
<html>
<head>
<title>NH.com auto refresh</title>
<?
if(isset($_GET['rate'])) {
if($_GET['rate'] != 0) {
printf("<meta http-equiv='Refresh' content='%d'>", $_GET['rate']);
$_GET['save'] = $_GET['rate'];
}
else if(!isset($_GET['save'])){
printf("<font color='red'>0 = invalid rate</font><br>");
unset($_GET['rate']);
}
}
?>
</head>
<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>
<?
if(isset($_GET['rate'])) {
?>
<a href='refresh.php?rate=0&save=<? printf("%d", $_GET['save']); ?>'>Stop</a> <a href='refresh.php?rate=<? printf("%d", $_GET['save']); ?>'>Start</a><br>
<iframe src='http://forum.nessaholics.com' frameborder=0 width='100%' height='100%'><br><br>
<?
}
else {
?>
<form method='GET' action='refresh.php'>
Refresh rate: <input type='text' name='rate' value='60'> seconds<br>
<input type='submit' value='Go'>
</form>
<?
}
?>
</body>
</html>
Open source forever! ;)
-Kev
-
8O eek, so kevin ever read 2600?
-
i think i'll have to learn html language soon
Was all the forum written in html code ??
I made a website but with Frontpage LOL so i don't have to know html code.
Yu guys are amazing .... congrats 8O
-
i think i'll have to learn html language soon
Was all the forum written in html code ??
I made a website but with Frontpage LOL so i don't have to know html code.
Yu guys are amazing .... congrats 8O
Nope, HTML is just a language that describes the static structure of a website (how it should look). The forum is written in a language called PHP. PHP is a level deeper than HTML and can do a lot more (almost anything you'd want) :)
You're on the right track. Frontpage is good for learning HTML, get frontpage to make something and then open the document in notepad and see how it was acheieved in HTML (that's how I learned ;))
-Kev
-
8O eek, so kevin ever read 2600?
lol, nope. I've never heard off it, although I can imagine what it is
8)
-Kev
-
As per request of Ty. This is a php-less JavaScript version. enjoy :)
1. Still too lazy to make it work with anything other than the index.
2. Tested only in Firefox. So you may get problems in IE. But anybody not using FireFox deserves to get problems ;-)
http://www.kev.nu/vc/refresh.html
And the code.
<html>
<head>
<title>NH.com auto refresh (JS version)</title>
<script language="javascript">
var intid = 0;
function refresh() {
document.getElementById("fframe").src = "http://forum.nessaholics.com";
}
function start() {
var inter = parseInt(document.getElementById("inter").value) * 1000;
if(!intid && inter >= 5000) {
refresh();
intid = setInterval("refresh();", inter);
}
else
alert("dumbass");
}
function stop() {
if(intid) {
clearInterval(intid);
intid = 0;
}
}
</script>
</head>
<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top">
Interval: <input type="text" id="inter" value="60"/> seconds (min: 5) <a href="#" onclick="start();">start</a> <a href="#" onclick="stop();">stop</a>
</td>
</tr>
<tr>
<td valign="top">
<iframe id="fframe" frameborder="0" src="http://forum.nessaholics.com/" width="100%" height="600"></iframe>
</td>
</tr>
</table>
</body>
</html>
-Kev
-
Who's Online Automatic Refresh
http://www.geocities.com/tnt____/automatic_refresh.html#
<html>
<head>
<title>NH.com auto refresh (JS version)</title>
<script language="javascript">
var intid = 0;
function refresh() {
document.getElementById("fframe").src = "http://forums.nessaholics.com/viewonline.php";
}
function start() {
var inter = parseInt(document.getElementById("inter").value) * 1000;
if(!intid && inter > 0) {
refresh();
intid = setInterval("refresh();", inter);
}
else
alert("dumbass");
}
function stop() {
if(intid) {
clearInterval(intid);
intid = 0;
}
}
</script>
</head>
<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top">
Interval: <input type="text" id="inter" value="60"/> seconds <a href="#" onclick="start();">start</a> <a href="#" onclick="stop();">stop</a>
</td>
</tr>
<tr>
<td valign="top">
<iframe id="fframe" frameborder="0" src="http://forums.nessaholics.com/viewonline.php" width="100%" height="600"></iframe>
</td>
</tr>
</table>
</body>
</html>
-
Who's Online Automatic Refresh
Code theif!
-
Although, I'm glad you left the "dumbass" in ;-)
-
I essentially disabled it though.
tylor
-
I essentially disabled it though.
tylor
Not quite. If someone enters a zero or negative interval or clicks start when it is already running, they will get insulted (and rightly so 8))
-Kev
-
I essentially disabled it though.
tylor
Not quite. If someone enters a zero or negative interval or clicks start when it is already running, they will get insulted (and rightly so 8))
-Kev
lol
I'll edit it later, dumbass. ;)
tylor
-
Yay I love it! :D
-
Yay I love it! :D
Which one? Mine, or that dumbass Tylor's?
-Kev
-
Yay I love it! :D
Which one? Mine, or that dumbass Tylor's?
-Kev
Your's all might Anglo Duck!
-
I updated the code on mine. Erased the 'dumbass' off of it, dumbass. :wink:
<html>
<head>
<title>NH.com 'Who's online' automatic refresh (JS version)</title>
<script language="javascript">
var intid = 0;
function refresh() {
document.getElementById("fframe").src = "http://forums.nessaholics.com/viewonline.php";
}
function start() {
var inter = parseInt(document.getElementById("inter").value) * 1000;
if(!intid && inter > 0) {
refresh();
intid = setInterval("refresh();", inter);
}
else
alert("Error: 107x has occurred. A virus has begun to infect your hard drive. Please erase all infected files.")
if (confirm("Please inform the the hardware vendor of this error."))
alert('The virus has been contained but the browser will shutdown to check for and prevent further internal damages.');
else
alert('The problem has not been fixed, the browser must be shut downtown to prevent further contamination.');
{
parent.close();
}
}
function stop() {
if(intid) {
clearInterval(intid);
intid = 0;
}
}
</script>
</head>
<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top">
Interval: <input type="text" id="inter" value="60"/> seconds <a href="#" onclick="start();">start</a> <a href="#" onclick="stop();">stop</a>
</td>
</tr>
<tr>
<td valign="top">
<iframe id="fframe" frameborder="0" src="http://forums.nessaholics.com/viewonline.php" width="100%" height="600"></iframe>
</td>
</tr>
</table>
</body>
</html>
-
Evil :twisted:
-
I updated the code on mine. Erased the 'dumbass' off of it, dumbass. :wink:
lolerskates!