Jump to content


[Hack - vB 3.x] Display vB logostrip in MKPortal


  • You cannot reply to this topic
No replies to this topic

#1 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 05 June 2006 - 03:02 PM

[vB 3.x] Display vB logostrip in MKPortal

This hack will replace the MKPortal logo and header background with the logo and background from your forum skin. If you have skin selection enabled in the Portal CP the logostrip will change with each different forum skin.

This code is working in vB 3.0.3 and I think it should work for vB 3.5. It gets the image directory and the logo image from the vB database "style" table. It looks for an image named "header_bg.gif" in the "Miscellaneous Images Folder" set for the skin.

(Note: I do not know if this is the correct place to look for the logostrip background-image in vB. Maybe some of you vB users can tell me the right place to look and what image names to look for.)

File to edit: /templates/Forum/tpl_main.php

REPLACE function view_logo with this modified version.
// Display vB 3 forum logostrip hack by visiblesoul
// Tested with vB 3.0.3
function view_logo() {
global $mklib, $mkportals, $DB;

if ($mkportals->member['theme']) {
	$DB->query("SELECT styleid, stylevars from " . TABLE_PREFIX . "style WHERE styleid = '{$mkportals->member['theme']}'");
}
else {
	$DB->query("SELECT styleid, stylevars from " . TABLE_PREFIX . "style WHERE styleid='1'");
}
$r = $DB->fetch_row();
$skinvars = unserialize(stripslashes($r['stylevars']));
$myimages_dir = $skinvars['imgdir_misc'];
$logoimg = $skinvars['titleimage'];
unset ($r);

// Import logo
$logo =  $mklib->sitepath."/".$mklib->forumpath."/".$logoimg;
if (!$logoimg)
	$logo = "$mklib->images/logo.gif";

// Import background-image
//$background =  "$mklib->images/sf_logo.jpg";
$background =  "";
$background2 =  $mklib->sitepath."/".$mklib->forumpath."/".$myimages_dir."/header_bg.gif";
if (is_file("$background2") ) {
	$background = "style="background-image: url('$background2')"";
}

return <<<EOF

<!-- begin logostrip -->
 
<tr>
  <td id="mklogostrip" $background width="100%">
		 <a href="$mklib->siteurl/index.php"><img src="$logo" border="0" alt="" /></a>
		 </td>
</tr>

<!-- end logostrip -->

EOF;
}
//end logostrip hack



Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users