TinyMCE and absolute urls
TinyMCE and absolute urls
Hi,
Im having issues in NMS where TinyMCE is stripping any absolute urls in the page after submitting it. This is naturally causing broken images and links when the page is being displayed in an email client.
Ive tried modifying the relative_url and convert_url options to 'false' in the tiny_mce.js file, but it doesnt seem to work.
Can the TinyMCE dev shed any light on this?
Thanks.
Harby.
Im having issues in NMS where TinyMCE is stripping any absolute urls in the page after submitting it. This is naturally causing broken images and links when the page is being displayed in an email client.
Ive tried modifying the relative_url and convert_url options to 'false' in the tiny_mce.js file, but it doesnt seem to work.
Can the TinyMCE dev shed any light on this?
Thanks.
Harby.
Re: TinyMCE and absolute urls
Im having issues in NMS where TinyMCE is stripping any absolute urls in the page after submitting it. This is naturally causing broken images and links when the page is being displayed in an email client.
please i need help on that
UPDATE
if to put in absolute they are http%3A//domain.com/uploads/images/myimage.jpg
Any sugestions please guys!!!!
please i need help on that
UPDATE
if to put in absolute they are http%3A//domain.com/uploads/images/myimage.jpg
Any sugestions please guys!!!!
Last edited by nuno on Sun Oct 28, 2007 11:06 pm, edited 1 time in total.
Re: TinyMCE and absolute urls
This does not work with me...nuno wrote:
if to put in absolute they are http%3A//domain.com/uploads/images/myimage.jpg
Kees
Re: TinyMCE and absolute urls
adding
in tinyconfig.php does the job for me...
Not checked what it does with other jobs!!!!!!!!!!
Kees
Code: Select all
convert_urls : "false",
Not checked what it does with other jobs!!!!!!!!!!
Kees
Re: TinyMCE and absolute urls
thanksKC wrote: adding
in tinyconfig.php does the job for me...Code: Select all
convert_urls : "false",
Not checked what it does with other jobs!!!!!!!!!!
Kees
In that place? (line)
Solved 50% but still http%3A//domain.com/uploads/images/myimage.jpg
Last edited by nuno on Sat Nov 10, 2007 9:56 pm, edited 1 time in total.
Re: TinyMCE and absolute urls
I placed it just under
relative_urls : "true",
Grtz Kees
relative_urls : "true",
Grtz Kees
Re: TinyMCE and absolute urls
See the attached image already tried to think of everything!




Re: TinyMCE and absolute urls
Hello,
Have you the solution for the absolute urls ?
Thanks
Have you the solution for the absolute urls ?
Thanks
Re: TinyMCE and absolute urls
Hello communitybmunsch wrote: Hello,
Have you the solution for the absolute urls ?
Thanks
For sending images in the body of newsletters already solved, continuing the TinyMCE with relative urls, is the best.
For e-mail clients like (Outlook) see the images of the body of the message included in the module NMS in the file action.process_queue.php
+- line 435
Code: Select all
switch( $message['templateid'] )
{
case -1: // html message (no template)
$mailer->SetBody($bodytext);
$mailer->IsHTML(true);
break;
case -2: // text message
$mailer->SetBody($bodytext);
$mailer->IsHTML(false);
break;
default: // page template
// assign the message as {$message_text} variable
$this->smarty->assign('message_text',$bodytext);
replace for this
Code: Select all
switch( $message['templateid'] )
{
case -1: // html message (no template)
$mailer->SetBody($bodytext);
$mailer->IsHTML(true);
break;
case -2: // text message
$mailer->SetBody($bodytext);
$mailer->IsHTML(false);
break;
default: // page template
// assign the message as {$message_text} variable
//////////// ADDED ///////////////////////////////////////////////////
$fullAbsolute = $config['image_uploads_url'];
$bodytext = str_replace("uploads/images", $fullAbsolute ,$bodytext);
///////////////////END ADDED //////////////////////////////////////////
$this->smarty->assign('message_text',$bodytext);
FOR NOW HAS BEEN THE ONLY SOLUTION THAT FIND AND WORKS IN PERFECTION, WHO HAVE BETTER CAN DEMONSTRATING, NOT HIDE JUST FOR YOU OWN, AFTER ALL THE MAGIC OF OPEN SOUCE It CAN SHARE!
Last edited by nuno on Mon Nov 19, 2007 11:22 pm, edited 1 time in total.
-
- New Member
- Posts: 8
- Joined: Wed Apr 09, 2008 2:09 pm
Re: TinyMCE and absolute urls
I was having this problem as well. Here's how I fixed it:
first, open modules/TinyMCE/tinymce/jscripts/tiny_mce/plugins/simplebrowser/frmresources.list.html
look around line 90 for the following:
I changed it to
the problem is that escape() is replacing the colon in http://.
We're all on windows machines which don't allow colons in a filename anyway, but should that be a concern, you might want to try something like
fileUrl = fileUrl.replace('http%3A/','http:/');
instead.
first, open modules/TinyMCE/tinymce/jscripts/tiny_mce/plugins/simplebrowser/frmresources.list.html
look around line 90 for the following:
Code: Select all
function OpenFile( fileUrl )
{
window.top.opener.TinyMCE_SimpleBrowserPlugin.browserCallback(escape(fileUrl)) ;
window.top.close() ;
//window.top.opener.focus() ; //AT 20060217 - causing focus problems, link dialog would loose focus
}
I changed it to
Code: Select all
function OpenFile( fileUrl )
{
fileUrl = escape(fileUrl);
fileUrl = fileUrl.replace('%3A',':');
window.top.opener.TinyMCE_SimpleBrowserPlugin.browserCallback(fileUrl) ;
window.top.close() ;
//window.top.opener.focus() ; //AT 20060217 - causing focus problems, link dialog would loose focus
}
the problem is that escape() is replacing the colon in http://.
We're all on windows machines which don't allow colons in a filename anyway, but should that be a concern, you might want to try something like
fileUrl = fileUrl.replace('http%3A/','http:/');
instead.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: TinyMCE and absolute urls
The NMS module post-processes all content (just prior to sending the message) to change all relative links to absolute links.
I call it like this:
$htmlbody = make_absolute_links($htmlbody,$config['root_url']);
and here's the body of that function:
I call it like this:
$htmlbody = make_absolute_links($htmlbody,$config['root_url']);
and here's the body of that function:
Code: Select all
function make_absolute_links($src,$base_url)
{
// Extracts strings containing href or src="something"
// that "something" can't begin with / or contain a :
// because that would indicate that its already a relative URI
// adjust the base url to have a trailing slash if it doesn't already
$base_url = cms_join_path($base_url,'.');
while (eregi("(href|src|action)=\"(([^/])[[:alnum:]/+=%&_.~?-]*)\"",
$src, $regs)) {
$input_uri = $regs[2];
//Inputs the extracted string into the function make_abs
$output_uri = _make_abs($input_uri, $base_url);
//Replaces the relative URI with the absolute one
$src = eregi_replace("((href|src|action)=\")$input_uri(\")", "\\1$output_uri\\3", $src);
//Repeats over again until no relative URI:s are detected
}
return($src);
}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: TinyMCE and absolute urls
To whom still interested:
Alby found a bug in /modules/TinyMCE/templates/tinyconfig.tpl
http://forum.cmsmadesimple.org/index.ph ... icseen#new
regards
blast
Alby found a bug in /modules/TinyMCE/templates/tinyconfig.tpl
http://forum.cmsmadesimple.org/index.ph ... icseen#new
regards
blast