From bdf9f7fe79f5c8077d20dbb1029903ed90e77d36 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 3 Oct 2009 18:42:21 +0000 Subject: added watermark plugin hooks --- docs/extending_tidypics.txt | 15 +++++++++++++-- languages/en.php | 2 +- lib/watermark.php | 13 ++++++++++++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/docs/extending_tidypics.txt b/docs/extending_tidypics.txt index 0fd544119..916cfa4ee 100644 --- a/docs/extending_tidypics.txt +++ b/docs/extending_tidypics.txt @@ -10,7 +10,7 @@ the custom front page tutorial plugin from Curverider. *** MAKING TIDYPICS MATCH YOUR THEME *** -Please check the css guid found in this directory. This will list the +Please check the css guide found in this directory. This will list the different css elements and where they are used. @@ -23,4 +23,15 @@ different css elements and where they are used. 6. photo deleted: 'delete', 'tp_image' *** TIDYPICS PLUGIN HOOKS *** -1. album slideshow: 'tp_slideshow', 'album' - return false to not have a slideshow, otherwise return link to slideshow \ No newline at end of file +1. album slideshow: 'tp_slideshow', 'album' - return false to not have a slideshow, otherwise return link to slideshow +2. watermark - return false to prevent default watermark + 'tp_watermark', 'gd' + 'tp_watermark', 'imagick' + 'tp_watermark', 'imagemagick' + + +*** IMAGE MENU EXTENSIONS *** +Below an image is a div called tidypics_controls. By default it contains controls +like tagging or downloading an image. You can change what is shown there by overridding +or extending the tidypics/image_menu view. + diff --git a/languages/en.php b/languages/en.php index 4b0d3e746..7dd7636dd 100644 --- a/languages/en.php +++ b/languages/en.php @@ -24,7 +24,7 @@ 'album:group' => "Group albums", 'item:object:image' => "Photos", 'item:object:album' => "Albums", - 'tidypics:uploading:images' => "Please wait. Uploading images", + 'tidypics:uploading:images' => "Please wait. Uploading images...", 'tidypics:enablephotos' => 'Enable group photo albums', 'tidypics:editprops' => 'Edit Image Properties', 'tidypics:mostcommented' => 'Most commented images', diff --git a/lib/watermark.php b/lib/watermark.php index 896be72fa..c7b8503c5 100644 --- a/lib/watermark.php +++ b/lib/watermark.php @@ -27,6 +27,10 @@ function tp_gd_watermark($image) { if (!$watermark_text) return; + // plugins can do their own watermark and return false to prevent this function from running + if (trigger_plugin_hook('tp_watermark', 'gd', $image, true) === false) + return; + global $CONFIG; $owner = get_loggedin_user(); @@ -60,6 +64,10 @@ function tp_imagick_watermark($filename) { if (!$watermark_text) return; + // plugins can do their own watermark and return false to prevent this function from running + if (trigger_plugin_hook('tp_watermark', 'imagick', $filename, true) === false) + return; + $owner = get_loggedin_user(); $watermark_text = tp_process_watermark_text($watermark_text, $owner); @@ -96,7 +104,10 @@ function tp_im_cmdline_watermark($filename) { if (!$watermark_text) return; - + // plugins can do their own watermark and return false to prevent this function from running + if (trigger_plugin_hook('tp_watermark', 'imagemagick', $filename, true) === false) + return; + $im_path = get_plugin_setting('im_path', 'tidypics'); if (!$im_path) { $im_path = "/usr/bin/"; -- cgit v1.2.3