Admun's NUDN

admun

  • San Francisco, CA

Navigation

Navigation

Categories

PreItem my Item (also known as PreComment your comment)

I've been working on many plugins recently to add support to call other plugins to do pre-processing work. In many plugins that deal with items and comments, the output often not display properly with other plugin's skinvar display in raw code (ie <%Image(file.jpg|1024|768|320|240|test image)%> for NP_PopupImageNetPBM).

I think the best way to fix such a problem is to trigger PreItem (for item) and PreComment (for comment) events before proceeding with the output. The event calls all plugins registered to the event to process the data so all plugin skinvars are render properly.

For comment pre-processing, this can be done by:

$manager->notify('PreComment', array('comment' => &$comment));

For item pre-processing, calls:

$manager->notify('PreItem', array('blog' => &$blog, 
'item' => &$item));

Assumption is "global $manager, $blog;" is done earlier in the code.

Note that plugin developer should format and make sure $comment and $item are in the same format as the core pass it to notify().

17:56:29 on 09/15/05 by Admun - Category: Developer Notes - tags: none - print

Comments

sesso con cavalli wrote:

Good Site .Nice work.

09/06/06 06:14:03

Add Comments



<=   October 2008   =>
SunMonTueWedThuFriSat
   1234
567891011
12131415161718
19202122232425
262728293031 

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