MyBB Community Forums

Full Version: hook sys help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello!
i want to put this code:
  $cpl = $mybb->settings['cpl'];
  $c=$mybb->settings['cex'];
  $catimg=$mybb->settings['catimg'];
  $csw=100 / $cpl.'%';
  if($forum['type'] == 'c'){
  if($c==1){
  $cc='<div class="hidden">';
  $cce='</div>';
  }else{
  $cc='';
  $cce='';
  }
  if($catimg==1){
  $ccc='<!--';
  $ecc='-->';
  }else{
  $ccc='';
  $ecc='';
  }
  $i++;
  }
  if($i==$cpl){
  $tr_end='</tr><tr><td colspan="'.$cpl.'"><hr></td></tr><tr>';
  $i=$i-$i;
  }else{
  $tr_end='';
  }

after the "build_forumbits_forum" hook (in the mod file.)
i tried to do:
	$plugins->add_hook("build_forumbits_forum", "csmodfunc");
	
	
	function csmodfunc(){
	global $mybb, $forum;
  $cpl = $mybb->settings['cpl'];
  $c=$mybb->settings['cex'];
  $catimg=$mybb->settings['catimg'];
  $csw=100 / $cpl.'%';
  if($forum['type'] == 'c'){
  if($c==1){
  $cc='<div class="hidden">';
  $cce='</div>';
  }else{
  $cc='';
  $cce='';
  }
  if($catimg==1){
  $ccc='<!--';
  $ecc='-->';
  }else{
  $ccc='';
  $ecc='';
  }
  $i++;
  }
  if($i==$cpl){
  $tr_end='</tr><tr><td colspan="'.$cpl.'"><hr></td></tr><tr>';
  $i=$i-$i;
  }else{
  $tr_end='';
  }
	}

but it didnt works.. so how to do this?
You have already a thread and got an answer there... http://community.mybb.com/thread-146843.html