Any way to prevent CT from logging views from my IP?
cosmin 269
From: -
From: -
Like the title says.
Notice
This topic is archived. New comments cannot be posted and votes cannot be cast.Responses to this topic
1 Re: Any way to prevent CT from logging views from my IP?
Philipp
From: Austria
Administrator
1342From: Austria
Doesn't seem to work. I did all the changes and added the IP found by searching for "find my IP" on Google. But if I refresh the frontpage 5 times I still see five more views the number of views increase in cadmin.
Do you have a static IP address?
is there a way to delete views from the DB based on IP?
No, this is not possible because it will not log the IP address with each new view
1 Re: Any way to prevent CT from logging views from my IP?
cosmin
OP
269
From: -
From: -
is there a way to delete views from the DB based on IP?
1 Re: Any way to prevent CT from logging views from my IP?
cosmin
OP
269
From: -
From: -
Doesn't seem to work. I did all the changes and added the IP found by searching for "find my IP" on Google. But if I refresh the frontpage 5 times I still see five more views the number of views increase in cadmin.
1 Re: Any way to prevent CT from logging views from my IP?
Philipp
From: Austria
Administrator
1342From: Austria
Open /classes/class_system.php in an editor and find:
then add:
and add:
to the end of the stats function, right before:
function stats()
{
global $config, $security, $database, $preferences, $user, $ipaddr;
then add:
if( $ipaddr != "xx.xx.xx.xx")
{
and add:
}
to the end of the stats function, right before:
function encode_array( $var )
1 Re: Any way to prevent CT from logging views from my IP?
cosmin
OP
269
From: -
From: -
Is there any way to disable it for the submit pad, frontpage and the "thank you for your file submission" interstitial as well?
1 Re: Any way to prevent CT from logging views from my IP?
Philipp
From: Austria
Administrator
1342From: Austria
Maybe in the 2.2 release.
1 Re: Any way to prevent CT from logging views from my IP?
cosmin
OP
269
From: -
From: -
As a suggestion, it would be nice if you could add this an option in cadmin (maybe for all the modules) instead of having to modify the source code.
1 Re: Any way to prevent CT from logging views from my IP?
Philipp
From: Austria
Administrator
1342From: Austria
For files views?
Open /modules/files/filesdetails.php in an editor and change:
to:
and replace xx.xx.xx.xx with your IP address
Open /modules/files/filesdetails.php in an editor and change:
$database -> dbquery( "UPDATE " . DB_PREFIX . "esselbach_ct_files SET file_views = file_views + 1 WHERE file_seo = '" . $page_query . "' AND (file_website = '0' OR file_website = '" . intval( $config[ 'WEBSITE' ] ) . "')" );
to:
if( $ipaddr != "xx.xx.xx.xx")
{
$database -> dbquery( "UPDATE " . DB_PREFIX . "esselbach_ct_files SET file_views = file_views + 1 WHERE file_seo = '" . $page_query . "' AND (file_website = '0' OR file_website = '" . intval( $config[ 'WEBSITE' ] ) . "')" );
}
and replace xx.xx.xx.xx with your IP address