NESSAholics.com

=> FAQ / Board Issues => Topic started by: tylor2000 on March 19, 2003, 07:31:07 pm

Title: automatic refresh
Post 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
Title: automatic refresh
Post by: kev222 on March 20, 2003, 06:44:18 am
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])
Title: automatic refresh
Post by: tylor2000 on March 20, 2003, 06:38:52 pm
is it safe to use on this public computer or will you get into trouble.

LOL
Title: automatic refresh
Post by: kev222 on March 20, 2003, 07:44:49 pm
Hah, yeah it's safe. Nothing trouble worthy ;-)
Title: automatic refresh
Post by: tylor2000 on March 20, 2003, 07:58:58 pm
thanks man...too cool.....I didn't even click the link before you answered...

I'll use it next time....gotta run...

tylor
Title: automatic refresh
Post by: kev222 on March 20, 2003, 08:03:17 pm
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
Title: automatic refresh
Post by: kaysha on March 20, 2003, 08:25:38 pm
worked for me on IE kev... you uber-stud

-katia
Title: automatic refresh
Post by: tylor2000 on March 21, 2003, 01:43:22 pm
yep worked for me also just before I left.....uber-stud...hehe
Title: automatic refresh
Post by: kev222 on March 21, 2003, 03:19:19 pm
Erm... thanks?

Heh. Glad it works.

-Kev
Title: automatic refresh
Post by: Will on March 27, 2003, 11:06:25 pm
Quote from: "kev222"

[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:.
Title: automatic refresh
Post by: kev222 on March 28, 2003, 07:17:41 am
Okay, but I warn you. It aint pretty.

Code: [Select]

<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
Title: automatic refresh
Post by: LostDwarf on March 29, 2003, 12:51:28 pm
8O eek, so kevin ever read 2600?
Title: well
Post by: vive-la-france on March 29, 2003, 01:37:14 pm
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
Title: Re: well
Post by: kev222 on March 29, 2003, 05:24:40 pm
Quote from: "vive-la-france"
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
Title: automatic refresh
Post by: kev222 on March 29, 2003, 06:24:24 pm
Quote from: "LostDwarf"
8O eek, so kevin ever read 2600?

lol, nope. I've never heard off it, although I can imagine what it is

8)

-Kev
Title: automatic refresh
Post by: kev222 on September 02, 2004, 04:02:21 am
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.

Code: [Select]

<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"/>&nbsp;seconds (min: 5)&nbsp;&nbsp;&nbsp;<a href="#" onclick="start();">start</a>&nbsp;&nbsp;&nbsp;<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
Title: automatic refresh
Post by: tylor2000 on September 02, 2004, 04:59:30 am
Who's Online Automatic Refresh

http://www.geocities.com/tnt____/automatic_refresh.html#

Code: [Select]

<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"/>&nbsp;seconds &nbsp;&nbsp;&nbsp;<a href="#" onclick="start();">start</a>&nbsp;&nbsp;&nbsp;<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>
Title: automatic refresh
Post by: kev222 on September 02, 2004, 05:29:15 am
Quote from: "tylor2000"
Who's Online Automatic Refresh

Code theif!
Title: automatic refresh
Post by: kev222 on September 02, 2004, 05:38:05 am
Although, I'm glad you left the "dumbass" in ;-)
Title: automatic refresh
Post by: tylor2000 on September 02, 2004, 06:14:25 am
I essentially disabled it though.

tylor
Title: automatic refresh
Post by: kev222 on September 02, 2004, 06:24:32 am
Quote from: "tylor2000"
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
Title: automatic refresh
Post by: tylor2000 on September 02, 2004, 06:31:36 am
Quote from: "kev222"
Quote from: "tylor2000"
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
Title: automatic refresh
Post by: Scotty on September 02, 2004, 09:18:15 am
Yay I love it! :D
Title: automatic refresh
Post by: kev222 on September 02, 2004, 10:28:27 am
Quote from: "Scotty"
Yay I love it! :D

Which one? Mine, or that dumbass Tylor's?

-Kev
Title: automatic refresh
Post by: Scotty on September 02, 2004, 11:37:18 am
Quote from: "kev222"
Quote from: "Scotty"
Yay I love it! :D

Which one? Mine, or that dumbass Tylor's?

-Kev


Your's all might Anglo Duck!
Title: automatic refresh
Post by: tylor2000 on September 03, 2004, 12:16:51 am
I updated the code on mine.  Erased the 'dumbass' off of it, dumbass. :wink:


Code: [Select]
<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"/>&nbsp;seconds &nbsp;&nbsp;&nbsp;<a href="#" onclick="start();">start</a>&nbsp;&nbsp;&nbsp;<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>
Title: automatic refresh
Post by: kev222 on September 03, 2004, 12:35:35 am
Evil  :twisted:
Title: automatic refresh
Post by: Grakthis on September 03, 2004, 06:27:05 am
Quote from: "tylor2000"
I updated the code on mine.  Erased the 'dumbass' off of it, dumbass. :wink:


lolerskates!