View previous topic :: View next topic |
Author |
Message |
leifg Newbie
Joined: 07 Jan 2007 Posts: 3
|
Posted: Sun Jan 07, 2007 2:55 pm Post subject: putting cropcanvas in a seperate directory |
|
|
hello everyone,
I get problems when I put all the files provided by cropcanvas in a different directory as the file where I want to use it.
Example
Code: | |
-- cropcanvas
| +-- class.cropcanvas.php
| +-- class.cropinterface.php
| +-- inc.cropinterface.php
| +-- inc.cropimage.php
| +-- inc.cropjavascript.php
| +-- wz_dragdrop.js
-- test.cropinterface.php
|
when I now execute test.cropinterface.php the image is not displayed. When I take a look in the HTML Source the image src looks something like this:
(<img src="inc.cropimage.php?f=fotos/tmp/picture.jpg&s=625x500">)
but this won't work because inc.cropimage.php is not in the same directory as test.cropinterface.php.
I looked over several entries in this forum, but was not able to find a solution (especially because the provided lines which are to edit are not present in my version of cropcanvas)
I already went over these entries:
http://php.amnuts.com/forums/viewtopic.php?t=316
http://php.amnuts.com/forums/viewtopic.php?t=129
so can please someone provide me a step to step guide to solve this problem?
thanks
Leif |
|
Back to top |
|
 |
amnuts Site Admin

Joined: 01 Sep 2002 Posts: 662 Location: East Sussex, England
|
Posted: Mon Jan 08, 2007 3:35 pm Post subject: |
|
|
Hi, and welcome to the board!
Make these changes and it should pretty much work:
inc.cropinterface.php line 142
Change:
Code: | <script type="text/javascript" src="wz_dragdrop.js"></script> |
to be:
Code: | <script type="text/javascript" src="/your/web/path/to/wz_dragdrop.js"></script> |
(Needless to say, changing the '/your/web/path/to' to your actual web path to the javascript file!)
inc.cropinterface.php line 336
Change:
Code: | ? "inc.cropimage.php?f={$this->file}&s={$this->crop['max-display'][0]}" |
to be:
Code: | ? "/your/web/path/to/inc.cropimage.php?f={$this->file}&s={$this->crop['max-display'][0]}" |
There are a couple things you could do to make it more generic and not have a fixed path. For example, instead of '/your/web/path/to/' you could use:
Code: | str_replace($_SERVER['DOCUMENT_ROOT'], '', dirname(__FILE__).'/') |
Andy |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|