We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1788
    • 1,103 Posts
    Quote from: Aramaki at Oct 06, 2008, 04:17 AM

    я так и хотел, но не нашел сайт разработчиков sad((
    http://www.lokeshdhakar.com/projects/lightbox2/
      • 1978
      • 131 Posts
      спс smiley
        Как русифировать Modx 0.9.6.1(QuickEdit, TinyMCE)
        QuickEdit под win-1251 без mb_-функций
        • 166
        • 1 Posts
        Не работает плагин в MODx 0.9.6.2...
          • 31136
          • 72 Posts
          Quote from: fenix2095 at Jun 26, 2008, 12:53 PM

          С некоторыми картинками при применении к ним DR возникает 500 ошибка internal server error. При отключении DR страница начинает функционировать нормально.
          Не подскажите в чем может быть проблема и как поправить?

          У меня была подобная проблема. Её возникновение провоцировал большой размер/количество изображений на странице, что вызывало перегрузку сервера и скрипт DirectResize просто не успевал завершиться до таймаута. Это приводило к тому, что сервер возвращал ошибку, а превьюшки не создавались.
          Кстати, здесь все сильно зависит от вашего конкретного хостера/тарифа и загруженности сервера (у меня было так: рано утром чаще всего сервер был слабо нагружен и все срабатывало нормально).

          Выход — уменьшить размер исходных изображений до загрузки на сервер.

          И еще не забывайте, что DirectResize кэширует результат работы. Если до таймаута превью успеет создаться, то при следующем заходе на страницу сервер загружен не будет и ошибка не возникнет (до следующего изменения документа/картинки).
          Также отмечу, что автор DirectResize советует в данной ситуации попробовать использовать MaxiGallery.
            • 31136
            • 72 Posts
            Quote from: seocoder.org at Jan 27, 2008, 11:26 AM

            стоит закомментить мне размеры большой картинки - ничего нет sad
            и кеш чистил и картинка на месте.

            Итак, чтобы помочь наконец всем, кто столкнулся с проблемой принудительного добавления водяного знака к большим изображениям без указания big_width и big_height, предлагаю следующее решение.

            Замените в файле directResize.php (для версии 0.8.2) нижеследующие строки.

            Рекомендация от автора плагина, строка 526:
            if ($currentImgWidth > $this->drconfig['big_width'] || $currentImgHeight > $this->drconfig['big_height']){
            								// Генерируем большое изображение
            								$this->PrepareImg($currentImgPath);
            								$this->imgWidth = $this->drconfig['big_width'];
            								$this->imgHeight = $this->drconfig['big_height'];
            								$this->mode = "big";
            								$this->bigPath = $this->Process();
            								$this->bigWidth = $this->imgWidth;
            								$this->bigHeight = $this->imgHeight;
            							} else {


            заменить на:
            if ($currentImgWidth > $this->drconfig['big_width'] || $currentImgHeight > $this->drconfig['big_height'] || $this->drconfig['big_watermark']['use_watermark']){
            							// Генерируем большое изображение
                							$this->PrepareImg($currentImgPath);
                							$this->imgWidth = $currentImgWidth > $this->drconfig['big_width'] ? $this->drconfig['big_width'] : $currentImgWidth;
                							$this->imgHeight = $currentImgHeight > $this->drconfig['big_height'] ?  $this->drconfig['big_height'] : $currentImgHeight;
            								$this->mode = "big";
                							$this->bigPath = $this->Process();
                							$this->bigWidth = $this->imgWidth;
                							$this->bigHeight = $this->imgHeight;
            							} else {


            Мое дополнение к рекомендации, строка 218:
            		if ($this->imgWidth == $this->img_src_w && $this->imgHeight == $this->img_src_h) return false;


            заменить на:
            		if ($this->imgWidth == $this->img_src_w && $this->imgHeight == $this->img_src_h && !$this->drconfig['big_watermark']['use_watermark']) return false;


            До выхода официального обновления можно использовать данный подход.
            Оригинальная табуляция (в ущерб читабельности) была перенесена намеренно, чтобы после Copy-Paste не щёлкать TAB’ом.

            Кстати, почему бы в шаблоне не использовать PHx с основными атрибутами типа align,alt,title по умолчанию?
            Вот пример шаблона для hislide (hislide.config.php в самом начале файла):
            // This is the template to markup your thumbnails. See readme for possible placeholders.
            $tpl = <<<HTML
            <a href="[+dr.bigPath+]" class="highslide" onclick="return hs.expand(this, {captionId: 'caption[+dr.id+]'})">
            <img src="[+dr.thumbPath+]" [+dr.align:ne=``:then=`align="[+dr.align+]"`+] [+dr.alt:ne=``:then=`alt="[+dr.alt+]"`+] [+dr.title:ne=``:then=`title="[+dr.title+]"`+] width="[+dr.thumbWidth+]" height="[+dr.thumbHeight+]" /></a>
            <div class="highslide-caption" id="caption[+dr.id+]">[+dr.title+]</div>
            HTML;


            Здесь при помощи PHx, атрибуты "alt", "align", "title" для тега img будут вставляться только в том случае, если у исходного тега img они есть.
              • 16956
              • 88 Posts
              Фон моего тестового сайта озарился в прекрасные фоновые символы состоящих из латинских символов.
              Тк к чему я клоню? grin

              Типо вот: - выдал ошибку.
               preg_match_all("/]*>/", $o, $imgs, PREG_PATTERN_ORDER); for($n=0;$nconfig[site_url], "", $currentImgPath); $currentImgPath = urldecode($currentImgPath); preg_match('~\[(\+|\*|\()([^:\+\[\]]+)([^\[\]]*?)(\1|\))\]~s', $currentImgPath, $matches); if (!empty($matches)) continue; // ���� ����� $this->CheckForLabels($imgs[0][$n]); //���������, ����� �� ��� ����������� � ��� ����� ������������ ������, ��������� ����� drskip, ��������� ���������� ����� if ($this->checkPath($currentImgPath) && !$this->label["drskip"] && $this->CheckAllowedExt($currentImgPath) && (($this->drconfig['lightbox_mode'] == 1 && $this->label["drlightbox"]) || $this->drconfig['lightbox_mode'] == 2)){ $img = strtolower($imgs[0][$n]); // ���������, ������ �� � ����������� height ��� width if ($this->CheckThumbSizes($img)){ $imgf =$imgs[0][$n]; preg_match("/^.+(src|Src|SRC)=('|\")/",$imgf,$lien_g); $imgf = eregi_replace("^.+src=('|\")","",$imgf); preg_match("/('|\").*$/",$imgf,$lien_d); // �������� ����� $currentImgPath = $this->PrepareImg($currentImgPath); $this->imgWidth = $this->imgHTMLWidth; $this->imgHeight = $this->imgHTMLHeight; $this->mode = "thumb"; $this->thumbPath = $this->Process(); /* thumbImgTag - HTML-��� ���� img ��� ����� thumbWidth, thumbHeight - ��������� ������� ��������������� ����� */ $HTML = $lien_g[0].$this->thumbPath.$lien_d[0]; $this->thumbWidth = $this->imgWidth; $this->thumbHeight = $this->imgHeight; //if ($this->label["drthumbonly"]) { $s = "/(width *= *[\"|'])([^\"']*)([\"'])/i"; $r = "\${1}{$this->thumbWidth}\${3}"; $HTML = preg_replace($s,$r, $HTML); $s = "/(height *= *[\"|'])([^\"']*)([\"'])/i"; $r = "\${1}{$this->thumbHeight}\${3}"; $HTML = preg_replace($s,$r, $HTML); } // ���������� ������� ����������� � lightbox HTML-��� if (!$modx->isBackend() && !$this->label["drthumbonly"]){ $size = getimagesize($modx->config['base_path'].$currentImgPath); $currentImgWidth = $size[0]; $currentImgHeight = $size[1]; if ($currentImgWidth > $this->imgHTMLWidth || $currentImgHeight > $this->imgHTMLHeight){ $this->originalPath = $currentImgPath; $this->originalWidth =$currentImgWidth; $this->originalHeight =$currentImgHeight; $this->bigPath = $currentImgPath; $this->bigWidth = $currentImgWidth; $this->bigHeight = $currentImgHeight; if ($currentImgWidth > $this->drconfig['big_width'] || $currentImgHeight > $this->drconfig['big_height']){ // ���������� ������� ����������� $this->PrepareImg($currentImgPath); $this->imgWidth = $this->drconfig['big_width']; $this->imgHeight = $this->drconfig['big_height']; $this->mode = "big"; $this->bigPath = $this->Process(); $this->bigWidth = $this->imgWidth; $this->bigHeight = $this->imgHeight; } else { $this->bigPath = $currentImgPath; } // ���������� HTML-��� lightbox-������ $HTML = $this->ParseTemplate($imgs[0][$n], $n); } } $o = str_replace($imgs[0][$n],$HTML,$o); $this->imgCounter++; } } } if (!$modx->isBackend()) $o = $this->ReplaceLabels($o); $this->output = $o; } //------------------------------------------------------------------------------------------------- /* ������ ������, �������� �������� ��� */ function ParseTemplate($tpl, $currId) { global $modx, $_lang; if (!class_exists('DRChunkie')) { $chunkieclass = $modx->config['base_path'].DIRECTRESIZE_PATH.'includes/chunkie.class.inc.php'; if (file_exists($chunkieclass)) { include_once $chunkieclass; } } $drtemplate = new DRChunkie($this->drconfig['tpl']); /* ������������ ��������� ��������� �����������, �������� �� � ������������ */ $HTMLattr = array( "alt" => "alt|Alt|ALT", "title" => "title|Title|TITLE", "class" => "class|Class|CLASS", "valign" => "valign|Valign|VALIGN", "align" => "align|align|ALIGN", "style" => "style|Style|STYLE", ); foreach ($HTMLattr as $attr_k => $attr_v) { preg_match("/(".$attr_v.") *= *[\"|'][^\"']*[\"']/",$tpl,$array); if (!empty($array[0])) { $tmp = eregi_replace($attr_k." *= *[\"|']","",$array[0]); $tmp = eregi_replace("[\"']*","",$tmp); $tpldata[$attr_k] = trim($tmp); } } $tpldata['id'] = $currId; $tpldata['thumbWidth'] =$this->thumbWidth; $tpldata['thumbHeight'] =$this->thumbHeight; $tpldata['thumbPath'] = $this->thumbPath; $tpldata['bigWidth'] =$this->bigWidth; $tpldata['bigHeight'] =$this->bigHeight; $tpldata['bigPath'] = $this->bigPath; $tpldata['originalPath'] = isset($this->originalremotePath) ? $this->originalremotePath : $this->originalPath; $tpldata['originalWidth'] =$this->originalWidth; $tpldata['originalHeight'] =$this->originalHeight; $tpldata['originalFilename'] =str_replace("b


              Воистину ужасное зрелище laugh я не знаю в чем проблема, может плагин DirectResize 0.8.0 не любит modx-0.9.6.2. Или вся вина на БД? По идее я делал все как в описании установки.

              Мож права к папке задал не те? Поставил 777. По умолку 755. undecided

              Каково решение проблемы
              huh
                • 36823
                • 334 Posts
                Плагин DirectResize нормально работает с: modx 0.9.6.1, 0.9.6.2, 0.9.6.3. Проверено на практике.
                  • 19164
                  • 1,215 Posts
                  @LEONeso Исходник DR содержит комментарии с кириллицей (писал для себя). Возможно ваш сайт работает на UTF-8, а файл сохранен в windows-1251. Пересохраните файл directResize.php в кодировке сайта.
                    DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. | DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.

                    Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.

                    [PLUGIN] DirectResize - as Maxigallery but for single images :: Download :: [url=http://modxcms.com/forums/index.php/topic,21490]
                    • 16956
                    • 88 Posts
                    Metaller, да, все верно, после того как я его пересохранил все встало на свои места, но когда я обновляю сайт в админке пишут:

                    Обновить сайт
                    0 документов опубликовано.
                    0 документов снято с публикации.
                    Кэш: найдено 5 файлов в папке кэширования и удалено 1 кэш-файлов.

                    Новые кэш-файлы будут созданы при запросах страниц.

                    Следующие файлы были удалены:

                    * docid_1.pageCache.php

                    Это в порядке вещей? Не стоит обращать на это внимание?
                      • 19164
                      • 1,215 Posts
                      Не пойму, при чем тут DR.
                        DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. | DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.

                        Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.

                        [PLUGIN] DirectResize - as Maxigallery but for single images :: Download :: [url=http://modxcms.com/forums/index.php/topic,21490]