Admun's NUDN

admun

  • Ottawa, Ontario, Canada

Navigation

Navigation

Categories

Softer plugin dependancy

Currently in CVS, there is a plugin dependancy support to allow a plugin to specify what other plugins must be installed for it to function properly.

In some cases, the dependancy is not as strict in the sense that some extra function can be enable if another plugin is installed. There is no dependancy check is needed since it's not mandatory, but the plugin can do some check on the fly to enable the additional function.

An example at hand is NP_Referer2 and NP_Trackback. Recently a new plugin NP_Blacklist is developed by Xiffy to help fight commant spam. The same filter engine actually can used to fight referer and trackback spam as well.

The dependancy to NP_Blacklist is not a strict one. It mean NP_Referer2 and NP_Trackback can utilize NP_Blacklist if it is installed. To enable the function. A run-time dependancy check can be done. An example for NP_Trackback:

if ($manager->pluginInstalled('NP_Blacklist') 
and $blacklist =& $manager->getPlugin('NP_Blacklist')) {
    if (floatval($blacklist->getVersion()) >= 0.95) {
        $blacklist->blacklist('TrackBack',$url.' '.$title.' '.$blog_name.' '.$excerpt);
    }
} 

If NP_Blacklist is found, NP_Trackback can call it to filter trackback for potential spam.

Cool, isn't it?

11:28:46 on 02/07/05 by Admun - Category: Developer Notes - tags: none - print

Comments

Admun wrote:

This is a variation of: http://edmondhui.homeip.net...

02/15/05 18:21:43

Add Comments



Emoticons
biggrin ! ? cool confused idea lol oops cry twisted arrow eek
evil frown mad wink neutral razz rolleyes surprised
<=   August 2008   =>
SunMonTueWedThuFriSat
     12
3456789
10111213141516
17181920212223
24252627282930
31      

My Quick Links

Documentation

How-To & Tips

Source Code

Developers utc

Latest Comments

  • Vikky Cabrera says Thank you for making my life a non-techie-pretending-to-be-one a lot more easy and...
  • Admun says It's now fixed... sorry for the problem.
  • Vikky Cabrera says Unfortunately the download link does not work and just comes up with the following...
  • CMN says Sure.. Thanks Admun
  • Admun says Some code change is needed, but I do not have time right now unfortunately. I...
  • CMN says Hello Admun, is there a quick way to work around it ? The blog content on my web...
  • Admun says You are correct.
  • CMN says Does the AutoExtended subscribe to Edit item ? It seems like the <%morelink%>...

Most Downloads