2008-06-02, 05:48 PM
Can someone help me convert this IPB code to MyBB code?
Thanks.
Thanks.
//logo hack2
global $mkportals, $DB;
if ($mkportals->member['theme']) {
$DB->query("SELECT set_image_dir, set_cache_css from ibf_skin_sets where set_skin_set_id = '{$mkportals->member['theme']}'");
} else {
$DB->query("SELECT set_image_dir, set_cache_css from ibf_skin_sets where set_default = '1'");
}
$r = $DB->fetch_row();
$myimages_dir = $r['set_image_dir'];
unset ($r);
// dirs where logo could to be stored
$logo = "$mklib->images/logo.gif";
$logo2 = $mklib->sitepath."/".$mklib->forumpath."/style_images/".$myimages_dir."/logo.gif";
$logo3 = "$mklib->images/logo.png";
$logo4 = $mklib->sitepath."/".$mklib->forumpath."/style_images/".$myimages_dir."/logo.png";
// check if exists logo.gif or logo.png in both dirs (in mkportal image path or in forum style)
if (is_file("$logo2") ) {
$logo = $logo2; // check if exists logo.gif in forum style dir
} elseif (is_file("$logo3") ) {
$logo = $logo3; // check if exists logo.png in mkportal dir
} elseif (is_file("$logo4") ) {
$logo = $logo3; // check if exists logo.png in forum style dir
} else {
$logo4 = $mklib->sitepath."/".$mklib->forumpath."/style_images/".$myimages_dir."/logo4.gif";
if (is_file("$logo4") ) {
$logo = $logo4;
}
}
// background image
$background = "$mklib->images/sf_logo.jpg";
$background2 = $mklib->sitepath."/".$mklib->forumpath."/style_images/".$myimages_dir."/tile_back.gif";
if (is_file("$background2") ) {
$background = $background2;
}
//end logo hack