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.


scaleable or resizeable

 
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
mmjaeger
Light Poster


Joined: 22 Oct 2004
Posts: 25

PostPosted: Mon Nov 15, 2004 12:29 pm    Post subject: scaleable or resizeable Reply with quote

Hello Andy,

I like to pass either scalable or resizeable in a php variable to the load javascript function. However, I cannot get it to work so far. Could you please tell me how to do this; I guess, it is this part of the script:

($this->crop['resize'] ? '+SCALABLE' : '') . '+MAXWIDTH+'

What would be the proper syntax?

Thank you in advance for your help.
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 Nov 15, 2004 1:00 pm    Post subject: Reply with quote

Correct syntax, just changing the wrong variable and in the wrong place. In the javascript output by the class you'll see a couple lines looking like:

Code:
    dd.elements.theCrop.scalable  = 1;
    dd.elements.theCrop.resizable = 0;


Swap the 0 and 1 if you want resizeable and not scalable on load.

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


Joined: 22 Oct 2004
Posts: 25

PostPosted: Mon Nov 15, 2004 1:24 pm    Post subject: passing variable Reply with quote

That was quick - thank for getting back to me.

However, I still don't see how I could pass either "scalable" or "sizable" to the crop class through the url like &ratio=scalable.

thanks again for your input
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 Nov 15, 2004 2:51 pm    Post subject: Reply with quote

Ah, okay, gotchya! Smile

Check out this thread:

http://php.amnuts.com/forums/viewtopic.php?t=167

Should help you out!

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


Joined: 22 Oct 2004
Posts: 25

PostPosted: Tue Nov 16, 2004 2:32 am    Post subject: where do I go now? Reply with quote

Hello Andy,

This is what I have so for in the interface file:

/**
* @return void
* @param int $r
* @desc Sets the initial state of the cropping area (0 or 1 for any dimension or proportional).
* If this is not specifically set, then the cropping size will set to scalable.
*/
function setParam($r=1) {
$this->param['ratio'] = $r ? 0 : 1;
}



This is what I have in the load interface file:

<?php

if ($mw > 0 || $mh >0) { // if width and height of cropping area are set
$ci->setCropDefaultSize($mw,$mh);
};
// $ci->setResizing(false); // allow resizing of cropping area
$ci->setParam($r);
$ci->loadInterface($s);
$ci->loadJavaScript();
?>

I guess, I'm a little stupid, but I still don't see where I go from here to tell the script that it should either use scalable or resizable?

Your help is very much appreciated - thank you
Back to top
View user's profile Send private message
mmjaeger
Light Poster


Joined: 22 Oct 2004
Posts: 25

PostPosted: Tue Nov 16, 2004 3:43 am    Post subject: GOT IT Reply with quote

Hello Andy

finally got it to work:

this is what I have:

$params = '"theCrop"+MAXOFFLEFT+0+MAXOFFRIGHT+' . $this->img['sizes'][0] . '+MAXOFFTOP+0+MAXOFFBOTTOM+' . $this->img['sizes'][1] . ($this->crop['resize'] ? '+' . $this->param['ratio'] : '') . '+MAXWIDTH+' . $this->img['sizes'][0] . '+MAXHEIGHT+' . $this->img['sizes'][1] . '+MINHEIGHT+' . $this->crop['min-height'] . '+MINWIDTH+' . $this->crop['min-width'] . ',"theImage"+NO_DRAG';

if you see a better way to do it, please let me know.

Thank you
Back to top
View user's profile Send private message
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