&Wrequire &Wuse
&path_web &path_abs_disk
&uri_escaped
- &a_href &a_href_cc
+ &a_href &a_href_cc &text_cc
&vskip
&img ¢erimg &rightimg &leftimg
$W
return $r;
}
+sub _cc()
+{
+ my $r;
+ $r||=Geo::IP->new()->country_code_by_addr(remote_ip()) if $have_Geo_IP;
+ $r||="";
+ return $r;
+}
+
# $url={"JP"=>"http://specific",...};
# $url={""=>"http://default",...};
sub a_href_cc($$;%)
# A bit ineffective but we must process all the possibilities to get stable 'headers_in' hits!
my %map=map(($_=>a_href($url->{$_},$contents,%args)),keys(%$url));
- my $cc;
- $cc||=Geo::IP->new()->country_code_by_addr(remote_ip()) if $have_Geo_IP;
- $cc||="";
- my $r=$map{$cc};
+ my $r=$map{_cc()};
return $r if $r;
return $contents;
}
+# $tree={"JP"=>"specific",...};
+# $tree={""=>"default",...};
+sub text_cc($)
+{
+my($tree)=@_;
+
+ return $tree->{_cc()};
+}
+
sub make ($)
{
my($cmd)=@_;