Page 1 of 1

some PHP code questions

Posted: March 18th, 2004, 1:02 am
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?

Re: some PHP code questions

Posted: March 18th, 2004, 1:15 am
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++;
}
// ------------------------------------
//

Posted: March 18th, 2004, 1:17 am
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")

Posted: March 18th, 2004, 2:24 am
by Tebow2000
all of the subs!