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
    True.. I would like it best if I wouldn’t have to keep up supporting old tags.. but then again, if I don’t, this might cause many support requests... hmm.. what to do, what to do?? smiley


      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
      • 7455
      • 2,204 Posts
      I do not know if this version does this but what i like to see is that when the max pic per page is set to les than 10 that the upload fields are as much as the image that are still alowed to upload. I made a mod for this in 0.5 BETA 2 Rev 49.

      		//check that max limit of pictures have not been reached, if it's set
      		if(!isset($mg->mgconfig['max_pic_number']) || ($mg->mgconfig['max_pic_number']==0 || $mg->mgconfig['max_pic_number']>mysql_num_rows($rs1))){
      			$outerTplDataHiddenFields['uploadform'] = '<input type="hidden" name="action" value="upload_pics" /><input type="hidden" name="mode" value="admin" />';
      		
      //mod by Dimmy 	
      //only shows the upload fields when "max_pic_number" is not reached yet. wit max of 10 fields
      
      			$uploadCount= $mg->mgconfig['max_pic_number'] - mysql_num_rows($rs1); 
      			
      			for($i=0;$i<$uploadCount and $i <10;$i++) {
      // end mod				
                                      $tpl = new CChunkie($mg->mgconfig['manageUploadTpl']);
      				$uploadPictureTplData = array();
      				
      				$uploadPictureTplData['counter'] = $i+1;
      				$uploadPictureTplData['fieldnames.file'] = 'file'.$i;
      				
      				$tpl->addVar('maxigallery', $uploadPictureTplData);
      			
      				$manageOuterTplData['uploadpictures'] .= $tpl->Render();
      							
      			}
      			
      		}else{
      			$manageOuterTplData['messages'] .= $strings['max_pics_reached'];
      		}
      		
      		$manageOuterTplData['hiddenfields'] = $outerTplDataHiddenFields;
      
      


      this wil display as much upload fields as images alowd to upload, With a max of 10, and reduces the upload fields when below 10.

      would be nice if the upload button is removed when limit is reached but thats in the template I think, I do not know how to change that.

      greets Dimmy
        follow me on twitter: @dimmy01
        • 7923
        • 4,213 Posts
        You can remove it by not setting the placeholder for it.. I’ll look into getting this to the final v0.5 release


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 7455
          • 2,204 Posts
          Quote from: doze at Feb 27, 2007, 01:12 PM

          You can remove it by not setting the placeholder for it.. I’ll look into getting this to the final v0.5 release

          in the template? then its not posible to upload at all but if you mean in the code then I do not know how.

          one other thing that would be good is to add the image id to the uploaded image name that way if images are called the same thre wil not be a conflict.
            follow me on twitter: @dimmy01
            • 7923
            • 4,213 Posts
            Not set the placeholder in the code, but I’ll do that too when I do the above thing.

            If there are images uploaded with the same file name, there will be a number appended to the filename on the later ones.


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 7455
              • 2,204 Posts
              Quote from: doze at Feb 27, 2007, 01:23 PM

              Not set the placeholder in the code, but I’ll do that too when I do the above thing.

              If there are images uploaded with the same file name, there will be a number appended to the filename on the later ones.
              Nice ok that is great

              Doze you do a great job on MG Thank you
                follow me on twitter: @dimmy01
                • 19889
                • 616 Posts
                I got a suggestion for the thumbnail listing - I guess it would be possible to check whether there are any title/description available - if not, there should be no html markup added or at least an empty tag should be placed in the code - currently, I’m ending up with some annyoing hyphens.
                  • 10573
                  • 101 Posts
                  Yes, I second that please. It gives a warning in validation.
                    • 7923
                    • 4,213 Posts
                    These just went to SVN:

                    Changed: max_pic_size default value to 450, fits better with default MODx templates
                    Changed: if max_pics_number is set and less than 10 pictures are available to be uploaded, amount of file upload input fields are decreased accordingly. If max pics number is reached, upload button is hidden.
                    Added: [+maxigallery.pics_allowed_count+] placeholder to manageOuterTpl what shows the number of pictures allowed to upload
                    Changed: if no title/description set for the picture, do not make any html markup for them
                    Added: manageButtonTpl, a template to style the "manage pictures" button. Possible placehoders: [+maxigallery.urlaction+], [+maxigallery.hiddenfields+], [+maxigallery.strings.key+]


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 7923
                      • 4,213 Posts
                      And we have reached the final version.


                        "He can have a lollipop any time he wants to. That's what it means to be a programmer."

                      This discussion is closed to further replies. Keep calm and carry on.