The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Relative URLs and Ckeditor
#12
Hello,

I think I've cracked this small but important issue with image paths being relative from within CKEDITOR.

The key to this issue was confirmed to me in LogicalOctopus statement.

Quote:The actual problem isn't with CKEditor but with the image browser which resolves the image path separately.

When you select an image after clicking the "Browse Server" button the full URL path was transferred into the image dialog box. CKEDITOR just used whatever was in the box and placed it in the source code.

The solution that I found but may need to be tested by others for confirmation.

Change line 24 of filebrowser.php from

$fullPath = $sitepath . "data/uploads/";

to

$fullPath = "data/uploads/";

I know line 23 was mentioned but changing line 24 so the $sitepath was omitted completly seemed to work great.

No other changes need to be done to GS. Leave all config files as they are in repsect to baseurl etc.

This solution is not "Upgrade friendly" but it seems to work in both Admin and Frontends of LOCALHOST and Live Domains (and I imagine if GS was installed into a subfolder).

I don't know if there could be a more permanent solution or if there is another reason why $sitepath was added to this line in filebrowser.php. All my testing seems to indicate that having a relavtive path is better than hardcoding the full site's URL in the source code.

I noticed that 3.1 also has this line in filebrowser.php (line 26)

On a sidenote using CKEDITOR with CKFINDER places a relative URL in the Source code which works both in LOCALHOST and the live domain.

Let me know if this works on other peoples environments.

I think moving GS websites around from local PC's, demo locations and Live Domains etc is fairly common and just being able to ZIP up the whole thing an locate it elsewhere fully in-tact without doing a massive Find and Repalce for every image or PDF link could be very handy.
Reply


Messages In This Thread
Relative URLs and Ckeditor - by peterb - 2011-06-17, 04:24:54
RE: Relative URLs and Ckeditor - by zulusnet - 2015-06-18, 23:53:00
RE: Relative URLs and Ckeditor - by shawn_a - 2015-06-19, 00:17:41
RE: Relative URLs and Ckeditor - by shawn_a - 2015-06-19, 00:32:20
RE: Relative URLs and Ckeditor - by datiswous - 2015-06-19, 19:07:23
Relative URLs and Ckeditor - by yojoe - 2011-06-17, 04:30:51
Relative URLs and Ckeditor - by gSvoren - 2011-06-17, 04:52:00
Relative URLs and Ckeditor - by Connie - 2011-06-17, 05:44:17
Relative URLs and Ckeditor - by peterb - 2011-06-19, 04:10:46
Relative URLs and Ckeditor - by yojoe - 2011-06-19, 04:17:40
Relative URLs and Ckeditor - by LogicalOctopus - 2011-06-22, 07:29:59
Relative URLs and Ckeditor - by Connie - 2011-06-22, 08:21:52
Relative URLs and Ckeditor - by LogicalOctopus - 2011-06-23, 01:46:35
Relative URLs and Ckeditor - by Connie - 2011-06-24, 20:32:32
Relative URLs and Ckeditor - by Lithie - 2011-10-04, 03:31:50
Relative URLs and Ckeditor - by stryker - 2012-03-01, 22:22:45
Relative URLs and Ckeditor - by mvlcek - 2012-03-01, 22:25:24
Relative URLs and Ckeditor - by stryker - 2012-03-01, 22:36:29
Relative URLs and Ckeditor - by mvlcek - 2012-03-01, 23:27:36
Relative URLs and Ckeditor - by stryker - 2012-03-02, 07:51:16
Relative URLs and Ckeditor - by Connie - 2012-03-02, 18:09:28
Relative URLs and Ckeditor - by stryker - 2012-03-02, 22:16:36
Relative URLs and Ckeditor - by cmb - 2012-03-03, 12:50:11
Relative URLs and Ckeditor - by sal - 2012-05-28, 15:50:42



Users browsing this thread: 3 Guest(s)