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 Pro Support Forums > Photopost Pro Bug Reports

Photopost Pro Bug Reports Post post installation PhotoPost Pro problems here.

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old November 27th, 2005, 06:42 PM   #1 (permalink)
Member
Verified Customer
 
Join Date: Dec 2002
Posts: 100
Problem with same filenames during moving between categories

Starting from some version of the PP (5.0 ?) there was changed the system of images filenames in the database. And we have the next problem.
For example, there is already file qwerty.jpg in the category ABC. If user trying to upload one more file qwerty.jpg to the same category, his file will get name qwerty1.jpg and will be placed into the same directory.
But if user uploaded one more file qwerty.jpg to the different category, say category DEF, his file will be accepted by system under the original name qwerty.jpg. OK, no problem, both files are in a different directories and there are no any conflicts.
Well, if after that file (page) qwerty.jpg will be moved from the category ABC to the category DEF, we getting a problem. File in the category DEF will be overwritten by file with the name, originally placed into the category ABC. So we have two different pages but with one image file.

That is not a fantasy but real situation. Users often don't care about filenames and simply uses 1.jpg or q.jpg etc.

How to resolve it?
charm is offline   Reply With Quote
Old November 27th, 2005, 07:16 PM   #2 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 66,809
Well don't know what to tell you about already uploaded ones but we can change it for new ones. In uploadphoto.php lines 490-512 delete the code in bold and instead of checking for just the category on upload it will search all and change it to the right name

Code:
Content visible to verified customers only.
__________________
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 November 28th, 2005, 02:39 AM   #3 (permalink)
Member
Verified Customer
 
Join Date: Dec 2002
Posts: 100
Sorry, Chuck, there are no code marked in bold in the above quoting
charm is offline   Reply With Quote
Old November 28th, 2005, 02:46 AM   #4 (permalink)
Member
Verified Customer
 
Crow's Avatar
 
Join Date: Dec 2003
Location: Michigan. USA
Posts: 200
Quote:
Originally Posted by charm
Sorry, Chuck, there are no code marked in bold in the above quoting
cat=$category AND
Crow is offline   Reply With Quote
Old November 28th, 2005, 02:59 AM   #5 (permalink)
Member
Verified Customer
 
Join Date: Dec 2002
Posts: 100
Thank you, I see now
charm is offline   Reply With Quote
Old November 28th, 2005, 04:09 AM   #6 (permalink)
Member
Verified Customer
 
Join Date: Dec 2002
Posts: 100
The problem with existing files can be resolved, if to edit photo and upload the same picture but with new file name.
But in the current version it is impossible. During editing the reuploaded file receives the name of the file that is already in the system.
charm is offline   Reply With Quote
Old November 28th, 2005, 05:05 AM   #7 (permalink)
Member
Verified Customer
 
Join Date: Dec 2002
Posts: 100
I removed code as you recommended but it doesn't help. File name is changed, only if the same file in the uploading category exist. In other cases it remains unrenamed.
charm is offline   Reply With Quote
Old November 28th, 2005, 09:58 AM   #8 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 66,809
You can't upload it as the same name it will not take on editphoto. when uploading a PHOTO again it must always be renamed different. It if is the same it is dropped

As stated the fix I have given is go forward meaning it fixes this issue from here on out. This has been tested thoroughly. If I upload the same picture 4 times to 4 different categories they are renamed accordingly

There is no fix for you moving files with existing ones. Other than to reupload the files with a slightly different name or I can give you a little snippet of code to check for a file the same name and die if it is found

In editphoto.php around line 431

Code:
Content visible to verified customers only.
__________________
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 November 28th, 2005, 11:39 AM   #9 (permalink)
Member
Verified Customer
 
Join Date: Dec 2002
Posts: 100
Look such example.

There was file 1.jpg in one categery:
http://www.zeno.ru/showphoto.php?photo=22732
http://www.zeno.ru/data/1037/medium/1.jpg

Today I uploaded file with the same name 1.jpg into the different category:
http://www.zeno.ru/showphoto.php?photo=23964
http://www.zeno.ru/data/2784/medium/1.jpg

And it didn't renamed.
charm is offline   Reply With Quote
Old November 28th, 2005, 11:58 AM   #10 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 66,809
Then you have not applied this code as I have posted here in post 2

I have uploaded the edited file myself since we just did your upgrade

Go ahead and try it
__________________
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 November 28th, 2005, 03:45 PM   #11 (permalink)
Member
Verified Customer
 
Join Date: Dec 2002
Posts: 100
Just tried:
http://www.zeno.ru/showphoto.php?photo=23969

no changes
charm is offline   Reply With Quote
Old November 28th, 2005, 04:10 PM   #12 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 66,809
works just fine

I uploaded the same image 2 times the filenames are shown right on screen here they are all incremented

http://www.zeno.ru/index.php
__________________
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 November 28th, 2005, 04:24 PM   #13 (permalink)
Member
Verified Customer
 
Join Date: Dec 2002
Posts: 100
So this improvement affects only on a new (later than 29-Nov) files? If we already have file.jpg in the system (uploaded before 29-Nov), and tomorrow will try to upload file.jpg again, it will be not inceremented?
charm is offline   Reply With Quote
Old November 28th, 2005, 04:29 PM   #14 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 66,809
No I did not say that. It works for all new uploads it scans the entire photos table looking for the filename
__________________
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 November 28th, 2005, 04:38 PM   #15 (permalink)
Member
Verified Customer
 
Join Date: Dec 2002
Posts: 100
In that case I don't understand why my last uploads didn't incremented ...
charm is offline   Reply With Quote
Old November 28th, 2005, 04:54 PM   #16 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 66,809
Mine did on yours as you can see
__________________
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 November 28th, 2005, 04:59 PM   #17 (permalink)
Member
Verified Customer
 
Join Date: Dec 2002
Posts: 100
I uploaded image under 'admin' login for user 'charm', using bulkupload. Can it be a reason that filename was not incremented?
charm is offline   Reply With Quote
Old November 28th, 2005, 05:09 PM   #18 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 66,809
Every query for all 6 imagecheck queries is this

$catq = ppmysql_query("SELECT id FROM {$Globals['pp_db_prefix']}photos WHERE bigimage='$realname'", $link);

It works as I just did it again

You uploaded an image named 1.jpg so I renamed one of my images 1.jpg and uploaded it was renamed to 150.jpg meaning it found 149 other files named 1 on your photos table

So this clearly works

http://www.zeno.ru/index.php
__________________
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 November 30th, 2005, 02:27 AM   #19 (permalink)
Member
Verified Customer
 
Join Date: Jan 2004
Posts: 220
To fix the problem for photos that are already in the database, a check could be applied to editphoto.php. Before moving the file to the new category, check if there's already an image with this filename. If so, rename it and also change the filename in the photos table.

Or would this cause problems I'm not aware of?
Astaran is offline   Reply With Quote
Old November 30th, 2005, 08:38 AM   #20 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 66,809
It shouldn't
__________________
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
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
5.03 - Moving categories Rids Photopost Pro Installation & Upgrades 11 April 26th, 2005 08:42 PM
Moving Images to Other Categories oldengine vBGallery Suggestions 5 January 17th, 2005 11:31 PM
Moving Images From Categories dieselpowered Installs and Upgrade - vBulletin 3.0.X 6 December 23rd, 2004 11:20 PM


All times are GMT -5. The time now is 04:53 PM.

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