I don't want to be dissing anyone, but I believe that the trackback module does not properly perform its stated function of "autodiscovering" a linking website when a user clicks on the link from that other website to mine, and, because I can't get any feedback from the module developers I'm trying to have a look at it myself. But I'm a hopeless programmer and very new to the drupal internals so I wonder if someone could answer this quite generic question (ie no real knowledge of trackback.module required):

I *believe* what needs to happen is that every time a node is requested from a browser, it needs to load something that will check for a referrer url and then run a function in the module that checks whether the referring page has a link to the node being requested and if so put that in the trackback_received table (after running some checks for spam. I presume that doing a database call is quicker than parsing the referrer page and so doing a quick check on that trackback_received table to see if that particular referrer has been checked and stored previous wold be a good idea.

So my specific question is which hook - if that's the right term - would be used to intercept this request?

There's a function called trackback_page which reading through it *looks* as though that's what it's trying to do, but which never seems to get called when I run the request through the Komodo debugger. So maybe it should be in _node? Or _load? Or something else?

Hopefully someone will be able to understand my inept description of what I'm trying to do and have a relatively easu answer that I'm missing somewhere in the developer documentation!

Cheers, Jock

Comments

prakashp’s picture

I am not familiar with the trackback module, but I believe it should be done in the hook_nodeapi()

jockox3@drupal.org’s picture

Yes, I'm not sure I fully understand the magic behind the nodeapi hook, but I was reading the tutorail over at IBM - http://www-128.ibm.com/developerworks/ibm/library/i-osource5/ - and wondered if that would be the right place. Because the node being loaded is just a story, or a page or some other content type, not a "trackback".

And once I had thought that I seem to remember in my debug session that it did actually invoke that, so the problem may be easier than I thought. I'll go have another look now!

Cheers,

Jock

jockox3@drupal.org’s picture

You think this should be with the "load" operation of "trackback_nodeapi()" by the way?

prakashp’s picture

Yes I think it should be the case. i.e. $op == 'load' in trackback_nodeapi().

nevets’s picture

I am not familiar with the module but was curious as to what it does. From the readme file it seems to need to be able to comunicate with a different server for anything to happen.

About TrackBack:
"In a nutshell, TrackBack was designed to provide a method of
notification between websites: it is a method of person A saying to
person B, "This is something you may be interested in." To do that,
person A sends a TrackBack ping to person B."
- Mena and Ben Trott (http://www.movabletype.org/trackback/beginners/)

Specification:
http://www.movabletype.org/docs/mttrackback.html

Limitations:
- Currently only supports sending a TrackBack to one site.
- No feedback if TrackBack was successful or not.
- Doesn't try to auto-discover TrackBack if sending fails.

jockox3@drupal.org’s picture

Indeed - in order to "discover" whether the referring site has a link in it to your node it does a request and parses it to check for links back to you. That much is all already in the code - just that it doesn't appear to be being invoked for an ordinary clickthrough request.

The "defined" mechanism when blogging about another site is to look up what's called a trackback URL and ping it explicitly - and this does work in the trackback module. However that's a bit old fashioned and nowadays I don't know of people who bother to go fetch the trackback URL of all the pages they blog about. So most blogging server software now implements some mechanism for trying to work out who is linking to you by looking at the referrer variables of requests and the trackback module is *supposed* to do that but doesn't appear to. I've logged a bug on the module but since there's only one maintainer active it would appear at the moment I want to try to narrow it down and if possible fix this for myself.

If I manage to fix it, I might then look at implementing the same thing via cron and the watchdog logs so that it doesn't try to to the connection to the other server on the fly at page load time, which could I suppose be a hostage to fortune.