كود PHP:
Step 1.
Run the following SQL code;
ALTER TABLE post ADD proxyip VARCHAR(50) not null AFTER ipaddress;
(Note: if you use table prefixes then remember to change "post" to the correct table name).
Step 2.
Add the following phrase "thread_displayproxyip" (as a Front End Error Phrase, not a Global Phrase) ;
Real IP Address : $postinfo[ipaddress]<br>
$postinfo[hostaddress]<br>
Proxy Server IP Address : $postinfo[proxyip]<br>
$postinfo[proxyhost]
Step 3.
Replace the template "postbit_ip";
<if condition="$show['ip']">
$vbphrase[ip]: $post[ip]
<else />
<if condition="($post[proxyip] != '')">
<a href="postings.php?$session[sessionurl]do=getip&p=$post[postid]"><img class="inlineimg" src="$stylevar[imgdir_button]/ipp.gif" alt="$vbphrase[ip]" title="$post[ip]" border="0" /></a>
<else />
<a href="postings.php?$session[sessionurl]do=getip&p=$post[postid]"><img class="inlineimg" src="$stylevar[imgdir_button]/ip.gif" alt="$vbphrase[ip]" title="$post[ip]" border="0" /></a>
</else></if>
</if>
Step 4.
In includes/functions_newpost.php
Find:
if ($vboptions['logip'])
{
$post['ipaddress'] = IPADDRESS;
}
else
{
$post['ipaddress'] = '';
}
Replace with:
// Paul M Proxy Hack v1.2
if ($vboptions['logip'])
{
$post['ipaddress'] = IPADDRESS;
$post['proxyip'] = PROXYIP;
}
else
{
$post['ipaddress'] = '';
$post['proxyip'] = '';
}
// End Proxy Hack
Step 5.
In includes/functions_newpost.php
Find:
// ### POST NEW POST ###
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "post
(threadid, parentid, title, username, userid, dateline, pagetext, allowsmilie,
showsignature, ipaddress, iconid, visible, attach)
VALUES
($threadinfo[threadid], $parentid, '" . addslashes($post['title']) . "',
'" . addslashes($post['postusername']) . "', $bbuserinfo[userid], " . TIMENOW . ",
'" . addslashes($post['message']) . "', $post[enablesmilies], $post[signature],
'" . addslashes($post['ipaddress']) . "', $post[iconid], $post[visible], $totalattachments)
");
Replace with:
// Paul M Proxy Hack v1.2
// ### POST NEW POST ###
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "post
(threadid, parentid, title, username, userid, dateline, pagetext, allowsmilie,
showsignature, ipaddress, proxyip, iconid, visible, attach)
VALUES
($threadinfo[threadid], $parentid, '" . addslashes($post['title']) . "',
'" . addslashes($post['postusername']) . "', $bbuserinfo[userid], " . TIMENOW . ",
'" . addslashes($post['message']) . "', $post[enablesmilies], $post[signature],
'" . addslashes($post['ipaddress']) . "','" . addslashes($post['proxyip']) . "', $post[iconid], $post[visible], $totalattachments)
");
// End Proxy Hack
Step 6.
In postings.php
Find:
eval(print_standard_error('thread_displayip', 1, 0));
Replace with:
// Paul M Proxy Hack v1.2
$postinfo['proxyhost'] = @gethostbyaddr($postinfo['proxyip']);
if ($postinfo[proxyip] != '')
{
eval(print_standard_error('thread_displayproxyip', 1, 0));
}
else
{
eval(print_standard_error('thread_displayip', 1, 0));
}
// End Proxy Hack
Step 7.
In includes/init.php
Find the following ;
// establish client IP address
< ** lines of code **>
// determine URL / referrer of current page
Replace the whole block of code with the following ;
// establish client IP address
// ## Paul M Proxy Hack v1.30 ##
$proxyip = '';
define('ALT_IP', $_SERVER['REMOTE_ADDR']);
if ($_SERVER['HTTP_FORWARDED'] != '')
{
$proxyip = $_SERVER['HTTP_FORWARDED'];
}
if ($_SERVER['HTTP_CLIENT_IP'] != '')
{
$proxyip = $_SERVER['HTTP_CLIENT_IP'];
}
if ($_SERVER['HTTP_X_FORWARDED_FOR'] != '')
{
$proxyip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
if (preg_match("#\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}#", $proxyip, $iplist))
{
$proxyip = $iplist[0];
// ## Uncomment this section to ignore private address ranges ## //
/*
if (preg_match("#^(127|10|172\.(1[6-9]|2[0-9]|3[0-1])|192\.168|169\.254)\.#", $proxyip))
{
$proxyip = '';
}
*/
}
else
{
$proxyip = '';
}
if ($proxyip == '')
{
define('PROXYIP', '');
define('IPADDRESS', $_SERVER['REMOTE_ADDR']);
}
else
{
define('PROXYIP', $_SERVER['REMOTE_ADDR']);
define('IPADDRESS', $proxyip);
}
unset($proxyip, $iplist);
// ## End of Proxy Hack ##
// determine URL / referrer of current page
Step 8.
Insert ipp.gif in the \images\buttons directory
Step 9 (optional).
Modify the standard phrase "banip";
Sorry, The administrators have banned your accesss to this forum.<br>To contact them click <a href="mailto:$vboptions[webmasteremail]">here</a>.