[r1081]: branches / 2.5.4 / cgi-bin / yabb2 / Sources / IPLookup.pm Maximize Restore History

Download this file

IPLookup.pm    58 lines (47 with data), 2.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
###############################################################################
# IPLookup.pm #
# $Date: 2013-06-25 15:33:13 +0000 (Tue, 25 Jun 2013) $
###############################################################################
# YaBB: Yet another Bulletin Board #
# Open-Source Community Software for Webmasters #
# Version: YaBB 2.5.4 #
# Packaged: July 1, 2013 #
# Distributed by: http://www.yabbforum.com #
# =========================================================================== #
# Copyright (c) 2000-2013 YaBB (www.yabbforum.com) - All Rights Reserved. #
# Software by: The YaBB Development Team #
# with assistance from the YaBB community. #
###############################################################################
use CGI::Carp qw(fatalsToBrowser);
our $VERSION = '2.5.4';
$iplookuppmver = 'YaBB 2.5.4 $Revision: 1081 $';
if ( $action eq 'detailedversion' ) { return 1; }
if ( !$ipLookup || !$INFO{'ip'} || ( !$iamadmin && !$iamgmod && !$iamymod ) ) {
fatal_error('not_allowed');
}
LoadLanguage('IPLookup');
LoadCensorList();
get_template('Other');
sub IPLookup {
$ip = $INFO{'ip'};
my $lookuplink = q{};
fopen( IPLOOKUP, "<$vardir/iplookup.urls" )
|| fatal_error( 'cannot_open', "$vardir/iplookup.urls", 1 );
@iplookup_urls = <IPLOOKUP>;
fclose(IPLOOKUP);
foreach my $i (@iplookup_urls) {
my ( $iplookup_name, $iplookup_url ) = split /\|/sm, $i;
$iplookup_name = Censor($iplookup_name);
$iplookup_url =~ s/{ip}/$ip/gsm;
$lookuplink .=
qq~<a href="http://$iplookup_url" target="_blank">$iplookup_name</a><br />~;
}
$yymain .= $my_ipdiv;
$yymain =~ s/{yabb lookuplink}/$lookuplink/gsm;
$yymain =~ s/{yabb ip}/$ip/gsm;
$yytitle = qq~$lookup_txt{'iplookup'}~;
$yynavigation = qq~&rsaquo; $lookup_txt{'iplookup'}~;
template();
return;
}
1;