Previous Thread
Next Thread
Print Thread
Rate Thread
#280555 10/08/2004 11:09 AM
Joined: Nov 2000
Posts: 1,271
Kahuna
Kahuna
Joined: Nov 2000
Posts: 1,271
all over my forum, there are posts with various images on my server. all of them are at the same url, like this:

http://www.robkamphausen.com/image/place/image1.jpg
http://www.robkamphausen.com/image/place/image2.jpg
http://www.robkamphausen.com/image/place/image3.jpg

if i wanted to move all of those images, is there any command i can enter that will automatically change the url of the posts? like, something that will universally change all references of:
http://www.robkamphausen.com/image/place/

to:
http://www.robkamphausen.com/image/place/boards/

?

Sponsored Links
Joined: Mar 2000
Posts: 528
Junior Member
Junior Member
Offline
Joined: Mar 2000
Posts: 528
Is the URL of the images in the content of the posts itself?

Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
UPDATE w3t_Posts SET B_Body = REPLACE(B_Body, 'robkamphausen.com/image/place/','robkamphausen.com/image/place/boards/');

Joined: Nov 2000
Posts: 1,271
Kahuna
Kahuna
Joined: Nov 2000
Posts: 1,271
[]Medar said:
Is the URL of the images in the content of the posts itself? [/]

naw, its not the actual URL. its a posted image, so it'll look like this:

Code
 <br />hey check out this new image!!! <br />[Linked Image] <br />

Joined: Nov 2000
Posts: 1,271
Kahuna
Kahuna
Joined: Nov 2000
Posts: 1,271
[]Anno said:
UPDATE w3t_Posts SET B_Body = REPLACE(B_Body, 'robkamphausen.com/image/place/','robkamphausen.com/image/place/boards/'); [/]

so this'll actually change the image URL? (NOT just a hyper link?)

Sponsored Links
Joined: Mar 2000
Posts: 528
Junior Member
Junior Member
Offline
Joined: Mar 2000
Posts: 528
What Anno said

That will change every instance in your B_Body (Post Content field) of:

robkamphausen.com/image/place/

Into:

robkamphausen.com/image/place/boards/

Test a single post first, make sure it is what you are wanting to do. Add a:

WHERE B_Number=xxxxx;

on the end to test a single post.

Joined: Nov 2000
Posts: 1,271
Kahuna
Kahuna
Joined: Nov 2000
Posts: 1,271
awesome!

i'll play around with this tonight -- that should definitely help me organize stuff on my server a lot more efficiently.

thanks guys!

Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
>Test a single post first, make sure it is what you are wanting to do.
Ah, yes, good advice.
And for an additional measure, make sure you have a recent database backup.

Joined: Nov 2000
Posts: 1,271
Kahuna
Kahuna
Joined: Nov 2000
Posts: 1,271
btw, i've used this a few times and it works GREAT!!!

thanks


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)