andy's php projects
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Script and site usage:
All of the scripts on this site are provided free for non-commerical, personal or non-profit use. If you find these scripts useful to you, appreciate the free support, or are just an all round nice person, then why not donate a little dosh? If you wish to use any of these in a commercial system, please refer to the payment plan.


putting cropcanvas in a seperate directory

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Crop Canvas
View previous topic :: View next topic  
Author Message
leifg
Newbie


Joined: 07 Jan 2007
Posts: 3

PostPosted: Sun Jan 07, 2007 2:55 pm    Post subject: putting cropcanvas in a seperate directory Reply with quote

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
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Mon Jan 08, 2007 3:35 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Crop Canvas All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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