[Easymod-cvs] easymod/install/em_files/includes/em em_common.php,1.1,1.2 em_functions.php,1.2,1.3 em
Status: Beta
Brought to you by:
wgeric
|
From: Eric F. <wg...@us...> - 2005-12-24 01:44:07
|
Update of /cvsroot/easymod/easymod/install/em_files/includes/em In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29382/em_files/includes/em Modified Files: em_common.php em_functions.php em_parser_text.php Log Message: - a semi decent error reporting system - semi decent debug information for installer - remove trailing white space on the ends of lines, haven't done every file - some minor bug fixes Index: em_common.php =================================================================== RCS file: /cvsroot/easymod/easymod/install/em_files/includes/em/em_common.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** em_common.php 4 Dec 2005 03:12:30 -0000 1.1 --- em_common.php 24 Dec 2005 01:43:42 -0000 1.2 *************** *** 68,82 **** { em_auth(); ! $template->set_filenames(array( 'em_head' => 'admin/em_header.tpl') ); ! // EM's Header! $template->assign_vars(array( 'VERSION' => sprintf($lang['EM_Version'], $board_config['em_version'])) ); - - $template->pparse('em_head'); } --- 68,80 ---- { em_auth(); ! $template->set_filenames(array( 'em_head' => 'admin/em_header.tpl') ); ! // EM's Header! $template->assign_vars(array( 'VERSION' => sprintf($lang['EM_Version'], $board_config['em_version'])) ); } Index: em_functions.php =================================================================== RCS file: /cvsroot/easymod/easymod/install/em_files/includes/em/em_functions.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** em_functions.php 22 Dec 2005 00:33:31 -0000 1.2 --- em_functions.php 24 Dec 2005 01:43:42 -0000 1.3 *************** *** 35,45 **** { $contents = implode('', file($file)); ! } } else { // ERROR, file doesn't exsist ! } ! if(empty($contents)) { --- 35,45 ---- { $contents = implode('', file($file)); ! } } else { // ERROR, file doesn't exsist ! } ! if(empty($contents)) { *************** *** 95,102 **** { global $phpbb_root_path, $phpEx; ! $methods = array(); $set_methods = true; ! $dir = @opendir($phpbb_root_path . $path . 'includes/em'); while( $file = @readdir($dir) ) --- 95,102 ---- { global $phpbb_root_path, $phpEx; ! $methods = array(); $set_methods = true; ! $dir = @opendir($phpbb_root_path . $path . 'includes/em'); while( $file = @readdir($dir) ) *************** *** 114,118 **** } @closedir($dir); ! return $methods; } --- 114,118 ---- } @closedir($dir); ! return $methods; } *************** *** 246,259 **** $mod_styles = unserialize($mod_styles); ! if( !is_array($mod_styles) ) { return true; } ! // Get syle list if( empty($installed_styles) ) { ! $sql = "SELECT themes_id FROM " . THEMES_TABLE; if( !($result = $db->sql_query($sql)) ) --- 246,259 ---- $mod_styles = unserialize($mod_styles); ! if( !is_array($mod_styles) ) { return true; } ! // Get syle list if( empty($installed_styles) ) { ! $sql = "SELECT themes_id FROM " . THEMES_TABLE; if( !($result = $db->sql_query($sql)) ) *************** *** 277,281 **** } } ! return false; } --- 277,281 ---- } } ! return false; } *************** *** 419,423 **** } ! /* --- 419,423 ---- } ! /* *************** *** 426,436 **** function em_trigger_error($err_type, $msg_text) { ! global $lang; ! $msg_text = ( isset($lang[$msg_text]) ) ? $lang[$msg_text] : $msg_text; $args = func_get_args(); ! switch($err_type) ! { case EM_ERR_INSTALL: page_header(); --- 426,446 ---- function em_trigger_error($err_type, $msg_text) { ! global $lang, $template; ! $msg_text = ( isset($lang[$msg_text]) ) ? $lang[$msg_text] : $msg_text; $args = func_get_args(); ! if ( sizeof($args) > 3 ) ! { ! $eval = '$msg_text = sprintf(\'' . $msg_text . '\', '; ! for($i = 3, $total = sizeof($args); $i < $total; $i++ ) ! { ! $eval .= '\'' . addslashes($args[$i]) . '\'' . (( ($i+1) != $total ) ? ', ' : ''); ! } ! $eval .= ');'; ! eval($eval); ! } ! switch($err_type) ! { case EM_ERR_INSTALL: page_header(); *************** *** 439,442 **** --- 449,461 ---- <table border="0" cellpadding="3" cellspacing="1" class="forumline" width="100%"> <tr> + <th>Error</th> + </tr> + <tr> + <td class="row1"><span class="gen"> <br /><?php echo $msg_text; ?><br /> </span></td> + </tr> + </table> + <br clear="all" /> + <table border="0" cellpadding="3" cellspacing="1" class="forumline" width="100%"> + <tr> <th>Error - Debug Information</th> </tr> *************** *** 444,450 **** <td class="row1"><span class="gen"> Formatted for forum posting<br /><br /> ! [quote="the error"]<strong><?php echo $msg_text; ?></strong>[/quote] ! <h3>[size=18]Debug Information[/size]</h3> <?php em_debug_display(); ?> </span></td> </tr> --- 463,470 ---- <td class="row1"><span class="gen"> Formatted for forum posting<br /><br /> ! [quote][quote="the error"]<?php echo $msg_text; ?>[/quote] ! <h2>[size=20]Debug Information[/size]</h2><br /> <?php em_debug_display(); ?> + [/quote] </span></td> </tr> *************** *** 452,474 **** <?php break; ! case EM_ERR_WARNING: ! echo '<strong>Warning!</strong><br />'; ! echo $msg_text; ! vd($args); ! ! break; ! ! case EM_ERR_CRITICAL: ! echo '<strong>Critical error!</strong><br />'; ! echo $msg_text; ! vd($args); break; ! default: // no error type found break; } ! return; } --- 472,491 ---- <?php break; ! case EM_ERR_WARNING: ! case EM_ERR_CRITICAL: ! $template->assign_block_vars('switch_error', array( ! 'TITLE' => ( $err_type == EM_ERR_WARNING ) ? $lang['EM_Err_warning'] : $lang['EM_Err_critical'], ! 'EXPLAIN' => ( $err_type == EM_ERR_WARNING ) ? $lang['EM_Err_warning_explain'] : $lang['EM_Err_critical_explain'], ! 'MESSAGE' => $msg_text, ! 'CODE' => htmlspecialchars(stripslashes($args[2]))) ! ); break; ! default: // no error type found break; } ! return; } Index: em_parser_text.php =================================================================== RCS file: /cvsroot/easymod/easymod/install/em_files/includes/em/em_parser_text.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** em_parser_text.php 9 Dec 2005 23:35:33 -0000 1.2 --- em_parser_text.php 24 Dec 2005 01:43:42 -0000 1.3 *************** *** 156,159 **** --- 156,160 ---- { $line = trim($this->mod_contents[$i]); + $line_one = false; if ( strstr($line, '##') && !strstr($line, '###') ) *************** *** 163,169 **** { $current_action = $this->valid_actions[$action]; } ! $contents = ( strstr($line, ':') && $current_action != 'desc' && $current_action != 'author-notes' ) ? trim(htmlspecialchars(substr($line, strpos($line, ':')+1))) : trim(htmlspecialchars(substr($line, 2))); if ( $current_action == 'desc' || $current_action == 'author-notes' ) --- 164,171 ---- { $current_action = $this->valid_actions[$action]; + $line_one = true; } ! $contents = ( (strstr($line, ':') && $current_action != 'desc' && $current_action != 'author-notes') || (($current_action == 'desc' || $current_action == 'author-notes') && $line_one == true) ) ? trim(htmlspecialchars(substr($line, strpos($line, ':')+1))) : trim(htmlspecialchars(substr($line, 2))); if ( $current_action == 'desc' || $current_action == 'author-notes' ) |