This website can use cookies to improve the user experience

This website can use cookies to improve the user experience and to provide certain services and functions to users. Cookies contain small amounts of information (such as login information and user preferences) and will be stored on your device.

Enable All Cookies Privacy Policy

Any way to prevent CT from logging views from my IP?


avatar
cosmin 269
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?
avatar
Administrator
1342
From: 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?
avatar
OP 269
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?
avatar
OP 269
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?
avatar
Administrator
1342
From: Austria
Open /classes/class_system.php in an editor and find:
    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?
avatar
OP 269
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?
avatar
Administrator
1342
From: Austria
Maybe in the 2.2 release.
1 Re: Any way to prevent CT from logging views from my IP?
avatar
OP 269
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?
avatar
Administrator
1342
From: Austria
For files views?

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

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.