Написал в службу поддержки и отправил им два файла:error log и accsses log, вот что мне ответили:
> Высылаю два файла, которые сегодня создались в логах.
Вот например:
include(../assets/modules/easy2/langs/english.inc.php)
или
[Wed Sep 8 18:49:36 2010] [error] PHP Parse error: syntax error, unexpected ’<’
in
/usr/home/pupkin/www/site1/public_html/manager/processors/execute_module.processor.php(114)
:
eval()’d code on line 1
В первом случае реальный инклуд находится по пути
../../assets/modules/easy2/langs/english.inc.php
Во втором случае, Вы видимо где-то поправили что-то, и там неисполнимый код стал
получаться.
Может быть у меня не правильно настроен modx?
В инструментах, в закладке "Интерфейс и представление" в форме URL к файлам: что писать? у меня написано просто assets/
Код PHP:
<?php
if (IN_MANAGER_MODE != ’true’) die("<b>INCLUDE_ORDERING_ERROR</b>
Please use the MODx Content Manager instead of accessing this file directly.");
/**
* EASY 2 GALLERY
* Gallery Module for MODx Evolution
* @author Cx2 <
[email protected]>
* @author Temus
* @author goldsky <
[email protected]>
*/
// Easy 2 Gallery version
if (!defined(’E2G_VERSION’) || ’E2G_VERSION’ !== ’1.4.0 - RC 1’) {
define(’E2G_VERSION’, ’1.4.0 - RC 1’);
}
// Easy 2 Gallery module path
if(!defined(’E2G_MODULE_PATH’)) {
define(’E2G_MODULE_PATH’, MODX_BASE_PATH . ’assets/modules/easy2/’);
}
// Easy 2 Gallery module URL
if(!defined(’E2G_MODULE_URL’)) {
define(’E2G_MODULE_URL’, MODX_BASE_URL . ’assets/modules/easy2/’);
}
require_once E2G_MODULE_PATH . ’includes/utf8/utf8.php’;
// LANGUAGE
if (file_exists( E2G_MODULE_PATH . ’includes/langs/’.$modx->config[’manager_language’].’.inc.php’)) {
require_once E2G_MODULE_PATH . ’includes/langs/’.$modx->config[’manager_language’].’.inc.php’;
// if there is a blank language parameter, english will fill it as the default.
foreach ($e2g_lang[$modx->config[’manager_language’]] as $olk => $olv) {
$olangkey[$olk] = $olk; // other languages
$olangval[$olk] = $olv;
}
include_once E2G_MODULE_PATH . ’includes/langs/english.inc.php’;
foreach ($e2g_lang[’english’] as $enk => $env) {
if ( !isset($olangkey[$enk]) ) {
$e2g_lang[$modx->config[’manager_language’]][$enk] = $env;
}
}
$lng = $e2g_lang[$modx->config[’manager_language’]];
} else {
require_once E2G_MODULE_PATH . ’includes/langs/english.inc.php’;
$lng = $e2g_lang[’english’];
}
mysql_select_db(str_replace(’`’, ’’, $GLOBALS[’dbase’]));
@mysql_query("{$GLOBALS[’database_connection_method’]} {$GLOBALS[’database_connection_charset’]}");
// ALERTS / ERRORS
if (!isset( $_SESSION[’easy2err’] ) ) $_SESSION[’easy2err’] = array();
if (!isset( $_SESSION[’easy2suc’] ) ) $_SESSION[’easy2suc’] = array();
// CONFIGURATIONS
if (!file_exists(E2G_MODULE_PATH . ’includes/configs/config.easy2gallery.php’)) {
// if config file has not been created, yet, this will create one
$createconfig = fopen(E2G_MODULE_PATH . ’includes/configs/config.easy2gallery.php’, ’w+’);
} else {
require_once E2G_MODULE_PATH . ’includes/configs/config.easy2gallery.php’;
foreach ($e2g as $ck => $cv) {
$confkey[$ck] = $ck;
$confval[$ck] = $cv;
}
}
// the default config will replace any blank value of config’s.
if (file_exists( E2G_MODULE_PATH . ’includes/configs/default.config.easy2gallery.php’ )) {
require_once E2G_MODULE_PATH . ’includes/configs/default.config.easy2gallery.php’;
// if config file is missing, this will create one
if (isset($createconfig)) {
$c = "<?php\r\n\$e2g = array (\r\n";
foreach($def_e2g as $dk => $dv) {
$c .= " ’$dk’ => ".(is_numeric($dv)?$dv:"’".addslashes($dv)."’").",\r\n";
}
$c .= ");\r\n?>";
fwrite($createconfig, $c);
fclose($createconfig);
unset($createconfig);
}
foreach ($def_e2g as $dk => $dv) {
if ( !isset($confkey[$dk]) ) {
$e2g[$dk] = $dv;
}
}
$def_e2g = array();
unset($def_e2g);
}
// CHECKING THE root and _thumbnails FOLDERs
if (!is_dir( MODX_BASE_PATH . $e2g[’dir’]) ) {
// INSTALL
if (is_dir( E2G_MODULE_PATH . ’install’)) {
require_once E2G_MODULE_PATH . ’install/index.php’;
exit();
} else {
$_SESSION[’easy2err’][] = ’<b style="color:red">’.$lng[’dir’].’ "’.$e2g[’dir’].’" ’.$lng[’empty’].’</b>’;
// exit;
}
} elseif (!is_dir( MODX_BASE_PATH . $e2g[’dir’] . ’_thumbnails’ ) ) {
if (mkdir( MODX_BASE_PATH . $e2g[’dir’] . ’_thumbnails’ ) ) {
@chmod( MODX_BASE_PATH . $e2g[’dir’] . ’_thumbnails’, 0755 );
} else {
$_SESSION[’easy2err’][] = ’<b style="color:red">’ . $lng[’_thumb_err’] . ’</b>’;
exit;
}
}
// ENCODING
$e2gmod_cfg[’e2g_encode’] = $e2g[’e2g_encode’];
// SET UP THE PATH
$e2gmod_cfg[’gdir’] = ( isset($gdir) ? $gdir : $e2g[’dir’] );
$e2gmod_cfg[’path’] = ( isset($path) ? $path : ’’ );
$e2gmod_cfg[’parent_id’] = ( isset( $_GET[’pid’] ) && is_numeric( $_GET[’pid’] ) ) ? (int) $_GET[’pid’] : 1;
/**
* SYSTEM VARS
*/
// Easy 2 Gallery’s debug parameter
$e2gmod_cfg[’e2g_debug’] = $e2g[’e2g_debug’];
// override MODx’s debug variable
$debug = 0;
// MODx’s manager theme
$e2gmod_cfg[’_t’] = ( isset($_t) ? $_t : $modx->config[’manager_theme’] );
// MODx’s action ID
$e2gmod_cfg[’_a’] = ( isset($_a) ? $_a : (int) $_GET[’a’] );
// MODx’s module ID
$e2gmod_cfg[’_i’] = ( isset($_i) ? $_i : (int) $_GET[’id’] );
// E2G’s module ID
$e2gmod_cfg[’mod_id’] = !empty($e2g[’mod_id’])? $e2g[’mod_id’] : $_GET[’id’];
// E2G’s plugin ID
$e2gmod_cfg[’plugin_id’] = !empty($e2g[’plugin_id’])? $e2g[’plugin_id’] : null;
/**
* If Easy 2 Gallery is included inside another module,
* append its params into the address bar
*/
$alienarray = array();
$alienparams = ’’;
if ($e2gmod_cfg[’mod_id’]!=$_GET[’id’]) {
// exclude ALL e2g’s internal $_GET params to identify other module’s $_GET params
$diff = array(
’a’=>(isset($_GET[’a’])?$_GET[’a’]:null)
, ’id’=>(isset($_GET[’id’])?$_GET[’id’]:null)
, ’pid’=>(isset($_GET[’pid’])?$_GET[’pid’]:null)
, ’file_id’=>(isset($_GET[’file_id’])?$_GET[’file_id’]:null)
, ’lang’=>(isset($_GET[’lang’])?$_GET[’lang’]:null)
, ’langfile’=>(isset($_GET[’langfile’])?$_GET[’langfile’]:null)
, ’dir_path’=>(isset($_GET[’dir_path’])?$_GET[’dir_path’]:null)
, ’file_path’=>(isset($_GET[’file_path’])?$_GET[’file_path’]:null)
, ’path’=>(isset($_GET[’path’])?$_GET[’path’]:null)
, ’act’=>(isset($_GET[’act’])?$_GET[’act’]:null)
, ’page’=>(isset($_GET[’page’])?$_GET[’page’]:null)
, ’ip’=>(isset($_GET[’ip’])?$_GET[’ip’]:null)
, ’u’=>(isset($_GET[’u’])?$_GET[’u’]:null)
, ’e’=>(isset($_GET[’e’])?$_GET[’e’]:null)
);
$aliendiff = array_diff_key ( $_GET , $diff );
foreach ($aliendiff as $k => $v) {
$alienparams .= ’&’.$k.’=’.$v;
}
$diff = array();
}
// module’s href
$e2gmod_cfg[’index’] = ( isset($index) ? $index : ’index.php?a=’.$e2gmod_cfg[’_a’].’&id=’.$e2gmod_cfg[’_i’] )
.( $alienparams!=’’ ? $alienparams : ’’ );
// ERROR REPORTING
if ($e2gmod_cfg[’e2g_debug’] == 1) {
// error_reporting(E_ALL);
// $old_error_handler = set_error_handler("error_handler");
}
/**
* To handle error
* @param int $errno error number
* @param string $errmsg error message
* @param string $filename filename
* @param int $linenum line number
* @param string $vars

*/
function error_handler ($errno, $errmsg, $filename, $linenum, $vars) {
echo ’<p>Error ’.$errno.’: ’.$errmsg.’
File: ’.$filename.’ <b>Line:’.$linenum.’</b></p>’;
}
// INSTALL
if (is_dir( E2G_MODULE_PATH . ’install’)) {
require_once E2G_MODULE_PATH . ’install/index.php’;
exit();
}
/**
* EXECUTE MODULE
*/
if(!class_exists(’e2g_pub’)) {
include_once(E2G_MODULE_PATH . "includes/classes/e2g.public.class.php");
}
if(!class_exists(’e2g_mod’)) {
include_once(E2G_MODULE_PATH . "includes/classes/e2g.module.class.php");
}
if (class_exists(’e2g_pub’) && class_exists(’e2g_mod’)) {
$e2g_mod = new e2g_mod($e2gmod_cfg, $e2g, $lng);
$e2g_mod->e2gpub_cfg = $e2gmod_cfg;
$e2g_mod->e2gpub_e2g = $e2g;
$e2g_mod->e2gpub_lng = $lng;
$output = $e2g_mod->explore($e2g, $lng);
} else {
$output = "<h3>error: required class not found</h3>";
}
return $output;