[Easymod-cvs] easymod2/mods/easymod/includes admin_easymod.php.txt,1.11,1.12
Status: Beta
Brought to you by:
wgeric
From: Jim W. <ter...@us...> - 2005-06-08 03:12:35
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6023/mods/easymod/includes Modified Files: admin_easymod.php.txt Log Message: - added support for the INCREMENT action - a few other small changes Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** admin_easymod.php.txt 3 Jun 2005 22:59:12 -0000 1.11 --- admin_easymod.php.txt 8 Jun 2005 03:12:20 -0000 1.12 *************** *** 87,91 **** /// /// ! define('EASYMOD_VER', 'beta1 (0.1.13)') ; define('NUTTZY_LINK', '<a href="http://www.spellingcow.com" target="_blank">Nuttzy</a>') ; define('FAQ_LINK', '<a href="http://area51.phpbb.com/phpBB22/viewtopic.php?t=12141" target="_blank">') ; --- 87,91 ---- /// /// ! define('EASYMOD_VER', 'beta1 (0.2.0)') ; define('NUTTZY_LINK', '<a href="http://www.spellingcow.com" target="_blank">Nuttzy</a>') ; define('FAQ_LINK', '<a href="http://area51.phpbb.com/phpBB22/viewtopic.php?t=12141" target="_blank">') ; *************** *** 1408,1411 **** --- 1408,1415 ---- $current_command = 'DIY INSTRUCTIONS'; } + else if ( strstr($buffer, 'INCREMENT') ) + { + $current_command = 'INCREMENT'; + } else if (strstr($buffer, 'SAVE/CLOSE')) { *************** *** 1762,1765 **** --- 1766,1802 ---- } + else if ($commands[$i]['command'] == 'INCREMENT') + { + // strip the body of whitespace down and down to a single line + $body[$i] = strip_whitespace( $body[$i], true) ; + + // if there is not exactly 1 line then throw a critical error + if ( count($body[$i]) != 1) + { + display_error( '<b>' . $lang['EM_err_critical_error'] . "</b><br><br>\n" . $commands[$i]['command'] . $lang['EM_err_increment_body'] . "<br>\n" . $lang['EM_line_num'] . $commands[$i]['line']) ; + break ; + } + + // parse the increment command + $inc_data = array(); + if (!preg_match('#(%\:\d+)\s*([\+\-]\d+)?#',trim($body[$i][0]),$inc_data)) + { + display_error( '<b>' . $lang['EM_err_critical_error'] . "</b><br><br>\n" . $commands[$i]['command'] . $lang['EM_err_increment_body'] . "<br>\n" . $lang['EM_line_num'] . $commands[$i]['line']) ; + break; + } + $inc_data[1] = '{'.$inc_data[1].'}'; + $inc_data[2] = isset($inc_data[2]) ? $inc_data[2] : 1; + + // perform the increment as appropriate + for ( $file = 0; $file < count($file_list); $file++ ) + { + for ( $j = 0; $j < count($find_array); $j++ ) + { + $increment_search = ($search_fragment != '') ? $search_fragment : $search_array[$j]; + $find_array[$file][$j] = increment_wildcard($inc_data[1], $inc_data[2], $increment_search, $find_array[$file][$j]); + } + } + } + // // IN-LINE commands; perform precision operations on a single line |