• [Snippet] Lightbox JS combined with phpThumb#

  • kingkoopa Reply #1, 6 years, 2 months ago

    Reply
    I've combined Lightbox JS with phpThumb. You can see a working example on the product pages at this URL: http://www.limehost.net/
    Please read the attached readme.txt before installing. One core file gets replaced, but don't worry it's just bug fixes found on this post.

    This only works if MODx is in your root directory. All paths are /assets/, etc. I will sort this in a later version.

    You must make sure /assets/snippets/phpThumb/cache/ is writeable too.


  • Robsta Reply #2, 6 years, 2 months ago

    Reply
    Kewl 
    Just found a bug on the demo site, try removing a product from the shopping cart. Parse error results.

    « Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?action=delete ) AND (sc.privateweb=0) LIMIT 1' at line 4 »
    SQL: SELECT sc.parent FROM `web18_modx`.modx_site_content sc LEFT JOIN `web18_modx`.modx_document_groups dg on dg.document = sc.id WHERE (sc.id=8?action=delete ) AND (sc.privateweb=0) LIMIT 1 


  • kingkoopa Reply #3, 6 years, 2 months ago

    Reply
    Thanks Robsta,

    That was a slight issue that I forgot to fix on that script. Luckily I sorted that before it went live for a customer.


  • wendy Reply #4, 6 years, 2 months ago

    Reply
    phpThumb looks really promising, but one thing that concern me though, will it have performance problem? Imagine if a photo album having 3 different sizes of image. SO when the user upload the image, it will be resize to that 3 different sizes and safed on a disk, so later when the visitor visit the photo album, they will directly fetch all images directly from the disk. While in phpThumb case, if 100 visitors visiting the photo album, it needs to use processing power that requires 100 times more than generating a thumbnail first during uploading the picture.

    It's just a thought though, I think resizing the image first will be much better in terms of performance wise. Can we use phpThumb to do that? I mean by using the API to generate the thumbnail.


  • kingkoopa Reply #5, 6 years, 2 months ago

    Reply
    It stores a cache if that's what you mean?

    When phpThumb first resizes an image, it caches it in /assets/snippets/phpThumb/cache/. Any subsequent calls from phpThumb to that image, it calls the cached file instead. Is that what you mean Wendy?

    Oh, by the way, I forgot to mention: you must make sure that /assets/snippets/phpThumb/cache/ is writeable.


  • wendy Reply #6, 6 years, 2 months ago

    Reply
    Hey Kunal, that will solve the problem of course. If that's what phpThumb do, then it will works just fine. Thanks for telling me that, and pardon me for commenting out the system without knowing the full features that this thing offer.


  • kingkoopa Reply #7, 6 years, 2 months ago

    Reply
    No worries Wendy. I hope that someone would find this useful. I've used it on two sites so far without any issues. phpThumb does all sorts from watermarking, to cropping, and even blurring images. I need to expand my snippet to use all of these functions. There's not enough hours in the day I tell you.


  • ScottyDelicious Reply #8, 6 years, 2 months ago

    Reply
    OK, I am a little confused.
    I followed the directions in the post, creating the TV, snippet, and replacing the parser, but I am not sure how to call the image. I put "" in the content of the page, but it gives me a blank page. I tried putting the URL to the image in the "Description" field of the TV, and also the path to the image, because the instructions said:

    Description: This is the image you wish to appear in the Lightbox.

    I love how this works on your site, but I don't think I know enough about how this works yet to get it to work on my site. Any help is appreciated.

    -sD-
    scotty Delicious


  • briggsys Reply #9, 6 years, 2 months ago

    Reply
    Quote from: Kunal at Mar 02, 2006, 09:02 AM
    No worries Wendy. I hope that someone would find this useful. I've used it on two sites so far without any issues. phpThumb does all sorts from watermarking, to cropping, and even blurring images. I need to expand my snippet to use all of these functions. There's not enough hours in the day I tell you.

    FYI, Product 1 on your site doesn't work for me. The screen goes dark, the loading bar comes up and thats it (even left it for 10+ mins in the background)
    http://www.limehost.net/index.php?id=7

    However product 2 works perfectly


  • kingkoopa Reply #10, 6 years, 2 months ago

    Reply
    Quote from: ScottyDelicious at Mar 02, 2006, 02:14 PM
    OK, I am a little confused.
    I followed the directions in the post, creating the TV, snippet, and replacing the parser, but I am not sure how to call the image. I put "" in the content of the page, but it gives me a blank page. I tried putting the URL to the image in the "Description" field of the TV, and also the path to the image, because the instructions said:

    Description: This is the image you wish to appear in the Lightbox.

    I love how this works on your site, but I don't think I know enough about how this works yet to get it to work on my site. Any help is appreciated.

    -sD-
    scotty Delicious

    Sorry... when you have created the TV and assigned it to a template, you then go to edit any document which uses that template. You'll see underneath your Document Content edit box, a Lightbox Image box with an Insert button next to it. Use this to select the image you would like to use. (I then put that snippet call inside my template somewhere. But you can just as well place it in your document content.)

    I hope that makes it clearer. Do let me know.

    Quote from: Briggsy at Mar 02, 2006, 02:33 PM
    Quote from: Kunal at Mar 02, 2006, 09:02 AM
    No worries Wendy. I hope that someone would find this useful. I've used it on two sites so far without any issues. phpThumb does all sorts from watermarking, to cropping, and even blurring images. I need to expand my snippet to use all of these functions. There's not enough hours in the day I tell you.

    FYI, Product 1 on your site doesn't work for me. The screen goes dark, the loading bar comes up and thats it (even left it for 10+ mins in the background)
    http://www.limehost.net/index.php?id=7

    However product 2 works perfectly

    I cannot replicate this. Both products seem to work for me. Does anyone else have that issue?