Dec 04, 2008, 12:27 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Search via SMF or Google: modx forums all of modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
Pages: [1] 2   Go Down
  Print  
Author Topic: [Snippet] Lightbox JS combined with phpThumb  (Read 10073 times)
0 Members and 1 Guest are viewing this topic.
Kunal Kapoor
Full Member
***
Posts: 145


Effective, Functional, Standards Compliant


WWW
« on: Mar 02, 2006, 08:04 AM »

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.

* readme.txt (4.93 KB - downloaded 680 times.)
* lighbox_js_and_phpthumb.zip (146.16 KB - downloaded 897 times.)
« Last Edit: Mar 02, 2006, 08:54 AM by Kunal Kapoor » Logged

Kunal Kapoor
Technical Director
Limesharp Internet Limited - Effective, Functional, Standards Compliant

IRC Nick: KingKoopa
Skype ID: KingKoopa16
Robsta
Full Member
***
Posts: 117


WWW
« Reply #1 on: Mar 02, 2006, 08:23 AM »

Kewl  Grin

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

Code:
« 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
« Last Edit: Mar 02, 2006, 08:24 AM by Robsta » Logged

Visit CubeCartForums.org to talk serious ecommerce!
Spot the biggest mistake in business... "Backups? I'm far too busy to take backups!"
www.inspired-solutions.net
Kunal Kapoor
Full Member
***
Posts: 145


Effective, Functional, Standards Compliant


WWW
« Reply #2 on: Mar 02, 2006, 08:30 AM »

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.
Logged

Kunal Kapoor
Technical Director
Limesharp Internet Limited - Effective, Functional, Standards Compliant

IRC Nick: KingKoopa
Skype ID: KingKoopa16
Djamoer
Testers
*
Posts: 1,492

No one can limit a man other than the man himself.


WWW
« Reply #3 on: Mar 02, 2006, 08:46 AM »

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.
Logged

Kunal Kapoor
Full Member
***
Posts: 145


Effective, Functional, Standards Compliant


WWW
« Reply #4 on: Mar 02, 2006, 08:49 AM »

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.
Logged

Kunal Kapoor
Technical Director
Limesharp Internet Limited - Effective, Functional, Standards Compliant

IRC Nick: KingKoopa
Skype ID: KingKoopa16
Djamoer
Testers
*
Posts: 1,492

No one can limit a man other than the man himself.


WWW
« Reply #5 on: Mar 02, 2006, 09:00 AM »

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.
Logged

Kunal Kapoor
Full Member
***
Posts: 145


Effective, Functional, Standards Compliant


WWW
« Reply #6 on: 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.
Logged

Kunal Kapoor
Technical Director
Limesharp Internet Limited - Effective, Functional, Standards Compliant

IRC Nick: KingKoopa
Skype ID: KingKoopa16
Dr. Scotty Delicious
Coding Team
*
Posts: 1,172


Dr. of Fine Pirate Arts


WWW
« Reply #7 on: 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 "[[lightboxImage? &width=`100` &height=`100`]]" 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:

Quote
    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
Logged

We pillage, we plunder, we rifle and loot. Drink up me 'earties, Yo Ho!
We kidnap and ravage and don't give a hoot. Drink up me 'earties, Yo Ho!
Yo Ho, Yo Ho! A pirate's life for me.
Briggsy
Sr. Member
****
Posts: 372



WWW
« Reply #8 on: Mar 02, 2006, 02:33 PM »

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 Smiley
Logged

Emergency Management Academy of New Zealand
      http://www.emanz.ac.nz

MODx Sandbox   Login: sandbox  Password: castle

Admin Sandbox   Login: sandbox  Password: castle
Kunal Kapoor
Full Member
***
Posts: 145


Effective, Functional, Standards Compliant


WWW
« Reply #9 on: Mar 02, 2006, 03:03 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 "[[lightboxImage? &width=`100` &height=`100`]]" 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:

Quote
    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 [[lightboxImage]] 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.

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 Smiley

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

Kunal Kapoor
Technical Director
Limesharp Internet Limited - Effective, Functional, Standards Compliant

IRC Nick: KingKoopa
Skype ID: KingKoopa16
xeres
Full Member
***
Posts: 171


« Reply #10 on: Mar 02, 2006, 04:02 PM »

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

Thanks for this nice snippet and your great showcase however this is not the exactly the same on my own test Wink
I follow your very detailed instruction but I have a strange error:

Code:
"/home/local/apache/htdocs/home/local/apache/htdocs/assets/images/test.jpg" does not exist

 This is exactly the error output with 2 /home/etc whereas it should be just /assets/images/test.jpg
Any ideas?
Logged
Kunal Kapoor
Full Member
***
Posts: 145


Effective, Functional, Standards Compliant


WWW
« Reply #11 on: Mar 02, 2006, 04:07 PM »

Hmmm...

If you go to Administration -> System Configuration -> Interface & Editor Settings, what values do you have for Resource Path and Resource URL?

Also, under Administration -> System Configuration -> Miscellaneous, what is set for Rewrite Image Paths?

I would suggest /assets/ for Resource URL, and No for Rewrite Image Paths.
Logged

Kunal Kapoor
Technical Director
Limesharp Internet Limited - Effective, Functional, Standards Compliant

IRC Nick: KingKoopa
Skype ID: KingKoopa16
xeres
Full Member
***
Posts: 171


« Reply #12 on: Mar 02, 2006, 04:35 PM »

For ressources path, I have the complete path from the root of my server and for url I have just /assets/ like you
I put "no" for image path without any success.
Logged
Kunal Kapoor
Full Member
***
Posts: 145


Effective, Functional, Standards Compliant


WWW
« Reply #13 on: Mar 02, 2006, 05:01 PM »

Xeres,

You seem to have a duplication in your path to your image:

/home/local/apache/htdocs/ seems to be repeated twice at the beginning of your path. Do images normally work when you insert them into your Document Content via FCKEditor?
Logged

Kunal Kapoor
Technical Director
Limesharp Internet Limited - Effective, Functional, Standards Compliant

IRC Nick: KingKoopa
Skype ID: KingKoopa16
xeres
Full Member
***
Posts: 171


« Reply #14 on: Mar 02, 2006, 05:17 PM »

Yes I see that and that's why I posted here  Wink, read my previous post
Quote
This is exactly the error output with 2 /home/etc whereas it should be just /assets/images/test.jpg
May be it wasn't very clear, I am agree. I don't understand why it adds the path to server root, moreover, this is the wrong path, mine looks like that /opt3/local/apache/htdocs/sites/m/mydomain

Everithing works fine with fck.
It doesn't matter but it's surprising, it was just a test, Thanks for your help.
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF 1.1.4 | SMF © 2005, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!