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.


implement problems
Goto page Previous  1, 2
 
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
ijasont
Newbie


Joined: 18 Jun 2004
Posts: 12

PostPosted: Fri Jun 18, 2004 7:04 pm    Post subject: Reply with quote

hmm I guess I don't know how to translate that into the code that already exsists.

I am passing this to the ci functions:
Code:

//$img path will soon be dynamic
 $img = '/img/loot/drum.jpg';
 $source = $DOCUMENT_ROOT . $img;
$ci->loadInterface($source);


so $source turns into $filename
The line that is showing the full string that I am trying to avoid is line 224 in the ci file.
Code:
      self.location.href = '{$_SERVER['PHP_SELF']}?file={$this->file}&sx=' +

So I guess I just need a way to not show the full string here as this is the only spot that it shows.
Back to top
View user's profile Send private message Visit poster's website
amnuts
Site Admin


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

PostPosted: Tue Jun 22, 2004 5:37 am    Post subject: Reply with quote

Oops.. Thought I had replied to this one already!

Code:
        echo <<< EOT
<script type="text/javascript">
<!--

    SET_DHTML($params);

    dd.elements.theCrop.moveTo(dd.elements.theImage.x, dd.elements.theImage.y);
    dd.elements.theCrop.setZ(dd.elements.theImage.z+1);
    dd.elements.theImage.addChild("theCrop");
    dd.elements.theCrop.defx = dd.elements.theImage.x;

    function my_DragFunc()
    {
        dd.elements.theCrop.maxoffr = dd.elements.theImage.w - dd.elements.theCrop.w;
        dd.elements.theCrop.maxoffb = dd.elements.theImage.h - dd.elements.theCrop.h;
        dd.elements.theCrop.maxw    = {$this->img['sizes'][0]};
        dd.elements.theCrop.maxh    = {$this->img['sizes'][1]};
    }

    function my_ResizeFunc()
    {
        dd.elements.theCrop.maxw = (dd.elements.theImage.w + dd.elements.theImage.x) - dd.elements.theCrop.x;
        dd.elements.theCrop.maxh = (dd.elements.theImage.h + dd.elements.theImage.y) - dd.elements.theCrop.y;
    }
   
    function my_Submit()
    {
EOT;
        echo "        self.location.href = '{$_SERVER['PHP_SELF']}?file=", basename($this->file), "&sx=' + ";
        echo <<<EOT
            (dd.elements.theCrop.x - dd.elements.theImage.x) + '&sy=' +
            (dd.elements.theCrop.y - dd.elements.theImage.y) + '&ex=' +
            ((dd.elements.theCrop.x - dd.elements.theImage.x) + dd.elements.theCrop.w) + '&ey=' +
            ((dd.elements.theCrop.y - dd.elements.theImage.y) + dd.elements.theCrop.h);
    }
   
    function my_SetResizingType(proportional)
    {
        if (proportional)
        {
            dd.elements.theCrop.scalable  = 1;
            dd.elements.theCrop.resizable = 0;
        }
        else
        {
            dd.elements.theCrop.scalable  = 0;
            dd.elements.theCrop.resizable = 1;
        }
    }
   
//-->
</script>
EOT;


Then make up your filename as I previously mentioned.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
ijasont
Newbie


Joined: 18 Jun 2004
Posts: 12

PostPosted: Tue Jun 22, 2004 8:40 pm    Post subject: Reply with quote

got errors when I copied that over. Just to be sure, I place/replace all that code under line 197 which is this:
Code:
   line195   function loadJavaScript()
line 196 {
line 197 $params = '"theCrop"+MAXOFFLEFT+0+MAXOFFRIGHT+' . $this->img['sizes'][0] . '+MAXOFFTOP+0+MAXOFFBOTTOM+' . $this->img['sizes'][1] . ($this->crop['resize'] ? '+RESIZABLE' : '') . '+MAXWIDTH+' . $this->img['sizes'][0] . '+MAXHEIGHT+' . $this->img['sizes'][1] . '+MINHEIGHT+' . $this->crop['min-height'] . '+MINWIDTH+' . $this->crop['min-width'] . ',"theImage"+NO_DRAG';
Line 198      echo <<< EOT 


when I replace all the code under here I get:
Code:
Parse error: parse error in /home/username/public_html/admin/12crop/class.cropinterface.php on line 252

Fatal error: Cannot instantiate non-existent class: cropinterface in /home/username/public_html/admin/12crop/test2.php on line 3
Back to top
View user's profile Send private message Visit poster's website
amnuts
Site Admin


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

PostPosted: Wed Jun 23, 2004 2:55 am    Post subject: Reply with quote

After each of these

echo <<< EOT

make sure there is NO whitespace - just the newline - after the 'EOT'.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
ijasont
Newbie


Joined: 18 Jun 2004
Posts: 12

PostPosted: Wed Jun 23, 2004 4:51 pm    Post subject: Reply with quote

yeah I did that. I have no idea why this isn't working. Ony thing I noticed what that in my color coding of the text is that the ?> at the end of the document is not Red like it should be. So clearly I have a syntax error somewhere I just cannot find where.

I removed all whitespace etc. Who knows.

----
UPDATE:
I needed to to this after the last EOT:
Code:

EOT;
}
}
?>


I can load the page now, but looks like I have an error in the JS but that is probably do to my path of the img or something.
Back to top
View user's profile Send private message Visit poster's website
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
Goto page Previous  1, 2
Page 2 of 2

 
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