We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7923
    • 4,213 Posts
    Hello,

    I have just couple things to do until I release the next version of MaxiGallery and would like to get some testing done to the current SVN code.

    So if you have time, download the working SVN version from this link and try it out.

    EDIT: The archive is attached to this post for the mean while as my SVN account wiped out.

    There are tons of fixes that have gone in and some new features. I will still do the phpThumb integration and gallery id feature before I release the v0.6.

    Thanks!

    Here’s the changelog since v0.5.2:
    Fixed: CHMOD issue in gallery resynch
    Changed: If picture files are deleted from file system folder, resynch operation deletes them also from the database table 
    Changed: Images can be browsed in query mode in the same document, pictures does not link to original document by default anymore
    Added: query_mode_link_original parameter what can be used to control whether the pictures link to original gallery documents in query mode or can be browsed in that document
    Changed: Do not show certain operations in picture management if in query mode 
    Added: possibility to manage pictures when using &gal_query_ids parameter
    Added: &customFields parameter
    Added: Possibility to manage pictures when using &pic_query_ids parameter 
    Fixed: Do not build link to big image if it doesn't exist
    Added: Possible to sort childgalleries by TV name (prefix tv name with "tv")
    Added: &childembedtype parameter
    Fixed: Last leaf of childgalleries in a tree were showing itself as a child gallery to itself
    Fixed: childgallerytpl maxigallery.picscount placeholder did not return corret picture count
    Fixed: octdec to chmod_files and chmod_folders parameter
    Changed: MaxiGallery database table validation routine so that MODx db api can be used 
    Fixed: Return to correct page when pics_per_page is used and index is clicked from picture view 
    Fixed: Added ftp_base_dir value to the chmod calls when using ftp commands
    Fixed: mysql_query calls changed to $modx->db->query
    Fixed: Trailing slash removed from path in mkdir calls, there is a bug in php on some versions what will choke on this
    Fixed: Upload process checks that was the picture moved ok from temp location before it starts to process the file
    Fixed: If ftp commands are enabled, also all chmod operations will be done by using ftp commands
    Changed: Improved error messaging for picture upload issues 
    Changed: Remove empty lines from outputted html source
    Fixed: Improved error handling on file upload
    Fixed: FTP mode upload CHMOD bug
    Changed: Smoothgallery updated to 2.0 and added new parameters accordingly
    Added: &chmod_folders and &chmod_files parameters.
    Added: &htmlentities_charset parameter, what is used only in slidebox xml file since htmlentities conversion is done by phx.
    Added: Possible to use @CHUNK binding in template parameters. Does just the same if no binding is set at all.
    Fixed: Too high css z-index value for Safari
    Fixed: Resync issue when &keep_bigimg=1
    Added: Copies index.html from assets/galleries to newly created gallery folders to prevent file listing
    Added: "random" parameter value to &childgalleries_order_by
    Changed: Smoothgallery variables to strings as they go straight to the js script and setlocale was messing with commas/dots
    Fixed: Extra ul tags after last thumbnail in page
    Fixed: CHMOD uploaded files correctly
    Added: &disable_draggable_js parameter
    Added: Following placeholders to galleryPictureTpl and childgalleryTpl, [+maxigallery.rownumber+] [+maxigallery.picnumber+] [+maxigallery.picpagenumber+] [+maxigallery.picrownumber+]
    


    And here’s new parameters:
    From SmoothGallery 2.0 integration:
    
    smoothgallery_preloader
    smoothgallery_preloaderImage
    smoothgallery_preloaderErrorImage
    smoothgallery_populateFrom
    smoothgallery_populateData
    smoothgallery_destroyAfterPopulate
    smoothgallery_elementSelector
    smoothgallery_titleSelector
    smoothgallery_subtitleSelector
    smoothgallery_linkSelector
    smoothgallery_imageSelector
    smoothgallery_thumbnailSelector
    smoothgallery_defaultTransition
    smoothgallery_slideInfoZoneSlide
    smoothgallery_thumbIdleOpacity
    smoothgallery_showCarouselLabel
    smoothgallery_thumbCloseCarousel
    smoothgallery_useExternalCarousel
    smoothgallery_carouselElement
    smoothgallery_carouselHorizontal
    smoothgallery_activateCarouselScroller
    smoothgallery_carouselPreloader
    smoothgallery_textPreloadingCarousel
    smoothgallery_baseClass
    smoothgallery_withArrowsClass
    smoothgallery_useHistoryManager
    smoothgallery_customHistoryKey
    smoothgallery_gallerySelector
    smoothgallery_galleryTitleSelector
    smoothgallery_textGallerySelector
    smoothgallery_textShowGallerySelector
    smoothgallery_textGalleryInfo
    smoothgallery_startWithSelector
    
    disable_draggable_js : disables the js for draggable sorting in picture management
    htmlentities_charset : charset for slidebox xml
    chmod_folders : chmod value for folders
    chmod_files : chmod value for files
    childembedtype : possible values normal, slidebox, lightboxv2, slimbox, smoothgallery
    childgalleryPictureTpl : used for childembedtype
    customFields : adds custom fields to pictures. 
    


    Few notes:

    If you want to use &customFields parameter, remember to add placeholders to managePictureTpl to manage your custom fields (for example copy the existing description field code and change the field name to your custom field name). Also remember to add placeholders to galleryPictureTpl or pictureTpl if you want to show your customfields.. The custom fields feature is done so that it adds the custom fields straight to maxigallery db table via alter table.. So it would be a good convention to use own db table (&gtable) each time you use custom fields, but not required. Galleries can also be sorted by custom fields.. and childgalleries can be sorted by tv names (new feature).

    &childembedtype=`smoothgallery` uses the new gallery set feature of SmoothGallery 2.0 to show the child galleries. In SmoothGallery 2.0 you can also have external thumbnail carousel (&smoothgallery_useExternalCarousel and &smoothgallery_carouselElement).



      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
      • 7923
      • 4,213 Posts
      Please give feedback on all errors or oddities you may see to this thread if you try this version, so I can get them sorted out for the v0.6 final version.. You can also post if all is working fine, so I know that at least someone has tried this..

      EDIT: I updated the link to download rev 164, made the following changes:

      Changed: Images can be browsed in query mode in the same document, pictures does not link to original document by default anymore
      Added: query_mode_link_original parameter what can be used to control whether the pictures link to original gallery documents in query mode or can be browsed in that document


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 36416
        • 589 Posts
        Quote from: doze at Apr 10, 2008, 06:29 AM

        Please give feedback on all errors or oddities you may see to this thread if you try this version, so I can get them sorted out for the v0.6 final version.. You can also post if all is working fine, so I know that at least someone has tried this..

        Will try this weekend, thanks for not giving up.
          • 7231
          • 4,205 Posts
          Wow, looks like quite a few enhancements/fixes. I will be testing it soon. Thanks for all the work grin
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 4172
            • 5,888 Posts
            looks very good!
            one thing - perhaps its not the right place to post this?
            in resynch-section to hide pictures, which are removed from directory I added some code for me.
            //add by Bruno
            $deleted=10000;
            $rsb=$modx->db->query("UPDATE " . $mg->pics_tbl . " SET gal_id=gal_id*".$deleted."  WHERE gal_id='" . $mg->pageinfo['id']."'");
            //end add
            // Store files currently in gallery
            $filesExist = array();
            while ($row = $modx->db->getRow($rsx)) {
            $filesExist[$row['filename']] = true;
            }
            $upload_error = false;
            $dh = opendir($mg->path_to_gal);
            while ($name = readdir($dh)) { //for each file in the gallery directory
            //if max number of pics limit has been reached, break
            if($mg->mgconfig['max_pic_number']!=0 && ($mg->mgconfig['max_pic_number'] <= ($i + $modx->db->getRecordCount($rsx)))){
            $upload_error = true;
            $manageOuterTplData['messages'] .= $mg->strings['max_pics_reached_some_discarded'];
            break;
            }
            //add by Bruno
            if (isset($filesExist[$name])) {
            $rsb=$modx->db->query("UPDATE " . $mg->pics_tbl . " SET gal_id=gal_id/".$deleted."  WHERE filename='" . $name."'");
            }
            //end add


            [Edit] I think better is $deleted=-1 ............. seems not to work with -1, so I let it with 10000
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 4172
              • 5,888 Posts
              to recreate thumbs if deleted - so you can delete the thumbs, if you want them in other size

                              //add by Bruno
                              if (isset ($filesExist[$name])) {
                              	$rsb = $modx->db->query("UPDATE " . $mg->pics_tbl . " SET gal_id=gal_id/" . $deleted . "  WHERE filename='" . $name . "'");
                              	//recreate thumb if deleted
              			if (!isset ($filesExist['tn_' . $name])) {
                             		if (substr(strtolower($name), -4) == ".jpg" || substr(strtolower($name), -5) == ".jpeg") {
                              		$retStr = $mg->createthumb($name, "jpeg", $mg->path_to_gal, "tn_");
                              		if ($retStr != "") {
                              			$handleMessage = $retStr;
                              		}
                              	} else
                              		if (substr(strtolower($name), -4) == ".png") {
                              			$retStr = $mg->createthumb($name, "png", $mg->path_to_gal, "tn_");
                              			if ($retStr != "") {
                              				$handleMessage = $retStr;
                              			}
                              		} else
                              			if (substr(strtolower($name), -4) == ".gif") {
                              				$retStr = $mg->createthumb($name, "gif", $mg->path_to_gal, "tn_");
                              				if ($retStr != "") {
                              					$handleMessage = $retStr;
                              				}
                              			}
                              }
                              }	
              				//end add by Bruno	
              					
              					if ($name != '..' && $name != '.' && strpos($name, 'tn_') !== 0 && strpos($name, 'big_') !== 0 && !isset($filesExist[$name])) {
              						$foundNewPics = true;
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 7923
                • 4,213 Posts
                Thanks again Bruno, I made similar modifications to rev 165, although implemented it little differently and the rows are also deleted from the db table. While doing the changes to the resynch feature, I noticed a bug in the CHMOD operation and fixed that too..

                The link in the first thread is updated to download rev 165 now, it adds following changes:

                Fixed: CHMOD issue in gallery resynch
                Changed: If picture files are deleted from file system folder, resynch operation deletes them also from the database table


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 19315
                  • 84 Posts
                  Hi,

                  I’m not sure if this is the place, but I have quite a trivial issue. If &pics_per_page is not set in the snippet call (i.e. so pics per page is unlimited), then in pictureTpl the placeholder [+maxigallery.index_url+] seems to always include ?page=1 in the link, when it is not necessary. This is only slightly annoying in terms of the stats for the site: with ?page=1 is seen as a different page to without ?page=1. (Plus I wonder if there is a SEO issue with two pages having the same content)

                  I was wondering if maybe a better idea would be: if the page to be displayed is the first page, then to just omit ?page=1 from the url given by [+maxigallery.index_url+]?

                  Michal.
                    • 7923
                    • 4,213 Posts
                    I’ll get that fixed, thanks for reporting..

                    EDIT: and yes, this is the right place to post errors / oddities in the v0.6 test version


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 4172
                      • 5,888 Posts
                      I had problems with the exif-data of some pictures, so I made this:
                      if(function_exists("exif_read_data")) {
                      //$exif = exif_read_data($gal_path.$name, 'IFD0');
                      try {
                      set_error_handler(create_function('', "throw new Exception(); return true;"));
                      $exif = exif_read_data($gal_path.$name, 0, true);
                      if(array_key_exists("EXIF", $exif)) {
                      $pic_date = " '".$exif["EXIF"]["DateTimeOriginal"]."' ";
                      }
                      } catch (Exception $e) {
                      echo 'Exif-Error: ',  $e->getMessage(), "\n";
                      }
                      restore_error_handler();
                      }


                      And I did some coding for me to resynch gallerys with &gal_query_ids, if you are interested I can post this too.
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!