MKPortal on phpBB 3.0.10

Discussion forum for MOD Writers regarding MOD Development.
Lelouch
Registered User
Posts: 2
Joined: Mon Jul 16, 2007 12:34 pm

MKPortal on phpBB 3.0.10

Post by Lelouch »

I've got many problem in the first time to add MKportal to phpBB 3.0.10, like many other peoples that I've seen on a large ammount of board.
But in the end, I've seen that is very simple.

First of all enter in your phpbb directory, enter the "includes" directory and open "function.php", in that find:

Code: Select all

if (@extension_loaded('zlib') && !headers_sent() && ob_get_level() <= 1 && ob_get_length() == 0)
		{
			ob_start('ob_gzhandler');
		}
	}
After add

Code: Select all

//added from MKportal
    ob_start();
// End added
Then find

Code: Select all

			$template->assign_var('RUN_CRON_TASK', '<img src="' . append_sid($phpbb_root_path . 'cron.' . $phpEx, 'cron_type=' . $cron_type) . '" width="1" height="1" alt="cron" />');
		}
	}

	$template->display('body');

	garbage_collection();
After add:

Code: Select all

//added from MKportal
if (strpos($_SERVER['REQUEST_URI'], '/adm/') === false) {
	define ( 'IN_MKP', 1 );
	require_once "../mkportal/include/PHPBB3/php_out.php";
	mkportal_board_out();
}
//end added
Save the file and activate the option that integrate the forum in your portal and the game is set!
User avatar
orynider
Translator
Posts: 277
Joined: Wed Nov 16, 2005 12:48 pm
Location: Arad, România
Name: Florin-Ciprian Bodin

Re: MKPortal on phpBB 3.0.10

Post by orynider »

You also need to update function display() in includes/template.php somehow like this:

Code: Select all

	function display($handle, $include_once = true)    
	{        
		global $user, $config, $auth, $phpbb_root_path, $phpEx;        
		if (!defined('MK_INDEX')) define('MK_INDEX', str_replace( '\\', '/', dirname(dirname(dirname(__FILE__)))).'/');                
		if (!defined('ADMIN_START')) {            
			global $ForumOut, $FORUM_VIEW, $MK_PATH;                        
			$MK_PATH = "../";                                
			if (!defined('IN_MKP')) define ( 'IN_MKP', 1 );            
			global $SITE_URL, $FORUM_PATH;            
			require_once MK_INDEX."/mkportal/conf_mk.php";            
			if ( !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_') && ($config['board_disable']	|| ($config['limit_load'] && $user->load !== false && $user->load > floatval($config['limit_load']) ) ))            
			{                
				$FORUM_VIEW = '0';            
			}                                    
			if (!defined('CREATED_MK_FORUM_OUT') && $FORUM_VIEW) {                
			define('CREATED_MK_FORUM_OUT', 1);                
			$ForumOut = '';            
			}        
		}        
		if ($filename = $this->_tpl_load($handle))        
		{            
			if( defined('CREATED_MK_FORUM_OUT') && $FORUM_VIEW && $handle == 'body' )            
			{                
				ob_start();                
				($include_once) ? include_once($filename) : include($filename);                
				$ForumOut = ob_get_contents();                   
				ob_end_clean();                
				require_once MK_INDEX."mkportal/include/PHPBB3/php_out.php";                
				mkportal_board_out();            
			} 
			else 
			{                
				($include_once) ? include_once($filename) : include($filename);            
			}        
		}        
		else        
		{            
			if( defined('CREATED_MK_FORUM_OUT') && $FORUM_VIEW && $handle == 'body' )            
			{                
				ob_start();                
				eval(' ?>' . $this->compiled_code[$handle] . '<?php ');                
				$ForumOut = ob_get_contents();                
				ob_end_clean();                
				require_once MK_INDEX."mkportal/include/PHPBB3/php_out.php";                
				mkportal_board_out();            
			} 
			else 
			{                
				eval(' ?>' . $this->compiled_code[$handle] . '<?php ');            
			}        
		}       
		return true;    
	} 

Return to “[3.0.x] MOD Writers Discussion”