Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2012, 09:38:50 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155528 Posts in 21713 Topics by 7737 Members
Latest Member: chris85
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Change url to droplet code  (Read 2305 times)
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1706



« 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 Smiley  So when you preview source code in wysiwyg to see link as [[WB_URL]]/media/picture1.jpg 

what do you think ?

cheers
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
maverik

Offline Offline

Posts: 1568



WWW
« 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
Logged

Signatur wird geladen...
pcwacht
AddOn Development
*
Offline Offline

Posts: 2858



WWW
« 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
Logged

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

Posts: 1706



« Reply #3 on: November 10, 2009, 10:54:12 PM »

yes, but when you call a picture from a wysiwyg you get absolute link.. Smiley
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
sare

Offline Offline

Posts: 29


« 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...
Logged
Vincent

Offline Offline

Posts: 360


WWW
« 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
Logged
LordDarkman
Development Team
*****
Offline Offline

Posts: 343


WWW
« 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
Logged
pcwacht
AddOn Development
*
Offline Offline

Posts: 2858



WWW
« 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
Logged

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

Posts: 2858



WWW
« Reply #8 on: November 11, 2009, 11:23:35 AM »

PS

This needs thorough testing because of the homefolders feature!!

Logged

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

Posts: 1706



« 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.. Smiley



Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!