event_photoblog

Creating and modifying plugins.
Post Reply
argh
Posts: 1
Joined: Wed Aug 09, 2006 4:16 am

event_photoblog

Post by argh »

I've been working with Serendipity for a couple of weeks and really love the product. I have an interest in developing/modifying plugins but at the moment can't quite put together how the plugin api works. Thinking i'd start small i decided to make a couple of changes to the event_photoblog plugin.

I was able to make some changes to the html code surrounding the image, but for the life a me I can't figure out how to get the image to display with articles on the main page. The image only appears when viewing individual articles. I looked at the event hooks currently used by the plugin(backend_display, frontend_display, entry_display). I also looked at how the plugin attaches the image to the $eventData[$i]['body']. I read through the plugin api documentation and don't see another event hook that appears to be needed. Anyone able to point me in the right direction?

thanks,

Argh.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: event_photoblog

Post by garvinhicking »

Hi!

This is basically because of the way how the hooks are called.

Only when an individual entry is being viewed, the data will be in the format the photoblog plugin uses ($eventData) in the hook 'entry_display', I believe. This is just using the pb_entry_display() function.

It might even be that some other event plugins are interacting here and lead to the photos not being able to be fetched in the overview? Which other event plugins are you utilizing?

Since I believe in the "trial and error" or "learning by doing" concept, and since you said you wanted to further look into programming plugins, I just suggest you to go to that hook location and make a "print_r($eventData)". Then have a look how the array is prepared, and adjust your for/foreach loops to accommodate that?

You might need to look up the "serendipity_printEntries()" function in include/functions_entries.inc.php. There the "entry_display" hook is executed. You could print_r() the $entry there and check if the photoblog entry is all there?

Of course if you need/want more information, please raise your hand. :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply