Trackback with Textpattern
Categorized under: utilities
Textpattern is a nice and very cool weblog system. Only one thing missing to complete weblog luck: Trackback!
The following collection of two PHP scripts, two plugins and a hack in the backend equips this functionality for Version 1.0rc1 after. If you are after this uncle-doctoral instruction orders, nothing evil can happen. Nevertheless, it is of course always a good idea to have a backup of the Textpattern scripts and create the database before you start tinkering with. ;-)
Download
First, we need the small ZIP archive with the necessary files:
* Trackback.zipThis pack you on your local hard disk, please make sure that the directory structure is preserved!
Trackback-“receiver”
First, we equip our TXP with the functionality to receive trackbacks, ie, other blogs we can send Trackback pings.
To do this we need two plugins, one for the edition of the trackback URL, and an edition of the “invisible” in the RDF codes weblog. To view the plugins in TXP to install, you take the code into the clipboard, paste it into the text field under admin – plugins and click on the game install-buttons:
In the two text boxes you can find the serialized code for the plugins, please complete the contents to the clipboard and paste into the textbox:
Plugin »rpg_trackbackurl«:
YTo4OntzOjQ6Im5hbWUiO3M6MTY6InJwZ190cmFja2JhY2t1cmwiO3M6NjoiYXV0aG9yIjtzOjk6IlJhbGYgR3JhZiI7czoxMDoiYXV0aG9yX3VyaSI7czoyNzoiaHR0cDovL3d3dy5kYXMtbmV0emJ1Y2guZGUvIjtzOjc6InZlcnNpb24iO3M6MzoiMC4yIjtzOjExOiJkZXNjcmlwdGlvbiI7czo0NzoiSW5zZXJ0cyBhIHRyYWNrYmFjay1VUkwgaW50byB5b3VyIGFydGljbGUgZm9ybSEiO3M6NDoiaGVscCI7czoyMTQ6Ig0KDQoJPHA + UGFyYW1ldGVyczoNCgk8YnIgLz50eXBlID0gQSBzaGlueSA8aT5saW5rPC9pPiBvciBqdXN0IHBsYWluIDxpPnRleHQ8L2k + IQ0KCTxiciAvPmxpbmt0ZXh0ID0gVGhlIExpbmt0ZXh0IDstKQ0KCTxiciAvPnByZSA9IEhUTUwgdG8gaW5zZXJ0IGJlZm9yZSBMaW5rIQ0KCTxiciAvPmFmdGVyID0gSFRNTCB0byBpbnNlcnQgYWZ0ZXIgTGluayENCgk8L3A + DQ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cnBnX3RyYWNrYmFja3JkZigpIHsNCglnbG9iYWwgJHRoaXNhcnRpY2xlOw0KCSRjb21tZW50c2FjdGl2ZSA9IGZldGNoKCJBbm5vdGF0ZSIsInRleHRwYXR0ZXJuIiwiSUQiLCR0aGlzYXJ0aWNsZVsidGhpc2lkIl0pOw0KCWlmIChpbnR2YWwoJGNvbW1lbnRzYWN0aXZlKSA9PSAxKXsNCgkkY29tbWVudHNkaXNhYmxlZCA9IGZldGNoKCJ2YWwiLCJ0eHBfcHJlZnMiLCJuYW1lIiwiY29tbWVudHNfZGlzYWJsZWRfYWZ0ZXIiKTsNCglpZiAoaW50dmFsKCRjb21tZW50c2Rpc2FibGVkKSA + IDApew0KCQkkcG9zdGVkID0gZmV0Y2goIlVOSVhfVElNRVNUQU1QKFBvc3RlZCkiLCJ0ZXh0cGF0dGVybiIsIklEIiwkdGhpc2FydGljbGVbInRoaXNpZCJdKTsNCgkJaWYgKCh0aW1lKCkgLSAkcG9zdGVkKSA + ICgkY + DQo8cmRmOkRlc2NyaXB0aW9uDQoJcmRmOmFib3V0PVwiIi4kbXlwYXRoLiRteXNlY3Rpb24uIi8iLiR0aGlzYXJ0aWNsZVsidGhpc2lkIl0uIi9cIg0KCWRjOmlkZW50aWZpZXI9XCIiLiRteXBhdGguJG15c2VjdGlvbi4iLyIuJHRoaXNhcnRpY2xlWyJ0aGlzaWQiXS4iL1wiDQoJZGM6dGl0bGU9XCIiLiRteXRpdGxlLiJcIg0KCXRyYWNrYmFjazpwaW5nPVwiIi4kbXl0YmxpbmsuIlwiIC8 + DQo8L3JkZjpSREY + DQotLT4iOw0KCQl9ZWxzZXsNCgkJcmV0dXJuICIiOw0KCQl9DQp9DQoNCiI7czozOiJtZDUiO3M6MzI6IjUyMzM5NThhM2ZhNzUwZDg2OTdlNTZlYWQ5ZTMzYjQyIjt9
This is a rather careworn and error-prone method of installation of plugins, no question, but it in itself is not the author of these lines out! ;-)
After the installation should be your plugin page in the TXP backend like this: Now just one click on the No in the column Active (then there should logically is Yes), and the plugins are ready!
Now we load the file trackback.php via ftp / sftp to the server and put them in the list of our TXP weblogs, above the text pattern-directory where all public weblogs are the scripts.
Since the world is an evil ;-), we should consider whether we Trackbacks moderate, ie, the comments generated by Trackbacks initially invisible in the database and only after an examination in TXP-panel visible. This setting is in the trackback.php controlled by the variable $ moderate, based on true or false can be made:
$ moderate = false, / / No Moderation, TB is immediately visible
$ moderate = true, / / moderation, TB left to invisible
So the technical conditions are met, now we need the item to adjust the form to get our Trackback capability to maintain the community to show. This we do by making our very painstakingly built plugins integrate into the form.
The trackback URL we build with rpg_trackbackurl On. The plugin is processed the following parameters:
* Can type or text link to the former returns the trackback URL into a link, the latter as normal text. If type = “link” is used, the parameters that determine the appearance, when type = “text”, they need not be specified. * Link text as the name says ;-), the text of the link in the blog is stored. Pre * Any HTML code before the link is spent. After * Any HTML code after the link is spent.Example: Here in the net book, the following code is used, the result can be admired in this article:
With rpg_trackbackrdf we add now the invisible RDF code added to the blog, it must be just the plug in the article form called:
That’s it, now we can receive Trackbacks. The incoming trackbacks are stored as comments. If a contribution for the comment off, it will also no longer accepts trackbacks.
Trackback-»Channels«
Trackbacks receive is beautiful, but of course we want to send even trackbacks. To do so we need another script, and we have the TXP backend hack.
First we copy the file to the server txp_trackback.php. You find them in the folder text pattern of the ZIP download, and they must also be on the server in the directory text pattern can be stored.
That was the easy part Now another link in the TXP backend, so we per-click can send trackbacks. There are two possibilities:
You copy from the ZIP archive file text pattern / include / txp_article.php to the server, also in the directory text pattern / include. This is the recommended solution for those who have not in this file herumgehackt and the release 1.0rc1 use.
If you already have or herumgehackt on a recent svn version updated you need to file txp_article.php in the following code and find accordingly. To do this you can watch txp_article.php (after RG Trackback link! Looking!) And your file in the appropriate place to modify.
If everything went smoothly, you’ll find in the article view Textpattern a new link Trackback Ping, a click on it opens the following window:
Thus you can now also send trackbacks!
That’s still a lot of fun with Textpattern and many important and exciting transaction weblog debates with Trackback. ;-)
— Zeus ::)
May 02, 2009

