Author Topic: Change url to droplet code  (Read 5249 times)

Offline crnogorac081

  • Posts: 1889
  • Gender: Male
Change url to droplet code
« on: November 10, 2009, 03:40:30 PM »
Hi,

Just came up to this idea while I was moving from one to another server.

For example when you move site from server A to server B, I noticed that pictures (and maybe some other content) doesnt work, as their url is stored in database like www.serverA/media/image1.jpg   and I had to manualy overwrite all paths to www.serverB

So my idea is to use a droplet when you add a picture from wysiwyg or others module, to replace www.serverA.xy/ with [[WB_URL]] or something like that - droplet :)  So when you preview source code in wysiwyg to see link as [[WB_URL]]/media/picture1.jpg 

what do you think ?

cheers
no bb in signature

Offline maverik

  • Posts: 1572
  • Gender: Male
  • ..:: viva los tioz ::..
Re: Change url to droplet code
« Reply #1 on: November 10, 2009, 03:48:48 PM »
i think thats a task for fck editor, maybe it can be modified to set the wb url by inserting images

Offline pcwacht

  • Posts: 2923
  • Gender: Male
    • Dutch ICT info
Re: Change url to droplet code
« Reply #2 on: November 10, 2009, 04:29:58 PM »
Content can be changed with a droplet

Simply scan the content for www.serverA and replace with www.serverB

BTW
You should allways use relative links (../pictureurl/picture.gif) , not absolute (http://www.server.com/pictureurl/picture.gif) .

Have fun.
John
http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....

Offline crnogorac081

  • Posts: 1889
  • Gender: Male
Re: Change url to droplet code
« Reply #3 on: November 10, 2009, 10:54:12 PM »
yes, but when you call a picture from a wysiwyg you get absolute link.. :)
no bb in signature

Offline sare

  • Posts: 29
Re: Change url to droplet code
« Reply #4 on: November 11, 2009, 08:32:15 AM »
Right, fck editor hands out absolute urls, which is slightly annoying.

I've always dealt with it by search-replacing the absolute urls in the MySQL dump when publishing a site...

Offline Vincent

  • Posts: 376
  • Gender: Male
    • websites voor ondernemers
Re: Change url to droplet code
« Reply #5 on: November 11, 2009, 11:11:45 AM »
Indeed this is one of the most annoying issues of WB!
Don't know if this issue is addressed earlier, but maybe we should make a ticket of it?

Vincent

Offline LordDarkman

  • Posts: 343
  • Gender: Male
  • Leben ist schön. Nur nicht drüber nachdenken...
    • Internet Radio Gates of Doom
Re: Change url to droplet code
« Reply #6 on: November 11, 2009, 11:17:39 AM »
Maybe? I made one :wink:
I thing this would be a gread Feuture!

CU Moritz

Offline pcwacht

  • Posts: 2923
  • Gender: Male
    • Dutch ICT info
Re: Change url to droplet code
« Reply #7 on: November 11, 2009, 11:21:12 AM »
Problem lies in the WB_PATH and WB_URL, these are needed for when a website resides in a subdir, ie
www.domain.nl/somedir/

You could manual change:
/modules/fckeditor/fckeditor/editor/filemanager/connectors/php/config.php

Line 52
$Config['UserFilesPath'] = WB_URL .MEDIA_DIRECTORY ;

to
$Config['UserFilesPath'] = MEDIA_DIRECTORY ;

If a subdir is used change it to:
$Config['UserFilesPath'] = '/somedir' .MEDIA_DIRECTORY ;

I tried and it worked at my end. xampp on windows xp
Worked with pictures and file-links


If it works with you lot, maybe add it to the created ticket to get /somedir in a variable like WB_URL, maybe WB_PATH or WB_ROOT or something.
This can be used in FCK and Xinha and TinyMCE to make them userconfigurable
Maybe add it as a setting in the backend so changes could be on the fly.



Have fun,
John
http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....

Offline pcwacht

  • Posts: 2923
  • Gender: Male
    • Dutch ICT info
Re: Change url to droplet code
« Reply #8 on: November 11, 2009, 11:23:35 AM »
PS

This needs thorough testing because of the homefolders feature!!

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....

Offline crnogorac081

  • Posts: 1889
  • Gender: Male
Re: Change url to droplet code
« Reply #9 on: November 13, 2009, 01:30:37 PM »
Right, fck editor hands out absolute urls, which is slightly annoying.

I've always dealt with it by search-replacing the absolute urls in the MySQL dump when publishing a site...

Yes, and this is exactly why I started this thread and wanted to hear your comments.. :)



no bb in signature

 

postern-length