private function myVotedRequests()
{
$sth = $this->db->query("SELECT requests.*, (SELECT COUNT(*) AS cnt FROM reqvotes WHERE reqid = requests.id) AS vote, (SELECT SUM(krydda) FROM reqvotes WHERE reqid = requests.id) AS krydda FROM reqvotes JOIN requests ON reqvotes.reqid = requests.id WHERE reqvotes.userid = " . $this->user->getId() . " AND requests.filled = 0 AND requests.userid != " . $this->user->getId() . " ORDER BY requests.added DESC");
$myVotedRequests = array();
while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
$arr = array();
$arr["id"] = $row["id"];
$arr["added"] = $row["added"];
$arr["filled"] = $row["filled"];
$arr["request"] = $row["request"];
$arr["p2p"] = $row["p2p"];
$arr["slug"] = $row["slug"];
$arr["comment"] = $row["comment"];
$arr["comments"] = $row["comments"];
$arr["ersatt"] = $row["ersatt"];
$arr["season"] = $row["season"];
$arr["imdbid"] = $row["imdbid"];
$arr["type"] = $row["typ"];
$arr["reward"] = $row["krydda"] += $this->getVoteTimeReward(strtotime($row["added"]));
$arr["votes"] = $row["votes"];
array_push($myVotedRequests, $arr);
}
return $myVotedRequests;
}