Phoca gallery tricks

Рейтинг:  0 / 5

Звезда не активнаЗвезда не активнаЗвезда не активнаЗвезда не активнаЗвезда не активна

Here's a linux command line solution to remove all your phoca thumbnails so the system will generate them again:

cd /home/your_joomla_folder/images/phocagallery
find  -name "*phoca_thumb*" -print0|xargs -0 rm


And here's another Phoca gallery trick for global watermark files(i.e you will have global watermark files instead of having to copy watermark-large.png and watermark-medium.png into all gallery subfolders):

This modification will watermark all files in all categories and subcategories subfolders using global watermark files placed in [your joomla root]/images/phocagallery.

Watermark files should be named watermark-large.png and watermark-medium.png, and you should save them as RGB PNG images with transparency.

You have to edit phocagallery.php in administrator/components/phocagallery/helpers

add this line



 // Which Watermark will be used 

,then a little bit below replace

$fileWatermark    = str_replace($fileName, 'watermark-medium.png', $file_in);


$fileWatermark    = $path.DS.'watermark-medium.png';


$fileWatermark    = str_replace($fileName, 'watermark-large.png', $file_in);


$fileWatermark    = $path.DS.'watermark-large.png';

the code should look like this now:

// global watermark file instead of per-gallery folder
// Which Watermark will be used
if ($thumbnailMedium) {
// $fileWatermark = str_replace($fileName, 'watermark-medium.png', $file_in);
$fileWatermark = $path.DS.'watermark-medium.png';
} else if ($thumbnailLarge) {
// $fileWatermark = str_replace($fileName, 'watermark-large.png', $file_in);
$fileWatermark = $path.DS.'watermark-large.png';

Additional fix for watermarks09-04-2009 00:04

In addition to the above fix find 
// Watermark 
if ($fileWatermark != '') { 
ImageCopy($image2,$waterImage1,$locationX,$locationY,0, 0,$wW,$hW); 

// End Watermark 
and replace it with  
// Watermark 
if ($fileWatermark != '') { 
ImageCopymerge($image2,$waterImage1,$locationX,$locatio nY,0,0,$wW,$hW, 15); 

// End Watermark 

where the extra 15 is the merge amount in % 
so 100 would be the same as ImageCopy() 
I found that 15% with white text & a thin black stroke around the letters works best.