MKB Forum

Forum Information => Known problems => Topic started by: Cunning Plan on March 01, 2015, 10:27:12 am

Title: Thread Images
Post by: Cunning Plan on March 01, 2015, 10:27:12 am
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:
Title: Re: Thread Images
Post by: Roadkill on March 02, 2015, 09:56:52 am
Yeah, this'll be a major issue if it's not a "quick fix" . . .
Title: Re: Thread Images
Post by: ianjpage on March 02, 2015, 11:37:32 am
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 ....
Title: Re: Thread Images
Post by: Roadkill on March 03, 2015, 02:04:26 pm
Just noticed that the "split topic" (what ever that is) doesn't display . . . or at least on the scheme I'm using ??
Title: Re: Thread Images
Post by: ianjpage on March 03, 2015, 03:20:28 pm
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....
Title: Re: Thread Images
Post by: ianjpage on March 03, 2015, 09:14:20 pm
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!
Title: Re: Thread Images
Post by: Jamieg285 on March 04, 2015, 12:46:47 pm
I take it no progress. Can I help at all?
Title: Re: Thread Images
Post by: ianjpage on March 04, 2015, 01:02:35 pm
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!
Title: Re: Thread Images
Post by: ianjpage on March 04, 2015, 10:27:47 pm
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.
Title: Re: Thread Images
Post by: Jamieg285 on March 05, 2015, 01:15:52 pm
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, 

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. 
Title: Re: Thread Images
Post by: ianjpage on March 05, 2015, 01:31:57 pm
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 !
Title: Re: Thread Images
Post by: ianjpage on March 08, 2015, 10:08:32 pm
Have ran a fix on the data for old images and smilieys so should work now :crossed:
Title: Re: Thread Images
Post by: Cunning Plan on March 09, 2015, 09:05:11 am
Great! Yes, they seem to all be there   :typo:

Thanks Ian :clap3:

:adminpower:

Title: Re: Thread Images
Post by: ianjpage on March 15, 2015, 10:01:47 pm
all sorted now (AFAIK) so locked