function LoadFromDB()
 {
   $s = new BM_Query("modification_requests");
   $s->AddField("modification_requests.id");
   $s->AddField("modification_requests.requestType");
   $s->AddField("modification_requests.itemID");
   $s->AddField("modification_requests.itemType");
   $s->AddField("modification_requests.requestBlob");
   $s->AddField("modification_requests.requestDate");
   $s->Attach(array("modification_requests"=>"userID"),array("users as user"=>"id"));
   $s->Attach(array("modification_requests"=>"itemID"),array("prods as prod"=>"id"));
   $s->AddWhere("approved is null");
   $s->AddOrder("requestDate desc");
   $this->requests = $s->perform();
 }
예제 #2
0
  function LoadFromDB() 
  {
    $this->board = SQLLib::SelectRow(sprintf_esc("select * from boards where id = %d",$this->id));
    if (!$this->board) return;

    $a = SQLLib::SelectRows(sprintf_esc("select * from boards_platforms where board = %d",$this->id));
    $this->platforms = array();
    foreach($a as $v) $this->platforms[] = $v->platform;

    $this->addedUser = PouetUser::Spawn($this->board->addedUser);

    $this->nfos = SQLLib::SelectRows(sprintf_esc("select * from othernfos where refid = %d",$this->id));

    $s = new BM_Query("affiliatedboards");
    $s->AddField("affiliatedboards.type");
    $s->Attach(array("affiliatedboards"=>"group"),array("groups as group"=>"id"));
    $s->AddWhere(sprintf_esc("affiliatedboards.board = %d",$this->id));
    $this->groups = $s->perform();

    $s = new BM_Query("prods");
    $s->AddWhere(sprintf_esc("prods.boardID = %d",$this->id));
    $this->bbstros = $s->perform();
  }
예제 #3
0
파일: prod.php 프로젝트: neodyme60/pouet2.0
  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);
  }
예제 #4
0
  function PouetBoxAdminEditProdCredits( $prod )
  {
    parent::__construct();

    $this->uniqueID = "pouetbox_prodeditprodcredits";
    $this->prod = $prod;
    $this->title = "credits";

    $this->headers = array("user","role");

    $s = new BM_Query("credits");
    $s->AddField("credits.id");
    $s->AddField("credits.role");
    $s->AddWhere(sprintf("credits.prodID = %d",$this->prod->id));
    $s->Attach(array("credits"=>"userID"),array("users as user"=>"id"));
    $this->data = $s->perform();
  }