Support Forums

location of thumbs and photos

This is a discussion on location of thumbs and photos within the Customizations forums, part of the Developer Forums category; I have two sites installed. The main site is installed in the root of my hosting account. The second site ...


Go Back   68 Classifieds Forums > Developer Forums > Customizations

Reply
 
Thread Tools Display Modes
Old 01-31-2010, 07:35 PM   #1
Customer
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 241
Rep Power: 16
MrGForce is on a distinguished road
Default location of thumbs and photos

I have two sites installed. The main site is installed in the root of my hosting account. The second site is installed in a directory within the main site. I did this as I wanted a different look for the second site, but wanted to use the same database that the first one uses. Everything works great EXCEPT for the photos and thumbnail images.

Does anyone know how to hardcode the path to the main photos and thumbs directory into the second install so that it puts those images into the main sites photos and thumbs directories?

I think it would be in the .... includes\classes\images\class_upload.php file. That file writes a temp file first and then moves the file to the destination. .....

// Move the file to the given location
function moveFile($source, $destination) {
$this->debug("<b>Moving the file to the destination</b><br/>");
// Check if you have write permissions
$this->debug("Checking permissions<br/>");
if (is_writeable($this->path)) {
if (move_uploaded_file($source, $destination)) {
// Change file permissions
@chmod($destination, 0644);
// Add filename to array with done files
$this->done[] = $destination;
$this->debug("file moved to <font color=\"#000099\"><b>".$destination."</b></font><br/>");
} else {
// Give an error if no write permissions
$this->error('writePerm', $destination);
}
} else {
// Give an error if no write permissions
$this->error('writePerm', $destination);
}
}

-----------------------------------------------------------

Would anyone know how to hardcode the $destination into the code above, or know where to change the "$path" to the photos and thumbs directory for the second install so it uses those directories to save it's files in? Your help would be greatly appreciated.

Thanks you.
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template

Last edited by MrGForce; 02-03-2010 at 07:48 AM.
MrGForce is offline   Reply With Quote
Old 02-03-2010, 09:41 AM   #2
Customer
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 241
Rep Power: 16
MrGForce is on a distinguished road
Default

I updated original post.

Thanks.
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline   Reply With Quote
Old 02-03-2010, 09:46 AM   #3
curmudgeon
 
Join Date: Mar 2006
Posts: 5,416
Rep Power: 139
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Have you scanned the code to see what the variable $destination is defined? I would think you could just hard code that in the second site.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 02-03-2010, 09:58 AM   #4
Customer
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 241
Rep Power: 16
MrGForce is on a distinguished road
Default

The only place I can find the var $destination is in that one file. I have not tried replacing that variable with the actual address to the original photos and thumbs directories. Not quite sure how you'd that that.
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline   Reply With Quote
Old 02-08-2010, 08:52 AM   #5
Customer
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 241
Rep Power: 16
MrGForce is on a distinguished road
Default

Still need help with this ....

I know how to use the {debug} command in the layout.tpl to show the info as you're going through the site, HOWEVER, when the program is uploading and saving the images, this debug command has no effect. Does anyone know how to debug just a file such as the one I mentioned in my first post ....

includes\classes\images\class_upload.php

that way I may be able to tell what the $destination variable is actually assigned to.

Any help would be greatly appreciated.

Thanks.
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline   Reply With Quote
Old 02-08-2010, 10:20 AM   #6
curmudgeon
 
Join Date: Mar 2006
Posts: 5,416
Rep Power: 139
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

At the top of the class_upload.php file where all the other variables are defined you can probably override the value and just set a new one....

$destination = "/path/to/my/thumbs/";

it may take some experimentation to get the path right.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 02-08-2010, 10:45 AM   #7
Customer
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 241
Rep Power: 16
MrGForce is on a distinguished road
Default

Thanks Larry, I'll try that.

But just an update to what I've just tried that also didn't work.

I went right to the guys site who wrote the PHP Upload module that 68C is using. They told me thru an online chat to simply indicate the path to the photos and thumbs directory right there in the file I am uploading from, which, in my case, is the step5.php file located in the .... includes/core/checkout directory. they said the variables would be ....

$ppu->path = "photos";
$sip->pathThumb = "thumbs";

so I set them using the actual directory scheme for my site, right from the root, which is /home at my hostgator shared hosting, and it still did not work, so I did the debug thing and found out that the variables, $ppu and $sip were not being picked up or indicated in the debug screen, so those variables aren't being used.

I'll try your idea and let you know. Thanks again as always for your help Larry. I really appreciate it.




.
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline   Reply With Quote
Old 02-08-2010, 10:50 AM   #8
curmudgeon
 
Join Date: Mar 2006
Posts: 5,416
Rep Power: 139
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

debug only shows smarty variables. What you are dealing with here are php variables.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 02-08-2010, 11:01 AM   #9
All Hands On Deck
 
seymourjames's Avatar
 
Join Date: Mar 2008
Posts: 3,527
Rep Power: 89
seymourjames is a jewel in the rough
Default

I may be wrong but with hostgator is it not public_html/
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C
seymourjames is offline   Reply With Quote
Old 02-08-2010, 01:52 PM   #10
Customer
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 241
Rep Power: 16
MrGForce is on a distinguished road
Default

Hey Guys;

Thanks for all your suggestions. But nothing seems to work. It just won't accept any other path than the ones intended.

And just to show that I am trying, I even went back to the folks who actually wrote the module "Pure PHP File UPload", which is the file 68C calls .... class_upload.php ...., and this time I chatted with the person who actually wrote the code, George Petrov, and was told by him that I should go to the folks I bought my program from for help, as they only help their Dreamweaver Extensions, and ended the chat.

And David, Hostgators directory structure, at least in my case, was said to be .... /home/mrgforce/public_html ....... even though all you see is the public_html when you ftp into your site.

Thanks again guys for all your help. If I finally figure it out, I'll post what I did.



.
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
photos oteenc Pre Sales Questions 2 07-31-2008 07:15 PM


All times are GMT -4. The time now is 07:02 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0