This is just a list of the different existing plugin hooks supported in version 1.4.8 of Coppermine. The following list is designed to aid in the creation of plugins by listing the hooks based on their different uses and properties. This list does not explain how to use each hook but simply lists them so that they can be identified, further researched, and implemented.
Action
The first type of hook is an action hook. Basically this allows for actions related to the plugin such as the following two hooks.
CPGPluginAPI::action('plugin_configure',$installed,CPG_EXEC_NEW);
CPGPluginAPI::action('plugin_cleanup',$uninstalled,$plugin_id);
These next two hooks are useful for running code that does not require anything to be exported. These hooks have access to the global variables and functions inside of Coppermine. These hooks will most likely be used to execute code that does not require an output.
CPGPluginAPI::action('page_start',null)
CPGPluginAPI::action('page_end',null);
Filter
This group of plugins is designed to manipulate data that will be used. Normally this involves adding or removing data from the variable submitted to the filter. This data can also be simply read from the variable.
This first group of filters are used in a variety of places and are each unique.
$info = CPGPluginAPI::filter('file_info',$info);
$params = CPGPluginAPI::filter('user_caption_params', array('{USER_NAME}' => $user['user_name'],
$matches = CPGPluginAPI::filter('plugin_block', $matches);
$anycontent = CPGPluginAPI::filter('anycontent',ob_get_contents());
$template = CPGPluginAPI::filter('template_html',$template);
$template_header = str_replace('{META}','{META}'.CPGPluginAPI::filter('page_meta',''),$template_header);
This group of filters is very specific for manipulating the data of the thumbnails. These are named according to what they modify and are extremely obvious.
$rowset = CPGPluginAPI::filter('thumb_caption',$rowset);
$rowset = CPGPluginAPI::filter('thumb_caption_regular',$rowset);
$rowset = CPGPluginAPI::filter('thumb_caption_lastcom',$rowset);
$rowset = CPGPluginAPI::filter('thumb_caption_lastcomby',$rowset);
$rowset = CPGPluginAPI::filter('thumb_caption_lastup',$rowset);
$rowset = CPGPluginAPI::filter('thumb_caption_lastupby',$rowset);
$rowset = CPGPluginAPI::filter('thumb_caption_topn',$rowset);
$rowset = CPGPluginAPI::filter('thumb_caption_toprated',$rowset);
$rowset = CPGPluginAPI::filter('thumb_caption_lasthits',$rowset);
$rowset = CPGPluginAPI::filter('thumb_caption_random',$rowset);
$rowset = CPGPluginAPI::filter('thumb_caption_search',$rowset);
$rowset = CPGPluginAPI::filter('thumb_caption_lastalb',$rowset);
$rowset = CPGPluginAPI::filter('thumb_caption_favpics',$rowset);
$pic_row = CPGPluginAPI::filter('thumb_data',$pic_row);
These two filters are used specifically to manipulate the data of a picture.
$CURRENT_PIC_DATA = CPGPluginAPI::filter('add_file_data',$CURRENT_PIC_DATA);
$CURRENT_PIC_DATA = CPGPluginAPI::filter('file_data',$CURRENT_PIC_DATA);
The breadcrumb plugin:
CPGPluginAPI::filter('post_breadcrumb',null);
This plugin is very powerful because it gives access to the entire body of HTML that will be then directly returned to the user. This filter can be used to remove parts of code or modify links for example.
return CPGPluginAPI::filter('page_html',$html);
These two filters relate to headers.
echo CPGPluginAPI::filter('usermgr_header','');
$template_header .= CPGPluginAPI::filter('gallery_header','');
These two filters relate to footers.
echo CPGPluginAPI::filter('usermgr_footer','');
$template_footer = CPGPluginAPI::filter('gallery_footer','').substr($template, $gallery_pos);
Sorry for any mistakes I may have made in the above documentation. I hope this helps someone.