09-02-2008, 10:32 PM
I noticed today that with my remotely hosted themes, mybb was failing to pick up the image lang directory correctly, thus showing the alt text for all the lang images.
Workaround
Open global.php
find
REPLACE with
FIND
REPLACE with
That should solve your problem
Credits: Some guy on php.net for the url_exists() function. ME for the rest!
Workaround
Open global.php
find
PHP Code:
// If a language directory for the current language exists within the theme - we use it
if(!empty($mybb->user['language']) && is_dir($theme['imgdir'].'/'.$mybb->user['language']))
REPLACE with
PHP Code:
//Custom function to enable remote hosted themes to work correctly
function url_exists($url) {
$hdrs = @get_headers($url);
return is_array($hdrs) ? preg_match('/^HTTP\\/\\d+\\.\\d+\\s+2\\d\\d\\s+.*$/',$hdrs[0]) : false;
}
// If a language directory for the current language exists within the theme - we use it
if(!empty($mybb->user['language']) && is_dir($theme['imgdir'].'/'.$mybb->user['language']))
FIND
PHP Code:
if(is_dir($theme['imgdir'].'/'.$mybb->settings['bblanguage']))
REPLACE with
PHP Code:
//if(is_dir($theme['imgdir'].'/'.$mybb->settings['bblanguage']))
if(if(url_exists($theme['imgdir'].'/'.$mybb->settings['bblanguage'].'/newreply.gif') OR is_dir($theme['imgdir'].'/'.$mybb->settings['bblanguage'])))
That should solve your problem

Credits: Some guy on php.net for the url_exists() function. ME for the rest!
