Turn Off Referers

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Pat

Turn Off Referers

Post by Pat »

How do I turn off Referers so that it does not continually add info to the db.

My host has a rule that it is illegal to have a separate stats program running. I once got shut down for this.
Guest

Re: Turn Off Referers

Post by Guest »

Pat wrote:How do I turn off Referers so that it does not continually add info to the db.

My host has a rule that it is illegal to have a separate stats program running. I once got shut down for this.
How about if I just change line 26 in index.php from

$track_referer = true; to
$track_referer = false;

will that stop adding the referer information to the db?

or can I just comment out a line somewhere that says
add_referer to DB?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Turn Off Referers

Post by garvinhicking »

Yes, you can change that line to turn it off!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Re: Turn Off Referers

Post by Guest »

garvinhicking wrote:Yes, you can change that line to turn it off!

Regards,
Garvin
Hi Gavin,

I tried, it did not work. I'm in phpmyadmin and, after emptying the referers table, I can still see the new referers being added.

I'm trying to understand the logic.

It seems to me the only thing that the entries in the referers table are good for are stats. All they say are google (host) sent me x amount of traffic on this particular querey, msn (host) sent me etc.al.

The only reason to have that table is for stats. I don't have the stats plugin installed and I can not find the file where the command for putting that information into the referers table in the db.
Guest

Post by Guest »

Well, I had to hack up your pretty code, but I finally solved the problem AND I'm saving much bandwidth.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

So what else did you have to hack to get it running? Just curious! :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Post by Guest »

garvinhicking wrote:So what else did you have to hack to get it running? Just curious! :)

Regards,
Garvin
oh, sorry, in include/functions.inc.php line 488 and below

serendipity_db_query(
//@sprintf(
//"UPDATE %s%s
//SET count = count + 1
//WHERE scheme = '%s'
//AND host = '%s'
//AND port = '%s'
//AND path = '%s'
//AND query = '%s'
//AND day = '%s'
//%s",

$serendipity['dbPrefix'],
$list,
serendipity_db_escape_string($url_parts['scheme']),
serendipity_db_escape_string($url_parts['host']),
serendipity_db_escape_string($url_parts['port']),
serendipity_db_escape_string($url_parts['path']),
serendipity_db_escape_string($url_parts['query']),
date('Y-m-d'),
($entry_id != 0) ? "AND entry_id = '". (int)$entry_id ."'" : ''
);

if (serendipity_db_affected_rows() == 0) {
serendipity_db_query(
//sprintf(
//"INSERT INTO %s%s
// (entry_id, day, count, scheme, host, port, path, query)
//VALUES (%d, '%s', 1, '%s', '%s', '%s', '%s', '%s')",

$serendipity['dbPrefix'],
$list,
(int)$entry_id,
date('Y-m-d'),
serendipity_db_escape_string($url_parts['scheme']),
serendipity_db_escape_string($url_parts['host']),
serendipity_db_escape_string($url_parts['port']),
serendipity_db_escape_string($url_parts['path']),
serendipity_db_escape_string($url_parts['query'])
);

you can see I just commented out entering the info into the table.

I also had to remove 2 ")" after
($entry_id != 0) ? "AND entry_id = '". (int)$entry_id ."'" : '' and

serendipity_db_escape_string($url_parts['query'])

to get rid of some parse errors
hanno
Regular
Posts: 72
Joined: Fri May 20, 2005 8:04 am
Contact:

Option for this?

Post by hanno »

Garvin, do you plan to have an option to turn off referrer saving?
Imho this is very important for high load blogs, beside that I'd suggest adjusting the stats/topreferrer/etc.-plugins to be able to use apache-logfiles.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Option for this?

Post by garvinhicking »

Thanks for the suggestion, I just added the config option to SVN trunk.

I disagree about plugins being able to parse apache logfiles. PHP applications should not do that, it's very memory and time intensive. Use modlogan, awstats or google analytics or any other offline analyzer. I think you intented a cronjob like script that imports apache logfiles into the serendipity_referrers tables, but I think that's not really required. All the data is already in serendipity, why parse the apache logfile with additional headaches? :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply