|
From: Jon O. <jon...@us...> - 2008-07-10 22:20:42
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32301 Modified Files: mx_functions_core.php Log Message: Moving load_file to mx_cache... Index: mx_functions_core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_core.php,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** mx_functions_core.php 10 Jul 2008 22:04:52 -0000 1.91 --- mx_functions_core.php 10 Jul 2008 22:20:34 -0000 1.92 *************** *** 460,463 **** --- 460,510 ---- /** + * Load file. + * + * 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_cache::load_file('functions_post'), will include the phpbb version of the file + * mx_cache::load_file('functions_post', true), will include the shared phpbb version of the file + * mx_cache::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 + * @param unknown_type $force_shared + */ + function load_file($file = '', $force_shared = false) + { + global $mx_root_path, $phpbb_root_path, $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; + case 'phpbb3': + $path = $mx_root_path . 'includes/shared/phpbb3/includes/'; + break; + } + } + else + { + $path = $phpbb_root_path . 'includes/'; + } + + if (file_exists($path . $file.'.'.$phpEx)) + { + @include_once($path . $file.'.'.$phpEx); + } + } + + /** * Enter description here... * *************** *** 3649,3699 **** /** - * Load file. - * - * 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 - * @param unknown_type $force_shared - */ - function load_file($file = '', $force_shared = false) - { - global $mx_root_path, $phpbb_root_path, $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; - case 'phpbb3': - $path = $mx_root_path . 'includes/shared/phpbb3/includes/'; - break; - } - } - else - { - $path = $phpbb_root_path . 'includes/'; - } - - if (file_exists($path . $file.'.'.$phpEx)) - { - @include_once($path . $file.'.'.$phpEx); - } - } - - /** * editcp_exists. * --- 3696,3699 ---- |