webster Posted November 18, 2010 Share Posted November 18, 2010 Hello, When I select and copy an image from a web-page into the bb rich-text editor, the image doesn't appear, I checked the source Imge Sorce <img style="max-width: 600px; cursor: pointer;" onclick="window.open(this.src)" src="images/smilies/smile.png" border="0" alt="" title="" class="inlineimg" /> I found it is saved in the post like. http://mydomain.com/images/smilies/smile.png[/code] This image is not in my website. Can you please modify this code to make the image bb code be like: http://somewebsite.com/images/smilies/smile.png[/code] else if (g == "img") { if (isWebKit) { f = f.replace(/<img(.*?)src="(.*?)">/gi, "[img=http://$2]"); } else { f.match(/<img(.*?)src="(.*?)"(.*?)>/gi); var s = RegExp.$2; s = s.replace("./", ""); if (s.toLowerCase().substr(0, 7) != "http://") { var t = document.URL; t = t.replace("http://", ""); var u = t.split("/"); var v = "http://"; for (var d = 0; d < u.length; d++) { if (d < u.length - 1) { v += u[d] + "/"; } } f = f.replace(/\<img(.*?)src="(.*?)"(.*?)>/gi, "[img=http://" + v + s + "]"); } else { f = f.replace(/<img(.*?)src="(.*?)"(.*?)>/gi, "[img=http://$2]"); } } Regards, Link to comment https://forums.phpfreaks.com/topic/219028-how-to-know-image-url-when-paste-it-in-wysiwyg-bb-editor/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.