$serendipity['view'] == 'plugin' - which plugin?
Posted: Mon Jan 14, 2008 1:20 am
When trying to determine which kind of page we're on, the view index in the $serendipity array is quite helpful. But what if it's a page that's generated by a plugin like serendipity_event_staticpages, serendipity_event_contactform or serendipity_event_freetag?
$serendipity['view'] gives 'plugin' in this case. Is there an easy way to find out which plugin?
I'm currently using these, but they are more like quick and dirty:
serendipity_event_staticpage:
serendipity_event_contactform:
serendipity_event_freetag:
$serendipity['view'] gives 'plugin' in this case. Is there an easy way to find out which plugin?
I'm currently using these, but they are more like quick and dirty:
serendipity_event_staticpage:
Code: Select all
if (array_key_exists('staticpage_plugin', $serendipity) && count($serendipity['staticpage_plugin']->staticpage) > 0)
Code: Select all
if (substr_count($_SERVER['REQUEST_URI'], $serendipity[preg_replace('/^.+?(serendipity_event_contactform:\S+?\/permalink).+?$/i', '$1', implode(' ', array_keys($serendipity)))]))
Code: Select all
$taglink = parse_url($serendipity[preg_replace('/^.+?(serendipity_event_freetag:\S+?\/taglink).+?$/i', '$1', implode(' ', array_keys($serendipity)))]);
if (substr_count($_SERVER['REQUEST_URI'], $taglink['path']))