We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    Oh, yeah. The WWW will never be the same. This is going to really get big.
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
      • 15914
      • 145 Posts
      I got lightbox.js working with my quick shopping cart snippet. I also got it to use phpThumb which generate thumbnails on the fly and caches them. You can see it working here: http://www.limehost.net/

      I will post up a quick tute soon. And here is my tutorial.
        Kunal Kapoor
        Technical Director
        Limesharp Internet Limited - Effective, Functional, Standards Compliant

        IRC Nick: KingKoopa
        Skype ID: KingKoopa16
        • 3984
        • 22 Posts
        Okay, to everyone who’s asking about my lightbox implementation. Firstly I wish I could get a demo URL up to show. I’m only running this on a test server at home. If anyone has a spare modx installation running that they can give access to, well maybe.

        Here’s a basic run through of what I did, in case anyone wants to play around.

        1. I put the lightbox files into a subfolder in the EasyPeasyGallery 2 folder, ie assests\modules\epg2\lightbox
        2. Modified the default template to include the lightbox js and css files.
        3. Added the rel="lightbox" attribute for the thumbnail links (as this was the layout I was using). The area you need to modify is near the start of the ’Generate the midsection’ comment.
                 $chunk_main .= '<td style="'.( $pics_per_row!=0 ? "width:".floor(100/$pics_per_row)."%; " : "" ).' " class="EPG2_td" >';
                 $chunk_main .=    '<a '.$target_to.' href="'.$link.'" rel="lightbox" title="'.stripslashes($picture['title']).'"><img class="EPG2_image_thumb" alt="'.stripslashes($picture['title']).'" src="assets/modules/epg2/image.php?type=pic_thumb&id='.$picture['id'].'" /></a>';
        		 

        4. Then the hard bit. I modified the lightbox.js code to pull out the pic id from the URL to use to retrive the fullsize image location.

        The function used get the paramater is like this.

        // Get Parameter function
        function GetParameter(formparams,ValueWanted)
        {
        
        params = formparams.split('&');
        
        // Handle form parameters
        
        valuetoreturn = '';
        
        for (var i=0; i < params.length; i++) {
        	splitparam = params[i].split('=');
        	paramname = splitparam[0];
        	paramvalue = splitparam[1];
        
        	if (paramname.toUpperCase() == ValueWanted.toUpperCase()) {
        
        		valuetoreturn = paramvalue;
        	}
        }
        
        return(valuetoreturn);
        }


        Then add some code into the showLightbox function.

        function showLightbox(objLink)
        {
        	// prep objects
        
        	b=objLink+''; // make the objLink variable a string rather than an attribute
        	paramstring = b.split('?'); // split the URL to get parameters from
        	picreturn=GetParameter(paramstring[1],'pic'); // get parameters
        	objLink2='assets/modules/epg2/image.php?type=pic_large&id='+picreturn; // new objLink for fullsize image
        
        // Note that original objLink variable is untouched. This var contains other attributes.
        


        Then also change

        imgPreload.onload=function(){
        		objImage.src = objLink2;


        And near the bottom of the function (not sure if this is necessary though).
        imgPreload.src = objLink2;


        And one more thing: change the lightbox file path directories inside lightbox.js
        var loadingImage = 'assets/modules/epg2/lightbox/loading.gif';		
        var closeButton = 'assets/modules/epg2/lightbox/close.gif';	


        Hopefully I didn’t miss anything there (though I prob did laugh )
        If that makes any sense to anyone, well good luck. smiley
          • 4095
          • 372 Posts
          Quote from: Braininator at Mar 03, 2006, 09:06 PM

          Okay, to everyone who’s asking about my lightbox implementation. Firstly I wish I could get a demo URL up to show. I’m only running this on a test server at home. If anyone has a spare modx installation running that they can give access to, well maybe.

          [snip]

          Hopefully I didn’t miss anything there (though I prob did laugh )
          If that makes any sense to anyone, well good luck. smiley

          I would be more than happy to provide a demo, however not being a programmer the brief instructions are a little to vague for me smiley I need more of a "replace this code with this" or "add this after these lines", otherwise I make assumptions about what I’m supposed to edit and really @%&! things up.
            [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
            Admin Sandbox Login: sandbox Password: castle
            • 3984
            • 22 Posts
            ScottyDelicious has kindly offered to provide me with some testing space on his server, due to my lack of database access on my current webspace. When this is done I will upload a demo to that place.

            I’m still trying to perfect the lightbox implementation, as there are some IE specific issues which most people miss in their implementations. Hopefully things should be ready soon.
              • 29774
              • 386 Posts
              It sometimes helps to set the wmode of your Flash movie to ’transparent’ in the object and embed code for the swf. Then divs that float above the Flash movie should appear above it. Note that setting the wmode can cause earlier versions of Firefox/Mozilla-derived browsers to be a bit flaky, so you should do some testing. Incidently, there is a very good technique for embedding Flash into your page without compromising accessibility and standards compliance: see http://blog.deconcept.com/flashobject/.
                Snippets: GoogleMap | FileDetails | Related Plugin: SSL
                • 9098
                • 1 Posts
                Quote from: therebechips at Mar 16, 2006, 04:58 AM

                It sometimes helps to set the wmode of your Flash movie to ’transparent’ in the object and embed code for the swf. Then divs that float above the Flash movie should appear above it. Note that setting the wmode can cause earlier versions of Firefox/Mozilla-derived browsers to be a bit flaky, so you should do some testing. Incidently, there is a very good technique for embedding Flash into your page without compromising accessibility and standards compliance: see http://blog.deconcept.com/flashobject/.

                Great therebechips, Thank you smiley
                  • 31837
                  • 59 Posts
                  Hi guys and gals,

                  I just had a play with lightbox, and it was driving me crazy. It would would in IE, Opera, but not Mozilla.

                  Then, after reading somewhere that maybe there was a feature or a bit of code that code have been messing it up.

                  After further investigation, I discovered that the when you are logged in, the quickedit toolbar prevents lightbox from functioning properly.

                  Disable the quickedit toolbar, and then it should work.

                  Cheers,
                  Steve.