The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
5000 entries in db for same file
Checking on my vbulletin 4 forums, I came across tens of ablums with 100% broken links to their uploaded images.
Looking in the attachment table, I found about 5000 entries all referring to the same file. Looking closely, the file is named keyword1_keyword2_keyword3_keyword4_keyword5_keywo rd6_keyword7_keyword8_keyword9_keyword10_keyw_.jpg OK I got it. A few years ago, I created some nice designs and pushed the SEO a bit too much by naming the files in the above way. I don't have those designs as I was very short on space on my SSD. After uploading them as attachments, I deleted them from my pc. They then looked fine... Now, the attachments are fine in their proper places as /n/n/filedataid.attach Can I fix this by renaming the files in the DB? I am good at manipulating data in Excel and re-uploading with a replace order to the DB. it would be a real pitty to have to delete 5000 files and re-create and re-upload. --------------- Added [DATE]1472153849[/DATE] at [TIME]1472153849[/TIME] --------------- This should not be very difficult to do as the files are not encrypted or modified except that they are renamed to filedataid.attach I tried simply renaming one of them to filedataid.attach.jpg and I could easily open it as a jpg. I know for a fact all of those files in question were jpg... I was thinking I am able to write a replace / update statement such as update attachment where filedataid=nnnnn set filename=new_short_name_filedataid.jpg |
#2
|
||||
|
||||
Can you share a link to your site? I'm very confused. You said it's fine?
|
#3
|
|||
|
|||
I said the attachments are fine in their places, that is they are indeed where you expect them to be ... in the attachments folder. However, they do not show up at all on the website....
|
#4
|
|||
|
|||
So it's incorrectly stored in the database? Can you show us an example of what it looks like in the database and what it's supposed to look like?
|
#5
|
|||
|
|||
Quote:
I have about 5000 entries in the attachment table with this under filename keyword1_keyword2_keyword3_keyword4_keyword5_keywo rd6_keyword7_keyword8_keyword9 _keyword10_keyw_.jpg Of course originally the entries were like keyword1_keyword2_keyword3_keyword4_keyword5_keywo rd6_keyword7_keyword8_keyword9 _keyword10_keyword11_some_serial_number.jpg Of course I can mass modify the entries in the mysql db... but how do those tie back with the attachments ? |
#6
|
|||
|
|||
If I recall correctly, there's no strict check against the filename column in the attachment table. What matters the most is that the attachmentid exists in the attachment table.
Browsing to /attachment.php?attachmentid=XX where XX is a valid attachmentid in your table does not download/load the attachment? |
#7
|
|||
|
|||
Quote:
On the website, the source of the images in the album is something like this: PHP Code:
and those do not lead to an image... they are broken links. --------------- Added [DATE]1472182313[/DATE] at [TIME]1472182313[/TIME] --------------- Quote:
I now recalled, thanks to you, that after the migration to a new server I did NOT update the path to the vbattachments folder. So sorry. Fixed now. |
#8
|
|||
|
|||
But does the attachmentid 20027 exist in the attachment table?
If so, it's probably not passing a bunch of checks that are coded in /packages/vbforum/attach/album.php or /packages/vbforum/attach/post.php (look for function verify_attachment) Based on those checks, you can see what's wrong and causing the attachment to "break". Edit: guess you figured it out. |
Благодарность от: | ||
MarkFL |
#9
|
|||
|
|||
You did, when you mentioned that the filename does not matter.... you logically lead me to conclude that if the files are available in their folder, then ... it is the path to them that is broken!
thank you much |
Благодарность от: | ||
MarkFL |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|