some PHP code questions

Tips and help with HTML, CSS, JavaScript, and site development.
Post Reply
User avatar
ccb056
Site Administrator
Posts: 981
Joined: January 14th, 2004, 11:36 pm
Location: Texas
Contact:

some PHP code questions

Post by ccb056 »

hi, I recently noticed that google has been crawling my forums with these ips:
64.68.86.15
and
64.68.87.69

the currect view google visit counter mod uses this code

Code: Select all

//
// Dr DLP's Google Visit Counter MOD
//
$google_visit_counter = $board_config['google_visit_counter'];

$tmp_list = explode(".", $REMOTE_ADDR);
if (($tmp_list[0] == "64" && $tmp_list[1] == "68" && $tmp_list[2] == "82") || ($tmp_list[0] == "216" && $tmp_list[1] == "239" && $tmp_list[2] == "46"))
{
	$sql = "UPDATE " . CONFIG_TABLE . "
			SET config_value = '" . ($google_visit_counter + 1) . "'
			WHERE config_name = 'google_visit_counter'";
	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not update google counter information', '', __LINE__, __FILE__, $sql);
	}

	$google_visit_counter++;
}
// ------------------------------------
//
how do I add the two other ips?
Ouray
Registered User
Posts: 2
Joined: March 18th, 2004, 12:47 am

Re: some PHP code questions

Post by Ouray »

Code: Select all

//
// Dr DLP's Google Visit Counter MOD
//
$google_visit_counter = $board_config['google_visit_counter'];

$tmp_list = explode(".", $REMOTE_ADDR);
if (($tmp_list[0] == "64" && $tmp_list[1] == "68" && $tmp_list[2] == "82") || ($tmp_list[0] == "64" && $tmp_list[1] == "68" && $tmp_list[2] == "86") || ($tmp_list[0] == "64" && $tmp_list[1] == "68" && $tmp_list[2] == "87") || ($tmp_list[0] == "216" && $tmp_list[1] == "239" && $tmp_list[2] == "46"))
{
	$sql = "UPDATE " . CONFIG_TABLE . "
			SET config_value = '" . ($google_visit_counter + 1) . "'
			WHERE config_name = 'google_visit_counter'";
	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not update google counter information', '', __LINE__, __FILE__, $sql);
	}

	$google_visit_counter++;
}
// ------------------------------------
//
User avatar
ccb056
Site Administrator
Posts: 981
Joined: January 14th, 2004, 11:36 pm
Location: Texas
Contact:

Post by ccb056 »

awesome, thanks man, I dont know why It didn't work when I tried it, maybe added an extra paren at the end of the IPs or something

:D

added these:

Code: Select all

|| ($tmp_list[0] == "164" && $tmp_list[1] == "71" && $tmp_list[2] == "1")
|| ($tmp_list[0] == "192" && $tmp_list[1] == "51" && $tmp_list[2] == "44")
|| ($tmp_list[0] == "209" && $tmp_list[1] == "185" && $tmp_list[2] == "108")
|| ($tmp_list[0] == "209" && $tmp_list[1] == "185" && $tmp_list[2] == "253")
|| ($tmp_list[0] == "210" && $tmp_list[1] == "131" && $tmp_list[2] == "75")
|| ($tmp_list[0] == "216" && $tmp_list[1] == "33" && $tmp_list[2] == "229")
|| ($tmp_list[0] == "216" && $tmp_list[1] == "239" && $tmp_list[2] == "33")
|| ($tmp_list[0] == "216" && $tmp_list[1] == "239" && $tmp_list[2] == "37")
|| ($tmp_list[0] == "216" && $tmp_list[1] == "239" && $tmp_list[2] == "39")
|| ($tmp_list[0] == "216" && $tmp_list[1] == "239" && $tmp_list[2] == "41")
|| ($tmp_list[0] == "216" && $tmp_list[1] == "239" && $tmp_list[2] == "45")
|| ($tmp_list[0] == "216" && $tmp_list[1] == "239" && $tmp_list[2] == "51")
|| ($tmp_list[0] == "216" && $tmp_list[1] == "239" && $tmp_list[2] == "53")
|| ($tmp_list[0] == "216" && $tmp_list[1] == "239" && $tmp_list[2] == "57")
|| ($tmp_list[0] == "216" && $tmp_list[1] == "239" && $tmp_list[2] == "59")
|| ($tmp_list[0] == "62" && $tmp_list[1] == "27" && $tmp_list[2] == "59")
|| ($tmp_list[0] == "63" && $tmp_list[1] == "83" && $tmp_list[2] == "186")
|| ($tmp_list[0] == "64" && $tmp_list[1] == "208" && $tmp_list[2] == "32")
|| ($tmp_list[0] == "64" && $tmp_list[1] == "208" && $tmp_list[2] == "33")
|| ($tmp_list[0] == "64" && $tmp_list[1] == "208" && $tmp_list[2] == "36")
|| ($tmp_list[0] == "64" && $tmp_list[1] == "208" && $tmp_list[2] == "37")
|| ($tmp_list[0] == "64" && $tmp_list[1] == "68" && $tmp_list[2] == "80")
|| ($tmp_list[0] == "64" && $tmp_list[1] == "68" && $tmp_list[2] == "81")
|| ($tmp_list[0] == "64" && $tmp_list[1] == "68" && $tmp_list[2] == "82")
|| ($tmp_list[0] == "64" && $tmp_list[1] == "68" && $tmp_list[2] == "83")
|| ($tmp_list[0] == "64" && $tmp_list[1] == "68" && $tmp_list[2] == "84")
|| ($tmp_list[0] == "64" && $tmp_list[1] == "68" && $tmp_list[2] == "85")
|| ($tmp_list[0] == "64" && $tmp_list[1] == "68" && $tmp_list[2] == "86")
|| ($tmp_list[0] == "64" && $tmp_list[1] == "68" && $tmp_list[2] == "87")
|| ($tmp_list[0] == "64" && $tmp_list[1] == "68" && $tmp_list[2] == "88")
|| ($tmp_list[0] == "64" && $tmp_list[1] == "68" && $tmp_list[2] == "89")
|| ($tmp_list[0] == "64" && $tmp_list[1] == "68" && $tmp_list[2] == "90")
|| ($tmp_list[0] == "64" && $tmp_list[1] == "68" && $tmp_list[2] == "92")
Tebow2000
Registered User
Posts: 1099
Joined: January 19th, 2004, 7:56 am
Location: New Orleans, Louisiana
Contact:

Post by Tebow2000 »

all of the subs!
Redcode Hosting redcodehosting.com | Unix Shared Hosting | sales[aT]redcodehosting[dOt]com
Post Reply