HEX
Server: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: iestorre (46869)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/iestorre/biologia/modules/mod_weather_jclock/mod_weather_jclock.php
<?php	

/**
* @Copyright Copyright (c) 2014 M. Bollmann
* @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
**/

// Weather J.Clock -Module
// Weather J.Clock creates a JavaScript digitalclock with weather display based on the globally available METAR weather data
//
// **************************************************************************
// Parts of the METAR-fetching Code by Vasco Nunes / INNATO BV from the great MambWeather Module
// Weather Icons by J. Correa - www.jcorrea.es
// **************************************************************************


defined( '_JEXEC' ) or die( 'Restricted access' );

include_once(JPATH_SITE.'/modules/mod_weather_jclock/mod_weather_jclock_functions.php');


$station=array();
if ($params->get('station')!=='') {
	$station = explode(',',$params->get('station'));
}
else
{
	$station = explode(',','Kiel,Hamburg');
}
$metar =array();
if ($params->get('metar')!=='') {
	$metar = explode(',',$params->get('metar'));
	}
else
{ $metar = explode(',','EDHK,EDDH'); }


if ($params->get('color')!=='') {
	$color = $params->get('color');
	}
else
{ $color = 'black'; }
if ($params->get('hours')!=='') {
	$hours = $params->get('hours');
	}
else
{ $hours = '12'; }

if ($params->get('dateformat')!=='') {
	$dateformat = $params->get('dateformat');
	}
else
{ $dateformat = '1'; }
if ($params->get('date')!=='') {
	$date = $params->get('date');
	}
else
{ $date = 'yes'; }
if ($params->get('temp')!=='') {
	$temp = $params->get('temp');
	}
else
{ $temp = '1'; }
if ($params->get('cachetime')!=='') {
	$cachetime = $params->get('cachetime');
	}
else
{ $cachetime = '3600'; }
if ($params->get('colortemp')!=='') {
	$colortemp = $params->get('colortemp');
	}
else
{ $colortemp = '6699cc'; }
if ($params->get('colortext')!=='') {
	$colortext = $params->get('colortext');
	}
else
{ $colortext = '999999'; }

if ($params->get('colorline')!=='') {
	$colorline = $params->get('colorline');
	}
else
{ $colorline = '999999'; }

if ($params->get('seconds')!=='') {
	$seconds = $params->get('seconds');
    
	}
else
{ $seconds = '2'; }
if ($params->get('colon')!=='') {
	$colon = $params->get('colon');
    
	}
else
{ $colon = '1'; }
if ($params->get('textsize')!=='') {
	$textsize = $params->get('textsize');
    
	}
else
{ $textsize = '12px'; }

if ($params->get('metar_mode')!=='') {
	$metar_mode = $params->get('metar_mode');
    
	}
else
{ $metar_mode = 'HTTP'; }

if ($params->get('weather')!=='') {
	$weather = $params->get('weather');
    
	}
else
{ $weather = 'yes'; }
if ($params->get('clock')!=='') {
	$clock = $params->get('clock');
    
	}
else
{ $clock = 'yes'; }
if ($params->get('lines')!=='') {
	$lines = $params->get('lines');
    
	}
else
{ $lines = 'no'; }
if ($params->get('back')!=='') {
	$back = $params->get('back');
    
	}
else
{ $back = 'yes'; }
if ($params->get('time')!=='') {
	$time = explode(',',$params->get('time'));
}
else
{
	$time = explode(',','1,1,-5');
}


$timestamp = time();
$tformat ='d.m.Y';

switch ($dateformat){
  case '1': $tformat ='d.m.y'; break;
  case '2': $tformat ='Y.m.d'; break;
  case '3': $tformat ='d.m.Y'; break;
  case '4': $tformat ='m.d.Y'; break;
  case '5': $tformat ='d/m/Y'; break;
  case '6': $tformat ='m/d/Y'; break;
  case '7': $tformat ='Y/m/d'; break;
  default: $tformat ='d.m.Y'; break;
  
}
$datum = date($tformat,$timestamp);

echo '<!-- WEATHER JCLOCK START! -->';

if ($clock == 'yes'){


echo '
<script language="JavaScript">
  
  var digits;
  var loadcontrol;
  var hoursalt = 0;
  var minutesalt = 0;
  var timerID;
  var baseurl = "'.JURI::base().'modules/mod_weather_jclock/icons/'.$color.'" ;
  
  function jclock() {

    digits = Array(60);
	loadcontrol = Array(60);';
	
	if ($seconds == '1'){
	echo' 
	for(var i = 0; i < 60; i++) {
      loadcontrol[i] = 1;
	  digits[i] =  new Image;
	  digits[i].src =  baseurl + i + ".png"

    }';
	} else { echo '
	
    for(var i = 0; i < 60; i++) {
      loadcontrol[i] = 0;
      
    } '; }
	echo '

    timerID = setTimeout("update_jclock()", 1000);   
  }

  function update_jclock() {
  
    var zeit = new Date();
    var hours = zeit.getHours();
    var minutes = zeit.getMinutes();
    var seconds = zeit.getSeconds();

	';

	
	
	if ($hours == '12') {
    echo 'if (hours > 12) {hours = hours-12;}'; }

	echo '
	if (loadcontrol[hours]== 0){
	digits[hours] =  new Image;
	digits[hours].src =  baseurl + hours + ".png";}
	if (loadcontrol[minutes]== 0){
	digits[minutes] =  new Image;
	digits[minutes].src =  baseurl + minutes + ".png";}
	
	if (hours != hoursalt){
	document.hourdigit.src = digits[hours].src;}
	
	if (minutes != minutesalt) {
	document.mindigit.src = digits[minutes].src;}
	';
	
	if ($seconds == '1'){
	echo' 
	if (loadcontrol[seconds]== 0){
	digits[seconds] =  new Image;
	digits[seconds].src =  baseurl + seconds + ".png";}

	document.secdigit.src = digits[seconds].src;';
	}
   
	echo'
	minutesalt = minutes;
	hoursalt = hours;
    timerID = setTimeout("update_jclock()", 1000);    
  }
  
  </script>';

echo '<table style="width: 100%; border-collapse: collapse;">';




if ($seconds == '1'){
echo '	<tr><td '; if ($back =='yes'){echo 'style="background-image:url('.JURI::base().'modules/mod_weather_jclock/icons/top.png);background-repeat: no-repeat; background-position: center bottom;"';} echo '>
<table style="width: 100%; border-collapse: collapse;">	

<tr >
			<td>&nbsp;</td>
			<td style="text-align: center; width: 65px;"><img style="border: 0 none; height: 65px; width: 65px;" name="hourdigit" src="'.JURI::base().'modules/mod_weather_jclock/icons/'.$color.'0.png"></td>
			<td style="text-align: center; width: 65px;"><img style="border:0 none; height: 65px; width: 65px;" name="mindigit" src="'.JURI::base().'modules/mod_weather_jclock/icons/'.$color.'0.png"></td>
			<td style="text-align: center; vertical-align: bottom; width: 40px;"><img style="height: 40px; width: 40px; border:0 none;" name="secdigit" src="'.JURI::base().'modules/mod_weather_jclock/icons/'.$color.'0.png"></td>
			<td>&nbsp;</td>
		</tr>
</table>
</td></tr>		
		
';
} else {
echo '		<tr><td '; if ($back =='yes'){echo'style="background-image:url('.JURI::base().'modules/mod_weather_jclock/icons/top.png); background-repeat: no-repeat; background-position: center bottom; "';} echo '>
<table style="width: 100%; border-collapse: collapse;">	

<tr >
			
			<td nowrap="nowrap" style="text-align: center; "><img style="border:0 none; height: 70px; width: 70px;" name="hourdigit" src="'.JURI::base().'modules/mod_weather_jclock/icons/'.$color.'0.png">'; if ($colon =='1') {echo '<img style="border:0 none;" name="dot" src="'.JURI::base().'modules/mod_weather_jclock/icons/'.$color.'dot.png">';} else {echo '&nbsp;';} echo '<img style="border:0 none;" name="mindigit" src="'.JURI::base().'modules/mod_weather_jclock/icons/'.$color.'0.png"></td>
			
		</tr>
</table>
</td></tr>	
';
  }
  } else {
  echo '<table style="width: 100%; border-collapse: collapse;">';
  if ($back =='yes'){
  echo '<tr>
  <td style="background-image:url('.JURI::base().'modules/mod_weather_jclock/icons/top2.png); background-repeat: no-repeat; background-position: center bottom; width:200px; height: 22px">&nbsp;</td>
</tr>';	
  
  }
  
  }
  
if ($weather =='yes'){
$count_station=0;
$tagesdaten = array();

foreach ($station as $station_t)
 {
 	$tagesdaten = wcauswerten(fetchmetar($metar[$count_station],$cachezeit,$metar_mode),$time[$count_station]);

    echo '<tr><td '; if ($back =='yes'){echo'style="background-image:url('.JURI::base().'modules/mod_weather_jclock/icons/middle.png); background-repeat: repeat-y; background-position: center center;"';} echo '>
<table style="width: 100%; border-collapse: collapse;">	

<tr >
			<td></td>
			<td style="'; if ( $lines == 'yes') {echo 'border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color:#'.$colorline.';';} echo 'text-align: left; font-weight:bold; color: #'.$colortext.'; width: 58px; font-size:'.$textsize.'; ">'.$station_t.'</td>
			<td style="'; if ( $lines == 'yes') {echo 'border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color:#'.$colorline.';';} echo 'text-align: center; color: #'.$colortext.'; width: 43px; "><img style="border:0 none;" src="'.JURI::base().'modules/mod_weather_jclock/icons/'.$tagesdaten['himmel']['bild'].'"></td>
			<td style="'; if ( $lines == 'yes') {echo 'border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color:#'.$colorline.';';} echo 'text-align: center; font-weight:bold; color: #'.$colortemp.'; width: 58px; font-size:'.$textsize.'; " nowrap="nowrap">'; if ($temp =='2') {echo $tagesdaten['temperature']['temp_f'].' &deg;F';} else { echo $tagesdaten['temperature']['temp_c'].' &deg;C'; } echo '</td>
			<td></td>
		</tr>
</table>
</td></tr>	
';


   
	$count_station++;
 }  
  }
  echo '<tr><td '; if ($back =='yes'){echo'style="background-image:url('.JURI::base().'modules/mod_weather_jclock/icons/bottom.png); background-repeat: no-repeat; background-position: center top;"';} echo '>
<table style="width: 100%; border-collapse: collapse;">	
<tr style="height: 22px;">
             <td></td>
			<td style="width:20px;">&nbsp;</td>
			<td style="width:120px; text-align: center; vertical-align:top; color: #'.$colortext.'; font-size: 8pt;" >';
			
			if ($date == 'yes') { echo $datum; } else { echo '&nbsp;';}

		
			echo '</td>
			<td style="width:20px; text-align:left; vertical-align:top;"><a title="Ferienhaus Ostsee" href="http://www.stranddorf.de"><img alt="Ferienhaus Ostsee" style="border:0 none;" src="'.JURI::base().'modules/mod_weather_jclock/icons/icon.png"></a></td>
			<td></td>
		</tr>
</table>
</td></tr>';
  


echo '</table>';

if ($clock == 'yes'){
echo '
  <script language="JavaScript">
 
     jclock();
  
  </script>';
  };
 echo ' 
<!-- WEATHER JCLOCK END! -->';





  



?>