01-12-2010, 08:43 PM
In case anyone else is wanting to do this the code below is what worked for me. You would just insert it above the } above the header('Location:' . $_SERVER['PHP_SELF'] .....line at the bottom of tobepublished.php.
//Find out the owners' username to add to log
$query = "SELECT username from user where id='$_SESSION[uid]'";
$result = mysql_query($query, $GLOBALS['connection']) or die ("Error in query: $query. " . mysql_error());
list($username) = mysql_fetch_row($result);
// Add a log entry for authorizing
$query = "INSERT INTO log (id,modified_on, modified_by, note, revision) VALUES ( '$fileid', NOW(), '" . addslashes($username) . "', 'Authorized', 'current')";
$result = mysql_query($query, $GLOBALS['connection']) or die ("Error in query: $query. " . mysql_error());
//End Added to try and log when someone Authorizes a document
dvst8s
//Find out the owners' username to add to log
$query = "SELECT username from user where id='$_SESSION[uid]'";
$result = mysql_query($query, $GLOBALS['connection']) or die ("Error in query: $query. " . mysql_error());
list($username) = mysql_fetch_row($result);
// Add a log entry for authorizing
$query = "INSERT INTO log (id,modified_on, modified_by, note, revision) VALUES ( '$fileid', NOW(), '" . addslashes($username) . "', 'Authorized', 'current')";
$result = mysql_query($query, $GLOBALS['connection']) or die ("Error in query: $query. " . mysql_error());
//End Added to try and log when someone Authorizes a document
dvst8s