function CheckAll()<br /> {<br /> $sql = "SELECT id,website,hash,UNIX_TIMESTAMP(lastchecked) AS lastchecked,UNIX_TIMESTAMP(lastupdated) AS lastupdated,webname FROM {$this->tbl}";<br /> $result = @mysql_query($sql, $this->id) or die("Unable to perform query: $sql");<br /> while ($row = @mysql_fetch_array($result, MYSQL_ASSOC))<br /> {<br /> $site = array();<br /> set_time_limit(120);<br /> ini_set("max_execution_time",120);<br /><br /> $site = @file($row['website']);<br /><br /> $timeout = 60; // <-- configure the URL timeout in seconds<br /> stream_set_timeout($site, $timeout);<br /><br /><br /> if (empty($site))<br /> {<br /> echo "<p>The website {$row['website']} could not be fetched.</p>\n";<br /> }<br /> else<br /> {<br /> $hash = md5(strip_tags(join('', $site)));<br /> if ($this->autoupdate)<br /> {<br /> if ($hash != $row['hash'])<br /> {<br /> $sql = "UPDATE {$this->tbl} SET lastchecked=NOW(),lastupdated=NOW(),hash='{$hash}' WHERE id={$row['id']}";<br /> }<br /> else<br /> {<br /> $sql = "UPDATE {$this->tbl} SET lastchecked=NOW() WHERE id={$row['id']}";<br /> }<br /> @mysql_query($sql, $this->id) or die("Unable to perform query: $sql");<br /> }<br /> else<br /> {<br /> if ($hash != $row['hash'])<br /> {<br /> $this->results[] = $row;<br /> }<br /> }<br /> }<br /> }<br /> @mysql_free_result($result);<br /> }