Thread Images

Started by Cunning Plan, March 01, 2015, 05:27:12 AM

Previous topic - Next topic

Cunning Plan

For example: http://www.mkb.cc/forum/index.php?topic=7603.msg188303;topicseen#msg188303

:notworking:

The images are all missing. Is there a script you can run to update all of the images to the new forum formatting or something?   :error:
1968 VW T2 Bay Bus (currently being restored and upgraded)
1999 Jeep Cherokee XJ (modern classic daily driver)

Roadkill

Yeah, this'll be a major issue if it's not a "quick fix" . . .

ianjpage

Yeah looking at the code, it's a bit of a pain as running the command on the server which should fix it, doesn't seem to be doing so....more investigation required ....

Roadkill

Just noticed that the "split topic" (what ever that is) doesn't display . . . or at least on the scheme I'm using ??

ianjpage

Quote from: Roadkill on March 03, 2015, 09:04:26 AM
Just noticed that the "split topic" (what ever that is) doesn't display . . . or at least on the scheme I'm using ??

Hmm, ok will have a look at the theme, prob missing an image or something....

ianjpage

Quote from: Roadkill on March 03, 2015, 09:04:26 AM
Just noticed that the "split topic" (what ever that is) doesn't display . . . or at least on the scheme I'm using ??

Sorted, image was missing!

Jamieg285

I take it no progress. Can I help at all?

ianjpage

Yeah not much progress, its all about the SQL statement and selecting just the ones i want....

What i need to do is find any post that contains the following string:

<img src=\"

and then replace with [ img ](without spaces)

whilst i can get teh SQL statement this far:

Select * from table where body contains '<img src=\\\' it doesn't like the "

Any thoughts on how to do it,  the only way i can think of is to manually export the data into SQL file, then do a find & replace in a text editor....but the SQL file is ~95mb!

ianjpage

Tested a somewhat manual fix on the test forum earlier and it worked, basically downloaded the entire content of teh forum in an SQL file (all 90mb ofit), then opened in a text editor, did find/replace with the dodgy link code and reuploaded and restored data, seems to work.

Will aim to do this at the weekend so will need to take forum down for a bit, probably sunday but for 30 mins max.

Jamieg285

Quote from: ianjpage on March 04, 2015, 08:02:35 AMwhilst i can get teh SQL statement this far:

Select * from table where body contains '<img src=\\\' it doesn't like the "

Any thoughts on how to do it, 

Try:

Select * from table where body contains "<img src=\\\""


Not sure how you would amend it after you've selected it though.  I think your idea of a full DB dump to text, find/replace and reload is probably the better anyway. 

ianjpage

i've located the code to do the replace, it's just getting it to find the parts

I'll try that later...think i did try that combination, but can't remember for sure as tried so many before giving up !

ianjpage

Have ran a fix on the data for old images and smilieys so should work now :crossed:

Cunning Plan

Great! Yes, they seem to all be there   :typo:

Thanks Ian :clap3:

:adminpower:

1968 VW T2 Bay Bus (currently being restored and upgraded)
1999 Jeep Cherokee XJ (modern classic daily driver)

ianjpage

all sorted now (AFAIK) so locked