function insertLogRow($type, $text, $submitter = "") { if (!IS_TESTSERVER && isInPath("preprints_test")) { return FALSE; } if (empty($type)) { return FALSE; } // ---------------------- $uid = !empty(auth::getUid()) ? auth::getUid() : PP_ROBOT_UID; $sql = "INSERT INTO " . $this->dbprefix . PP_LOGTABLE . " (type,time,uid,text,ip) " . "VALUES " . " (" . " '" . addslashes(strip_tags($type)) . "'," . " '" . time() . "'," . " '" . $uid . "'," . " '" . addslashes(strip_tags($text . " " . $submitter)) . "'," . " '" . addslashes($_SERVER["REMOTE_ADDR"]) . "'" . " )"; $res = (bool) $this->query($sql, IS_TESTSERVER); // includes a call to connect // ---------------------- return $res ? $this->insert_id() : FALSE; }
public static function mail_preprint_prettyprinted($row, $owner, $pp, $action) { $uid = !empty(auth::getUid()) ? auth::getUid() : PP_ROBOT_UID; $url = "http://" . $_SERVER["REMOTE_ADDR"] . (preg_match("#/\$#i", $_SERVER["PHP_SELF"]) ? $_SERVER["PHP_SELF"] : dirname($_SERVER["PHP_SELF"])) . "/?selectPP=" . $row["rowid"]; $date = strtolower($action) != "deleted" ? date("Y-m-d G:i", $row["tm"]) : ""; $tit = strtolower($action) == "reminder" ? "Preprint " . $row["status"] . " " . $date . " (" . functions::deltaTime(time(), (int) $row["tm"]) . " ago) but has not being completed yet.\n\n" . "URL: " . $url : "Preprint " . $action . " " . $date; return $tit . "\r\n" . "Number: " . $pp . "\r\n" . "Field: " . self::$researchFields[$row["field"]] . "\r\n" . "Owner: " . $owner . "\r\n" . "Title: " . $row["title"] . "\r\n" . "Authors: " . $row["authors"] . "\r\n" . $action . " by " . auth::getGecos($uid); }