La Vita è Bella

Wednesday, November 22, 2006

A hack for NP_TrackBack

You are visiting a NucleusCMS powered blog. NucleusCMS is a good blog system, the only (?) problem is that it doesn't support trackbacks itself. So I use the plugin NP_TrackBack to add trackback support.

NP_TrackBack was good, especially on its anti-spam ability. It blocks nearly all my received trackback pings automatically (I haven't got any real trackback yet, all I got were spams).

NP_TrackBack can also send a notification to me when a trackback ping received. But the problem is, that it also send me notification about blocked trackback pings.

I have faith on its anti-spam ability, so I don't wanna get notifications about blocked trackbacks. But I do hope get a notification on real trackbacks. So finally, I've made this hack.

I've added a option to NP_TrackBack not to send notification on blocked pings (see the screenshot below), so that my mailbox won't be spammed instead of my blog. And its default value is "no", so that it won't change your default settings.

NP_TrackBack hack

Here's the patch file and the plugin php file itself (don't forget to replace the ".txt" extension with ".php" ). Cause I've added a option, you can't simply replace your old file if you are currently using NP_TrackBack plugin. You may need to uninstall your old one and install your new one to make it work.



tags: , , , , ,

02:20:34 by fishy - opensource - Permanent Link

Revision: 1.1/1.1, last modified on 2006-11-21 @ 04:32.

Karma: 97 (70.46% out of 237 were positive) [+/-]

You can subscribe to RSS 2.0 feed for comments and trackbacks

Trackbacks:
La Vita Bella
Too cool to refuse: NP_Revision: Yesterday I made a patch for NucleusCMS plugin NP_TrackBack, and post in into the forum. On the forum, I've found another amazing plugin from the same author: NP_Revision It's amazing because, it...
2006-11-22 @ 07:08
Use this TrackBack url to ping this item (right-click, copy link target). If your blog does not support Trackbacks you can manually add your trackback by using this form.

admun

admun wrote:

Hi,

I am looking at adding this patch to teh code... and don't understand this part:

@@ -545,7 +545,7 @@
// 4. Save data in the DB
$res = @mysql_query('
SELECT
- tb_id
+ block
FROM
'.sql_table('plugin_tb').'
WHERE

Can you explain a bit?

you can also email me... you can leave me a shout or private message from my blog

Tuesday, February 20, 2007 03:35:06

fishy

fishy wrote:

This is to get block status for already exist items. As we need to check it before sending notification, after the end of if (mysql_num_rows($res) != 0), the original code only set $block in the "else" switch.

This works together with:
@@ -556,6 +556,8 @@
if (mysql_num_rows($res) != 0)
{
// Existing TB, update it
+ $row = mysql_fetch_row($res);
+ $block = $row[0] == 1;
$res = @mysql_query('
UPDATE
'.sql_table('plugin_tb').'

Tuesday, February 20, 2007 06:02:25

Thor Schrock

Thor Schrock wrote:

Thanks for the patch for this. I have been struggling trying to do the same thing for some time.

Nucleus is a great CMS.

Saturday, April 07, 2007 10:58:41

Add Comment

 

May the Force be with you. RAmen