Admun's NUDN

admun

  • San Francisco, CA

Navigation

Navigation

Categories

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 - Category: Developer Notes - tags: none - print

Comments

No comments yet

Add Comments



<=   November 2009   =>
SunMonTueWedThuFriSat
1234567
891011121314
15161718192021
22232425262728
2930     

My Quick Links

Documentation

How-To & Tips

Source Code

Developers utc

Latest Comments

  • Admun says If you are running wp from a hosting environment, your system admin people can tell...
  • Dan says Hi, Im a noob and Im not sure what to input for the Database Name, for Nucleus and...
  • Admun says what version of PHP you are running? It looks like this function is...
  • Kevin says I am getting this error: Fatal error: Call to undefined function sql_table() in...
  • Admun says thx Frank, I will look into it.
  • ftruscot says admun, a bug/fix suggestion on the forum that you might want to look at:...
  • Admun says Indeed David. 8( A quick fix for now until 0.9 is out: - do a "ALTER TABLE...
  • David Geens says Dear Edmond, Your twitter plugin suffer from the twitocalyps. You should...

Most Downloads