--- prewikka-0.9.14.orig/prewikka/templates/AlertListing.tmpl	2008-03-21 10:51:53.000000000 -0400
+++ prewikka-0.9.14/prewikka/templates/AlertListing.tmpl	2008-05-01 15:19:59.000000000 -0400
@@ -1,3 +1,4 @@
+#import GeoIP
 #from prewikka import User, utils
 #extends prewikka.templates.MessageListing
 
@@ -524,6 +525,8 @@
 
 #set $need_hr = 0
 
+#set gi = GeoIP.new(GeoIP.GEOIP_MEMORY_CACHE)
+
 #if $hidden > 0
        #set $string = $_("%(hidden)d of %(total)d %(name)ss not shown...")
        <b>($str($string % { "hidden": $hidden, "total": $total, "name": $name })
@@ -547,11 +550,18 @@
       #end if
 
       #for $address in $direction.addresses
+
+       #set $address_code = gi.country_code_by_addr($address.value);
+       #set $address_name = gi.country_name_by_addr($address.value);
+       #set $address_code = str($address_code).lower()
+
+       <img src="/images/flags/$(address_code).png" alt="$(address_name)">
        <a class="popup_menu_toggle">$address.hostname</a><span class="popup_menu">
          - <a href="$address.inline_filter">$str($_("Filter on this %s") % ($name))</a><br />
 
        #if not $address.category or $address.category in ("ipv4-addr", "ipv4-net", "ipv6-addr", "ipv6-net")
          - <a target="$prewikka.external_link_target" href="https://www.prelude-ids.com/host_details.php?host=$address.value">$str($_("%s information") % ($name)).capitalize()</a><br />
+         - <a target="$prewikka.external_link_target" href="http://www.ip2location.com/$address.value">$str($_("%s location") % ($name)).capitalize()</a><br />
 
           #for $cmdname, $link in $address.host_commands
          - <a href="$link">$cmdname</a><br />
