function Commit($data) { global $partyID; $sql = array(); $sql["download"] = $data["download"]; $sql["csdb"] = $data["csdbID"]; $sql["slengpung"] = $data["slengpungID"]; //$sql["zxdemo"] = $data["zxdemoID"]; $sql["demozoo"] = $data["demozooID"]; $sql["artcity"] = $data["artcity"]; $links = SQLLib::selectRow(sprintf_esc("select * from partylinks where party = %d and year = %d",$this->id,$this->year)); if ($links) { SQLLib::UpdateRow("partylinks",$sql,sprintf_esc("party = %d and year = %d",$this->id,$this->year)); } else { $sql["party"] = $this->id; $sql["year"] = $this->year; SQLLib::InsertRow("partylinks",$sql); } if (is_uploaded_file($_FILES["results"]["tmp_name"])) { move_uploaded_file_fake($_FILES["results"]["tmp_name"],get_local_partyresult_path($this->id,$this->year)); } gloperator_log( "party", (int)$this->id, "party_edit_links", array("year"=>$this->year) ); return array(); }
function Commit($data) { global $groupID; $a = array(); $a["category"] = $data["category"]; $a["closed"] = $data["closed"]=="on"; SQLLib::UpdateRow("bbs_topics",$a,"id=".$this->topic->id); gloperator_log( "topic", $this->topic->id, "topic_edit" ); return array(); }
function Commit($data) { SQLLib::Query(sprintf_esc("UPDATE prods SET party=null, party_year=0, party_compo=0, party_place=0 WHERE party=%d",$this->party->id)); SQLLib::Query(sprintf_esc("UPDATE prods SET invitation=0, invitationyear=0 WHERE invitation=%d",$this->party->id)); SQLLib::Query(sprintf_esc("DELETE FROM partiesaka WHERE party1=%d OR party1=%d",$this->party->id,$this->party->id)); SQLLib::Query(sprintf_esc("DELETE FROM prodotherparty WHERE party=%d",$this->party->id)); SQLLib::Query(sprintf_esc("DELETE FROM partylinks WHERE party=%d",$this->party->id)); SQLLib::Query(sprintf_esc("DELETE FROM listitems WHERE itemid=%d AND type='party'",$this->party->id)); SQLLib::Query(sprintf_esc("DELETE FROM parties WHERE id=%d",$this->party->id)); gloperator_log( "party", (int)$this->party->id, "party_delete", get_object_vars($this->party) ); return array(); }
function Commit($data) { global $currentUser; $req = SQLLib::SelectRow(sprintf_esc("select itemID,requestType,requestBlob,approved from modification_requests where id = %d",$data["requestID"])); if ($req->approved !== NULL) return array("this request was already processed"); if ($data["requestDeny"]) { $a = array(); $a["gloperatorID"] = $currentUser->id; $a["approved"] = 0; $a["comment"] = $data["comment"]; $a["approveDate"] = date("Y-m-d H:i:s"); SQLLib::UpdateRow("modification_requests",$a,"id=".(int)$data["requestID"]); return array(); } $reqData = unserialize($req->requestBlob); global $REQUESTTYPES; if ($REQUESTTYPES[$req->requestType]) { $errors = $REQUESTTYPES[$req->requestType]::Process($req->itemID,$reqData); if ($errors) return $errors; gloperator_log( $REQUESTTYPES[$req->requestType]::GetItemType(), $req->itemID, $req->requestType, $reqData ); } else { return array("no such request type!"); } $a = array(); $a["gloperatorID"] = $currentUser->id; $a["approved"] = 1; $a["approveDate"] = date("Y-m-d H:i:s"); SQLLib::UpdateRow("modification_requests",$a,"id=".(int)$data["requestID"]); return array(); }
function Commit($data) { SQLLib::Query(sprintf_esc("DELETE FROM othernfos WHERE refid=%d AND type='bbs'",$this->board->id)); // TODO: cleanup files SQLLib::Query(sprintf_esc("DELETE FROM affiliatedboards WHERE board=%d",$this->board->id)); SQLLib::Query(sprintf_esc("DELETE FROM boards_platforms WHERE board=%d",$this->board->id)); SQLLib::Query(sprintf_esc("DELETE FROM boards WHERE id=%d",$this->board->id)); gloperator_log( "board", (int)$this->board->id, "board_delete", get_object_vars($this->board) ); return array(); }
function Commit($data) { if ($data["delAffil"]) { SQLLib::Query("delete from affiliatedprods where id=".(int)$data["delAffil"]); gloperator_log( "prod", (int)$this->prod->id, "prod_rel_del" ); return array(); } list($direction,$type) = explode(":",$data["type"],2); $a = array(); $a["type"] = $type; $a["original"] = $direction == "o" ? $this->prod->id : $data["prod"]; $a["derivative"] = $direction == "d" ? $this->prod->id : $data["prod"]; if ($data["editAffilID"]) { SQLLib::UpdateRow("affiliatedprods",$a,"id=".(int)$data["editAffilID"]); $a["id"] = $data["editAffilID"]; gloperator_log( "prod", (int)$this->prod->id, "prod_rel_edit", array("id"=>$a["id"]) ); } else { $a["id"] = SQLLib::InsertRow("affiliatedprods",$a); gloperator_log( "prod", (int)$this->prod->id, "prod_rel_add", array("id"=>$a["id"]) ); } if ($data["partial"]) { $o = toObject($a); $o->prodOriginal = PouetProd::Spawn($a["original"]); $o->prodDerivative = PouetProd::Spawn($a["derivative"]); $this->RenderNormalRow($o); $this->RenderNormalRowEnd($o); exit(); } return array(); }
function Commit($data) { SQLLib::Query(sprintf_esc("UPDATE prods SET group1=NULL WHERE group1=%d",$this->group->id)); SQLLib::Query(sprintf_esc("UPDATE prods SET group2=NULL WHERE group2=%d",$this->group->id)); SQLLib::Query(sprintf_esc("UPDATE prods SET group3=NULL WHERE group3=%d",$this->group->id)); SQLLib::Query(sprintf_esc("DELETE FROM groupsaka WHERE group1=%d OR group2=%d",$this->group->id,$this->group->id)); SQLLib::Query(sprintf_esc("DELETE FROM affiliatedboards WHERE `group`=%d",$this->group->id)); SQLLib::Query(sprintf_esc("DELETE FROM listitems WHERE itemid=%d AND type='group'",$this->group->id)); SQLLib::Query(sprintf_esc("DELETE FROM groups WHERE id=%d",$this->group->id)); gloperator_log( "group", (int)$this->group->id, "group_delete", get_object_vars($this->group) ); return array(); }