Phoca gallery tricks

Thursday, 08 January 2009

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

$path=JPATH_ROOT.DS.'images'.DS.'phocagallery';

before 

 // Which Watermark will be used 

,then a little bit below replace

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

with

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

then 

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

with

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

the code should look like this now:

// TMJ MOD
// global watermark file instead of per-gallery folder
$path=JPATH_ROOT.DS.'images'.DS.'phocagallery';
// 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';


Give us some social love (it really works now)!

Reddit! Del.icio.us! StumbleUpon! Yahoo! Swik!



Comments (2)
RSS comments
1. 13-05-2009 14:01

Great info about thumbnails, thank you! I wonder why there is no button for that in Phoca...

2. Additional fix for watermarks09-04-2009 01: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.

Write Comment
  • Please keep the topic of messages relevant to the subject of the article.
  • Please don't use comments to plug your web site. Links are rel='nofollow'-ed
  • Please refresh the page if you're having trouble with the security image code
Name:
E-mail
Homepage
Title:
Comment:

:) :grin ;) 8) :p
:roll :eek :upset :zzz :sigh
:? :cry :( :x
Code:* Code

Last Updated ( Thursday, 08 January 2009 )
 
468x60b

Europe freelancer directory

Newsletter

Subscribe to TeachMeJoomla's newsletter
Name:
Email:


Auto tags

phoca gallery watermark

phoca gallery

images/phocagallery/1.rss

phoca watermark

phoca gallery image path

how to use phoca gallery

phoca gallery+watermark

how to use phoca gallery in joomla

how to use phoca gallery joomla

phoca gallery modify

phoca gallery images path

phoca gallery add comments

comment in phocagallery

joomla gallery with watermark

watermark phocagallery

phocagalery comment

phocagallery delete

phocagallery change folder

phocagallery

joomla phoca watermark

Phocagallery watermark

phoca gallery directory