Page 1 of 1

Writing plugin, needing tips :)

Posted: Fri Feb 16, 2007 7:55 pm
by Boris
Hi,

I'm currently writing a Lucene-based Index&Search-plugin with Zend_Search_Lucene. Currently the whole core stuff (indexing, searching, deleting and updating of entries) is working quite good.

Now it comes to the finer (read: harder :)) parts, at least for me as I don't know much of the s9y-internals. I need a way to display the search-result with the current template. I had a look into the static-page-plugin, but this seems to be very low level.
Then I tried serendipity_printEntries, but this outputs nothing in my current context. I'm currently using it in a function which is called by entries_header.
Any hints how I could implement that in an (quite easy) way?


Garvin hinted a while ago in a PN, that he could imagine to implement some kind of search-abstraction to allow different search-plugins. But until that's available, I'm looking for a sane solution to display my results in a nice a. (currently it's only plain text).

Posted: Sun Feb 18, 2007 4:38 pm
by Boris
Here's a link to that code if it helps:

http://nopaste.tshw.de/1171813036fd13d/
(show() starts in line 94)

Posted: Tue Feb 20, 2007 11:00 am
by garvinhicking
Hi!

I believe the easiest way would be to hook into the frontend_fetchentries function, and if possible manipulate the $eventData to fetch the SQL resultset.

If that can't be done, you can resort to the frontend_entryproperties event hook and just inject your resultset datainto the eventData array?

If that also don't help, you'll need to do something like what you initially tried. If I read your code correctly, you are simply missing an smarty fetch call from your results. The printEntries() method only assigns variables into an ENTRIES variable, but your method doesn'T seem to call any $serendipity['smarty']->display() call, or an serendipity_smarty_fetch('CONTENT', 'content.tpl'); call. The 'show()' method needs to output data to the browser; you could try an 'echo' as well, AFAIK.

I'm a bit short on time so I can't execute your plugin. But if you are not able to proceed any further let me know, and I'll have a deeper look.

Best regards,
Garvin

Posted: Tue Feb 20, 2007 3:54 pm
by Boris
Thanks.
garvinhicking wrote:I'm a bit short on time so I can't execute your plugin.
I think/hope one of these hints will work. Otherwise I'll get in touch with you again.