Hello again!
Now, i’ve tried to insert into another database:
If i wan’t that this is working, i have to choose "OnDocFormSave"
But, wher i start this plugin
------>
$kopiraj = ’yes’;
if ($kopiraj == ’yes’) {
echo ’kopiram’;
$link = mysql_connect("$server", "$dbase", "$pass") or die(mysql_error());
mysql_select_db("$dbase", $link);
$type = "document";
$contentType = "text/html";
$pagetitle = "test11111";
$longtitle = "test";
$description = "test";
$alias = "test";
$link_attributes = "";
$published = "1";
$pub_date = "0";
$unpub_date = "0";
$parent = "403";
$isfolder = "0";
$introtext = "test";
$content = "test";
$richtext = "1";
$template = "1";
$menuindex = "1";
$searchable = "1";
$cachable = "1";
$createdby = "1";
$createdon = "1144904400";
$editedby = "1";
$editedon = "1222371358";
$deleted = "0";
$deletedon = "0";
$deletedby = "0";
$publishedon = "0";
$publishedby = "0";
$menutitle = "test";
$donthit = "0";
$haskeywords = "0";
$hasmetatags = "0";
$privateweb = "0";
$privatemgr = "0";
$content_dispo = "0";
$hidemenu = "0";
$sql_insert = "INSERT INTO modx_site_content (type, contentType, pagetitle, longtitle, description, alias, link_attributes, published, pub_date, unpub_date, parent, isfolder, introtext, content, richtext, template, menuindex, searchable, cacheable, createdby, createdon, editedby, editedon, deleted, deletedon, deletedby, publishedon, publishedby, menutitle, donthit, haskeywords, hasmetatags, privateweb, privatemgr, content_dispo, hidemenu) VALUES (’$type’, ’$contentType’, ’$pagetitle’, ’$longtitle’, ’$description’, ’$alias’, ’$link_attributes’, ’$published’, ’$pub_date’, ’$unpub_date’, ’$parent’, ’$isfolder’, ’$introtext’, ’$content’, ’$richtext’, ’$template’, ’$menuindex’, ’$searchable’, ’$cachable’, ’$createdby’, ’$createdon’, ’$editedby’, ’$editedon’, ’$deleted’, ’$deletedon’, ’$deletedby’, ’$publishedon’, ’$publishedby’, ’$menutitle’, ’$donthit’, ’$haskeywords’, ’$hasmetatags’, ’$privateweb’, ’$privatemgr’, ’$content_dispo’, ’$hidemenu’)";
mysql_query($sql_insert, $link);
} else {
echo ’ne kopiram’;
}
<-----
I get serious error, the content is written to another database, but configuration page of modx is automaticly opened, and i have to choose save - or the page crashes.
How can i get $pagetitle = $_POST[’pagetitle’]; .... ... longtitle, content .... ?
And why isn’t this working = $kopiraj = $_POST[’tvkopiraj_novico’]; ?
Thank you!