Exemplo n.º 1
0
function formatIP($ip)
{
    global $loguser;
    $res = $ip;
    $res .= " " . IP2C($ip);
    $res = "<nobr>{$res}</nobr>";
    if (HasPermission('admin.ipsearch')) {
        return actionLinkTag($res, "ipquery", $ip);
    } else {
        return $res;
    }
}
Exemplo n.º 2
0
        return $html;
    }
    if ($isCLI == 'YES' && $string == 0) {
        echo "\n-> Query Time: {$rt} seconds\n              \r-> Source Count: {$sipCount}\n              \r-> Destination Count: {$dipCount}\n              \r-> Total Mapped: {$allCount['0']}\n\n";
    }
}
function TheHTML($string)
{
    echo "\r<html>\n          \r<head>\n          \r<script type=\"text/javascript\" src=\"../.js/squert.js\"></script>\n          \r<style type=\"text/css\" media=\"screen\">@import \"../.css/squert.css\";</style>\n          \r</head>\n          \r<body style=\"background: #ffffff;\">\n          \r<form id=ip2c method=post action=ip2c.php>\n          \r<center>          \n          \r<input class=rb onclick=\"poof('wrkn','yes');\" id=csync name=csync type=\"submit\" value=\"update\">\n          \r<br><br><span id=\"wrkn\" name=\"wrkn\" style=\"display: none;\"><img src=work.gif></span>\n          \r<input type=hidden id=qText name=qText value=\"{$string}\">\n          \r</center>\n          \r</body>\n          \r</html>";
}
if (isset($argc)) {
    if ($argc == 1 || $argc > 2 || $argv[1] > 1 || !is_numeric($argv[1])) {
        echo "\nUsage: update.php <option>\n\n          \rOptions\n          \r-------\n          \r0 - First run. Map everything in the DB (this can take a while)\n          \r1 - Update. This is intended to be called via Cron\n\n";
        exit;
    } else {
        IP2C($argv[1], 'YES');
    }
} else {
    $html = '';
    if (!isset($_REQUEST['qText'])) {
        $string = $_REQUEST['qp'];
    } else {
        $string = $_REQUEST['qText'];
    }
    if (@$_REQUEST['csync']) {
        $string = $_REQUEST['qText'];
        $html = IP2C($string, 'NO');
    }
    TheHTML($string);
    echo $html;
}
Exemplo n.º 3
0
    $foo[__("Title")] = $title;
}
if ($currentRank) {
    $foo[__("Rank")] = $currentRank;
}
if ($toNextRank) {
    $foo[__("To next rank")] = $toNextRank;
}
$foo[__("Karma")] = $karma . $karmaLinks;
$foo[__("Total posts")] = format("{0} ({1} per day)", $posts, $averagePosts);
$foo[__("Total threads")] = format("{0} ({1} per day)", $threads, $averageThreads);
$foo[__("Registered on")] = format("{0} ({1} ago)", cdate($dateformat, $user['regdate']), TimeUnits($daysKnown * 86400));
$foo[__("Score")] = $score;
$foo[__("Browser")] = $user['lastknownbrowser'];
if ($loguser['powerlevel'] > 0) {
    $foo[__("Last known IP")] = $user['lastip'] . " " . IP2C($user['lastip']);
}
$profileParts[__("General information")] = $foo;
$foo = array();
$foo[__("Email address")] = $emailField;
if ($homepage) {
    $foo[__("Homepage")] = CleanUpPost($homepage);
}
$profileParts[__("Contact information")] = $foo;
$foo = array();
$foo[__("Theme")] = $themes[$user['theme']];
$foo[__("Items per page")] = Plural($user['postsperpage'], __("post")) . ", " . Plural($user['threadsperpage'], __("thread"));
$profileParts[__("Presentation")] = $foo;
$foo = array();
if ($user['realname']) {
    $foo[__("Real name")] = strip_tags($user['realname']);
if ($isMod) {
    $format = "\n\t\t<tr class=\"cell{0}\">\n\t\t\t<td>\n\t\t\t\t{1}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{2}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{3}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{4}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{5}\n\t\t\t</td>\n\t\t</tr>\n\t";
} else {
    $format = "\n\t\t<tr class=\"cell{0}\">\n\t\t\t<td>\n\t\t\t\t{1}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{2}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{3}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{5}\n\t\t\t</td>\n\t\t</tr>\n\t";
}
$items = "";
while ($user = Fetch($peeps)) {
    $bucket = "userMangler";
    include "./lib/pluginloader.php";
    $lip = $user['lastip'];
    $lkb = $user['lastknownbrowser'];
    if (isset($_GET['showfull'])) {
        $lkb = str_replace("-->", "", str_replace("<!--", " &mdash;", $lkb));
    }
    $cellClass = ($cellClass + 1) % 2;
    $items .= format($format, $cellClass, $user['id'], UserLink($user), IP2C($lip), $lip, $lkb);
}
if ($isMod) {
    write("\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header1\">\n\t\t\t<th>\n\t\t\t\t" . __("ID") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("Name") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t&nbsp;\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("IP") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("Last known browser") . "\n\t\t\t</th>\n\t\t</tr>\n\t\t{0}\n\t</table>\n", $items);
} else {
    write("\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header1\">\n\t\t\t<th>\n\t\t\t\t" . __("ID") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("Name") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t&nbsp;\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("Last known browser") . "\n\t\t\t</th>\n\t\t</tr>\n\t\t{0}\n\t</table>\n", $items);
}
function IP2C($ip)
{
    $q = @mysql_query("select cc from ip2c where ip_from <= inet_aton('" . $ip . "') and ip_to >= inet_aton('" . $ip . "')") or $r['cc'] = "";
    if ($q) {
        $r = @mysql_fetch_array($q);
    }
    if ($r['cc']) {
        return " <img src=\"img/flags/" . strtolower($r['cc']) . ".png\" alt=\"" . $r['cc'] . "\" title=\"" . $r['cc'] . "\" />";
    }
Exemplo n.º 5
0
function formatIP($ip)
{
    global $loguser;
    $res = $ip;
    $res .= " " . IP2C($ip);
    if ($loguser["powerlevel"] >= 3) {
        return actionLinkTag($res, "ipquery", $ip);
    } else {
        return $res;
    }
}
Exemplo n.º 6
0
        $pagelinks .= " " . ($i / $ppp + 1);
    } else {
        $pagelinks .= " " . actionLinkTag($i / $ppp + 1, "lastknownbrowsers", "", $ual . "from=" . $i);
    }
}
if ($pagelinks) {
    if ($from == 0) {
        $pagelinks = "1" . $pagelinks;
    } else {
        $pagelinks = actionLinkTag(1, "lastknownbrowsers", "", $ual) . $pagelinks;
    }
    Write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks);
}
if ($isMod) {
    $format = "\n\t\t<tr class=\"cell{0}\">\n\t\t\t<td>\n\t\t\t\t{1}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{2}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{4}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{5}\n\t\t\t</td>\n\t\t</tr>\n\t";
} else {
    $format = "\n\t\t<tr class=\"cell{0}\">\n\t\t\t<td>\n\t\t\t\t{1}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{2}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{3}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{5}\n\t\t\t</td>\n\t\t</tr>\n\t";
}
$items = "";
while ($user = Fetch($peeps)) {
    $lip = $user['lastip'];
    $lkb = $user['lastknownbrowser'];
    $lkb = str_replace("-->", "", str_replace("<!--", " &mdash;", $lkb));
    $cellClass = ($cellClass + 1) % 2;
    $items .= format($format, $cellClass, $user['id'], UserLink(getDataPrefix($user, "u_")), IP2C($lip), formatIP($lip), $lkb);
}
if ($isMod) {
    write("\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header1\">\n\t\t\t<th>\n\t\t\t\t" . __("ID") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("Name") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("IP") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("Last known browser") . "\n\t\t\t</th>\n\t\t</tr>\n\t\t{0}\n\t</table>\n", $items);
} else {
    write("\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header1\">\n\t\t\t<th>\n\t\t\t\t" . __("ID") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("Name") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t&nbsp;\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("Last known browser") . "\n\t\t\t</th>\n\t\t</tr>\n\t\t{0}\n\t</table>\n", $items);
}
Exemplo n.º 7
0
        $i++;
    }
} else {
    $userList = "<tr class=\"cell0\"><td colspan=\"6\">" . __("No users") . "</td></tr>";
}
$guestList = "";
if (NumRows($rGuests)) {
    $i = 1;
    while ($guest = Fetch($rGuests)) {
        $cellClass = ($cellClass + 1) % 2;
        if ($guest['date']) {
            $lastUrl = "<a href=\"" . $guest['lasturl'] . "\">" . FilterURL($guest['lasturl']) . "</a>";
        } else {
            $lastUrl = __("None");
        }
        $guestList .= format("\n\t\t<tr class=\"cell{0}\">\n\t\t\t<td>{1}</td>\n\t\t\t<td title=\"{2}\">{3}</td>\n\t\t\t<td>{4}</td>\n\t\t\t<td>{5}</td>\n\t\t\t<td>{6} {7}</td>\n\t\t</tr>\n", $cellClass, $i, htmlspecialchars($guest['useragent']), htmlspecialchars(substr($guest['useragent'], 0, 65)), cdate("d-m-y G:i:s", $guest['date']), $lastUrl, $guest['ip'], IP2C($guest['ip']));
        $i++;
    }
} else {
    $guestList = "<tr class=\"cell0\"><td colspan=\"5\">" . __("No guests") . "</td></tr>";
}
$botList = "";
if (NumRows($rBots)) {
    $i = 1;
    while ($bot = Fetch($rBots)) {
        $cellClass = ($cellClass + 1) % 2;
        if ($bot['date']) {
            $lastUrl = "<a href=\"" . $bot['lasturl'] . "\">" . FilterURL($bot['lasturl']) . "</a>";
        } else {
            $lastUrl = __("None");
        }