function LoadFromDB() { $this->prod = PouetProd::spawn($_GET["which"]); if (!$this->prod) return; $a = array(&$this->prod); PouetCollectPlatforms( $a ); $this->title = "mirrors :: ".$this->prod->name; }
function LoadFromDB() { $this->prod = PouetProd::spawn( $_GET["which"] ); $s = new BM_Query(); $s->AddField("added"); $s->AddTable("nfos"); $s->SetLimit(1); $s->attach(array("nfos"=>"user"),array("users as user"=>"id")); $s->AddWhere(sprintf_esc("prod=%d",$this->prod->id)); list($this->nfo) = $s->perform(); }
function LoadFromDB() { $this->prod = PouetProd::spawn( $this->id ); if(!$this->prod) return; if($this->prod->latestip != $_SERVER["REMOTE_ADDR"] && CheckReferrer($_SERVER["HTTP_REFERER"]) ) { SQLLib::Query(sprintf_esc("UPDATE prods SET views=views+1, latestip='%s' WHERE id=%d",$_SERVER["REMOTE_ADDR"],$this->id)); } $this->linkCheck = SQLLib::SelectRow(sprintf_esc("SELECT * FROM prods_linkcheck where prodID = %d",$this->id)); $a = array(&$this->prod); PouetCollectPlatforms( $a ); if ($this->prod->boardID) $this->board = SQLLib::SelectRow(sprintf_esc("SELECT * FROM boards WHERE id = %d",$this->prod->boardID)); $s = new BM_Query(); $s->AddField("added"); $s->AddTable("screenshots"); $s->SetLimit(1); $s->attach(array("screenshots"=>"user"),array("users as user"=>"id")); $s->AddWhere(sprintf_esc("prod=%d",$this->id)); list($this->screenshot) = $s->perform(); $s = new BM_Query(); $s->AddField("prodotherparty.party_compo"); $s->AddField("prodotherparty.party_place"); $s->AddField("prodotherparty.party_year"); $s->AddTable("prodotherparty"); $s->attach(array("prodotherparty"=>"party"),array("parties as party"=>"id")); $s->AddWhere(sprintf_esc("prod=%d",$this->id)); $rows = $s->perform(); foreach($rows as $row) { $this->prod->placings[] = new PouetPlacing( array("party"=>$row->party,"compo"=>$row->party_compo,"ranking"=>$row->party_place,"year"=>$row->party_year) ); } $s = new BM_Query(); $s->AddTable("affiliatedprods"); $s->AddField("affiliatedprods.type"); $s->attach(array("affiliatedprods"=>"original"),array("prods as prodOriginal"=>"id")); $s->attach(array("affiliatedprods"=>"derivative"),array("prods as prodDerivative"=>"id")); $s->AddWhere(sprintf_esc("affiliatedprods.original=%d or affiliatedprods.derivative=%d",$this->id,$this->id)); $this->relatedProds = $s->perform(); $s = new BM_Query(); $s->AddTable("users_cdcs"); $s->attach(array("users_cdcs"=>"user"),array("users as user"=>"id")); $s->AddWhere(sprintf_esc("cdc = %d",$this->id)); $cdcs = $s->perform(); $this->userCDCs = array(); foreach($cdcs as $v) $this->userCDCs[$v->user->id] = $v; $this->isPouetCDC = SQLLib::selectRow(sprintf_esc("select * from cdc where which = %d",$this->id)); $this->awards = SQLLib::selectRows(sprintf_esc("select * from sceneorgrecommended where prodid = %d order by type, category",$this->id)); $s = new BM_Query("credits"); $s->AddField("credits.role"); $s->AddWhere(sprintf("credits.prodID = %d",$this->id)); $s->Attach(array("credits"=>"userID"),array("users as user"=>"id")); $s->AddOrder("credits.role"); $this->credits = $s->perform(); $this->downloadLinks = array(); /* if ($this->prod->sceneorg) { $o = new stdClass(); $o->type = "scene.org"; $o->id = "sceneorgID"; $o->link = "http://scene.org/file.php?id=".(int)$this->prod->sceneorg; $this->downloadLinks[] = $o; } */ if ($this->prod->csdb) { $o = new stdClass(); $o->type = "csdb"; $o->id = "csdbID"; $o->link = "http://csdb.dk/release/?id=".(int)$this->prod->csdb; $this->downloadLinks[] = $o; } if ($this->prod->zxdemo) { $o = new stdClass(); $o->type = "zxdemo"; $o->id = "zxdemoID"; $o->link = "http://zxdemo.org/item.php?id=".(int)$this->prod->zxdemo; $this->downloadLinks[] = $o; } if ($this->prod->demozoo) { $o = new stdClass(); $o->type = "demozoo"; $o->id = "demozooID"; $o->link = "http://demozoo.org/productions/".(int)$this->prod->demozoo."/"; $this->downloadLinks[] = $o; } $this->downloadLinks = array_merge($this->downloadLinks,SQLLib::selectRows(sprintf_esc("select type, link from downloadlinks where prod = %d order by type",$this->id))); $this->screenshotPath = find_screenshot($this->prod->id); }