© Сделано на LiveStreet
Дизайн - ©2009 MODx RED Group
session_start();
$username = $_SESSION['webShortname'];
$нужныйМнеПараметр='...'.$username;
Fatal error: Cannot redeclare userip() (previously declared in /.../www/htdocs/manager/includes/document.parser.class.inc.php(770): eval()'d code:120) in /.../www/htdocs/manager/includes/document.parser.class.inc.php(770): eval()'d code on line 138

function evalSnippet($snippet, $params) {
$etomite= $modx= & $this;
$modx->event->params= & $params; // store params inside event object
if (is_array($params)) {
extract($params, EXTR_SKIP);
}
ob_start();
$snip= eval ($snippet);
$msg= ob_get_contents();
ob_end_clean();
if ($msg && isset ($php_errormsg)) {
if (!strpos($php_errormsg, 'Deprecated')) { // ignore php5 strict errors
// log error
$this->logEvent(1, 3, "<b>$php_errormsg</b><br /><br /> $msg", $this->currentSnippet . " - Snippet");
if ($this->isBackend())
$this->Event->alert("An error occurred while loading. Please see the event log for more information<p />$msg");
}
}
unset ($modx->event->params);
return $msg . $snip;
}
$e = &$modx->Event;
if ($e->name == "OnBeforeDocFormSave") {
if (($mode == "new")&&($template == 4)) {
$table = $modx->getFullTableName('site_content');
$fields = array(
'type' => 'document',
'content' => 'Содержание документа-родителя',
'pagetitle' =>'Родительский документ',
'longtitle' => 'Родительский документ',
'alias' => 'parent',
'contentType' => 'text/html',
'published' => '0',
'isfolder' => '1',
'template' => '4',
'cacheable' => '0',
'createdon' => time(),
'editedon' => time(),
'publishedon' => time(),
'hidemenu' => '0',
);
$modx->db->insert($fields, $table);
$parent = $modx->db->getInsertId();
$fields = array(
'type' => 'document',
'content' => 'Содержание дочернего документа',
'pagetitle' =>'Дочерний документ',
'longtitle' => 'Дочерний документ',
'alias' => 'child_doc',
'contentType' => 'text/html',
'published' => '0',
'parent' => $parent,
'isfolder' => '0',
'template' => '6',
'cacheable' => '0',
'createdon' => time(),
'editedon' => time(),
'publishedon' => time(),
'hidemenu' => '0',
);
$modx->db->insert($fields, $table);
return;
}
}
[!snippet? ¶m=`{php_code}`!][!snippet? ¶m=`{php_code}`!]