MyBB Community Forums

Full Version: Convert this IPB code to MyBB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can someone help me convert this IPB code to MyBB code?

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
This code is to make a header from mybb to show up on my mkportal page.

I think this is the part of the code, that needs editing from IPB code to MyBB, but i dont know what changes i need to make. so any help whatsoevere, would be extremly helpful.

Thanks.

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'"); 
 }
i "think" i got all of it except this part,and for the life of me i cant figure it out, any assistance would be gladly appreiciated.


$r = $DB->fetch_row();
$myimages_dir = $r['set_image_dir'];
unset ($r);