my $flag = '';
require '/var/ipfire/general-functions.pl';
+require "${General::swroot}/geoip-functions.pl";
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
my $flagcode = uc(substr($flag, 0, 2));
my $fcode = lc($flagcode);
+
+ # Get flag icon for of the country.
+ my $flag_icon = &GeoIP::get_flag_icon($fcode);
+
my $country = Locale::Country::code2country($fcode);
if($fcode eq 'eu') { $country = 'Europe'; }
if($fcode eq 'tp') { $country = 'East Timor'; }
if($fcode eq 'yu') { $country = 'Yugoslavia'; }
if ($lines % 2) {
- print "<td $col><a id='$fcode'><img src='/images/flags/$fcode.png' alt='$flagcode' title='$flagcode'/></a></td>";
+ print "<td $col><a id='$fcode'><img src='$flag_icon' alt='$flagcode' title='$flagcode'/></a></td>";
print "<td $col>$flagcode</td>";
print "<td $col>$country</td></tr>\n";
}
$col="style='background-color:${Header::table1colour};'";
}
print "<tr>";
- print "<td $col><a id='$fcode'><img src='/images/flags/$fcode.png' alt='$flagcode' title='$flagcode'/></a></td>";
+ print "<td $col><a id='$fcode'><img src='$flag_icon' alt='$flagcode' title='$flagcode'/></a></td>";
print "<td $col>$flagcode</td>";
print "<td $col>$country</td>";
print "<td $col> </td>";
#use CGI::Carp 'fatalsToBrowser';
require '/var/ipfire/general-functions.pl';
+require "${General::swroot}/geoip-functions.pl";
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
<td align='center' $col>$srcport<br/>$dstport</td>
END
;
- if ( $fcode ne "" ){
- print "<td align='center' $col><a href='../country.cgi#$fcode'><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$ccode'></a></td>";}
- else {
- print "<td align='center' $col></td>";}
+ # Get flag icon for of the country.
+ my $flag_icon = &GeoIP::get_flag_icon($fcode);
+
+ if ( $flag_icon) {
+ print "<td align='center' $col><a href='../country.cgi#$fcode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode'></a></td>";
+ } else {
+ print "<td align='center' $col></td>";
+ }
+
print <<END
<td align='center' $col>$macaddr</td>
</tr>
#use CGI::Carp 'fatalsToBrowser';
require '/var/ipfire/general-functions.pl';
+require "${General::swroot}/geoip-functions.pl";
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
print "<td align='center' $col>$key[$s]</td>";
}
else {
- if($key[$s] ne 'unknown' ) {
- my $fcode = lc($key[$s]);
- print "<td align='center' $col><a href='/cgi-bin/country.cgi#$fcode'><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$key[$s]' title='$key[$s]'></a></td>";}
- else {
- print "<td align='center' $col>$key[$s]</td>";
+ my $fcode = lc($key[$s]);
+
+ # Get flag icon for of the country.
+ my $flag_icon = &GeoIP::get_flag_icon($fcode);
+
+ if($flag_icon) {
+ print "<td align='center' $col><a href='/cgi-bin/country.cgi#$fcode'><img src='$flag_icon' border='0' align='absmiddle' alt='$key[$s]' title='$key[$s]'></a></td>";
+ } else {
+ print "<td align='center' $col>$key[$s]</td>";
}
}
print "<td align='center' $col>$value[$s]</td>";
#use CGI::Carp 'fatalsToBrowser';
require '/var/ipfire/general-functions.pl';
+require "${General::swroot}/geoip-functions.pl";
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
$color++;
print "<td align='center' $col><form method='post' action='showrequestfromip.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='ip' value='$key[$s]'> <input type='submit' value='$Lang::tr{'details'}'></form></td>";
print "<td align='center' $col><a href='/cgi-bin/ipinfo.cgi?ip=$key[$s]'>$key[$s]</a></td>";
- if ( $fcode ne "" ){
- print "<td align='center' $col><a href='/cgi-bin/country.cgi#$fcode'><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$ccode' title='$ccode'></a></td>";}
- else {
- print "<td align='center' $col></td>";}
- print "<td align='center' $col>$value[$s]</td>";
- print "<td align='center' $col>$percent</td>";
- print "</tr>";
+
+ # Get flag icon for of the country.
+ my $flag_icon = &GeoIP::get_flag_icon($ccode);
+
+ if ( $flag_icon ) {
+ print "<td align='center' $col><a href='/cgi-bin/country.cgi#$fcode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode' title='$ccode'></a></td>";
+ } else {
+ print "<td align='center' $col></td>";
+ }
+
+ print "<td align='center' $col>$value[$s]</td>";
+ print "<td align='center' $col>$percent</td>";
+ print "</tr>";
}
if($cgiparams{'otherspie'} == 2 ){}