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.


Andy...um...I'm quite new to PHP==beginner to intermediate

 
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 -> Drop Shadowed Thumbnail Creator
View previous topic :: View next topic  
Author Message
NikaRasmussenWelling
Newbie


Joined: 14 Jul 2006
Posts: 5
Location: Lutselk'e, Northwest Territories, Canada

PostPosted: Fri Jul 14, 2006 8:30 am    Post subject: Andy...um...I'm quite new to PHP==beginner to intermediate Reply with quote

Oi,

To a lot of people, this will be a stupid question, however, I need clarification regarding the function setShadowPath as follows:


Quote:
function setShadowPath($path = '.')
{
$this->_shadowPath = realpath($path);
if ($this->_shadowPath[strlen($this->_shadowPath)-1] != '/') $this->_shadowPath .= '/';
}


Now, I created a directory as per your script called 'gallery' and have uploaded some *jpg's into that directory. Embarassed Is the directory 'gallery' the
Quote:
_shadowPath
? From reading the code,
Quote:
_shadowPath
and
Quote:
realpath($path)
are synonomous, yes?

Please let me know as I'm a bit flummoxed due to my limited PHP programming experience. Sad

Thank you.

Nika
Back to top
View user's profile Send private message Send e-mail
amnuts
Site Admin


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

PostPosted: Fri Jul 14, 2006 10:50 am    Post subject: Reply with quote

Hi Nika, and welcome to the board!

The _shadowPath variable is the path where you have the collection of images that comprise the drop-shadow, not where your photos you want resizing are, which I'm guessing is what's in gallery.

The realpath() function simply gets the absolute path from whatever you pass it. So assuming your root directory it '/home/nika/' and you passed it '../foo/../nika/./gallery' then the path will be '/home/nika/gallery/'.

You shouldn't need to set the _shadowPath variable manually as it's done via the setShadowPath() method.

So, assuming you had '/home/nika/' and your class files where in there, I'd set up a 'shadows' directory and a 'gallery' directory. 'shadows' would obviously contain your shadow images (like the size found on my website) and 'gallery' would have your photos.

You'd then use $obj->setShadowPath('./shadows/'); (with $obj being whatever you called the variable you instantiated the class to).

Does that help?

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


Joined: 14 Jul 2006
Posts: 5
Location: Lutselk'e, Northwest Territories, Canada

PostPosted: Fri Jul 14, 2006 3:15 pm    Post subject: re: Beginner PHP programa de computador... Reply with quote

Hei Andy,

Quote:
Does that help?


I think so. I will have to analyse your reply as my english is not very good. So, if I understand, I need another directory as an 'image bucket' or something, yes? The processed images? That is where I am wrong because I only have the one directory, the images yet to be processed, i.e., the code is not exicuting. This is what is happening, and it's quite embarassing actually. I have my page on a timer to redirect elsewhere until I fix this problem. Embarassed

Thank you for your thorough discription.

Nika
Back to top
View user's profile Send private message Send e-mail
NikaRasmussenWelling
Newbie


Joined: 14 Jul 2006
Posts: 5
Location: Lutselk'e, Northwest Territories, Canada

PostPosted: Sat Jul 15, 2006 3:52 pm    Post subject: Reply with quote

amnuts wrote:
Hi Nika, and welcome to the board!

The _shadowPath variable is the path where you have the collection of images that comprise the drop-shadow, not where your photos you want resizing are, which I'm guessing is what's in gallery.

The realpath() function simply gets the absolute path from whatever you pass it. So assuming your root directory it '/home/nika/' and you passed it '../foo/../nika/./gallery' then the path will be '/home/nika/gallery/'.

You shouldn't need to set the _shadowPath variable manually as it's done via the setShadowPath() method.

So, assuming you had '/home/nika/' and your class files where in there, I'd set up a 'shadows' directory and a 'gallery' directory. 'shadows' would obviously contain your shadow images (like the size found on my website) and 'gallery' would have your photos.

You'd then use $obj->setShadowPath('./shadows/'); (with $obj being whatever you called the variable you instantiated the class to).

Does that help?

Andy


Oi,

Andy, I am going nuts.... Very Happy [no pun intended]

OK, here's an update of what I am 'trying to do'

1. I named _setShadowPath as:

Quote:
function setShadowPath($path = '/shadow/')
{
$this->_shadowPath = realpath($path);
if ($this->_shadowPath[strlen($this->_shadowPath)-1] != '/') $this->_shadowPath .= '/';
}


2. This is probably way wrong, but I passed an image through as a variable to called here (?):

Quote:
function loadImage($filename= 'JTPO.jpg', $forceext = 'png')
{
if (!@file_exists($filename))
{
$this->_debug('loadImage', "The supplied file name '$filename' does not point to an existing file.");
return FALSE;
}


3. I am presuming I need to pass a file name here? (remember estou not an expert PHP programmer. I ask because $filename is not a global variable as I tenho tido mentioned in 4 below. Sad

Quote:
function _getExtension($filename ='<filename.jpg>')
{
$ext = strtolower(substr($filename, (strrpos($filename, '.') ? strrpos($filename, '.') + 1 : strlen($filename)), strlen($filename)));
if ($ext == 'jpg') $ext = 'jpeg';
return $ext;
}


4. Since $filename is not a global variable, do I need to have the actual string passed through every function? Or can I just make the filename a global variable before 'class dropShadow' I was muito tempted a do so. i.e.,

Quote:
class dropShadow
{
var $_imgOrig; // the original image
var $_imgFinal; // the final image, resized
var $_imgShadow; // the final image with a drop shadow, if applied
var $_shadows; // the dropshadow image array
var $_shadowPath; // the path to the dropshadow images
var $_showDebug; // debugging on/off (TRUE/FALSE)
var $filename='gallery/JTPO.jpg' //the name of file being passed as a variable for $filename
(???)

5. está um outro questão, do I need a have um outro mirror php file a which I post? Este é um outro questão tenho sido regarding how to display the shadowed imagems.

I wrote este rápido because I am in a rush estar to an event. I apologise.

Obrigado,

Nika...
Back to top
View user's profile Send private message Send e-mail
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 -> Drop Shadowed Thumbnail Creator 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