WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.9 R24 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • General Community »
  • Global WebsiteBaker 2.8.x discussion »
  • Change url to droplet code
  • Print
Pages: [1]   Go Down

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

Offline crnogorac081

  • Posts: 2168
  • 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
Logged
Web developer

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
Logged

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
Logged
http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....

Offline crnogorac081

  • Posts: 2168
  • 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.. :)
Logged
Web developer

sare

  • Guest
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...
Logged

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
Logged

LordDarkman

  • Guest
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
Logged

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
Logged
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!!

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

Offline crnogorac081

  • Posts: 2168
  • Gender: Male
Re: Change url to droplet code
« Reply #9 on: November 13, 2009, 01:30:37 PM »
Quote from: sare 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...

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



Logged
Web developer

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • General Community »
  • Global WebsiteBaker 2.8.x discussion »
  • Change url to droplet code
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2