Because my webserver is on an internal host that is firewalled in, it can’t make trackback requests directly. WP in its natural form is blissfully unaware of this concept, so I had to adjust the code a bit:
$ diff -bc functions.php.orig functions.php *** functions.php.orig Mon Oct 18 12:38:57 2004 --- functions.php Mon Oct 18 12:47:05 2004 *************** *** 551,556 **** --- 551,566 ---- $tb_url = $trackback_url; $url = urlencode(get_permalink($ID)); $query_string = "title=$title&url=$url&blog_name=$blog_name&excerpt=$excerpt"; + + $proxy = 1; + if ($proxy) { + $http_request = "POST $trackback_url HTTP/1.0\r\n"; + $http_request .= 'Content-Type: application/x-www-form-urlencoded'."\r\n"; + $http_request .= 'Content-Length: '.strlen($query_string)."\r\n"; + $http_request .= "\r\n"; + $http_request .= $query_string; + $fs = @fsockopen(<my-proxy-host>, 3128); + } else { $trackback_url = parse_url($trackback_url); $http_request = 'POST ' . $trackback_url['path'] . $trackback_url['query'] . " HTTP/1.0\r\n"; $http_request .= 'Host: '.$trackback_url['host']."\r\n"; *************** *** 559,564 **** --- 569,575 ---- $http_request .= "\r\n"; $http_request .= $query_string; $fs = @fsockopen($trackback_url['host'], 80); + } @fputs($fs, $http_request); /* $debug_file = 'trackback.log';
Yay, now I get to harass others with my blog. 😉
Update:
Either WP or one of the plugins doesn’t like backslashes in the text. It strips them out except if it’s doubled, but then when it presents the text to me for editing it doesn’t double them itself so editing something twice without doubling all the backslashes makes me lose it again. Oh well, can’t win ’em all.
Update 2:
Ok, doubling still didn’t do the trick properly because in the resulting output they got lost. I ended up using \ which was thankfully left alone by the WP and related code.