PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |

Go Back   PhotoPost Community > PhotoPost Support > PhotoPost Classifieds Support > Classifieds Bug Reports

Classifieds Bug Reports Post any problems you may be having with Classifieds here.

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old September 30th, 2005, 04:32 AM   #1 (permalink)
Member
Verified Customer
 
Join Date: Dec 2002
Location: Norway
Posts: 118
Advice please.

I have a modified version of classified that I am running as a photo record database (three images per record.) Users upload their images to one category and then an administrator moves the record to the most suitable category (there are lots.) Using Classified in this way has produced a bug which I can’t seem to fix. If a user uploads two images with the same name to the same category, the second image is refused and a warning message about duplicate images is displayed (No problem there.) But the bug occurred if they upload an image and Admin move it into the correct category, if they then upload a second image named the same and admin also move it into the same category (with the first image,) the first recorded images are over writen and the database entry becomes corrupted.

This is my understanding on how this works.
Each image is renamed with the user-number added to the front of the image name (e.g. user 666 uploads image.jpg that is renamed 666image.jpg.) These files are stored in a directory named by the category-number within the data directory. When you move a record from one category to another, the images are moved from one category directory to another… overwriting any files with the same file name.

I need to fix this and can see two avenues to pursue.
1) Each image needs to be uploaded with a unique name, perhaps utilising the date Function time(). So the image.jpg uploaded by user 666 would be renamed 666958950466image.jpg.
I would have thought this would’ve been quite easy to achieve, but three hours in, I am loosing too much hair to keep trying.
2) So how about utilising a function already available? When a record is moved from one category to another, a check is done for existing files named the same, before the move is implemented. Here is the function move_image() in the pp-inc.php.

Code:
Content visible to verified customers only.
In uploadproduct.php this script handles the duplicate image check;

Code:
Content visible to verified customers only.
Is it possible to adjust the first script to check for existing files before overwriting them?

Please could you advise which avenue I should pursue and if anyone has already fixed this please advice.

Last edited by garybrun; September 30th, 2005 at 04:35 AM.
garybrun is offline   Reply With Quote
Old September 30th, 2005, 12:28 PM   #2 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,680
Well the uploadpage properly renames an image.

The uploadproduct renames images so you would never have an image of the same name uploaded as the file is renamed on upload so why would the move image function need to be modified?

If I am following here
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old September 30th, 2005, 02:29 PM   #3 (permalink)
Member
Verified Customer
 
Join Date: Dec 2002
Location: Norway
Posts: 118
Maybe this has changed on the later versions of classified... I will upgrade my instalation and see if it has.
garybrun is offline   Reply With Quote
Old September 30th, 2005, 03:24 PM   #4 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,680
No problem I am just trying to understand why if on uploadproduct the image is renamed

02image.jpg

would become

02image1.jpg

why you would ever have an issue with moving the files and it overwriting other files
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old September 30th, 2005, 04:18 PM   #5 (permalink)
Member
Verified Customer
 
Join Date: Dec 2002
Location: Norway
Posts: 118
On my installation this is what is happening.

We only allow users to upload to one category called “Records awaiting validation.”
Admin then moves these records to the most apt category e.g. “Ford cars models 1980 to 1985.”

We had a problem with a user who always calls his image the same “scan.jpg.”
The first record was uploaded to the “Records awaiting validation” category and then after admin checked for errors moved it to the “Ford cars models 1980 to 1985” category. The image files were named 61scan.jpg, 61scan-thumb.jpg and 61scan-large.jpg.

A week later the same user uploaded a new record with the same image named “scan.jpg” to the “Records awaiting validation” category. There wasn't a problem with duplicate images as the previous record had been moved, so the files generated were files named 61scan.jpg, 61scan-thumb.jpg and 61scan-large.jpg.
When the new record was moved to the “Ford cars models 1980 to 1985” category (after admin had validated it,) its images over wrote the previous images that were named the same.
garybrun is offline   Reply With Quote
Old September 30th, 2005, 06:39 PM   #6 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 71,680
Well there is the issue then

In uploadproduct.php remove the code in bold for this line

$querya = "SELECT id FROM {$Globals['pp_db_prefix']}products WHERE userid={$User['userid']} AND cat=$category AND bigimage='$irealname'";
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old October 1st, 2005, 02:33 AM   #7 (permalink)
Member
Verified Customer
 
Join Date: Dec 2002
Location: Norway
Posts: 118
That's great and it works brilliantly!!! A lot better solution than what I was trying
Thanks omegatron
garybrun is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
changing BBS need advice Doh Photopost Pro Installation & Upgrades 3 October 21st, 2005 10:29 AM
layout advice.. jamzz ReviewPost Installation & Upgrades 1 September 27th, 2005 04:04 PM
Advice Please about search Engines with Classifieds pilot Classifieds Installation & Upgrades 20 April 24th, 2005 04:21 PM
Result: Table 'forum1.forum1members' doesn't exist any advice ? LittleBrother ReviewPost Installation & Upgrades 3 June 29th, 2004 09:23 PM


All times are GMT -5. The time now is 07:55 AM.

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