Author Topic: Thread Images  (Read 1941 times)

Cunning Plan

  • Mega Ho
  • *
  • Posts: 5452
    • View Profile
Thread Images
« 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:


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

Roadkill

  • Guest
Re: Thread Images
« Reply #1 on: March 02, 2015, 09:56:52 am »
Yeah, this'll be a major issue if it's not a "quick fix" . . .

ianjpage

  • Administrator
  • Trainee Gangsta
  • *****
  • Posts: 15352
    • View Profile
Re: Thread Images
« Reply #2 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 ....

Roadkill

  • Guest
Re: Thread Images
« Reply #3 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 ??

ianjpage

  • Administrator
  • Trainee Gangsta
  • *****
  • Posts: 15352
    • View Profile
Re: Thread Images
« Reply #4 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....

ianjpage

  • Administrator
  • Trainee Gangsta
  • *****
  • Posts: 15352
    • View Profile
Re: Thread Images
« Reply #5 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!

Jamieg285

  • Pimp
  • *
  • Posts: 7356
    • View Profile
    • http://www.mfatw.com/WD
Re: Thread Images
« Reply #6 on: March 04, 2015, 12:46:47 pm »
I take it no progress. Can I help at all?

ianjpage

  • Administrator
  • Trainee Gangsta
  • *****
  • Posts: 15352
    • View Profile
Re: Thread Images
« Reply #7 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!

ianjpage

  • Administrator
  • Trainee Gangsta
  • *****
  • Posts: 15352
    • View Profile
Re: Thread Images
« Reply #8 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.

Jamieg285

  • Pimp
  • *
  • Posts: 7356
    • View Profile
    • http://www.mfatw.com/WD
Re: Thread Images
« Reply #9 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. 

ianjpage

  • Administrator
  • Trainee Gangsta
  • *****
  • Posts: 15352
    • View Profile
Re: Thread Images
« Reply #10 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 !

ianjpage

  • Administrator
  • Trainee Gangsta
  • *****
  • Posts: 15352
    • View Profile
Re: Thread Images
« Reply #11 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:

Cunning Plan

  • Mega Ho
  • *
  • Posts: 5452
    • View Profile
Re: Thread Images
« Reply #12 on: March 09, 2015, 09:05:11 am »
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

  • Administrator
  • Trainee Gangsta
  • *****
  • Posts: 15352
    • View Profile
Re: Thread Images
« Reply #13 on: March 15, 2015, 10:01:47 pm »
all sorted now (AFAIK) so locked