We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18373 ☆ A M B ☆
    • 3,141 Posts
    Somehow I lost my notification to this topic and didn’t notice any new posts..

    Can everybody that has trouble with EvoGallery check if the problem exists with 1.0 from the repo, and 1.1 from github? https://github.com/Mark-H/EvoGallery/issues

    If it’s appearing in the github version PLEASE (and I really mean: PLEASE PLEASE PRETTY PLEASE WITH A CHERRY ON TOP) post it on Github. https://github.com/Mark-H/EvoGallery/issues This topic is enormous and is now discussing two different versions and it’s not clear (at least: not to me) where these problems exist in. You can see a log of all changes in the Github commits and most of the issues I see in the last bunch of posts don’t seem to be related to anything I changed, so far.. And if it’s present on Github it should be fixed smiley https://github.com/Mark-H/EvoGallery/issues

    Quote from: M. at Feb 24, 2011, 07:10 AM

    I’ve already found the problem, the EvoGallery snippet and thumb_handler.php aren’t getting their paths from config.inc.php, but have them hard coded..

    Please put that in a Github issue. https://github.com/Mark-H/EvoGallery/issues That’s an easy fix which can save others lots of work later.

    Quote from: M. at Feb 24, 2011, 09:13 AM

    I just encountered a serious problem.
    I just installed a fresh copy of modx and evogallery, and wanted to change the paths I mentioned before.
    I tried to change the path to the galleries in the EvoGallery snippet and suddenly everything stopped working.
    So I reinstalled everything and tried to just open the EvoGallery snippet and save it without changing anything.
    When I did that the gallery again stopped working and outputted nothing, no errors, nothing..

    Any clue?
    Thanx in advance!
    Check the MODX error log - seems something’s messed up.
      Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

      Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
      • 23192
      • 13 Posts
      Quote from: M. at Feb 24, 2011, 11:48 AM

      This is unbelievable: when editing the snippet directly in mysql it works just fine..
      I just had a similar experience and had to use phpmyadmin to get a site working again... It seems that some kind of security extension on the server I’m using is filtering out include() statements in HTTP POST. Maybe you’re having a similar issue. After saving a snippet, try opening it again and check if the include() statements are still intact.

      I don’t understand why phpmyadmin worked though...
        • 20324
        • 3 Posts
        if somebody needs cropped thumbnails, you can get it)
        the original image is centered, then cropped to the short side, then resized to the thumbnail size wich is set in the config.inc.php
        find files replace.php and upload.php in assets\modules\evogallery
        find the line
        resizeImage($target_file, $target_thumb, $params['thumbSize'], $params['thumbQuality']);  // Create and save thumb

        and replace it with
        cropImage($target_file, $target_thumb, $params['thumbSize'], $params['thumbQuality']);  // Create and save thumb

        do it in both files.
        then in the end of both files insert the code (before ?> offcourse)) :
        /**
        * Crop a given image
        */
        function cropImage($filename, $target, $target_size = 110, $target_quality = 76)
        {
        	$info = @getimagesize($filename);  // Determine whether file is an image using getimagesize()
        	if ($info)
        	{
        		if ($info[2] > 3)  // Use Imagemagick to convert other filetypes
        		{
        		/*
        			// SWF, PSD, BMP, TIFF (intel + motorola)
        			if ($info[2] == 4 || $info[2] == 5 || $info[2] == 6 || $info[2] == 7 || $info[2] == 8)
        			{
        				$cmd = $this->convert . " \"" . addslashes($filename) . "\" -quality $target_quality -quiet -resize $target_size" . "x" . "$target_size \"jpeg:" . addslashes($target) . "\"";
        				shell_exec($cmd);
        			}
        		*/
        		}
        		else  // Use the GD library to convert jpeg, gif, and png images
        		{
        			switch ($info[2])  // Check image type
        			{
        				case 1:
        					$img = @imagecreatefromgif($filename);
        					break;
        				case 2:
        					$img = @imagecreatefromjpeg($filename);
        					break;
        				case 3:
        					$img = @imagecreatefrompng($filename);
        					break;
        			}
        
        			if (!$img) return false;  // Incompatible type
        
        			$width = imageSX($img);
        			$height = imageSY($img);
        			if (!$width || !$height) return;  // Invalid width or height
        
        			$ratio = ($width / $height);
        
        			$new_height = $height;
        			$new_width = $width;
        			$x_start = 0;
        			$y_start = 0;
        			if ($width>$height)
        			{
        				$size = $height;
        				$x_start = ceil(($width-$size)/2);  //horizontal start
        			}
        			if ($height>=$width)
        			{
        				$size = $width;
        				$y_start = ceil(($height-$size)/2);  //vertical start
        			}
        				
        			$new_img = imagecreatetruecolor($target_size, $target_size);
        			if (!@imagefilledrectangle($new_img, 0, 0, $target_size, $target_size, 0)) return false;  // Could not fill image
        			if (!@imagecopyresampled($new_img, $img, 0, 0, $x_start, $y_start, $target_size, $target_size, $size, $size)) return false;  // Could not resize image
        			imagejpeg($new_img, $target, $target_quality);  // Save resulting thumbnail
        			imagedestroy($new_img);
        		}
        	}
        }


        enjoy)
        p.s. sorry for my english

          • 18453
          • 66 Posts
          Is there a way to get the parent id from within "images view".
          I need the id to get a tv from its parent with getfield..
            • 18373 ☆ A M B ☆
            • 3,141 Posts
            Could use a snippet which gets the parent of the content_id resource, and in turn gets the title from that.
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
              • 18453
              • 66 Posts
              Thanx for your hint mark, but I know nothing about writing snippets.
              I tried this but it did’t work:

              <?php
              $parent = $modx->getParentIds($modx->documentIdentifier);
              return array_shift($parent);
              ?>

              Could you write me this snippet wink

              BTW, alle the problems I encountered where with the version from github and there where no errors in my log.
                • 18373 ☆ A M B ☆
                • 3,141 Posts
                I never really developed snippets for Evolution tongue

                Also, $modx->documentIdentifier refers to the current document, where you should be using the value being passed by the [+content_id+] placeholder in the tpl chunk.

                You sure it’s getParentIds too? My gut tells me it only has one parent and the terminology would probably second that. But I didn’t check that.
                  Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                  Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                  • 18453
                  • 66 Posts
                  It works, thanx mate!
                    • 18373 ☆ A M B ☆
                    • 3,141 Posts
                    Could you share your solution for others? I don’t think you’re the first to want this..
                      Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                      Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                      • 18453
                      • 66 Posts
                      [+content_id+] worked smiley