maternal
Welcome, Guest. Please login or register.
Did you miss your activation email?

 
Advanced search

22750 Posts in 6706 Topics- by 17591 Members - Latest Member: permsk

31-05-2020 04:50:23
  Show Posts
Pages: [1]
1  JoomGallery 3.x JUX / Backend / Administration / Re: Joomgallery in multilingual mode on: 30-05-2016 18:31:00
I found a solution Grin

Edit this file: ROOT/plugins/joomgallery/joomfancybox/joomfancybox.php
In function in line 142 add a condition right under:

Code
$attribs['data-fancybox-type'] = 'image';

Code
		$lang = JFactory::getLanguage();
$result = $lang->getTag();
if ($result=="pl-PL") {
$attribs['title'] = $image->imgtitle;
} elseif ($result=="en-GB") {
$attribs['title'] = strip_tags($image->imgtext);
}

Explanation:

It checks what is current language. if current language is pl-PL then it loads image (1) title.
If current language is en-GB then it loads (2) description.

http://i.prntscr.com/aea0dc49f2f04a0594c4f7bff5c985ab.png

Result at frontend:

pl-PL: https://snag.gy/47K0zw.jpg
http://i.prntscr.com/3454c951e6bd48b09588e98c648250da.png

en-GB: https://snag.gy/lqN0IY.jpg
http://i.prntscr.com/5da0d4a7328b4cf495f64a5ff86d8732.png

This was designed to work with Jancybox and JoomPlu.

Please, note that this is a CORE HACK, what means it will be OVERWRITTEN during next plugin upgrade. So remember it and make a safe copy of your customized file.
2  JoomGallery 3.x JUX / Backend / Administration / Joomgallery in multilingual mode on: 30-05-2016 15:20:37
I know that Joomgallery doesn't support multilingual mode in Joomla! and you recommend to use some 3rd party extension that allow to manage content for different languages.
But to be honest, this is rather bad idea as Joomla! already has built in multilingual support.
Installing another component just only to translate content is unacceptable for my project.
The good old rule: less extensions the better.

So I'd like to start discussion about other alternatives to display image titles or descriptions  for other languages.

lets say that I have only two languages: Polish and English.
I used image title field as image title (which, in a fact, serves me as image description).
Title is in Polish so I may use other field e.g description to display other text e.g in English.

Also, what is important here, I use Fancybox to display my images.
Image title is displayed under image.
Whole box is displayed using js script.

So my idea is to customize script so it will use title or description field according to set language.

PHP condition is quite easy:

Code
	$lang = JFactory::getLanguage();
$result = $lang->getTag();
if ($result=="pl-PL") {
something;
} elseif ($result=="en-GB") {
  something;
}

The question is WHICH place is the best to do such a customization? Do anyone has any idea?
I don't ask for code - just to put me on right tracks.
3  JoomGallery 3.x JUX / Miscellaneous / Improvement: change underscore with hyphens in file names on: 30-06-2015 21:21:39
As JoomGallery is great extension but it has a serious drawback. Files created from uploaded images have names like:

konserwacja_-_pracownia_konserwacji_malarstwa_i_rzeby_polichromowanej_20150603_2084737421.jpg

And when we use real image URLs it impact severely on SEO.

It will be enough to change underscores with hyphens in those files:

/administrator/components/com_joomgallery/helpers/file.php line 100

Code
    // Replace whitespace with underscore
   array_push($filenamesearch, '\s');
   array_push($filenamereplace, '-');
   // Replace slash with underscore
   array_push($filenamesearch, '/');
   array_push($filenamereplace, '-');
   // Replace backslash with underscore
   array_push($filenamesearch, '\\\\');
   array_push($filenamereplace, '-');
   // Replace other stuff
   array_push($filenamesearch, '[^a-z_0-9-]');
   array_push($filenamereplace, '');

Also you'll need to change any appearance of '_' in that file to get SEO folder names.

/administrator/components/com_joomgallery/helpers/upload.php line 1706

Code
      // New filename
     if(is_null($filecounter))
     {
       $newfilename = $filename.'-'.$filedate.'-'.$randomnumber.'.'.$tag;
     }
     else
     {
       $newfilename = $filename.'-'.$filecounter.'-'.$filedate.'-'.$randomnumber.'.'.$tag;
     }

Not sure if this is needed but I changed it also:

/administrator/components/com_joomgallery/models/image.php line 624

Code
      // New filename
     $newfilename = $filename.'-'.$date.'-'.$randomnumber;

REF:

http://blog.woorank.com/2013/04/underscores-in-urls-why-are-they-not-recommended/

I did it myself but it's a core hack. And I'm not sure if I changed in every place that is needed, but those changes work as gold.

If you already have gallery on your site then you need to rename gallery folders and files (just copy them to your had and use batch name converter).
Then you need to convert names in db:

Code
UPDATE `your-database`.`prefix_joomgallery` SET `imgfilename` = REPLACE(imgfilename,'_','-')
UPDATE `your-database`.`prefix_joomgallery` SET `imgthumbname` = REPLACE(imgthumbname,'_','-')
UPDATE `your-database`.`prefix_joomgallery_catg` SET `catpath` = REPLACE(catpath,'_','-')


I'll be happy if you include that improvement in your source code.
4  Archive / Mambots / Plugins / Re: JoomPlu+JoomBu frontend freez on: 02-09-2011 18:07:25
Thanks for replay. Could you tell me how I can check that? I installed Web Developer Toolbar. It have so many functions - I tried few of them... but I haven't found right one (I think). What function should I use?
5  Archive / Mambots / Plugins / JoomPlu+JoomBu frontend freez on: 02-09-2011 14:13:56
Another problem with lates JoomPlu and JoomBu plugins. When I try to add a photo to an article in frontend JoomPlu freezes. When I clikck on button pop-up opens. I see some photos but when i choose a category it freezes - it starts searching and it never ends. Also windows looks odd - not like that one in backend.

In backend everything works fine.
6  Archive / Mambots / Plugins / Joomplu additional class problem on: 02-09-2011 14:09:16
Here's what's going on:

When I insert a photo to an article with Joomplu I need to add a additional class (default is jg_photo, I need to add additional class not-touch to avoid capturing photo enlargement by another plugin thau uses highslide). So when I try to add additional class in plugin configuration or in Joomplu pop-up window - image does not show in article - no code is inserted.

I use JoomPlu 1.5 BETA6.

Is that issue known? Is there a solution?
Pages: [1]
HOSTED BY SCHWARZKÜNSTLER ®

PROTECTED BY  ZB BLOCK  AND Project Honey Pot
Theme orange-lt created by panic

Bad Behavior has blocked 2838 access attempts in the last 7 days.

maternal