Admun's NUDN

admun

  • San Francisco, CA

Navigation

Navigation

Categories

Search

Getting the post, the right way

In the other post, I come up with a trick to call PreItem event to allow other installed plugins to process any skinvar might be in the data. There is still one problem that internal skinvar like <%image%>, <%popup%>, and etc are not resolve.

Here's the trick to do that, in a one stone for 2 birds fashion. The trick used PHP output buffer control function redirect the output mean for the broswer and capture it into a variable for our use.

example: getting contents of a post:

...
... (get blogid)
...
$b =& $manager->getBlog($blogid);
...
...
$extraQuery = ' and inumber=' . intval($itemid);
$template = 'default';

ob_start();
$b->readLogAmount($tempalte, 1, $extraQuery, 0, 1, 0);
$outbuf = ob_get_contents();
ob_end_clean();
The contents of the post is in the $outbuf for your consumption.

10:48:46 on 11/22/05 by Admun - Developer Notes - tags: none - #

NP_MailToAFriend v1.4

I fixed the resolve problem.

NP_MailToAFriend v1.4

10:36:29 on 11/22/05 by Admun - My Work - tags: none - #
<=   November 2005   =>
SunMonTueWedThuFriSat
  12345
6789101112
13141516171819
20212223242526
27282930