Recent Topics

1 Jul 01, 2005 14:03    

Hey there -

I have what should be a simple question. When I post, I want to specify images via the simplest relative links. Does this mean I have to move all my photos into

mydomain.com/blog/skins/custom/pics ?

rather than pics/ ?

So far I am having to put in the entire URL for the image links like

href="http://mydomain.com/pics/this.jpg"

rather than just href="pics/this.jpg"

When I change my domain URL in a few weeks, it will be a pain in the *ss to have to redo all those links in my 199 posts.

Isn't there a way to specify a home directory for new posts?

Thanks for your help!

3 Jul 01, 2005 14:37

in other words : it is not possible for the moment !

4 Jul 01, 2005 16:01

Your problem is caused by the <base href= which makes the skins work, have you tried linking as ../../pics/im.jpg and then putting pics in blog root ?

¥

5 Jul 01, 2005 17:08

If your pics directory is at the root of your domain, then you can specify it like this:

<img src="/pics/image.jpg" />

Beginning a URL with a slash (and no dots) tells the browser to go to the root of whatever domain it is on and find the path based on that. In that case it will disregard the <base> tag.

The problem with doing that in b2evolution is that (as far as I can tell) it won't accept anything but a full absolute URL for an image. It might work if you turn off the HTML validator (I haven't tried that).

As far as updating your posts when your domain name changes, you can do that fairly easily if you have access to your database. The SQL looks like this:

update evo_posts set post_content = replace(post_content,'www.oldURL.com','www.newURL.com');

NOTE: This will replace all instances of your old URL with your new URL, including links, references to images, and plain text. You could modify this to only change image tags by including more info in the search / replace code:

update evo_posts set post_content = replace(post_content,'img src="http://www.oldURL.com','img src="http://www.newURL.com');

But event that will only work if all your image tags have the src attribute as the first attribute, with only one space, just as it is shown (that's the way b2evolution always generates the img tags).

If you want to update URLs in other tables (such as comments, etc.) just change the table name (2 places) in the SQL.

6 Jul 01, 2005 19:27

Kweb, thank you. The MySQL find and replace would certainly save me a lot of time. I will try that.

Better than going through all those posts one by one! I am in Baghdad on a congested dual-satellite-hopped link that makes dialup seem like a T1 in comparison. Woa that would be awful. My time aint cheap!

Thanks again.

- Kent


Form is loading...