diff --git a/api.php b/api.php index c5c850a..e8b2231 100644 --- a/api.php +++ b/api.php @@ -1,4 +1,5 @@ prepare("SELECT ID, Username, Nickname, FullName, IsAdmin FROM Users;"); $stmt6->execute(); @@ -133,32 +138,44 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { function processCitationRelated($actionin, mysqli $mysqliconn){ - if($actionin == "getcitations"){ - + if($actionin == "getallcitations"){ + //TODO Create this query } if($actionin == "getrandomcitation"){ - + //TODO Create this query } - if($actionin == "getcitationfulltextsearch"){ - + if($actionin == "getcitationsfulltextsearch"){ + //TODO Create this query } if($actionin == "getcitationsbyuser"){ - + //TODO Create this query + } + + if($actionin == "getcitationthreadbyid"){ + //TODO Create this query + } + + if($actionin == "getcitationversionbyid"){ + //TODO Create this query } if($actionin == "getcitationsbysource"){ - + //TODO Create this query } if($actionin == "getcitationsbytags"){ - + //TODO Create this query } - if($actionin == "getcitationbyverse"){ - + if($actionin == "getcitationsbyverse"){ + //TODO Create this query + } + + if($actionin == "getcitationsuggestionsbyverse"){ + //TODO Create this query } return 0; @@ -230,6 +247,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } if($actionin == "getallsources"){ + //TODO Use JOIN to embed the publication info $stmt17 = $mysqliconn->prepare("SELECT ID, PublicationID, Place, CreatorID FROM Sources;"); $stmt17->execute(); $stmt17->bind_result($id, $publicationid, $place, $creatorid); @@ -248,6 +266,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } if($actionin == "getallsourcesbycreator"){ + //TODO Use JOIN to embed the publication info $stmt13 = $mysqliconn->prepare("SELECT ID, PublicationID, Place, CreatorID FROM Sources WHERE CreatorID = ?;"); $cruid = intval($_POST['creatorid']); $stmt13->bind_param("i", $cruid); @@ -284,6 +303,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } if($actionin == "getallcommentsbycreator"){ + //TODO Use JOIN to embed the citation info $stmt15 = $mysqliconn->prepare("SELECT ID, CreatorID, CitationID, CitationThreadID, Content FROM Comments WHERE CreatorID = ?;"); $cruid = intval($_POST['creatorid']); $stmt15->bind_param("i", $cruid); @@ -303,17 +323,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } return json_encode($outarr); } - + //TODO Also send user info with ID if($actionin == "getcommentsbycitationlatestversion"){ - + //TODO Create this query + //TODO Use JOIN to embed the citation info } if($actionin == "getcommentsbycitationbyversion"){ - + //TODO Create this query + //TODO Use JOIN to embed the citation info } if($actionin == "getcommentsbycitationallversions"){ - + //TODO Create this query + //TODO Use JOIN to embed the citation info } return 0;