ouch, one other thing.
in the name of really really really zealous error trapping, the lovely author of this snippet has a place:
if($_REQUEST['modified'.$i]=='yes') {
// restructured for clarity and extended MF oct2005
$updateQueryString= "UPDATE ".$mg->pics_tbl." SET ";
$updateQueryString.= "title='".addslashes($_REQUEST['title'.$i])."'"; //add title content
if(!$mg->mgconfig['keep_date'])
$updateQueryString.=",date=NOW()";
if($descvalid==1)
$updateQueryString.=", descr='".addslashes($_REQUEST['descr'.$i])."'"; //MF add descr content
if($custposvalid==1 && is_numeric($_REQUEST['pos'.$i]))
$updateQueryString.=", pos=".$_REQUEST['pos'.$i]; //add pos value
if ($_REQUEST['hide'.$i]=="yes") {
$updateQueryString.=", hide='1'";
} else {
$updateQueryString.=", hide='0'";
}
$updateQueryString.=" WHERE id='" .$_REQUEST['pic_id'.$i]."'";
$rs3=$modx->db->query( $updateQueryString );
}
like that in maxigallery.php
because I want this to -work- I totally hacked it up and added this:
if($_REQUEST['modified'.$i]=='no') {
// restructured for clarity and extended MF oct2005
$updateQueryString= "UPDATE ".$mg->pics_tbl." SET ";
$updateQueryString.= "title='".addslashes($_REQUEST['title'.$i])."'"; //add title content
if(!$mg->mgconfig['keep_date'])
$updateQueryString.=",date=NOW()";
if($descvalid==1)
$updateQueryString.=", descr='".addslashes($_REQUEST['descr'.$i])."'"; //MF add descr content
if($custposvalid==1 && is_numeric($_REQUEST['pos'.$i]))
$updateQueryString.=", pos=".$_REQUEST['pos'.$i]; //add pos value
if ($_REQUEST['hide'.$i]=="yes") {
$updateQueryString.=", hide='1'";
} else {
$updateQueryString.=", hide='0'";
}
$updateQueryString.=" WHERE id='" .$_REQUEST['pic_id'.$i]."'";
$rs3=$modx->db->query( $updateQueryString );
}
which basically just undoes all the zealous and painstaking error trapping that Sparky did. I’m deeply sorry.
I understand that the correct way to fix this is to go and bind the event with ajax so the keyDown registers and toggles the "modified" trigger... and there is an actual tinyMCE function to do that (tinyMCE writes to an iframe and then replaces your textarea, so a keyDown event doesn’t register when you use it here), but I tried it and it seems to be fighting Prototype/Scriptaculous. I’m just not that ambitious and it seems to me that it might be okay to send an update query whether there was a keyDown trigger or not?
so I am.
the other small wrinkle.
one other place the pesky :htmlent appeared.... managepicturetpl.html
<br/>
<textarea name="[+maxigallery.fieldnames.title+]" rows="2" cols="40" onKeyDown="document.editform.[+maxigallery.fieldnames.modified+].value='yes'">[+maxigallery.picture.title+]</textarea>
<br />
[+maxigallery.strings.description+]:
<br/>
<textarea name="[+maxigallery.fieldnames.description+]" rows="4" cols="40" onKeyDown="document.editform.[+maxigallery.fieldnames.modified+].value='yes'">[+maxigallery.picture.descr+]</textarea>
<br />
that’s what it was after I removed them.
alright, all is working now. If anyone wishes to correct me and give me the right js to fix and bind my form rather than hacking up the if-then statement then you will be my hero, if not then,....oh well.
peace.