|
From: Jon O. <jon...@us...> - 2008-06-15 21:02:37
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25617 Modified Files: Tag: core28x mx_functions_core.php Log Message: updated load_file() method Index: mx_functions_core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_core.php,v retrieving revision 1.52.2.14 retrieving revision 1.52.2.15 diff -C2 -d -r1.52.2.14 -r1.52.2.15 *** mx_functions_core.php 3 Jun 2008 21:00:25 -0000 1.52.2.14 --- mx_functions_core.php 15 Jun 2008 21:02:29 -0000 1.52.2.15 *************** *** 3072,3075 **** --- 3072,3084 ---- * Load additional functions/classes. * + * The $force_shared parameter will ensure we include the mxp shared version of the file. + * If you need to include a shared version from a different backend, pass this info. + * + * Examples + * + * mx_page::load_file('functions_post'), will include the phpbb version of the file + * mx_page::load_file('functions_post', true), will include the shared phpbb version of the file + * mx_page::load_file('functions_post', 'phpbb2'), will include the shared phpbb2 version of the file, even though we are running in internal/phpbb3 mode + * * @param unknown_type $file * @param unknown_type $backend *************** *** 3080,3085 **** --- 3089,3115 ---- global $mx_root_path, $phpbb_root_path, $phpEx; + /* $path = PORTAL_BACKEND == 'internal' || $force_shared ? $mx_root_path . 'includes/shared/' . PORTAL_BACKEND . '/includes/' : $phpbb_root_path . 'includes/'; + if (file_exists($path . $file.'.'.$phpEx)) + { + @include_once($path . $file.'.'.$phpEx); + } + */ + if (PORTAL_BACKEND == 'internal' || $force_shared) + { + $backend = in_array($force_shared, array('internal', 'phpbb2', 'phpbb3')) ? $force_shared : PORTAL_BACKEND; + switch ($backend) + { + case 'internal': + case 'phpbb2': + $path = $mx_root_path . 'includes/shared/phpbb2/includes/'; + break; + } + } + else + { + $path = $phpbb_root_path . 'includes/'; + } if (file_exists($path . $file.'.'.$phpEx)) |