private function updateAvgRating($content_id) { $chk = GenFun::error_chk(array($this->setRating_tbl, $this->avgRating_tbl)); //---------------------------------------------------------- if (!$chk['bool']) { return $chk; } //---------------------------------------------------------- $queryString = "UPDATE " . $this->avgRating_tbl . " SET " . $this->avgRating_tbl . ".avg_rating = (SELECT AVG(" . $this->setRating_tbl . ".rating) FROM " . $this->setRating_tbl . " WHERE content_id = '{$content_id}') WHERE " . $this->avgRating_tbl . ".id = '{$content_id}'"; $chk = Result::go($queryString, array('resetQueries' => true)); //---------------------------------------------------------- return $chk; }
public function changePassword($hash, $password) { Trace::output($this->traceID, "changePassword"); //---------------------------------------------------------- $chk = GenFun::error_chk(array($hash, $password)); //---------------------------------------------------------- $this->tblName = ForgotPwRequest_const::TBL; //---------------------------------------------------------- //init var //---------------------------------------------------------- $chk = array("bool" => true, "traceID" => "changePassword"); //---------------------------------------------------------- $chk = $this->getAccountRow($hash); //---------------------------------------------------------- if (!$chk['bool']) { return $chk; } //---------------------------------------------------------- if ($chk['result'][0]['confirmed'] == 1) { $chk['bool'] = false; } //---------------------------------------------------------- if (sizeof($chk['result']) != 0 && $chk['bool']) { $chk = Update::go(Accounts_const::TBL, array("password" => GenFun::encrypt($password . $this->salt)), array("id" => $chk['result'][0]['accounts_id'])); $chk = $this->confirm($hash, "forgotPwRequest"); } else { $chk['bool'] = false; $chk['message'] = "This link has been disabled!!!"; } //---------------------------------------------------------- if ($chk['bool']) { $chk['message'] = "Password Updated!!!"; } //---------------------------------------------------------- return $chk; }
public function _agreeWith_comment($accounts_id, $comments_id, $returnQuery) { $chk = GenFun::error_chk(array($accounts_id, $comments_id)); if ($chk['bool']) { $chk = InsertINTO::go("agreeWith", array("accounts_id" => $accounts_id, "comments_id" => $comments_id)); } return $chk; }
public function changePassword($hash, $password) { Trace::output($this->traceID, "changePassword"); //---------------------------------------------------------- $chk = array("bool" => true, "traceID" => "changePassword"); //---------------------------------------------------------- $chk = GenFun::error_chk(array($hash, $password)); //---------------------------------------------------------- $this->confirmLinkType = "2"; //---------------------------------------------------------- $chk = $this->getAccountRow($hash); //---------------------------------------------------------- if (!$chk['bool']) { return $chk; } //---------------------------------------------------------- if (!is_null($chk['result'][0]['disabled'])) { $chk['bool'] = false; } //---------------------------------------------------------- if (sizeof($chk['result']) != 0 && $chk['bool']) { $chk = Update::go(Accounts_const::TBL, array("password" => GenFun::encrypt($password . $this->salt)), array("id" => $chk['result'][0]['id'])); $chk = $this->disableConfirmLink($hash); } else { $chk['bool'] = false; $chk['message'] = "This link has been disabled!!!"; } //---------------------------------------------------------- if ($chk['bool']) { $chk['message'] = "Password Updated!!!"; } //---------------------------------------------------------- return $chk; }
public function getPlaylistWithVideo($id, $count = false, $returnQuery = false) { $chk = GenFun::error_chk(array($id)); $queryString = "SELECT DISTINCT playlist_id FROM playlist_videos WHERE playlist_videos.videos_id = {$id}"; if ($returnQuery) { return $queryString; } if ($chk['bool']) { $chk = Result::go($queryString, array("count" => $count)); } else { return $chk; } return $chk; }
public function _agreeWith_comment($accounts_id, $comments_id, $agree = "1", $returnQuery = NULL) { $chk = GenFun::error_chk(array($accounts_id, $comments_id)); if ($chk['bool']) { $chk = InsertINTO::go("agreeWith", array("accounts_id" => $accounts_id, "comments_id" => $comments_id, "agree" => $agree)); //---------------------------------------------------------- if ($chk['bool']) { $chk = Result::resetQueries(); } //---------------------------------------------------------- } return $chk; }