Jump to content


[Hack] Display IPB logostrip in MKP


4 replies to this topic

#1 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 14 September 2005 - 11:20 AM

Display IPB logostrip in MKPortal
based on original hack by Meo at mkportal.it

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.

File to edit: templates/Forum/tpl_main.php

REPLACE function view_logo with this modified version.




for IPB 1.3 x MKP 1.0

// Display IPB 1.3 forum logostrip hack by visiblesoul
function view_logo() {
global $mklib, $mkportals, $DB;

//if ($mkportals->member['theme']) {
	//$DB->query("SELECT img_dir from ibf_skins WHERE set_id = '{$mkportals->member['theme']}'");
//}
//else {
	$DB->query("SELECT img_dir from ibf_skins WHERE default_set = '1'");
//}
$r = $DB->fetch_row();
$myimages_dir = $r['img_dir'];
unset ($r);
$logo = $mklib->images.'/logo.gif';
$logo2 =  $mklib->sitepath.'/'.$mklib->forumpath.'/style_images/'.$myimages_dir.'/logo.gif';
if (is_file($logo2) ) {
	$logo = $logo2;
}
else {
	$logo4 =  $mklib->sitepath.'/'.$mklib->forumpath.'/style_images/'.$myimages_dir.'/logo4.gif';
		 if (is_file($logo4) ) {
			  $logo = $logo4;
		 }
}
$background =  $mklib->images.'/sf_logo.jpg';
$background2 =  $mklib->sitepath.'/'.$mklib->forumpath.'/style_images/'.$myimages_dir.'/tile_back.gif';
if (is_file($background2) ) {
	$background = $background2;
}

return <<<EOF

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

EOF;

}
//end logostrip hack
for IPB 2.0.x x MKP 1.0

// Display IPB 2.0.x forum logostrip hack by visiblesoul
function view_logo() {
global $mklib, $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);
$logo = "$mklib->images/logo.gif";
$logo2 =  $mklib->sitepath."/".$mklib->forumpath."/style_images/".$myimages_dir."/logo.gif";
if (is_file("$logo2") ) {
	$logo = $logo2;
}
else {
	$logo4 =  $mklib->sitepath."/".$mklib->forumpath."/style_images/".$myimages_dir."/logo4.gif";
	  if (is_file("$logo4") ) {
		$logo = $logo4;
  }
}
$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

return <<<EOF

<!-- begin logostrip -->
 
<tr>
  <td id="mklogostrip" style="background-image: url('$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

#2 Alk

  • Members
  • 17 posts

Posted 11 March 2006 - 05:08 PM

Quote

REPLACE function view_logo with this modified version.
Could you explain in a little more detail please visiblesoul what code you have to replace the hack with?
Whatever I try to replace in the original code, I get an error so I don't think I am replacing the right bit of code.
Thanks!

#3 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 11 March 2006 - 05:36 PM

Alk said:

Quote

REPLACE function view_logo with this modified version.
Could you explain in a little more detail please visiblesoul what code you have to replace the hack with?
Whatever I try to replace in the original code, I get an error so I don't think I am replacing the right bit of code.
Thanks!
Welcome Alk-

Simply replace the entire function from...
function view_logo() {
until the closing tag of the function...
}
Note that this hack is for MKPortal version 1.0. It may not work with other versions. What version of MKP and IPB are you running?


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

#4 Alk

  • Members
  • 17 posts

Posted 11 March 2006 - 06:20 PM

Yes, that is what I replaced.
I am using IPB v1.3 with mkportal1.1rc1.
That's probably why..
Thanks!

#5 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 15 March 2006 - 12:35 PM

Alk-

I am very sorry. My code above was not all there for IPB1.3. I have corrected the code posted above. I tested it with IPB 1.3 x MKP 1.1Rc1 and it worked for me.

Let me know if this works for you.

-=DKC=-


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