Мини-галерея в материале Joomla создается так:
Код: Выделить всё
{ppgallery}stories/folder/001{/ppgallery}
Если хочется высоту или ширину указать отличную от настроек плагина pPGallery, то делается так:
Код: Выделить всё
{ppgallery width="60" height="40"}stories/vodkomotornik{/ppgallery}
По умолчанию pPGallery грузит свои стили и скрипты - нах они не нужны нам - только лишний вес страницы. Используем свои стили и скрипты, которые уже загружены с шаблоном.
Пилим так:
\plugins\content\ppgallery\ppgallery.php
1. Отрубаем загрузку лишних стилей:
Код: Выделить всё
$doc->addStyleSheet($relpath./plugins/content/ppgallery/ppgallery/res/prettyphoto.css);
$doc->addStyleSheet($relpath./plugins/content/ppgallery/ppgallery/res/pPGallery.css);
Код: Выделить всё
//$doc->addStyleSheet($relpath./plugins/content/ppgallery/ppgallery/res/prettyphoto.css);
//$doc->addStyleSheet($relpath./plugins/content/ppgallery/ppgallery/res/pPGallery.css);
3. Включаем свой lightbox, который уже загружен с шаблоном:
Код: Выделить всё
$content .= <a href=".$relpath."/".$imageset[$a]->img_path."/".$imageset[$a]->img_file." rel="prettyPhoto[.$ppgid.]" title=";
Код: Выделить всё
$content .= <a href=".$relpath."/".$imageset[$a]->img_path."/".$imageset[$a]->img_file." rel="lightbox" title=";
Код: Выделить всё
$content .= <img src=".$relpath."/".$thb_file." alt=".($imageset[$a]->img_alt == "" ? $imageset[$a]->img_file : $imageset[$a]->img_alt)." width=".$thb_w." height=".$thb_h." title=";
Код: Выделить всё
$content .= <img class="image_thumb" src=".$relpath."/".$thb_file." alt=".($imageset[$a]->img_alt == "" ? $imageset[$a]->img_file : $imageset[$a]->img_alt)." width=".$thb_w." height=".$thb_h." title=";
Чтобы у картинок были alt и title, в папку с картинками добавить файл ppgallery.txt с кодировкой UTF-8 без BOOM следующего содержания:
Код: Выделить всё
"001.jpg","Здесь alt - Мамоново - команда на старте","А это - title Мамоново - команда на старте"
"002.jpg","Въехали в Польшу","Въехали в Польшу"
"003.jpg","Перед Бранево","Перед Бранево"
После установки Content - LVSpoiler в материале с изображениями ошибка:
Unhandled Error: jQuery is not a function
jQuery(document).ready(function($) {
$("a[rel^=\"prettyPhoto\"]").prettyPhoto({
animation_speed: "normal",
Лечится так:
\plugins\content\ppgallery\ppgallery.php
Код: Выделить всё
//if ($noconflict) { $doc->addScriptDeclaration( jQuery.noConflict();); }
//$doc->addScriptDeclaration(jQuery(document).ready(function($) {$("a[rel^=\"prettyPhoto\"]").prettyPhoto({.ltrim($ppparams,",").})}); //v.4.312);
//$doc->addScriptDeclaration(jQuery(document).ready(function($) {$("a[rel^=\"prettyPhoto[.$ppgid.]\"]").prettyPhoto({.ltrim($ppparams[$ppgid],",").}) }););
2018.01.20 - борьба с кэшированием превью
В одном материале 1000 фотографий - при открытии страница долго висит, затем висит хостинг, т.к. создать 1000 фото разом для него проблемно. А ведь после очистки кэша превью создаются снова и снова. Т.е. происходит циклическая операция по созданию нагрузки на хост, хотя картинки не меняются!
Найти:
Код: Выделить всё
//create/check thumb folder in J!cache
if (!JFolder::exists(JPATH_CACHE.'/ppgallery/'.$ppgid.'/'.$imageset[$a]->img_path)) {
JFolder::create(JPATH_CACHE.'/ppgallery/'.$ppgid.'/'.$imageset[$a]->img_path, 0755);
Код: Выделить всё
//create/check thumb folder in Joomla! /images/ppgallery not cache folder - not new created!
if (!JFolder::exists(images.'/ppgallery/'.$ppgid.'/'.$imageset[$a]->img_path)) {
JFolder::create(images.'/ppgallery/'.$ppgid.'/'.$imageset[$a]->img_path, 0755);