<commit_before><?php 
/*
 * My purpose in life is to produce pics
 */
include("../../config/settings.inc.php");
include("../../include/database.inc.php");
include("setup.php");

include("../../include/myview.php");
$t = new MyView();

$dir = isset($_GET["dir"]) ? $_GET["dir"]: "";

$filename='/mesonet/share/pics/'.$station.'/'.$station.'.jpg'; 
$puri='pics/'.$station.'/'.$station.'.jpg';

if ($dir != ""){
 $filename='/mesonet/share/pics/'.$station.'/'.$station.'_'.$dir.'.jpg';
 $puri='pics/'.$station.'/'.$station.'_'.$dir.'.jpg';
}
if (! file_exists($filename)){
	$puri = '/images/nophoto.png';
}

$t->thispage = "iem-sites";
$t->title = "Site Photos";

$t->sites_current = "pics"; 


function printtd($instr,$selected,$station){
  	global $network;
  	$s = "";
  	$filename='/mesonet/share/pics/'.$station.'/'.$station.'_'.$instr.'.jpg';
  	if (file_exists($filename)){ 
  		if ($instr == $selected){
       	$s .= '<td align="center" style="background: #ee0;">'.$instr.'</td>';
       	$s .= "\n";
    	} else {
      	$s .= '<td align="center"><a href="pics.php?network='.$network.'&station='.$station.'&dir='.$instr.'">'.$instr.'</a></td>';
      	$s .= "\n";
    	}
	} else {
     $s .= '<td align="center">'.$instr.'</td>';
     $s .= "\n";
    }
	return $s;
}

$table = sprintf("<tr>%s%s%s</tr><tr>%s%s%s</tr><tr>%s%s%s</tr>",
 		printtd("NW",$dir,$station), printtd("N",$dir,$station), 
		printtd("NE",$dir,$station), printtd("W",$dir,$station),
 	"<td><img src=\"{$puri}\" alt=\"{$station} {$dir}\" /></td>",
    	printtd("E",$dir,$station), printtd("SW",$dir,$station),
  		printtd("S",$dir,$station), printtd("SE",$dir,$station));

$more = "";
$filename='/mesonet/share/pics/'.$station.'/'.$station.'_span.jpg';
$puri='pics/'.$station.'/'.$station.'_span.jpg';
$lfilename='/mesonet/share/pics/'.$station.'/'.$station.'_pan.jpg';
$pluri='pics/'.$station.'/'.$station.'_pan.jpg';
if (file_exists($filename))
{
	$more = "<h3>Panoramic Shot</h3><img src=\"$puri\"><br /><a href=\"$pluri\">Full resolution version</a>";
}
if (file_exists("/mesonet/share/pics/$station/HEADER.html")){
	$more .= "<p><strong>". file_get_contents("/mesonet/share/pics/$station/HEADER.html") ."</strong>";
}<commit_msg>use responsive image viewing<commit_after><?php 
/*
 * My purpose in life is to produce pics
 */
include("../../config/settings.inc.php");
include("../../include/database.inc.php");
include("setup.php");

include("../../include/myview.php");
$t = new MyView();

$dir = isset($_GET["dir"]) ? $_GET["dir"]: "";

$filename='/mesonet/share/pics/'.$station.'/'.$station.'.jpg'; 
$puri='pics/'.$station.'/'.$station.'.jpg';

if ($dir != ""){
 $filename='/mesonet/share/pics/'.$station.'/'.$station.'_'.$dir.'.jpg';
 $puri='pics/'.$station.'/'.$station.'_'.$dir.'.jpg';
}
if (! file_exists($filename)){
	$puri = '/images/nophoto.png';
}

$t->thispage = "iem-sites";
$t->title = "Site Photos";

$t->sites_current = "pics"; 


function printtd($network, $instr,$selected,$station){
  	$s = "";
  	$filename='/mesonet/share/pics/'.$station.'/'.$station.'_'.$instr.'.jpg';
  	if (file_exists($filename)){ 
  		if ($instr == $selected){
       	$s .= '<td align="center" style="background: #ee0;">'.$instr.'</td>';
       	$s .= "\n";
    	} else {
      	$s .= '<td align="center"><a href="pics.php?network='.$network.'&station='.$station.'&dir='.$instr.'">'.$instr.'</a></td>';
      	$s .= "\n";
    	}
	} else {
     $s .= '<td align="center">'.$instr.'</td>';
     $s .= "\n";
    }
	return $s;
}

$table = sprintf("<tr>%s%s%s</tr><tr>%s%s%s</tr><tr>%s%s%s</tr>",
 		printtd($network,"NW",$dir,$station), printtd($network,"N",$dir,$station), 
		printtd($network,"NE",$dir,$station), printtd($network,"W",$dir,$station),
 	"<td><img src=\"{$puri}\" alt=\"{$station} {$dir}\" class=\"img img-responsive\" /></td>",
    	printtd($network,"E",$dir,$station), printtd($network,"SW",$dir,$station),
  		printtd($network,"S",$dir,$station), printtd($network,"SE",$dir,$station));

$more = "";
$filename='/mesonet/share/pics/'.$station.'/'.$station.'_span.jpg';
$puri='pics/'.$station.'/'.$station.'_span.jpg';
$lfilename='/mesonet/share/pics/'.$station.'/'.$station.'_pan.jpg';
$pluri='pics/'.$station.'/'.$station.'_pan.jpg';
if (file_exists($filename))
{
	$more = "<h3>Panoramic Shot</h3><img src=\"$puri\"><br /><a href=\"$pluri\">Full resolution version</a>";
}
if (file_exists("/mesonet/share/pics/$station/HEADER.html")){
	$more .= "<p><strong>". file_get_contents("/mesonet/share/pics/$station/HEADER.html") ."</strong>";
}
{'fraction_non_alphanumeric': 0.3102076889085285, 'fraction_numerical': 0.0013256738842244808, 'mean_word_length': 4.209436133486767, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1510392', 'n_tokens_mistral': 1749, 'n_tokens_neox': 1763, 'n_words': 214}