MyBB Community Forums

Full Version: image, style and charset vars in plugin files
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This post is mainly for Chris. As we discussed in a post last week regarding encapsulating all plugin files in their respective dir in the inc/plugins/my_plugin dir, I am have a few minor issues with file paths and global vars. The $style var is available and I can set the correct path to the default admin stylesheet using the following:

//make sure we load the correct path for the default admin stylesheet
if( !file_exists( MYBB_ADMIN_DIR . 'styles/' . $mybb->settings['cpstyle']. '/stylesheet.css' ) )
    $style = $mybb->settings['bburl'] . '/' . $config['admin_dir'] . '/styles/Axiom/stylesheet.css';
else
    $style = $mybb->settings['bburl'] . '/' . $config['admin_dir'] . '/styles/' . $mybb->settings['cpstyle'] . '/stylesheet.css';

When using the built-in navbit navigation, it references the image path as inc/plugins/images/nav_bit.gif. This is probably due to the images and stylesheets using relative paths. Is there a global var like $style that I can access to set the correct path for core images?

And lastly, in my inc/plugins/my_plugin/my_xmlhttp.php file I am needing to return the content-type header for inline editing. The setting for $charset is not available which causes IE errors.

Any suggestions?