[Pushed] Editor loads smiley images relatively
#1
Normally this would not be a problem. However I'm building a forum where I've kind of beaten MyBB's URL structure into submission via mod_rewrite and it kind of breaks things being loaded relatively when the page tries to load images from example.com/custompage/addthing/images/smilies/smile.gif (which is not correct). Loading the images from {$mybb->settings['bburl']}/images/smilies/smile.gif (or whatever the JS equivalent is) would fix this due to being an absolute URL.

If for whatever reason this won't be done I'm going to have fun trying to figure out how to hack around this...

On an unrelated note, the means by which I had to do this URL beating is horrible and fragile and belongs on TDWTF but was the only way I could think of to globally format the links for MyBB because there isn't really any other way.
[Image: LogoO.png]
Reply
#2
+ one with this issue, embedding MyBB into 3rd party sites is difficult here.
My Company - I am Microsoft Certified in HTML5, CSS3 and JS
Reply
#3
Also note loading relatively means the CDN settings aren't used. 1.8 has a new variable under $mybb->asset_url to handle this which should be used.
Reply
#4
Hi,

Thank you for your report. We have pushed this issue to our Github repository for further analysis where you can track our commits and progress with fixing this bug. Discussions regarding this bug may also take place there too.

Follow this link to visit the issue on Github: https://github.com/mybb/mybb/issues/1291

Thanks for contributing to MyBB!

Regards,
The MyBB Group
Reply
#5
Does the [Pushed] prefix mean the issue was pushed to github, or the fix? Confused because I thought to add it, then thought better of it...
[Image: LogoO.png]
Reply
#6
just pushed, not fixed... but feel free to pull a fix
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#7
Oh I just meant for the title. I haven't the foggiest where to start with fixing SCeditor...
[Image: LogoO.png]
Reply
#8
SCEditor is using $dropdownsmilies, $moresmilies and $hiddensmilies, so I'd say changing


if($i < $mybb->settings['smilieinsertertot'])
{
$dropdownsmilies .= '"'.$find.'": "'.$image.'",';
}
else
{
$moresmilies .= '"'.$find.'": "'.$image.'",';
}
for($j = 1; $j < $finds_count; ++$j)
{
$find = htmlspecialchars_uni($finds[$j]);
$hiddensmilies .= '"'.$find.'": "'.$image.'",';
}

to

if($i < $mybb->settings['smilieinsertertot'])
{
	$dropdownsmilies .= '"'.$find.'": "'.$mybb->asset_url.'/'.$image.'",';
}
else
{
	$moresmilies .= '"'.$find.'": "'.$mybb->asset_url.'/'.$image.'",';
}
for($j = 1; $j < $finds_count; ++$j)
{
	$find = htmlspecialchars_uni($finds[$j]);
	$hiddensmilies .= '"'.$find.'": "'.$mybb->asset_url.'/'.$image.'",';
}


in functions.php should give the absolute URL for the smilies.
Reply
#9
Would be better to use the get_asset_url() function in that case as it handles things such as links to external sites.
Reply
#10
Fixed in #1492.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)