easymod-cvs Mailing List for EasyMOD
Status: Beta
Brought to you by:
wgeric
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
(16) |
May
(36) |
Jun
(53) |
Jul
(21) |
Aug
|
Sep
(10) |
Oct
(4) |
Nov
(69) |
Dec
(57) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(8) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
(5) |
Oct
(3) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
(12) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jim W. <ter...@us...> - 2008-02-16 22:18:36
|
Update of /cvsroot/easymod/sql_parser/root/includes/sql In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv13207 Modified Files: sql_builder_postgresql.php Log Message: - fixed bug 1680118 - PostgreSQL errors Index: sql_builder_postgresql.php =================================================================== RCS file: /cvsroot/easymod/sql_parser/root/includes/sql/sql_builder_postgresql.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sql_builder_postgresql.php 26 Sep 2005 09:59:13 -0000 1.3 --- sql_builder_postgresql.php 16 Feb 2008 22:18:28 -0000 1.4 *************** *** 227,231 **** $set_default = ( strstr('BIFD', $column_data['constant_type']) ? 0 : "''" ); } ! $sql_output[] = 'UPDATE TABLE ' . $sql_data['table_name'] . " SET $column_name = $set_default WHERE $column_name IS NULL"; $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name'] . ' ALTER COLUMN ' . $column_name . $set_null; } --- 227,231 ---- $set_default = ( strstr('BIFD', $column_data['constant_type']) ? 0 : "''" ); } ! $sql_output[] = 'UPDATE ' . $sql_data['table_name'] . " SET $column_name = $set_default WHERE $column_name IS NULL"; $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name'] . ' ALTER COLUMN ' . $column_name . $set_null; } *************** *** 274,278 **** if( $set_drop == 'SET' && isset($column_data['default']) ) { ! $sql_output[] = 'UPDATE TABLE ' . $sql_data['table_name'] . " SET $column_name = " . $column_data['default'] . " WHERE $column_name IS NULL"; } $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name'] . ' ALTER COLUMN ' . $column_name . ' ' . $set_drop . ' NOT NULL'; --- 274,278 ---- if( $set_drop == 'SET' && isset($column_data['default']) ) { ! $sql_output[] = 'UPDATE ' . $sql_data['table_name'] . " SET $column_name = " . $column_data['default'] . " WHERE $column_name IS NULL"; } $sql_output[] = 'ALTER TABLE ' . $sql_data['table_name'] . ' ALTER COLUMN ' . $column_name . ' ' . $set_drop . ' NOT NULL'; |
From: Jim W. <ter...@us...> - 2008-02-16 21:54:02
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv2706 Modified Files: easymod_install.php Log Message: - fixed bug 1680118 - PostgreSQL errors Index: easymod_install.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_install.php,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** easymod_install.php 11 Feb 2008 01:00:16 -0000 1.52 --- easymod_install.php 16 Feb 2008 21:53:58 -0000 1.53 *************** *** 941,948 **** if( $create_easymod_table ) { ! $sql[] = "CREATE SEQUENCE " . EASYMOD_TABLE . "_mod_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1"; $sql[] = "CREATE TABLE " . EASYMOD_TABLE . " ( ! mod_id int4 NOT NULL DEFAULT nextval('" . EASYMOD_TABLE . "_mod_id_seq'::text), CONSTRAINT PK_phpbb_easymod PRIMARY KEY (mod_id), mod_title varchar(255) NULL DEFAULT '', --- 941,948 ---- if( $create_easymod_table ) { ! $sql[] = "CREATE SEQUENCE " . EASYMOD_TABLE . "_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1"; $sql[] = "CREATE TABLE " . EASYMOD_TABLE . " ( ! mod_id int4 NOT NULL DEFAULT nextval('" . EASYMOD_TABLE . "_id_seq'::text), CONSTRAINT PK_phpbb_easymod PRIMARY KEY (mod_id), mod_title varchar(255) NULL DEFAULT '', |
From: Jim W. <ter...@us...> - 2008-02-16 21:47:09
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv32352 Modified Files: admin_easymod.php.txt Log Message: - fixed bug 1852872 - misidentification of SQL action Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** admin_easymod.php.txt 16 Feb 2008 15:12:42 -0000 1.56 --- admin_easymod.php.txt 16 Feb 2008 21:47:01 -0000 1.57 *************** *** 1687,1691 **** if ($mod_type == MODX) { ! $modx = new mod_parser_xml(implode("\n", file($install_path . $install_file))); $modx->_parse(); --- 1687,1691 ---- if ($mod_type == MODX) { ! $modx = new mod_parser_xml(implode('', file($install_path . $install_file))); $modx->_parse(); *************** *** 1716,1720 **** { // if we find [ and ] and OPEN on this line, then we can be reasonably sure we've got an OPEN command ! if ((strstr($buffer, '[')) && (strstr($buffer, ']')) && (strstr($buffer, 'OPEN'))) { // get us past any remaining # lines --- 1716,1720 ---- { // if we find [ and ] and OPEN on this line, then we can be reasonably sure we've got an OPEN command ! if ((substr($buffer, 0, 2) != '##') && (strstr($buffer, '[')) && (strstr($buffer, ']')) && (strstr($buffer, 'OPEN'))) { // get us past any remaining # lines *************** *** 2086,2090 **** // if we find [ and ] on this line, then we can be reasonably sure it is an action command ! if ((strstr($buffer, '[')) && (strstr($buffer, ']'))) { --- 2086,2090 ---- // if we find [ and ] on this line, then we can be reasonably sure it is an action command ! if ((substr($buffer, 0, 2) != '##') && (strstr($buffer, '[')) && (strstr($buffer, ']'))) { |
From: Jim W. <ter...@us...> - 2008-02-16 15:12:48
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv7111 Modified Files: admin_easymod.php.txt Log Message: - fixed bug 1843472 - INCREMENTs don't work on multi-line FINDs Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** admin_easymod.php.txt 10 Feb 2008 23:45:23 -0000 1.55 --- admin_easymod.php.txt 16 Feb 2008 15:12:42 -0000 1.56 *************** *** 2542,2546 **** for ( $file_count = 0; $file_count < count($file_list); $file_count++ ) { ! for ( $j = 0; $j < count($find_array); $j++ ) { $increment_search = ($search_fragment != '') ? $search_fragment : $search_array[$j]; --- 2542,2546 ---- for ( $file_count = 0; $file_count < count($file_list); $file_count++ ) { ! for ( $j = 0; $j < count($find_array[$file_count]); $j++ ) { $increment_search = ($search_fragment != '') ? $search_fragment : $search_array[$j]; *************** *** 2552,2556 **** } } ! if ($j == count($find_array)) { // halt if this is an english lang file --- 2552,2556 ---- } } ! if ($j == count($find_array[$find_array])) { // halt if this is an english lang file |
From: Jim W. <ter...@us...> - 2008-02-11 01:00:20
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv26713 Modified Files: easymod_install.php Log Message: - fixed bug 1763346 - BLOB/TEXT column 'mod_description' can't have a default value Index: easymod_install.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_install.php,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** easymod_install.php 10 Feb 2008 14:39:51 -0000 1.51 --- easymod_install.php 11 Feb 2008 01:00:16 -0000 1.52 *************** *** 916,920 **** mod_author_name varchar(100) NULL DEFAULT '', mod_author_url varchar(100) NULL DEFAULT '', ! mod_description text NULL DEFAULT '', mod_process_date int(11) NULL DEFAULT '0', mod_phpBB_version varchar(15) NULL DEFAULT '', --- 916,920 ---- mod_author_name varchar(100) NULL DEFAULT '', mod_author_url varchar(100) NULL DEFAULT '', ! mod_description text NULL, mod_process_date int(11) NULL DEFAULT '0', mod_phpBB_version varchar(15) NULL DEFAULT '', |
From: Jim W. <ter...@us...> - 2008-02-10 23:45:27
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv25115 Modified Files: admin_easymod.php.txt Log Message: rm debug code Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** admin_easymod.php.txt 10 Feb 2008 23:43:11 -0000 1.54 --- admin_easymod.php.txt 10 Feb 2008 23:45:23 -0000 1.55 *************** *** 3509,3513 **** if ($failure) { ! $sql[] = array('command' => $sql_line, 'status' => '<b>' . 'zzz.1'.$lang['EM_not_attempted'] . '</b>'); } else if ($sql_allow) --- 3509,3513 ---- if ($failure) { ! $sql[] = array('command' => $sql_line, 'status' => '<b>' . '1'.$lang['EM_not_attempted'] . '</b>'); } else if ($sql_allow) *************** *** 3520,3524 **** $failure = true; ! $error = $db->sql_error().'zzz'; //echo "[" . $error['message'] . "][" . $error['code'] . "]<br />\n"; //exit; --- 3520,3524 ---- $failure = true; ! $error = $db->sql_error(); //echo "[" . $error['message'] . "][" . $error['code'] . "]<br />\n"; //exit; |
From: Jim W. <ter...@us...> - 2008-02-10 23:43:15
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv24267 Modified Files: admin_easymod.php.txt Log Message: - fixed bug 1593154 - REPLACEs don't need to be preceeded by FINDs Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** admin_easymod.php.txt 10 Feb 2008 14:39:51 -0000 1.53 --- admin_easymod.php.txt 10 Feb 2008 23:43:11 -0000 1.54 *************** *** 2313,2322 **** // that the find_array is being managed correctly; OPEN and FIND write out any remenants of find_array; AFTER // and REPLACE destroy the array while BEFORE and the IN-LINE's preserve it to be used again ! if ((count($find_array) == 0 ) && (($commands[$i]['command'] == 'BEFOREADD') || (strstr($commands[$i]['command'], 'IN-LINE')))) { ! display_error( '<b>' . $lang['EM_err_critical_error'] . "</b><br /><br />\n" . $commands[$i]['command'] . $lang['EM_err_no_find'] . "<br />\n" . $lang['EM_line_num'] . $commands[$i]['line']); ! break; ! } // --- 2313,2337 ---- // that the find_array is being managed correctly; OPEN and FIND write out any remenants of find_array; AFTER // and REPLACE destroy the array while BEFORE and the IN-LINE's preserve it to be used again ! if (count($find_array) == 0) { ! $error = false; ! switch ($commands[$i]['command']) ! { ! case 'BEFOREADD': ! case 'REPLACE': ! case 'AFTERADD': ! case 'INCREMENT': ! case 'IN-LINE BEFOREADD': ! case 'IN-LINE REPLACE': ! case 'IN-LINE AFTERADD': ! display_error( '<b>' . $lang['EM_err_critical_error'] . "</b><br /><br />\n" . $commands[$i]['command'] . $lang['EM_err_no_find'] . "<br />\n" . $lang['EM_line_num'] . $commands[$i]['line']); ! $error = true; ! } + if ($error) + { + break; + } + } // *************** *** 3494,3498 **** if ($failure) { ! $sql[] = array('command' => $sql_line, 'status' => '<b>' . $lang['EM_not_attempted'] . '</b>'); } else if ($sql_allow) --- 3509,3513 ---- if ($failure) { ! $sql[] = array('command' => $sql_line, 'status' => '<b>' . 'zzz.1'.$lang['EM_not_attempted'] . '</b>'); } else if ($sql_allow) *************** *** 3505,3509 **** $failure = true; ! $error = $db->sql_error(); //echo "[" . $error['message'] . "][" . $error['code'] . "]<br />\n"; //exit; --- 3520,3524 ---- $failure = true; ! $error = $db->sql_error().'zzz'; //echo "[" . $error['message'] . "][" . $error['code'] . "]<br />\n"; //exit; |
From: Jim W. <ter...@us...> - 2008-02-10 14:39:57
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv28265/includes Modified Files: admin_easymod.php.txt Log Message: - fixed bug 1528971 - IN-LINE REPACE WITH action problem Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** admin_easymod.php.txt 8 Feb 2008 19:26:44 -0000 1.52 --- admin_easymod.php.txt 10 Feb 2008 14:39:51 -0000 1.53 *************** *** 2595,2603 **** $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_inline_body'] . "<br />\n" . $lang['EM_line_num'] . $commands[$i]['line']); ! break; } --- 2595,2615 ---- $body[$i] = strip_whitespace($body[$i], true); ! if ($commands[$i]['command'] == 'IN-LINE REPLACE') { ! // IN-LINE FINDs can be blank or contain actual, at most, one line. ! if (count($body[$i]) > 1) ! { ! display_error('<b>' . $lang['EM_err_critical_error'] . "</b><br /><br />\n" . $commands[$i]['command'] . $lang['EM_err_inline_body'] . "<br />\n" . $lang['EM_line_num'] . $commands[$i]['line']); ! break; ! } ! } ! else ! { ! // 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_inline_body'] . "<br />\n" . $lang['EM_line_num'] . $commands[$i]['line']); ! break; ! } } |
From: Jim W. <ter...@us...> - 2008-02-10 14:39:56
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv28265 Modified Files: easymod_install.php Log Message: - fixed bug 1528971 - IN-LINE REPACE WITH action problem Index: easymod_install.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_install.php,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** easymod_install.php 22 Feb 2007 03:32:20 -0000 1.50 --- easymod_install.php 10 Feb 2008 14:39:51 -0000 1.51 *************** *** 744,748 **** $command_file = new mod_io('post_process.sh', '', $read, $write, $move, $ftp_user, $ftp_pass, $ftp_dir, $ftp_host, $ftp_port, $ftp_type, $ftp_cache); - //TerraFrost sez hi // this is really more about moving the other files than is about the command file; establish the FTP connection // for moving files if necessary --- 744,747 ---- |
From: Jim W. <ter...@us...> - 2008-02-08 19:27:25
|
Update of /cvsroot/easymod/easymod2/mods/easymod/em_includes In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv9310/em_includes Modified Files: parser_xml.php Log Message: - fixed a few bugs in the modx parsing routines Index: parser_xml.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/parser_xml.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** parser_xml.php 1 Oct 2006 22:09:24 -0000 1.1 --- parser_xml.php 8 Feb 2008 19:26:43 -0000 1.2 *************** *** 61,65 **** function mod_parser_xml($mod_contents) { ! $this->mod_contents = preg_replace("/\r?\n|\r/", "\n", stripslashes(trim($mod_contents))); } --- 61,65 ---- function mod_parser_xml($mod_contents) { ! $this->mod_contents = str_replace(array("\r\n", "\r", "\n"), "\n", trim($mod_contents)); } *************** *** 113,121 **** if(isset($this->data[count($this->data)-1]['data'])) { ! $this->data[count($this->data)-1]['data'] .= unhtmlspecialchars($tag_data); } else { ! $this->data[count($this->data)-1]['data'] = unhtmlspecialchars($tag_data); } } --- 113,121 ---- if(isset($this->data[count($this->data)-1]['data'])) { ! $this->data[count($this->data)-1]['data'] .= $tag_data; } else { ! $this->data[count($this->data)-1]['data'] = $tag_data; } } *************** *** 239,242 **** --- 239,245 ---- $action_info = ( !empty($edit_info[$j]['children']) ) ? $edit_info[$j]['children'] : array(); $this->actions['open'][$current_file]['edit'][$j]['find'] = $action_info['FIND'][0]['data']; + //echo '<pre>'; + //print_r($this->actions['open'][$current_file]['edit'][$j]['find']); + //exit('</pre>'); $actions = ( !empty($action_info['ACTION']) ) ? $action_info['ACTION'] : array(); *************** *** 290,300 **** } - function unhtmlspecialchars($string) - { - $unhtml_specialchars_match = array('#>#', '#<#', '#"#', '#&#'); - $unhtml_specialchars_replace = array('>', '<', '"', '&'); - - return preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, $string); - } - ?> \ No newline at end of file --- 293,295 ---- |
From: Jim W. <ter...@us...> - 2008-02-08 19:27:25
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv9310/includes Modified Files: admin_easymod.php.txt Log Message: - fixed a few bugs in the modx parsing routines Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** admin_easymod.php.txt 22 Feb 2007 03:32:20 -0000 1.51 --- admin_easymod.php.txt 8 Feb 2008 19:26:44 -0000 1.52 *************** *** 412,416 **** global $phpbb_root_path, $script_path; ! $modx = new mod_parser_xml(implode("\n", file($file))); $modx->parse_header(); --- 412,416 ---- global $phpbb_root_path, $script_path; ! $modx = new mod_parser_xml(implode("", file($file))); $modx->parse_header(); *************** *** 1866,1870 **** if ($mod_type == MODX) { ! $modx = new mod_parser_xml(implode("\n", file($install_path . $install_file))); $modx->parse_actions(); --- 1866,1870 ---- if ($mod_type == MODX) { ! $modx = new mod_parser_xml(implode('', file($install_path . $install_file))); $modx->parse_actions(); *************** *** 1909,1913 **** $commands[] = array('command' => $current_command, 'line' => $edit_actions[$j]['line']); ! $body[] = $code; } --- 1909,1913 ---- $commands[] = array('command' => $current_command, 'line' => $edit_actions[$j]['line']); ! $body[] = $code."\n"; } *************** *** 1974,1982 **** $commands[] = array('command' => 'OPEN', 'line' => 0); $body[] = array($file); ! for($i = 0, $total = sizeof($actions['edit']); $i < $total; $i++) { $commands[] = array('command' => 'FIND', 'line' => 0); ! $body[] = explode("\n", $actions['edit'][$i]['find']); $edit_actions = $actions['edit'][$i]['action']; --- 1974,1989 ---- $commands[] = array('command' => 'OPEN', 'line' => 0); $body[] = array($file); ! for($i = 0, $total = sizeof($actions['edit']); $i < $total; $i++) { $commands[] = array('command' => 'FIND', 'line' => 0); ! ! $temp = explode("\n", $actions['edit'][$i]['find']); ! for ($j = 0; $j < count($temp); $j++) ! { ! $temp[$j].= "\n"; ! } ! ! $body[] = $temp; $edit_actions = $actions['edit'][$i]['action']; *************** *** 1984,1990 **** { $code = explode("\n", $edit_actions[$j]['code']); for($k = 0, $total3 = sizeof($code); $k < $total3; $k++) { ! $code[$k] = rtrim($code[$k]) . "\n"; } --- 1991,1998 ---- { $code = explode("\n", $edit_actions[$j]['code']); + for($k = 0, $total3 = sizeof($code); $k < $total3; $k++) { ! $code[$k] = rtrim($code[$k]). "\n"; } |
From: Jim W. <ter...@us...> - 2008-02-08 19:26:53
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv9310 Modified Files: modx_inside.png Log Message: - fixed a few bugs in the modx parsing routines Index: modx_inside.png =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/modx_inside.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsEGMgUf and /tmp/cvsFjlQD5 differ |
From: Eric F. <wg...@us...> - 2007-02-22 03:32:32
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv20896 Modified Files: easymod_display_functions.php easymod_install.php Log Message: - MODs can't edit files with 'config' in them. Makes it so can't edit config.php - Attempt to move a .htaccess file into place so that you can't browse the mods folder after installing EasyMOD - Removed the EasyMOD version check on install. Index: easymod_display_functions.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_display_functions.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** easymod_display_functions.php 30 Sep 2006 17:59:09 -0000 1.26 --- easymod_display_functions.php 22 Feb 2007 03:32:20 -0000 1.27 *************** *** 746,755 **** { // if this version matches the one in the DB, then throw an error if ( $row['config_value'] == $easymod_install_version) { $error_msg = '<strong>' . $lang['EM_err_critical_error'] . ':</strong> ' . $lang['EM_err_dupe_install']; $error_msg .= '<br /><br />' . $lang['EN_reinstall_version']; ! handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $error_msg); ! } } $db->sql_freeresult($result); --- 746,756 ---- { // if this version matches the one in the DB, then throw an error + /* 0.4.0 removing check to see if EasyMOD has already been installed. Reinstalling easymod won't hurt anything if ( $row['config_value'] == $easymod_install_version) { $error_msg = '<strong>' . $lang['EM_err_critical_error'] . ':</strong> ' . $lang['EM_err_dupe_install']; $error_msg .= '<br /><br />' . $lang['EN_reinstall_version']; ! handle_error( OPEN_FAIL_OK, $file_list, false, $error_msg); ! }*/ } $db->sql_freeresult($result); Index: easymod_install.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_install.php,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** easymod_install.php 1 Oct 2006 22:09:24 -0000 1.49 --- easymod_install.php 22 Feb 2007 03:32:20 -0000 1.50 *************** *** 791,794 **** --- 791,796 ---- $command_file->afile[] = 'copy includes/sql/sql_reserved_keywords.php ../../../includes/sql/sql_reserved_keywords.php'; $command_file->afile[] = 'copy languages/lang_sql_parser.php ../../../language/lang_english/lang_sql_parser.php'; + + //$command_file->afile[] = 'copy includes/htaccess.txt ../../../admin/mods/.htaccess'; ////////////// *************** *** 1872,1875 **** --- 1874,1884 ---- } + // move protective .htaccess file into place + $type = $lang['EM_pp_download']; + $link = 'easymod_install.' . $phpEx . '?install_step=6&mode=file&pw=' . md5($em_pass) . '&file=../../../admin/mods/.htaccess'; + $io = new mod_io('post_process.sh', '', $read, $write, $move, $ftp_user, $ftp_pass, $ftp_dir, $ftp_host, $ftp_port, $ftp_type, $ftp_cache); + $io->modio_prep('move'); + $io->modio_move('../../../admin/mods/.htaccess', 'includes/htaccess.txt', 1, $link, $type); + echo '<br /><br /><strong>' . $lang['EM_move_htaccess'] . '</strong>: <b class="ok">' . $lang['EM_done'] . "</b>\n"; // |
From: Eric F. <wg...@us...> - 2007-02-22 03:32:32
|
Update of /cvsroot/easymod/easymod2/mods/easymod/languages In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv20896/languages Modified Files: lang_easymod_english.php Log Message: - MODs can't edit files with 'config' in them. Makes it so can't edit config.php - Attempt to move a .htaccess file into place so that you can't browse the mods folder after installing EasyMOD - Removed the EasyMOD version check on install. Index: lang_easymod_english.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/languages/lang_easymod_english.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** lang_easymod_english.php 9 Feb 2007 00:49:26 -0000 1.14 --- lang_easymod_english.php 22 Feb 2007 03:32:21 -0000 1.15 *************** *** 230,234 **** $lang['EM_more_info'] = 'More information'; $lang['EM_see_file_access'] = 'Let\'s see what you have for file access. You do not need everything to read \'ok\'.'; ! $lang['EN_reinstall_version'] = 'If you are trying to reinstall this version, change the EM version number from the Admin Control Panel under EasyMOD Settings. Or you could also use the EM Version Changer (by GPHemsley) <a href="http://area51.phpbb.com/phpBB/viewtopic.php?f=24&t=13559&start=17#92295">here</a>.'; $lang['EM_simple_mode'] = 'Simple Mode'; $lang['EM_advanced_mode'] = 'Advanced Mode'; --- 230,234 ---- $lang['EM_more_info'] = 'More information'; $lang['EM_see_file_access'] = 'Let\'s see what you have for file access. You do not need everything to read \'ok\'.'; ! $lang['EN_reinstall_version'] = 'If you are trying to reinstall this version, change the EM version number from the Admin Control Panel under EasyMOD Settings. Or you could also use the EM Version Changer (by GPHemsley) <a href="http://area51.phpbb.com/phpBB/viewtopic.php?p=92295#p92295">here</a>.'; $lang['EM_simple_mode'] = 'Simple Mode'; $lang['EM_advanced_mode'] = 'Advanced Mode'; *************** *** 431,434 **** --- 431,435 ---- $lang['EM_store_files'] = 'Storing processed files table'; $lang['EM_do_worry'] = 'Could not successfully update table. Something is wrong and install cannot complete.'; + $lang['EM_move_htaccess'] = 'Moving protective .htaccess file into place'; $lang['EM_complete_post'] = 'Completing Post-Process'; $lang['EM_admin_panel'] = 'You can now proceed to the Admin Control Panel and select "Install MODs" under "MOD Center". You may install the included MODs if you desire. Return to <a href="%s">Forum Index</a>.'; *************** *** 509,512 **** --- 510,514 ---- $lang['EM_err_find_fail'] = 'FIND FAILED: In file [%s] could not find'; $lang['EM_err_ifind_fail'] = 'IN-LINE FIND FAILED: In file [%s] could not find'; + $lang['EM_error_edit_config'] = '<b>Critical Error:</b> This MOD is trying to edit config.php. This is a security risk. MOD will not be installed.'; // admin_easymod errors |
From: Eric F. <wg...@us...> - 2007-02-22 03:32:32
|
Update of /cvsroot/easymod/easymod2/mods/easymod/em_includes In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv20896/em_includes Modified Files: em_ftp.php em_functions.php em_modio.php Log Message: - MODs can't edit files with 'config' in them. Makes it so can't edit config.php - Attempt to move a .htaccess file into place so that you can't browse the mods folder after installing EasyMOD - Removed the EasyMOD version check on install. Index: em_functions.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_functions.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** em_functions.php 8 Jun 2006 04:08:07 -0000 1.23 --- em_functions.php 22 Feb 2007 03:32:20 -0000 1.24 *************** *** 250,253 **** --- 250,262 ---- $edit->emftp = $command_file->emftp ; + // don't let mods edit config.php + if (stristr($filename, 'config')) + { + $edit->err_msg = $lang['EM_trace'] . ': open_files[6]'; + $edit->err_msg = '<b>' . $lang['EM_err_critical_error'] . '</b><br /><br />' . $lang['EM_error_edit_config']; + $file_list[] = $edit ; + return OPEN_FAIL_CRITICAL; + } + // open the file and update our command file actions if ( $edit->modio_open()) *************** *** 844,848 **** // assume the EM_test.txt file exists; now see if we can chmod it ! if ( chmod( 'EM_test.txt', 0777)) { $access_msg = $lang['EM_ok'] ; --- 853,857 ---- // assume the EM_test.txt file exists; now see if we can chmod it ! if ( chmod( 'EM_test.txt', 0755)) { $access_msg = $lang['EM_ok'] ; *************** *** 892,896 **** // check for server mkdir access ! if ( mkdir( 'EM_test_dir', 0777) ) { // clean up! --- 901,905 ---- // check for server mkdir access ! if ( mkdir( 'EM_test_dir', 0755) ) { // clean up! Index: em_modio.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_modio.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** em_modio.php 1 Oct 2006 22:09:24 -0000 1.11 --- em_modio.php 22 Feb 2007 03:32:20 -0000 1.12 *************** *** 132,137 **** { // use the mkdir command ! mkdir($dir_path, 0777); ! chmod($dir_path, 0777); } --- 132,137 ---- { // use the mkdir command ! mkdir($dir_path, 0755); ! chmod($dir_path, 0755); } *************** *** 182,187 **** { // use the mkdir command ! mkdir($dir_path, 0777); ! chmod($dir_path, 0777); } $dir_path .= '/' ; --- 182,187 ---- { // use the mkdir command ! mkdir($dir_path, 0755); ! chmod($dir_path, 0755); } $dir_path .= '/' ; *************** *** 211,216 **** if (!file_exists($dir_path)) { ! mkdir($dir_path, 0777); ! chmod($dir_path, 0777); } $dir_path .= '/' ; --- 211,216 ---- if (!file_exists($dir_path)) { ! mkdir($dir_path, 0755); ! chmod($dir_path, 0755); } $dir_path .= '/' ; *************** *** 359,363 **** if ($create_command) { ! chmod( $install_path . $this->path . trim($this->filename), 0777 ) ; } --- 359,363 ---- if ($create_command) { ! chmod( $install_path . $this->path . trim($this->filename), 0755 ) ; } *************** *** 365,369 **** else { ! chmod( $install_path . 'processed/' . $this->path . trim($this->filename) . '.txt', 0777 ) ; } } --- 365,369 ---- else { ! chmod( $install_path . 'processed/' . $this->path . trim($this->filename) . '.txt', 0755 ) ; } } *************** *** 601,609 **** // I lifted this list from the attachment MOD and it saved me a lot of time. Thank you Acyd Burn! $extensions = array('ace', 'ai', 'aif', 'aifc', 'aiff', 'ar', 'asf', 'asx', 'au', 'avi', 'doc', 'dot', 'gif', 'gtar', 'gz', 'ivf', 'jpeg', 'jpg', 'm3u', 'mid', 'midi', 'mlv', 'mp2', 'mp3', 'mp2v', 'mpa', 'mpe', 'mpeg', 'mpg', 'mpv2', 'pdf', 'png', 'ppt', 'ps', 'rar', 'rm', 'rmi', 'snd', 'swf', 'tga', 'tif', 'wav', 'wax', 'wm', 'wma', 'wmv', 'wmx', 'wvx', 'xls', 'zip') ; ! $is_binary = false ; // see if the extension is in our list of binary types // damn! i wanted to use array_key_exists, but that is a PHP 4 function :( ! for ($count=0; $count<count($extensions); $count++) { // its a binary so mark it as such --- 601,609 ---- // I lifted this list from the attachment MOD and it saved me a lot of time. Thank you Acyd Burn! $extensions = array('ace', 'ai', 'aif', 'aifc', 'aiff', 'ar', 'asf', 'asx', 'au', 'avi', 'doc', 'dot', 'gif', 'gtar', 'gz', 'ivf', 'jpeg', 'jpg', 'm3u', 'mid', 'midi', 'mlv', 'mp2', 'mp3', 'mp2v', 'mpa', 'mpe', 'mpeg', 'mpg', 'mpv2', 'pdf', 'png', 'ppt', 'ps', 'rar', 'rm', 'rmi', 'snd', 'swf', 'tga', 'tif', 'wav', 'wax', 'wm', 'wma', 'wmv', 'wmx', 'wvx', 'xls', 'zip') ; ! $is_binary = true ; // forcing binary for every file // see if the extension is in our list of binary types // damn! i wanted to use array_key_exists, but that is a PHP 4 function :( ! /*for ($count=0; $count<count($extensions); $count++) { // its a binary so mark it as such *************** *** 613,617 **** break ; } ! } --- 613,617 ---- break ; } ! }*/ Index: em_ftp.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_ftp.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** em_ftp.php 9 Feb 2007 00:49:26 -0000 1.17 --- em_ftp.php 22 Feb 2007 03:32:20 -0000 1.18 *************** *** 299,305 **** { $emftp->ftp_chdir('em_includes'); ! $emftp->emftp_chmod('em_includes', '0777'); $emftp->ftp_chdir('cache'); ! $emftp->emftp_chmod('cache', '0777'); } --- 299,305 ---- { $emftp->ftp_chdir('em_includes'); ! $emftp->emftp_chmod('em_includes', '0755'); $emftp->ftp_chdir('cache'); ! $emftp->emftp_chmod('cache', '0755'); } *************** *** 1195,1199 **** if ( $result ) { ! $this->emftp_chmod($dir_name, '0777'); } return $result; --- 1195,1199 ---- if ( $result ) { ! $this->emftp_chmod($dir_name, '0755'); } return $result; *************** *** 1202,1206 **** { $result = @ftp_mkdir( $this->ftp_conn_id, $dir_name) ; ! $this->emftp_chmod($dir_name, '0777'); // return $result ; ///////////// --- 1202,1206 ---- { $result = @ftp_mkdir( $this->ftp_conn_id, $dir_name) ; ! $this->emftp_chmod($dir_name, '0755'); // return $result ; ///////////// |
From: Eric F. <wg...@us...> - 2007-02-22 03:32:32
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv20896/includes Modified Files: admin_easymod.php.txt Added Files: htaccess.txt Log Message: - MODs can't edit files with 'config' in them. Makes it so can't edit config.php - Attempt to move a .htaccess file into place so that you can't browse the mods folder after installing EasyMOD - Removed the EasyMOD version check on install. Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** admin_easymod.php.txt 9 Feb 2007 00:49:26 -0000 1.50 --- admin_easymod.php.txt 22 Feb 2007 03:32:20 -0000 1.51 *************** *** 3077,3084 **** $mod_description = ''; $mod_version = ''; ! $compliant = false; // get the properties of the MOD so we can display them nicely ! get_mod_properties($install_path . '/' . $install_file, $mod_title, $mod_author_handle, $mod_author_email, $mod_author_name, $mod_author_url, $mod_description, $mod_version, $compliant); $mod_themes = get_themes(); --- 3077,3084 ---- $mod_description = ''; $mod_version = ''; ! $compliant = $modx_mod = false; // get the properties of the MOD so we can display them nicely ! get_mod_properties($install_path . '/' . $install_file, $mod_title, $mod_author_handle, $mod_author_email, $mod_author_name, $mod_author_url, $mod_description, $mod_version, $compliant, $modx_mod); $mod_themes = get_themes(); *************** *** 3745,3750 **** $mod_description = ''; $mod_version = ''; ! $compliant = false; ! get_mod_properties($install_path . '/' . $install_file, $mod_title, $mod_author_handle, $mod_author_email, $mod_author_name, $mod_author_url, $mod_description, $mod_version, $compliant); $template->assign_vars(array( --- 3745,3750 ---- $mod_description = ''; $mod_version = ''; ! $compliant = $modx_mod = false; ! get_mod_properties($install_path . '/' . $install_file, $mod_title, $mod_author_handle, $mod_author_email, $mod_author_name, $mod_author_url, $mod_description, $mod_version, $compliant, $modx_mod); $template->assign_vars(array( --- NEW FILE: htaccess.txt --- order deny,allow deny from all |
From: Eric F. <wg...@us...> - 2007-02-09 00:49:31
|
Update of /cvsroot/easymod/easymod2/mods/easymod/languages In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv31779/mods/easymod/languages Modified Files: lang_easymod_english.php Log Message: Some bug fixes Index: lang_easymod_english.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/languages/lang_easymod_english.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** lang_easymod_english.php 8 Nov 2005 19:35:12 -0000 1.13 --- lang_easymod_english.php 9 Feb 2007 00:49:26 -0000 1.14 *************** *** 230,234 **** $lang['EM_more_info'] = 'More information'; $lang['EM_see_file_access'] = 'Let\'s see what you have for file access. You do not need everything to read \'ok\'.'; ! $lang['EN_reinstall_version'] = 'If you are trying to reinstall this version, change the EM version number from the Admin Control Panel under EasyMOD Settings. Or you could also use the EM Version Changer (by GPHemsley) <a href="http://gphemsley.music-hq.net/phpBB/EasyMOD/">here</a>.'; $lang['EM_simple_mode'] = 'Simple Mode'; $lang['EM_advanced_mode'] = 'Advanced Mode'; --- 230,234 ---- $lang['EM_more_info'] = 'More information'; $lang['EM_see_file_access'] = 'Let\'s see what you have for file access. You do not need everything to read \'ok\'.'; ! $lang['EN_reinstall_version'] = 'If you are trying to reinstall this version, change the EM version number from the Admin Control Panel under EasyMOD Settings. Or you could also use the EM Version Changer (by GPHemsley) <a href="http://area51.phpbb.com/phpBB/viewtopic.php?f=24&t=13559&start=17#92295">here</a>.'; $lang['EM_simple_mode'] = 'Simple Mode'; $lang['EM_advanced_mode'] = 'Advanced Mode'; |
From: Eric F. <wg...@us...> - 2007-02-09 00:49:29
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv31779/mods/easymod/includes Modified Files: admin_easymod.php.txt Log Message: Some bug fixes Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** admin_easymod.php.txt 1 Oct 2006 22:19:05 -0000 1.49 --- admin_easymod.php.txt 9 Feb 2007 00:49:26 -0000 1.50 *************** *** 215,219 **** // parse the MOD file and get properties about it (make sure it really is a MOD too) ! function get_mod_properties($file, &$mod_title, &$mod_author_handle, &$mod_author_email, &$mod_author_name, &$mod_author_url, &$mod_description, &$mod_version, &$compliant, &$modx_mod = false) { global $phpbb_root_path, $script_path, $mod_type; --- 215,219 ---- // parse the MOD file and get properties about it (make sure it really is a MOD too) ! function get_mod_properties($file, &$mod_title, &$mod_author_handle, &$mod_author_email, &$mod_author_name, &$mod_author_url, &$mod_description, &$mod_version, &$compliant, &$modx_mod) { global $phpbb_root_path, $script_path, $mod_type; *************** *** 224,227 **** --- 224,231 ---- return get_modx_properties($file, $mod_title, $mod_author_handle, $mod_author_email, $mod_author_name, $mod_author_url, $mod_description, $mod_version, $compliant); } + else + { + $modx_mod = false; + } // used to add a little tolerance on the Author line |
From: Eric F. <wg...@us...> - 2007-02-09 00:49:29
|
Update of /cvsroot/easymod/easymod2/mods/easymod/em_includes In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv31779/mods/easymod/em_includes Modified Files: em_ftp.php Log Message: Some bug fixes Index: em_ftp.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_ftp.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** em_ftp.php 8 Jun 2006 04:08:07 -0000 1.16 --- em_ftp.php 9 Feb 2007 00:49:26 -0000 1.17 *************** *** 1069,1073 **** else { ! if ( function_exists('ftp_chmod') && ftp_chmod($this->ftp_conn_id, intval($perms, 8), $file) ) { return true; --- 1069,1073 ---- else { ! if ( function_exists('ftp_chmod') && @ftp_chmod($this->ftp_conn_id, intval($perms, 8), $file) ) { return true; |
From: Eric F. <wg...@us...> - 2006-10-01 22:19:08
|
Update of /cvsroot/easymod/easymod2/mods/easymod/includes In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv32211/includes Modified Files: admin_easymod.php.txt Log Message: MODX! Ready to test. CVS files were messed up and that's why this didn't go through with the other commit. Index: admin_easymod.php.txt =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** admin_easymod.php.txt 30 Sep 2006 17:59:09 -0000 1.48 --- admin_easymod.php.txt 1 Oct 2006 22:19:05 -0000 1.49 *************** *** 91,99 **** include($phpbb_root_path . 'admin/em_includes/em_modio.' . $phpEx); include($phpbb_root_path . 'admin/em_includes/em_functions.' . $phpEx); /// /// ! define('EASYMOD_VER', 'beta (0.3.5)'); define('FAQ_LINK', '<a href="http://easymod.sourceforge.net/readme/" target="_blank">'); define('REPORT_LINK', '<a href="http://area51.phpbb.com/phpBB/viewtopic.php?t=12143" target="_blank">'); --- 91,100 ---- include($phpbb_root_path . 'admin/em_includes/em_modio.' . $phpEx); include($phpbb_root_path . 'admin/em_includes/em_functions.' . $phpEx); + include($phpbb_root_path . 'admin/em_includes/parser_xml.' . $phpEx); /// /// ! define('EASYMOD_VER', 'beta (0.4.0)'); define('FAQ_LINK', '<a href="http://easymod.sourceforge.net/readme/" target="_blank">'); define('REPORT_LINK', '<a href="http://area51.phpbb.com/phpBB/viewtopic.php?t=12143" target="_blank">'); *************** *** 214,221 **** // parse the MOD file and get properties about it (make sure it really is a MOD too) ! function get_mod_properties($file, &$mod_title, &$mod_author_handle, &$mod_author_email, &$mod_author_name, &$mod_author_url, &$mod_description, &$mod_version, &$compliant) { global $phpbb_root_path, $script_path, $mod_type; // used to add a little tolerance on the Author line $faux_author = false; --- 215,228 ---- // parse the MOD file and get properties about it (make sure it really is a MOD too) ! function get_mod_properties($file, &$mod_title, &$mod_author_handle, &$mod_author_email, &$mod_author_name, &$mod_author_url, &$mod_description, &$mod_version, &$compliant, &$modx_mod = false) { global $phpbb_root_path, $script_path, $mod_type; + if ($mod_type == MODX) + { + $modx_mod = true; + return get_modx_properties($file, $mod_title, $mod_author_handle, $mod_author_email, $mod_author_name, $mod_author_url, $mod_description, $mod_version, $compliant); + } + // used to add a little tolerance on the Author line $faux_author = false; *************** *** 231,240 **** $buffer = fgets($f_mod_script, 1024); - if ($mod_type == MODX) - { - get_modx_properties($buffer, &$mod_title, &$mod_author_handle, &$mod_author_email, &$mod_author_name, &$mod_author_url, &$mod_description, &$mod_version, &$compliant); - return true; - } - // see if it is EMC right away; first line starts with ## on it and contains "easymod" $compliant = false; --- 238,241 ---- *************** *** 403,410 **** } ! function get_modx_properties($buffer, &$mod_title, &$mod_author_handle, &$mod_author_email, &$mod_author_name, &$mod_author_url, &$mod_description, &$mod_version, &$compliant) { global $phpbb_root_path, $script_path; } --- 404,424 ---- } ! function get_modx_properties($file, &$mod_title, &$mod_author_handle, &$mod_author_email, &$mod_author_name, &$mod_author_url, &$mod_description, &$mod_version, &$compliant) { global $phpbb_root_path, $script_path; + $modx = new mod_parser_xml(implode("\n", file($file))); + $modx->parse_header(); + + $mod_title = $modx->header['name']; + $mod_author_handle = $modx->header['author'][0]['username']; + $mod_author_email = $modx->header['author'][0]['email']; + $mod_author_name = $modx->header['author'][0]['realname']; + $mod_author_url = $modx->header['author'][0]['website']; + $mod_description = $modx->header['desc']; + $mod_version = $modx->header['version']; + $compliant = false; + + return (!empty($mod_title) && !empty($mod_author_handle)) ? true : false; } *************** *** 727,731 **** } ! // --- 741,750 ---- } ! if (!empty($install_file)) ! { ! $extension = explode('.', $install_file); ! $extension = array_pop($extension); ! $mod_type = ($extension == 'xml') ? MODX : TEXT; ! } // *************** *** 1597,1602 **** { $file_path = $path . '/' . $file; // make sure it is not a dir, and that it ends with .txt or .mod ! if ( !is_dir( $file_path) && ( (eregi(".txt$", $file_path)) || (eregi(".mod$", $file_path)))) { $mod_title = ''; --- 1616,1624 ---- { $file_path = $path . '/' . $file; + $extension = explode('.', $file); + $extension = array_pop($extension); // make sure it is not a dir, and that it ends with .txt or .mod ! //(eregi(".txt$", $file_path)) || (eregi(".mod$", $file_path)) || (eregi(".xml$", $file_path)))) ! if ( !is_dir( $file_path) && in_array($extension, array('txt', 'mod', 'xml'))) { $mod_title = ''; *************** *** 1608,1613 **** $mod_version = ''; $compliant = false; ! $is_mod = get_mod_properties($file_path, $mod_title, $mod_author_handle, $mod_author_email, $mod_author_name, $mod_author_url, $mod_description, $mod_version, $compliant); // if it is a MOD and has not been processed yet then add it to the list --- 1630,1637 ---- $mod_version = ''; $compliant = false; + $modx_mod = false; + $mod_type = ($extension == 'xml') ? MODX : TEXT; ! $is_mod = get_mod_properties($file_path, $mod_title, $mod_author_handle, $mod_author_email, $mod_author_name, $mod_author_url, $mod_description, $mod_version, $compliant, $modx_mod); // if it is a MOD and has not been processed yet then add it to the list *************** *** 1615,1618 **** --- 1639,1649 ---- { $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; + + $emc = ''; + if ($modx_mod == true) + { + $emc = '<img src="../templates/subSilver/images/modx_inside.png"><br />'; + } + $emc .= ($compliant) ? '<img src="../templates/subSilver/images/emc.gif">' : $lang['No']; $template->assign_block_vars('unprocessed', array( 'ROW_CLASS' => $row_class, *************** *** 1622,1626 **** 'MOD_VERSION' => $mod_version, 'MOD_DESC' => $mod_description, ! 'MOD_EMC' => ($compliant) ? '<img src="../templates/subSilver/images/emc.gif">' : $lang['No'], 'MOD_PATH' => $path . '/', 'MOD_FILE' => $file, --- 1653,1657 ---- 'MOD_VERSION' => $mod_version, 'MOD_DESC' => $mod_description, ! 'MOD_EMC' => $emc, 'MOD_PATH' => $path . '/', 'MOD_FILE' => $file, *************** *** 1649,1716 **** $files = array(); check_file_scope($install_path . $install_file, $phpbb_root_path . $script_path); ! $f_mod_script = fopen($install_path . $install_file, 'rb'); ! while (!feof($f_mod_script)) { ! $buffer = fgets($f_mod_script, 4096); ! ! // if the line starts with #, this is either a comment or an action command ! ! // after obtaining the command, skip any comments until we reach the command body ! if (($buffer[0] == '#') && ($in_header)) { ! // do nothing until we are out of the command header!! } ! ! // not in a header so this comment is either a random comment or start of a command header ! else if ($buffer[0] == '#') { ! // if we find [ and ] and OPEN on this line, then we can be reasonably sure we've got an OPEN command ! if ((strstr($buffer, '[')) && (strstr($buffer, ']')) && (strstr($buffer, 'OPEN'))) { ! // get us past any remaining # lines ! $buffer = fgets($f_mod_script, 4096); ! while ($buffer[0] == '#') { ! if ( feof($f_mod_script)) { ! break; } ! $buffer = fgets($f_mod_script, 4096); ! } ! ! // loop until we get a filename (a non-whitespace line) or the next # line ! while (!feof($f_mod_script)) ! { ! // got a line with some text not starting with #, so we're calling this a filename ;) ! if ((strlen(trim($buffer)) > 0) && ($buffer[0] != '#')) { ! $files[] = trim($buffer); ! break; } ! ! // we found a # so get us out of here ! else if ($buffer[0] == '#') { break; } - - $buffer = fgets($f_mod_script, 4096); - } - - // if we hit eof, then get us out of here - if (feof($f_mod_script)) - { - break; } } } ! ! // not a comment or command so this is the body of the command ! else ! { ! $in_header = false; ! } } - fclose($f_mod_script); --- 1680,1763 ---- $files = array(); check_file_scope($install_path . $install_file, $phpbb_root_path . $script_path); ! ! if ($mod_type == MODX) { ! $modx = new mod_parser_xml(implode("\n", file($install_path . $install_file))); ! $modx->_parse(); ! ! $actions = $modx->data[0]['children']['ACTION-GROUP'][0]['children']; ! $open_info = (!empty($actions['OPEN'])) ? $actions['OPEN'] : array(); ! for($i = 0, $total = sizeof($open_info); $i < $total; $i++) { ! $files[] = str_replace('\\', '/', trim($open_info[$i]['attrs']['SRC'])); } ! } ! else ! { ! $f_mod_script = fopen($install_path . $install_file, 'rb'); ! while (!feof($f_mod_script)) { ! $buffer = fgets($f_mod_script, 4096); ! ! // if the line starts with #, this is either a comment or an action command ! ! // after obtaining the command, skip any comments until we reach the command body ! if (($buffer[0] == '#') && ($in_header)) { ! // do nothing until we are out of the command header!! ! } ! ! // not in a header so this comment is either a random comment or start of a command header ! else if ($buffer[0] == '#') ! { ! // if we find [ and ] and OPEN on this line, then we can be reasonably sure we've got an OPEN command ! if ((strstr($buffer, '[')) && (strstr($buffer, ']')) && (strstr($buffer, 'OPEN'))) { ! // get us past any remaining # lines ! $buffer = fgets($f_mod_script, 4096); ! while ($buffer[0] == '#') { ! if ( feof($f_mod_script)) ! { ! break; ! } ! $buffer = fgets($f_mod_script, 4096); } ! ! // loop until we get a filename (a non-whitespace line) or the next # line ! while (!feof($f_mod_script)) { ! // got a line with some text not starting with #, so we're calling this a filename ;) ! if ((strlen(trim($buffer)) > 0) && ($buffer[0] != '#')) ! { ! $files[] = trim($buffer); ! break; ! } ! ! // we found a # so get us out of here ! else if ($buffer[0] == '#') ! { ! break; ! } ! ! $buffer = fgets($f_mod_script, 4096); } ! ! // if we hit eof, then get us out of here ! if (feof($f_mod_script)) { break; } } } + + // not a comment or command so this is the body of the command + else + { + $in_header = false; + } } ! fclose($f_mod_script); } *************** *** 1812,2009 **** check_file_scope($install_path . $install_file, $phpbb_root_path . $script_path); ! $f_mod_script = fopen($install_path . $install_file, 'rb'); ! while (!feof($f_mod_script)) { ! $buffer = fgets($f_mod_script, 4096); ! $line_num++; ! ! // if the line starts with #, this is either a comment or an action command; will also tell us when ! // we've hit the last search line of the target content for this command (meaning we've reached the ! // next command) ! ! // after obtaining the command, skip any comments until we reach the command body ! if (($buffer[0] == '#') && ($in_header)) ! { ! // do nothing until we are out of the command header!! ! } ! ! // not in a header so this comment is either a random comment or start of a command header ! else if ($buffer[0] == '#') { ! // done with last command now that we've hit a comment (regardless if a new command or just a comment) ! if ( $current_command != '') ! { ! $current_command = ''; ! } ! ! // if we find [ and ] on this line, then we can be reasonably sure it is an action command ! if ((strstr($buffer, '[')) && (strstr($buffer, ']'))) { ! ! // ! // we know it's an action, take appropriate steps for the action; see if the current command ! // is found on our list; NOTE: since we are using strstr, it is important to keep the ! // IN-LINE commands listed before thier similarly named cousins ! // ! ! if (strstr($buffer, 'OPEN')) ! { ! $current_command = 'OPEN'; ! } ! else if (strstr($buffer, 'IN-LINE FIND')) ! { ! $current_command = 'IN-LINE FIND'; ! } ! else if (strstr($buffer, 'FIND')) ! { ! $current_command = 'FIND'; ! } ! else if (strstr($buffer, 'IN-LINE AFTER, ADD')) ! { ! $current_command = 'IN-LINE AFTERADD'; ! } ! else if (strstr($buffer, 'AFTER, ADD')) ! { ! $current_command = 'AFTERADD'; ! } ! else if (strstr($buffer, 'IN-LINE BEFORE, ADD')) ! { ! $current_command = 'IN-LINE BEFOREADD'; ! } ! else if (strstr($buffer, 'BEFORE, ADD')) ! { ! $current_command = 'BEFOREADD'; ! } ! else if (strstr($buffer, 'IN-LINE REPLACE')) ! { ! $current_command = 'IN-LINE REPLACE'; ! } ! else if (strstr($buffer, 'REPLACE')) ! { ! $current_command = 'REPLACE'; ! } ! else if (strstr($buffer, 'COPY')) ! { ! $current_command = 'COPY'; ! } ! else if (strstr($buffer, 'SQL')) ! { ! $current_command = 'SQL'; ! } ! else if ( strstr($buffer, 'DIY INSTRUCTIONS') ) ! { ! $current_command = 'DIY INSTRUCTIONS'; ! } ! else if ( strstr($buffer, 'INCREMENT') ) ! { ! $current_command = 'INCREMENT'; ! } ! else if (strstr($buffer, 'SAVE/CLOSE')) ! { ! $current_command = 'CLOSE'; ! } ! ! // not a known command, let see if it is unrecognized command or just a comment ! else { ! $left_bracket = strpos($buffer, '['); ! $right_bracket = strpos($buffer, ']'); ! $left_of_bracket = substr($buffer, 0, $left_bracket); ! $right_of_bracket = substr($buffer, $right_bracket); ! ! // if there is no "--" both before and after the brackets, this must be a comment ! if (($left_bracket < $right_bracket) && (strstr($left_of_bracket, '--')) && (strstr($right_of_bracket, '--'))) { ! $current_command = trim(substr($buffer, $left_bracket+1, (($right_bracket-1)-($left_bracket+1)))); } } ! ! // handle special cases when we display or download the file; we are looking for the commands ! // for one file ONLY, so skip commands until we find the corresponding OPEN ! if (($mode == 'display_file') || ($mode == 'download_file')) { ! if ( $current_command != '') { ! // not found found file yet so this is a possible canidate ! if ((!$found_file) && ($current_command == 'OPEN')) ! { ! $in_header = true; ! } ! ! // ignore all other commands until we have our file ! else if ((!$found_file) && ($current_command != 'OPEN')) ! { ! $current_command = ''; ! } ! ! // after found, once we hit another OPEN or the CLOSE, then we are done ! else if ((($found_file) && ($current_command == 'OPEN') && (!$in_header)) || ($current_command == 'CLOSE')) { ! $current_command = ''; break; } ! ! // allow processing of this command ! else ! { ! $in_header = true; ! $commands[] = array( 'command' => $current_command, 'line' => $line_num); ! $body[] = array(); ! } } } ! ! // normal command processing ! else if ( $current_command != '') { ! $in_header = true; ! $commands[] = array( 'command' => $current_command, 'line' => $line_num); ! $body[] = array(); } } } ! ! // not a comment or command so this is the body of the command ! else if ( $current_command != '') { ! // handle special cases; make sure this is for the specific file we are looking for ! if (($mode == 'display_file') || ($mode == 'download_file')) { ! // not found found file yet so see if this is it ! if ((!$found_file) && ($current_command == 'OPEN')) { ! // found the file, excellent! ! if (trim($buffer) == $process_file) { $commands[] = array( 'command' => $current_command, 'line' => $line_num); $body[] = array(); - $body[ count($body)-1 ][] = $buffer; - $found_file = true; } } ! ! // haven't found the file yet, so don't process this command (should never get in here) ! else if (!$found_file) { ! $current_command = ''; } ! ! // this command relates to the file we are looking for, so go ahead else { $body[ count($body)-1 ][] = $buffer; } - $in_header = false; - } - - // store this as this body of our command - else - { - $in_header = false; - $body[ count($body)-1 ][] = $buffer; } } } - fclose($f_mod_script); // load the process mod template unless we are in special case mode --- 1859,2246 ---- check_file_scope($install_path . $install_file, $phpbb_root_path . $script_path); ! ! if ($mod_type == MODX) { ! $modx = new mod_parser_xml(implode("\n", file($install_path . $install_file))); ! ! $modx->parse_actions(); ! if (($mode == 'display_file') || ($mode == 'download_file')) { ! $commands[] = array('command' => 'OPEN', 'line' => 0); ! $body[] = array($process_file); ! ! $actions = $modx->actions['open'][$process_file]; ! for($i = 0, $total = sizeof($actions['edit']); $i < $total; $i++) { ! $commands[] = array('command' => 'FIND', 'line' => 0); ! $body[] = explode("\n", $actions['edit'][$i]['find']); ! ! $edit_actions = $actions['edit'][$i]['action']; ! for($j = 0, $total2 = sizeof($edit_actions); $j < $total2; $j++) { ! $code = explode("\n", $edit_actions[$j]['code']); ! for($k = 0, $total3 = sizeof($code); $k < $total3; $k++) { ! $code[$k] = rtrim($code[$k]) . "\n"; ! } ! ! switch($edit_actions[$j]['type']) ! { ! case 'after-add': ! $current_command = 'AFTERADD'; ! break; ! ! case 'before-add': ! $current_command = 'BEFOREADD'; ! break; ! ! case 'replace-with': ! $current_command = 'REPLACE'; ! break; ! ! case 'increment': ! $current_command = 'INCREMENT'; ! break; } + + $commands[] = array('command' => $current_command, 'line' => $edit_actions[$j]['line']); + $body[] = $code; } ! ! $inline_edit_actions = $actions['edit'][$i]['in-line-edit']; ! for($j = 0, $total2 = sizeof($inline_edit_actions); $j < $total2; $j++) { ! $commands[] = array('command' => 'IN-LINE FIND', 'line' => 0); ! $body[] = explode("\n", $inline_edit_actions[$j]['in-line-find']); ! ! $inline_actions = $inline_edit_actions[$j]['in-line-action']; ! for($k = 0, $total3 = sizeof($inline_actions); $k < $total3; $k++) { ! switch($inline_actions[$k]['type']) { ! case 'in-line-before-add': ! $current_command = 'IN-LINE BEFOREADD'; ! break; ! ! case 'in-line-after-add': ! $current_command = 'IN-LINE AFTERADD'; ! break; ! ! case 'in-line-replace-with': ! $current_command = 'IN-LINE REPLACE'; break; } ! ! $commands[] = array('command' => $current_command, 'line' => $inline_actions[$k]['line']); ! $body[] = array($inline_actions[$k]['code']); } } ! } ! } ! else ! { ! foreach($modx->actions as $action => $data) ! { ! switch($action) { ! case 'sql': ! $commands[] = array('command' => 'SQL', 'line' => 0); ! $body[] = $data; ! break; ! ! case 'copy': ! //copy x to y ! $copy = array(); ! for($i = 0, $total = sizeof($data); $i < $total; $i++) ! { ! $copy[] = 'copy ' . $data[$i]['from'] . ' to ' . $data[$i]['to'] . "\n"; ! } ! $commands[] = array('command' => 'COPY', 'line' => 0); ! $body[] = $copy; ! break; ! ! case 'diy-instructions': ! $commands[] = array('command' => 'DIY INSTRUCTIONS', 'line' => 0); ! $body[] = $data; ! break; ! ! case 'open': ! foreach($data as $file => $actions) ! { ! $commands[] = array('command' => 'OPEN', 'line' => 0); ! $body[] = array($file); ! ! for($i = 0, $total = sizeof($actions['edit']); $i < $total; $i++) ! { ! $commands[] = array('command' => 'FIND', 'line' => 0); ! $body[] = explode("\n", $actions['edit'][$i]['find']); ! ! $edit_actions = $actions['edit'][$i]['action']; ! for($j = 0, $total2 = sizeof($edit_actions); $j < $total2; $j++) ! { ! $code = explode("\n", $edit_actions[$j]['code']); ! for($k = 0, $total3 = sizeof($code); $k < $total3; $k++) ! { ! $code[$k] = rtrim($code[$k]) . "\n"; ! } ! ! switch($edit_actions[$j]['type']) ! { ! case 'after-add': ! $current_command = 'AFTERADD'; ! break; ! ! case 'before-add': ! $current_command = 'BEFOREADD'; ! break; ! ! case 'replace-with': ! $current_command = 'REPLACE'; ! break; ! ! case 'increment': ! $current_command = 'INCREMENT'; ! break; ! } ! ! $commands[] = array('command' => $current_command, 'line' => $edit_actions[$j]['line']); ! $body[] = $code; ! } ! ! $inline_edit_actions = $actions['edit'][$i]['in-line-edit']; ! for($j = 0, $total2 = sizeof($inline_edit_actions); $j < $total2; $j++) ! { ! $commands[] = array('command' => 'IN-LINE FIND', 'line' => 0); ! $body[] = explode("\n", $inline_edit_actions[$j]['in-line-find']); ! ! $inline_actions = $inline_edit_actions[$j]['in-line-action']; ! for($k = 0, $total3 = sizeof($inline_actions); $k < $total3; $k++) ! { ! switch($inline_actions[$k]['type']) ! { ! case 'in-line-before-add': ! $current_command = 'IN-LINE BEFOREADD'; ! break; ! ! case 'in-line-after-add': ! $current_command = 'IN-LINE AFTERADD'; ! break; ! ! case 'in-line-replace-with': ! $current_command = 'IN-LINE REPLACE'; ! break; ! } ! ! $commands[] = array('command' => $current_command, 'line' => $inline_actions[$k]['line']); ! $body[] = array($inline_actions[$k]['code']); ! } ! } ! } ! } ! break; } } + + $commands[] = array('command' => 'CLOSE', 'line' => 0); + $body[] = array(); } ! } ! else ! { ! $f_mod_script = fopen($install_path . $install_file, 'rb'); ! while (!feof($f_mod_script)) { ! $buffer = fgets($f_mod_script, 4096); ! $line_num++; ! ! // if the line starts with #, this is either a comment or an action command; will also tell us when ! // we've hit the last search line of the target content for this command (meaning we've reached the ! // next command) ! ! // after obtaining the command, skip any comments until we reach the command body ! if (($buffer[0] == '#') && ($in_header)) { ! // do nothing until we are out of the command header!! ! } ! ! // not in a header so this comment is either a random comment or start of a command header ! else if ($buffer[0] == '#') ! { ! // done with last command now that we've hit a comment (regardless if a new command or just a comment) ! if ( $current_command != '') { ! $current_command = ''; ! } ! ! // if we find [ and ] on this line, then we can be reasonably sure it is an action command ! if ((strstr($buffer, '[')) && (strstr($buffer, ']'))) ! { ! ! // ! // we know it's an action, take appropriate steps for the action; see if the current command ! // is found on our list; NOTE: since we are using strstr, it is important to keep the ! // IN-LINE commands listed before thier similarly named cousins ! // ! ! if (strstr($buffer, 'OPEN')) ! { ! $current_command = 'OPEN'; ! } ! else if (strstr($buffer, 'IN-LINE FIND')) ! { ! $current_command = 'IN-LINE FIND'; ! } ! else if (strstr($buffer, 'FIND')) ! { ! $current_command = 'FIND'; ! } ! else if (strstr($buffer, 'IN-LINE AFTER, ADD')) ! { ! $current_command = 'IN-LINE AFTERADD'; ! } ! else if (strstr($buffer, 'AFTER, ADD')) ! { ! $current_command = 'AFTERADD'; ! } ! else if (strstr($buffer, 'IN-LINE BEFORE, ADD')) ! { ! $current_command = 'IN-LINE BEFOREADD'; ! } ! else if (strstr($buffer, 'BEFORE, ADD')) ! { ! $current_command = 'BEFOREADD'; ! } ! else if (strstr($buffer, 'IN-LINE REPLACE')) ! { ! $current_command = 'IN-LINE REPLACE'; ! } ! else if (strstr($buffer, 'REPLACE')) ! { ! $current_command = 'REPLACE'; ! } ! else if (strstr($buffer, 'COPY')) ! { ! $current_command = 'COPY'; ! } ! else if (strstr($buffer, 'SQL')) ! { ! $current_command = 'SQL'; ! } ! else if ( strstr($buffer, 'DIY INSTRUCTIONS') ) ! { ! $current_command = 'DIY INSTRUCTIONS'; ! } ! else if ( strstr($buffer, 'INCREMENT') ) ! { ! $current_command = 'INCREMENT'; ! } ! else if (strstr($buffer, 'SAVE/CLOSE')) ! { ! $current_command = 'CLOSE'; ! } ! ! // not a known command, let see if it is unrecognized command or just a comment ! else ! { ! $left_bracket = strpos($buffer, '['); ! $right_bracket = strpos($buffer, ']'); ! $left_of_bracket = substr($buffer, 0, $left_bracket); ! $right_of_bracket = substr($buffer, $right_bracket); ! ! // if there is no "--" both before and after the brackets, this must be a comment ! if (($left_bracket < $right_bracket) && (strstr($left_of_bracket, '--')) && (strstr($right_of_bracket, '--'))) ! { ! $current_command = trim(substr($buffer, $left_bracket+1, (($right_bracket-1)-($left_bracket+1)))); ! } ! } ! ! // handle special cases when we display or download the file; we are looking for the commands ! // for one file ONLY, so skip commands until we find the corresponding OPEN ! if (($mode == 'display_file') || ($mode == 'download_file')) ! { ! if ( $current_command != '') ! { ! // not found found file yet so this is a possible canidate ! if ((!$found_file) && ($current_command == 'OPEN')) ! { ! $in_header = true; ! } ! ! // ignore all other commands until we have our file ! else if ((!$found_file) && ($current_command != 'OPEN')) ! { ! $current_command = ''; ! } ! ! // after found, once we hit another OPEN or the CLOSE, then we are done ! else if ((($found_file) && ($current_command == 'OPEN') && (!$in_header)) || ($current_command == 'CLOSE')) ! { ! $current_command = ''; ! break; ! } ! ! // allow processing of this command ! else ! { ! $in_header = true; ! $commands[] = array( 'command' => $current_command, 'line' => $line_num); ! $body[] = array(); ! } ! } ! } ! ! // normal command processing ! else if ( $current_command != '') { + $in_header = true; $commands[] = array( 'command' => $current_command, 'line' => $line_num); $body[] = array(); } } ! } ! ! // not a comment or command so this is the body of the command ! else if ( $current_command != '') ! { ! // handle special cases; make sure this is for the specific file we are looking for ! if (($mode == 'display_file') || ($mode == 'download_file')) { ! // not found found file yet so see if this is it ! if ((!$found_file) && ($current_command == 'OPEN')) ! { ! // found the file, excellent! ! if (trim($buffer) == $process_file) ! { ! $commands[] = array( 'command' => $current_command, 'line' => $line_num); ! $body[] = array(); ! $body[ count($body)-1 ][] = $buffer; ! $found_file = true; ! } ! } ! ! // haven't found the file yet, so don't process this command (should never get in here) ! else if (!$found_file) ! { ! $current_command = ''; ! } ! ! // this command relates to the file we are looking for, so go ahead ! else ! { ! $body[ count($body)-1 ][] = $buffer; ! } ! $in_header = false; } ! ! // store this as this body of our command else { + $in_header = false; $body[ count($body)-1 ][] = $buffer; } } } + fclose($f_mod_script); } // load the process mod template unless we are in special case mode |
From: Eric F. <wg...@us...> - 2006-10-01 22:09:29
|
Update of /cvsroot/easymod/easymod2/mods/easymod/em_includes In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv28426/easymod/em_includes Modified Files: em_modio.php Added Files: parser_xml.php Log Message: MODX support. Ready to test :D --- NEW FILE: parser_xml.php --- <?php /** * * @package EasyMOD_parser * @version $Id: parser_xml.php,v 1.1 2006/10/01 22:09:24 wgeric Exp $ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU General Public License * */ /** * @package EasyMOD_parser * Parser for the XML MOD template */ class mod_parser_xml { /** * Contents of the MOD to be parsed. * @type string */ var $mod_contents; /** * Valid MOD actions. * @type array */ var $valid_actions = array(); /** * Header parts from the MOD * @type array */ var $header = array(); /** * Actions for the MOD * @type array */ var $actions = array(); /** * Parsed XML file in an array * @type array */ var $data = array(); var $indexes = array(); /** * XML parser resource * @type resource */ var $parser; /** * Constructor * * @access public * @param string Filename */ function mod_parser_xml($mod_contents) { $this->mod_contents = preg_replace("/\r?\n|\r/", "\n", stripslashes(trim($mod_contents))); } function _parse() { $XML = $this->mod_contents; $this->parser = xml_parser_create(); xml_set_object($this->parser, $this); xml_set_element_handler($this->parser, '_tag_open', '_tag_closed'); xml_set_character_data_handler($this->parser, '_tag_data'); //$XML = str_replace('<', '<![CDATA[<]]>', $XML); //$XML = str_replace('>', '<![CDATA[>]]>', $XML); //$XML = preg_replace('#<!\[CDATA\[(.*)<!\[CDATA\[(.*)\]\]>#is', '\\1\\2', $XML); if(!xml_parse($this->parser, $XML)) { die(sprintf('XML error: %s at line %d', xml_error_string(xml_get_error_code($this->parser)), xml_get_current_line_number($this->parser))); } xml_parser_free($this->parser); return $this->data; } function _parse_into_struct() { $this->parser = xml_parser_create(); xml_parse_into_struct($this->parser, $this->mod_contents, $this->data, $this->indexes); echo '<pre>'; var_dump($this->data); echo '</pre><pre>'; var_dump($this->indexes); echo '</pre>'; xml_parser_free($this->parser); } function _tag_open($parser, $name, $attrs) { $tag = array('name' => $name, 'attrs' => $attrs); array_push($this->data, $tag); } function _tag_data($parser, $tag_data) { if(!empty($tag_data)) { if(isset($this->data[count($this->data)-1]['data'])) { $this->data[count($this->data)-1]['data'] .= unhtmlspecialchars($tag_data); } else { $this->data[count($this->data)-1]['data'] = unhtmlspecialchars($tag_data); } } } function _tag_closed($parser, $name) { $this->data[count($this->data)-2]['children'][$name][] = $this->data[count($this->data)-1]; array_pop($this->data); } /** * Returns array of MOD header information */ function parse_header() { if(empty($this->data)) { $this->_parse(); } $header_info = $this->data[0]['children']['HEADER'][0]['children']; // Name and decription // @TODO check lang attribute to see if it is the correct language $this->header['name'] = trim($header_info['TITLE'][0]['data']); $this->header['desc'] = trim($header_info['DESCRIPTION'][0]['data']); $this->header['author-notes'] = trim($header_info['AUTHOR-NOTES'][0]['data']); $this->header['install-level'] = trim($header_info['INSTALLATION'][0]['children']['LEVEL'][0]['data']); $this->header['install-time'] = intval($header_info['INSTALLATION'][0]['children']['TIME'][0]['data']); $this->header['license'] = ( !empty($header_info['LICENSE'][0]['data']) ) ? $header_info['LICENSE'][0]['data'] : 'blah'; // Version $version_info = $header_info['MOD-VERSION'][0]['children']; $this->header['version'] = ( isset($version_info['MAJOR'][0]['data']) ) ? trim($version_info['MAJOR'][0]['data']) : 0; $this->header['version'] .= '.' . (( isset($version_info['MINOR'][0]['data']) ) ? trim($version_info['MINOR'][0]['data']) : 0); $this->header['version'] .= '.' . (( isset($version_info['REVISION'][0]['data']) ) ? trim($version_info['REVISION'][0]['data']) : 0); $this->header['version'] .= (isset($version_info['RELEASE'][0]['data'])) ? $version_info['RELEASE'][0]['data'] : ''; // author $author_info = $header_info['AUTHOR-GROUP'][0]['children']['AUTHOR']; for($i = 0, $total = sizeof($author_info); $i < $total; $i++) { $this->header['author'][] = array( 'username' => trim($author_info[$i]['children']['USERNAME'][0]['data']), 'email' => trim($author_info[$i]['children']['EMAIL'][0]['data']), 'realname' => trim($author_info[$i]['children']['REALNAME'][0]['data']), 'website' => trim($author_info[$i]['children']['HOMEPAGE'][0]['data'])); } // history $history_info = $header_info['HISTORY'][0]['children']['ENTRY']; for($i = 0, $total = sizeof($history_info); $i < $total; $i++) { $changes = array(); $entry = $history_info[$i]['children']; $changelog = $entry['CHANGELOG'][0]['children']['CHANGE']; $version = $entry['REV-VERSION'][0]['children']; for($j = 0, $change_total = sizeof($changelog); $j < $change_total; $j++) { $changes[] = $changelog[$j]['data']; } $this->header['history'][] = array( 'date' => $entry['DATE'][0]['data'], 'version' => intval($version['MAJOR'][0]['data']) . '.' . intval($version['MINOR'][0]['data']) . '.' . intval($version['REVISION'][0]['data']) . $version['RELEASE'][0]['data'], 'change' => $changes, ); } return $this->header; } function parse_actions() { if(empty($this->data)) { $this->_parse(); } $actions = $this->data[0]['children']['ACTION-GROUP'][0]['children']; // sql $sql_info = ( !empty($actions['SQL']) ) ? $actions['SQL'] : array();; for( $i = 0, $total = sizeof($sql_info); $i < $total; $i++ ) { $this->actions['sql'][] = ( !empty($sql_info[$i]['data']) ) ? trim($sql_info[$i]['data']): ''; } // diy instructions $diy_info = ( !empty($actions['DIY-INSTRUCTIONS']) ) ? $actions['DIY-INSTRUCTIONS'] : array();; for( $i = 0, $total = sizeof($diy_info); $i < $total; $i++ ) { $this->actions['diy-instructions'][] = ( !empty($diy_info[$i]['data']) ) ? trim($diy_info[$i]['data']): ''; } // copy $copy_info = ( !empty($actions['COPY']) ) ? $actions['COPY'] : array(); for( $i = 0, $total = sizeof($copy_info); $i < $total; $i++ ) { $copy_files = $copy_info[$i]['children']['FILE']; for( $j = 0, $file_total = sizeof($copy_files); $j < $file_total; $j++ ) { $this->actions['copy'][] = array( 'from' => str_replace('\\', '/', $copy_files[$j]['attrs']['FROM']), 'to' => str_replace('\\', '/', $copy_files[$j]['attrs']['TO'])); } } // open $open_info = ( !empty($actions['OPEN']) ) ? $actions['OPEN'] : array();; for( $i = 0, $total = sizeof($open_info); $i < $total; $i++ ) { $current_file = str_replace('\\', '/', trim($open_info[$i]['attrs']['SRC'])); $this->actions['open'][$current_file] = array(); $edit_info = ( !empty($open_info[$i]['children']['EDIT']) ) ? $open_info[$i]['children']['EDIT'] : array(); for($j = 0, $edit_total = sizeof($edit_info); $j < $edit_total; $j++) { $action_info = ( !empty($edit_info[$j]['children']) ) ? $edit_info[$j]['children'] : array(); $this->actions['open'][$current_file]['edit'][$j]['find'] = $action_info['FIND'][0]['data']; $actions = ( !empty($action_info['ACTION']) ) ? $action_info['ACTION'] : array(); for($k = 0, $action_total = sizeof($actions); $k < $action_total; $k++) { $this->actions['open'][$current_file]['edit'][$j]['action'][] = array( 'line' => 0, 'type' => str_replace(',', '-', str_replace(' ', '', $actions[$k]['attrs']['TYPE'])), 'code' => $actions[$k]['data'] ); } $inline_info = ( !empty($action_info['INLINE-EDIT']) ) ? $action_info['INLINE-EDIT'] : array(); for($k = 0, $inline_total = sizeof($inline_info); $k < $inline_total; $k++) { $inline_actions = ( !empty($inline_info[$k]['children']) ) ? $inline_info[$k]['children'] : array(); $this->actions['open'][$current_file]['edit'][$j]['in-line-edit'][$k]['in-line-find'] = $inline_actions['INLINE-FIND'][0]['data']; $actions = ( !empty($inline_actions['INLINE-ACTION']) ) ? $inline_actions['INLINE-ACTION'] : array(); for($x = 0, $actions_total = sizeof($actions); $x < $actions_total; $x++) { $type = str_replace(',', '-', str_replace(' ', '', $actions[$x]['attrs']['TYPE'])); $this->actions['open'][$current_file]['edit'][$j]['in-line-edit'][$k]['in-line-action'][] = array( 'line' => 0, 'type' => (( $type != 'increment' ) ? 'in-line-' : '') . $type , 'code' => $actions[$x]['data'] ); } } } } } /** * Check the file is an install file. Return false, if it isn't */ function verify() { if(empty($this->data)) { $this->_parse(); } if(isset($this->data[0]['name']) && $this->data[0]['name'] == 'MOD') { return true; } return false; } } function unhtmlspecialchars($string) { $unhtml_specialchars_match = array('#>#', '#<#', '#"#', '#&#'); $unhtml_specialchars_replace = array('>', '<', '"', '&'); return preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, $string); } ?> Index: em_modio.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_modio.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** em_modio.php 30 Sep 2006 18:00:52 -0000 1.10 --- em_modio.php 1 Oct 2006 22:09:24 -0000 1.11 *************** *** 544,548 **** if ( copy( $from, $to)) { ! chmod($to, 0644); return '<b>' . $lang['EM_pp_complete'] . '</b>' ; } --- 544,548 ---- if ( copy( $from, $to)) { ! @chmod($to, 0644); return '<b>' . $lang['EM_pp_complete'] . '</b>' ; } |
From: Eric F. <wg...@us...> - 2006-10-01 22:09:29
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv28426/easymod Modified Files: easymod_install.php Added Files: modx_inside.png Log Message: MODX support. Ready to test :D --- NEW FILE: modx_inside.png --- (This appears to be a binary file; contents omitted.) Index: easymod_install.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_install.php,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** easymod_install.php 30 Sep 2006 17:59:09 -0000 1.48 --- easymod_install.php 1 Oct 2006 22:09:24 -0000 1.49 *************** *** 54,58 **** //// ! $easymod_install_version = '0.3.0'; $script_path = 'admin/mods/easymod/'; //// --- 54,58 ---- //// ! $easymod_install_version = '0.4.0'; $script_path = 'admin/mods/easymod/'; //// *************** *** 781,784 **** --- 781,785 ---- $command_file->afile[] = 'copy em_includes/em_modio.php ../../../admin/em_includes/em_modio.php'; $command_file->afile[] = 'copy em_includes/em_ftp.php ../../../admin/em_includes/em_ftp.php'; + $command_file->afile[] = 'copy em_includes/parser_xml.php ../../../admin/em_includes/parser_xml.php'; $command_file->afile[] = 'copy em_includes/index.htm ../../../admin/em_includes/index.htm'; *************** *** 827,830 **** --- 828,832 ---- $command_file->afile[] = 'copy easymod.gif ../../../' . $pics[$i]['path'] . 'easymod.gif'; + $command_file->afile[] = 'copy modx_inside.png ../../../' . $pics[$i]['path'] . 'modx_inside.png'; $command_file->afile[] = 'copy includes/emc.gif ../../../' . $pics[$i]['path'] . 'emc.gif'; } |
From: Eric F. <wg...@us...> - 2006-09-30 18:00:56
|
Update of /cvsroot/easymod/easymod2/mods/easymod/em_includes In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv5650/easymod/em_includes Modified Files: em_modio.php Log Message: oops, forgot to remove debug code Index: em_modio.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_modio.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** em_modio.php 30 Sep 2006 17:59:09 -0000 1.9 --- em_modio.php 30 Sep 2006 18:00:52 -0000 1.10 *************** *** 50,54 **** var $move_method ; ! // write method tools var $pfile ; // file pointer var $afile = array() ; // array of strings to make a file --- 50,54 ---- var $move_method ; ! // write method tools var $pfile ; // file pointer var $afile = array() ; // array of strings to make a file *************** *** 464,468 **** // using the FTP class ! if ((($action == 'move') && ($this->move_method == 'ftpa')) || (($action == 'write') && ($this->write_method == 'ftpb'))) { --- 464,468 ---- // using the FTP class ! if ((($action == 'move') && ($this->move_method == 'ftpa')) || (($action == 'write') && ($this->write_method == 'ftpb'))) { *************** *** 495,499 **** } ! return true ; } --- 495,499 ---- } ! return true ; } *************** *** 542,546 **** // return a success message if the copy works - echo $from . ' | ' . $to . '<br />'; if ( copy( $from, $to)) { --- 542,545 ---- |
From: Eric F. <wg...@us...> - 2006-09-30 17:59:14
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv5136/easymod Modified Files: easymod_display_functions.php easymod_install.php Log Message: Bug fixes. - append_sid() used in install now - and some others Index: easymod_display_functions.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_display_functions.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** easymod_display_functions.php 8 Nov 2005 19:35:12 -0000 1.25 --- easymod_display_functions.php 30 Sep 2006 17:59:09 -0000 1.26 *************** *** 140,144 **** // we have to fix the password so it does not have a # in it or else the link won't work $ftp_pass = str_replace('#', '~pound~', $ftp_pass); ! $link = "easymod_install.$phpEx?mode=debug&install_step=$install_step&write=$write&move=$move&ftp_dir=$ftp_dir&ftp_user=$ftp_user&ftp_pass=$ftp_pass&ftp_host=$ftp_host&ftp_port=$ftp_port&ftp_debug=$ftp_debug&ftp_type=$ftp_type"; $variables = array(); --- 140,144 ---- // we have to fix the password so it does not have a # in it or else the link won't work $ftp_pass = str_replace('#', '~pound~', $ftp_pass); ! $link = append_sid("easymod_install.$phpEx?mode=debug&install_step=$install_step&write=$write&move=$move&ftp_dir=$ftp_dir&ftp_user=$ftp_user&ftp_pass=$ftp_pass&ftp_host=$ftp_host&ftp_port=$ftp_port&ftp_debug=$ftp_debug&ftp_type=$ftp_type"); $variables = array(); *************** *** 169,173 **** $variables = array(); ! $variables['U_FORM'] = $phpbb_root_path . $script_path . 'easymod_install.'.$phpEx; $variables['STEP'] = $step; $variables['HIDDEN'] = $hidden; --- 169,173 ---- $variables = array(); ! $variables['U_FORM'] = append_sid($phpbb_root_path . $script_path . 'easymod_install.'.$phpEx); $variables['STEP'] = $step; $variables['HIDDEN'] = $hidden; *************** *** 454,458 **** global $phpEx, $lang, $easymod_install_version, $phpBB_version, $phpbb_root_path, $script_path, $language; ! $variables['U_FORM'] = $phpbb_root_path . $script_path . 'easymod_install.' . $phpEx; $variables['EM_Install_Info'] = $lang['EM_Install_Info']; $variables['EM_Select_Language'] = $lang['EM_Select_Language']; --- 454,458 ---- global $phpEx, $lang, $easymod_install_version, $phpBB_version, $phpbb_root_path, $script_path, $language; ! $variables['U_FORM'] = append_sid($phpbb_root_path . $script_path . 'easymod_install.' . $phpEx); $variables['EM_Install_Info'] = $lang['EM_Install_Info']; $variables['EM_Select_Language'] = $lang['EM_Select_Language']; *************** *** 832,836 **** // assign template data ! $variables['U_FORM'] = $phpbb_root_path . $script_path . 'easymod_install.'.$phpEx; $variables['EM_support'] = $lang['EM_support']; $variables['EM_Settings'] = $lang['EM_settings']; --- 832,837 ---- // assign template data ! $variables['U_FORM'] = append_sid($phpbb_root_path . $script_path . 'easymod_install.'.$phpEx); ! $variables['U_SIMPLE'] = append_sid($phpbb_root_path . $script_path . 'easymod_install.' . $phpEx . '?setup=simple'); $variables['EM_support'] = $lang['EM_support']; $variables['EM_Settings'] = $lang['EM_settings']; *************** *** 882,886 **** // assign template data ! $variables['U_FORM'] = $phpbb_root_path . $script_path . 'easymod_install.'.$phpEx; $variables['EM_support'] = $lang['EM_support']; $variables['EM_Settings'] = $lang['EM_settings']; --- 883,888 ---- // assign template data ! $variables['U_FORM'] = append_sid($phpbb_root_path . $script_path . 'easymod_install.'.$phpEx); ! $variables['U_ADVANCED'] = append_sid($phpbb_root_path . $script_path . 'easymod_install.' . $phpEx . '?setup=advanced'); $variables['EM_support'] = $lang['EM_support']; $variables['EM_Settings'] = $lang['EM_settings']; *************** *** 951,955 **** // assign template data ! $variables['U_FORM'] = $phpbb_root_path . $script_path . 'easymod_install.'.$phpEx; $variables['EM_support'] = $lang['EM_support']; $variables['EM_Settings'] = $lang['EM_settings']; --- 953,957 ---- // assign template data ! $variables['U_FORM'] = append_sid($phpbb_root_path . $script_path . 'easymod_install.'.$phpEx); $variables['EM_support'] = $lang['EM_support']; $variables['EM_Settings'] = $lang['EM_settings']; *************** *** 992,996 **** // assign template data ! $variables['U_FORM'] = $phpbb_root_path . $script_path . 'easymod_install.'.$phpEx; $variables['EM_support'] = $lang['EM_support']; $variables['EM_Settings'] = $lang['EM_settings']; --- 994,998 ---- // assign template data ! $variables['U_FORM'] = append_sid($phpbb_root_path . $script_path . 'easymod_install.'.$phpEx); $variables['EM_support'] = $lang['EM_support']; $variables['EM_Settings'] = $lang['EM_settings']; *************** *** 1032,1036 **** // assign template data ! $variables['U_FORM'] = $phpbb_root_path . $script_path . 'easymod_install.'.$phpEx; $variables['EM_support'] = $lang['EM_support']; $variables['EM_Settings'] = $lang['EM_settings']; --- 1034,1038 ---- // assign template data ! $variables['U_FORM'] = append_sid($phpbb_root_path . $script_path . 'easymod_install.'.$phpEx); $variables['EM_support'] = $lang['EM_support']; $variables['EM_Settings'] = $lang['EM_settings']; Index: easymod_install.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_install.php,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** easymod_install.php 8 Nov 2005 16:52:41 -0000 1.47 --- easymod_install.php 30 Sep 2006 17:59:09 -0000 1.48 *************** *** 161,165 **** { $errored = true; ! $error_ary['sql'][] = ( is_array($sql) ) ? $sql[$i] : $sql; $error_ary['error_code'][] = $db->sql_error(); } --- 161,165 ---- { $errored = true; ! $error_ary['sql'][] = ( is_array($sql) ) ? $sql[0] : $sql; $error_ary['error_code'][] = $db->sql_error(); } |
From: Eric F. <wg...@us...> - 2006-09-30 17:59:14
|
Update of /cvsroot/easymod/easymod2/mods/easymod/templates In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv5136/easymod/templates Modified Files: step1_classic.tpl step1_simple.tpl Log Message: Bug fixes. - append_sid() used in install now - and some others Index: step1_classic.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/step1_classic.tpl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** step1_classic.tpl 31 Oct 2005 17:57:15 -0000 1.5 --- step1_classic.tpl 30 Sep 2006 17:59:09 -0000 1.6 *************** *** 1,3 **** ! <span class="gen"><a href="easymod_install.php?setup=simple">{{EM_simple_mode}}</a> :: {{EM_advanced_mode}}</span><br /> <table width="100%" border="1" cellpadding="5"> <tr> --- 1,3 ---- ! <span class="gen"><a href="{{U_SIMPLE}}">{{EM_simple_mode}}</a> :: {{EM_advanced_mode}}</span><br /> <table width="100%" border="1" cellpadding="5"> <tr> Index: step1_simple.tpl =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/templates/step1_simple.tpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** step1_simple.tpl 31 Oct 2005 17:57:15 -0000 1.4 --- step1_simple.tpl 30 Sep 2006 17:59:09 -0000 1.5 *************** *** 1,3 **** ! <span class="gen">{{EM_simple_mode}} :: <a href="easymod_install.php?setup=advanced">{{EM_advanced_mode}}</a></span><br /> <table width="100%" border="1" cellpadding="5"> <tr> --- 1,3 ---- ! <span class="gen">{{EM_simple_mode}} :: <a href="{{U_ADVANCED}}">{{EM_advanced_mode}}</a></span><br /> <table width="100%" border="1" cellpadding="5"> <tr> |