Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-07-24 12:26:13

wordgasm
Member
Registered: 2006-05-17
Posts: 83
Website

logs: excluding IPs for TXP 4.03

How do I exclude my IP and robots’ IP for TXP 4.03? All I was able to find were those for lower versions. A link to where I could find the hack would be fine. Thank you :)

Last edited by wordgasm (2006-07-24 12:27:43)

Offline

#2 2006-07-24 15:31:31

bit
Archived Plugin Author
From: Philippines
Registered: 2005-02-14
Posts: 65
Website

Re: logs: excluding IPs for TXP 4.03

You seem to know your PHP, so I’ll just point you in the right direction (I’d do it myself but you seem to have a specific idea of what you want to do).

Just hack the logit() function starting on line 16 in textpattern/publish/log.php.

You can also hack the insert_logit() function if you like. Whichever makes more sense to you. :-)


“The neighboring marshmallow factory fared no better, having been unable to absorb the incredible pressure wave.”

Offline

#3 2006-07-24 16:09:52

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: logs: excluding IPs for TXP 4.03

Offline

#4 2006-07-24 16:13:38

hcgtv
Archived Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: logs: excluding IPs for TXP 4.03

I went through all the related threads on this subject and never got it to work with 4.0.3.

I’d just like to remove my own IP, like we could do with Dean’s refer script.

Offline

#5 2006-07-24 16:16:59

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: logs: excluding IPs for TXP 4.03

I’ve got it working in 4.0.3 (just my own IP).

Offline

#6 2006-07-24 16:49:39

hcgtv
Archived Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: logs: excluding IPs for TXP 4.03

Els, could you post what you did in 4.03, thanks.

Offline

#7 2006-07-24 16:57:12

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: logs: excluding IPs for TXP 4.03

Sure, I didn’t mean to say ha ha, I know something you don’t ;) I just had to find it.
Here are the first lines of my function log_list() in /include/txp_log.php:

	function log_list() 
	{
		pagetop(gTxt('visitor_logs'));
		extract(get_prefs());
        $ip = @gethostbyaddr($_SERVER['REMOTE_ADDR']);
        safe_delete("txp_log", "`host` LIKE '$ip' AND `time` > date_sub(now(),interval 1 day)");
		safe_delete("txp_log", "time < date_sub(now(),interval ".
						$expire_logs_after." day)");

		$page = gps('page');

As far as I can see I did exactly what Sencer said in his first post in the thread I mentioned.

You just have to remember to do this every time you upgrade.

Offline

#8 2006-07-24 17:29:16

wordgasm
Member
Registered: 2006-05-17
Posts: 83
Website

Re: logs: excluding IPs for TXP 4.03

Hurrah! I found it! :D Thanks for the help anyway. :p

Offline

#9 2006-07-24 17:38:54

hcgtv
Archived Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: logs: excluding IPs for TXP 4.03

Els, tried it and it doesn’t remove my IP from the log file.

My version: Textpattern version: 4.0.3 (r1188)

Offline

#10 2006-07-24 17:45:34

wordgasm
Member
Registered: 2006-05-17
Posts: 83
Website

Re: logs: excluding IPs for TXP 4.03

it does remove the robots tho.:s

Offline

#11 2006-07-24 18:01:10

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: logs: excluding IPs for TXP 4.03

Bert, I’m using exactly the same version and it’s working. Keep in mind that it deletes hits from your current IP from the current day, as Sencer explained. I suppose you could modify the “interval 1 day” part of the code.
Also, as I understand it, the hits are deleted when you open the ‘logs’ tab.

Offline

#12 2006-07-24 18:05:13

wordgasm
Member
Registered: 2006-05-17
Posts: 83
Website

Re: logs: excluding IPs for TXP 4.03

hcgtv wrote:

Els, tried it and it doesn’t remove my IP from the log file.
My version: Textpattern version: 4.0.3 (r1188)

Wait, it can remove your own IP and even other’s IP. Just click the “+” sign at the logs area, that is, if have the plug installed.

Offline

Board footer

Powered by FluxBB