Like to help out with hosting costs for WXForum.net? Use the donate page. Thanks!
0 Members and 1 Guest are viewing this topic.
Hi,While not centred like the two other images above it, it seems to be displaying fine and updating.Enjoy,Paul
Your existing cam is referenced in TWO places.1/ In the holding <element> 2/ In the immediately following 'refresh' javascript.Make sure you amend the url in both places.As an aside ... the holding element (and the script) has three <center> but no closures ?
<div align="center"> <!-- cams container --> <p> Webcam Waterford City Suburbs Looking East</p> <p> Credit to TII For Kilmacthomas/Dungarvan Road Cams</p> <div align="center"> <img class="lb-image refresh" src="https://cdn.mtcc.ie/static/cctv/0286.jpg" style="display: inline;"> <img class="lb-image refresh" src="https://cdn.mtcc.ie/static/cctv/0330.jpg" style="display: inline;"> <p> My fantastic webcam ...</p> <img src="http://waterfordweather.ddns.net:8080/images/live.jpg" class="refresh" style= " /* width: 640px; height; 480px; */ border: 2px solid black"><SCRIPT language="JavaScript" type="text/javascript"><!-- var t = 10; // interval in seconds var x = document.getElementsByClassName("refresh"); var cam = setInterval( function() { tmp = new Date(); tmp = "?"+tmp.getTime() for(y = 0; y < x.length; y++) { z = x[y].src.split('?'); x[y].src = z[0]+tmp; }}, t * 1000);// --></SCRIPT> </div></div> <!-- END cams container --><footer>
OK ....Some down and dirty code that should work html / javascript:Code: [Select]<div align="center"> <!-- cams container --> <p> Webcam Waterford City Suburbs Looking East</p> <p> Credit to TII For Kilmacthomas/Dungarvan Road Cams</p> <div align="center"> <img class="lb-image refresh" src="https://cdn.mtcc.ie/static/cctv/0286.jpg" style="display: inline;"> <img class="lb-image refresh" src="https://cdn.mtcc.ie/static/cctv/0330.jpg" style="display: inline;"> <p> My fantastic webcam ...</p> <img src="webcam.jpg" class="refresh" style= " /* width: 640px; height; 480px; */ border: 2px solid black"><?php include('camfetch.php'); ?><SCRIPT language="JavaScript" type="text/javascript"><!-- var t = 10; // interval in seconds var x = document.getElementsByClassName("refresh"); var cam = setInterval( function() { let response = fetch('camfetch.php'); tmp = new Date(); tmp = "?"+tmp.getTime() for(y = 0; y < x.length; y++) { z = x[y].src.split('?'); x[y].src = z[0]+tmp; }}, t * 1000);// --></SCRIPT> </div></div> <!-- END cams container --><footer>NEW php file - camfetch.phpCode: [Select]<?phpini_set('display_startup_errors',1);ini_set('display_errors',1);error_reporting(-1);$bert = time();copy("http://waterfordweather.ddns.net:8080/images/live.jpg?t=".time(),"webcam.jpg");echo "<!-- cam copied -->";exit;?>Note: There will be an initial update delay for your cam on page load.Edit: Additional php include added, and php slightly modified ... I haven't posted this code
<div align="center"> <!-- cams container --> <p> Webcam Waterford City Suburbs Looking East</p> <p> Credit to TII For Kilmacthomas/Dungarvan Road Cams</p> <div align="center"> <img class="lb-image refresh" src="https://cdn.mtcc.ie/static/cctv/0286.jpg" style="display: inline;"> <img class="lb-image refresh" src="https://cdn.mtcc.ie/static/cctv/0330.jpg" style="display: inline;"> <p> My fantastic webcam ...</p> <img src="webcam.jpg" class="refresh" style= " /* width: 640px; height; 480px; */ border: 2px solid black"><?php include('camfetch.php'); ?><SCRIPT language="JavaScript" type="text/javascript"><!-- var t = 10; // interval in seconds var x = document.getElementsByClassName("refresh"); var cam = setInterval( function() { let response = fetch('camfetch.php'); tmp = new Date(); tmp = "?"+tmp.getTime() for(y = 0; y < x.length; y++) { z = x[y].src.split('?'); x[y].src = z[0]+tmp; }}, t * 1000);// --></SCRIPT> </div></div> <!-- END cams container --><footer>
<?phpini_set('display_startup_errors',1);ini_set('display_errors',1);error_reporting(-1);$bert = time();copy("http://waterfordweather.ddns.net:8080/images/live.jpg?t=".time(),"webcam.jpg");echo "<!-- cam copied -->";exit;?>
NO - this should work in the current circumstances !
failed to open stream: Connection refused
Hmm ...Quote failed to open stream: Connection refusedDidn't foresee that - I'll PM you with something naughty to try ....