function Save() { $time = mTime(); queryDB(true, "INSERT IGNORE INTO `" . DB_PREFIX . DATABASE_STATS_AGGS . "` (`year`,`month`,`day`,`time`,`mtime`) VALUES (" . $this->GetSQLDateValues() . "," . $time[1] . "," . $time[0] . ");"); }
function Save($_mTime = 0) { global $INTERNAL; if ($_mTime == 0) { $_mTime = mTime(); $this->Created = $_mTime[1]; } if ($this->Receiver == $this->ReceiverOriginal && isset($INTERNAL[$this->Receiver]) && !empty($INTERNAL[$this->Receiver]->AppDeviceId) && $INTERNAL[$this->Receiver]->AppBackgroundMode) { $INTERNAL[$this->Receiver]->AddPushMessage("", $this->Sender, $this->SenderName, 1, strip_tags($this->Text)); } queryDB(false, "INSERT INTO `" . DB_PREFIX . DATABASE_POSTS . "` (`id`,`chat_id`,`time`,`micro`,`sender`,`receiver`,`receiver_group`,`receiver_original`,`text`,`translation`,`translation_iso`,`received`,`persistent`,`repost`,`sender_name`,`browser_id`) VALUES ('" . DBManager::RealEscape($this->Id) . "','" . DBManager::RealEscape($this->ChatId) . "'," . DBManager::RealEscape($this->Created) . "," . DBManager::RealEscape($_mTime[0]) . ",'" . DBManager::RealEscape($this->Sender) . "','" . DBManager::RealEscape($this->Receiver) . "','" . DBManager::RealEscape($this->ReceiverGroup) . "','" . DBManager::RealEscape($this->ReceiverOriginal) . "','" . DBManager::RealEscape($this->Text) . "','" . DBManager::RealEscape($this->Translation) . "','" . DBManager::RealEscape($this->TranslationISO) . "','" . DBManager::RealEscape($this->Received ? 1 : 0) . "','" . DBManager::RealEscape($this->Persistent ? 1 : 0) . "','" . DBManager::RealEscape($this->Repost ? 1 : 0) . "','" . DBManager::RealEscape($this->SenderName) . "','" . DBManager::RealEscape($this->BrowserId) . "');"); }
function Save() { queryDB(false, "INSERT INTO `" . DB_PREFIX . DATABASE_POSTS . "` (`id`,`chat_id`,`time`,`micro`,`sender`,`receiver`,`receiver_group`,`text`,`translation`,`translation_iso`,`received`,`persistent`) VALUES ('" . @mysql_real_escape_string($this->Id) . "','" . @mysql_real_escape_string($this->ChatId) . "'," . @mysql_real_escape_string($this->Created) . "," . @mysql_real_escape_string(mTime()) . ",'" . @mysql_real_escape_string($this->Sender) . "','" . @mysql_real_escape_string($this->Receiver) . "','" . @mysql_real_escape_string($this->ReceiverGroup) . "','" . @mysql_real_escape_string($this->Text) . "','" . @mysql_real_escape_string($this->Translation) . "','" . @mysql_real_escape_string($this->TranslationISO) . "','0','" . @mysql_real_escape_string(parseBool($this->Persistent, false)) . "');"); }
function writePost($_post) { queryDB(false, "INSERT INTO `" . DB_PREFIX . DATABASE_POSTS . "` (`id`,`time`,`micro`,`sender`,`receiver`,`receiver_group`,`text`,`received`,`persistent`) VALUES ('" . mysql_real_escape_string($_post->Id) . "'," . mysql_real_escape_string($_post->Created) . "," . mysql_real_escape_string(mTime()) . ",'" . mysql_real_escape_string($_post->Sender) . "','" . mysql_real_escape_string($_post->Receiver) . "','" . mysql_real_escape_string($_post->ReceiverGroup) . "','" . mysql_real_escape_string($_post->Text) . "','0','" . mysql_real_escape_string(parseBool($_post->Persistent, false)) . "');"); }