|
From: Jon O. <jon...@us...> - 2008-07-10 22:27:28
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4580 Modified Files: Tag: core28x 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.52.2.15 retrieving revision 1.52.2.16 diff -C2 -d -r1.52.2.15 -r1.52.2.16 *** mx_functions_core.php 15 Jun 2008 21:02:29 -0000 1.52.2.15 --- mx_functions_core.php 10 Jul 2008 22:27:23 -0000 1.52.2.16 *************** *** 131,134 **** --- 131,186 ---- /** + * 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; + + /* + $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)) + { + @include_once($path . $file.'.'.$phpEx); + } + } + + /** * Read. * *************** *** 3068,3123 **** /** - * 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; - - /* - $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)) - { - @include_once($path . $file.'.'.$phpEx); - } - } - - /** * editcp_exists. * --- 3120,3123 ---- |