function get_i18n_gallery_header_from_content($content) { global $i18n_gallery_on_page; require_once GSPLUGINPATH . 'i18n_gallery/gallery.class.php'; if (preg_match_all("/\\(%\\s*(gallery)(\\s+(?:%[^%\\)]|[^%])+)?\\s*%\\)/", $content, $matches)) { $plugins = I18nGallery::getPlugins(); foreach ($matches[2] as $paramstr) { $gallery = I18nGallery::getGalleryFromParamString($paramstr); $plugin = @$plugins[$gallery['type']]; if ($plugin) { include_once GSPLUGINPATH . 'i18n_gallery/helper.php'; call_user_func_array($plugin['header'], array($gallery)); } } $i18n_gallery_on_page = true; } }