Esempio n. 1
0
  function LoadFromDB() {
    $this->prod = PouetProd::spawn($_GET["which"]);
    if (!$this->prod) return;

    $a = array(&$this->prod);
    PouetCollectPlatforms( $a );

    $this->title = "mirrors :: ".$this->prod->name;
  }
Esempio n. 2
0
  function PouetBoxSubmitProdInfo( $id )
  {
    parent::__construct();


    $this->prod = PouetProd::Spawn( $id );
    $a = array(&$this->prod);
    PouetCollectPlatforms( $a );

    $this->title = "submit things for this prod: "._html($this->prod->name);
  }
Esempio n. 3
0
  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();
  }
Esempio n. 4
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);
  }
Esempio n. 5
0
<?
require_once("../bootstrap.inc.php");

header("Content-type: application/xml; charset=utf-8");
//header("Content-type: text/plain; charset=utf-8");

$xml = new SimpleXMLElement("<"."?xml version='1.0' encoding='UTF-8'?"."><xnfo/>");

$prod = PouetProd::Spawn( $_GET["which"] );

$a = array(&$prod);
PouetCollectPlatforms( $a );

if (!$prod)
  die($xml->AsXML());

$xml->addAttribute("standard","1.1");
$xml->addAttribute("version","1");
$xml->addAttribute("author","*****@*****.**");
$xml->addAttribute("mode","partial");

$xml->addChild("demo");
$xml->demo->addAttribute("pouet_id",_html($prod->id));
$xml->demo->addChild("name",_html($prod->name));

foreach($prod->types as $v)
  $xml->demo->addChild("category",ucfirst(_html($v)))->addAttribute("type",_html($v));

$s = new BM_Query();
$s->AddField("prodotherparty.party_compo");
$s->AddField("prodotherparty.party_place");
Esempio n. 6
0
  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 Render()
  {
    $error = "";
    
    echo "\n\n";
    echo "<div class='pouettbl' id='".$this->uniqueID."'>\n";

    echo "  <h2>".$this->title.": ";
    if ($_REQUEST["prod"])
    {
      $prod = PouetProd::Spawn($_REQUEST["prod"]);
      if (!$prod) die("no such prod!");
      echo $prod->RenderSingleRowShort();
    }
    echo "</h2>\n";

    $error = "";
    if(!$_POST["requestType"])
    {
      echo "  <div class='content'>\n";
      if(count($this->fields["requestType"]["fields"]))
        $this->formifier->RenderForm( $this->fields );
      else
      {
        echo "you need to select something to request about first !";
        $error = " ";
      }
      echo "  </div>\n";
    }
    else
    {
      $this->fields["requestType"]["type"] = "statichidden";
      echo "  <div class='content'>\n";
      $this->formifier->RenderForm( $this->fields );
      echo "  </div>\n";
      echo "  <h2>more data</h2>\n";
      echo "  <div class='content'>\n";
      $fields = array();
      
      $js = "";
      global $REQUESTTYPES;
      if ($REQUESTTYPES[ $_POST["requestType"] ])
      {
        $error = $REQUESTTYPES[ $_POST["requestType"] ]::GetFields($_REQUEST,$fields,$js);
      }
      else
      {
        $error = "no such request type !";
      }

      if ($fields && !$error)
      {
        foreach($_POST as $k=>$v)
          if ($fields[$k])
            $fields[$k]["value"] = $v;
        $this->formifier->RenderForm($fields);
      }
      if ($error)
        echo $error;
      echo "  </div>\n";

    }
    
    if ($js)
    {
      echo "<script type='text/javascript'>\n";
      echo "<!--\n";
      echo $js;
      echo "//-->\n";
      echo "</script>\n";
    }
  
    if (!$error)
      echo "  <div class='foot'><input type='submit' value='Submit' /></div>";
    echo "</div>\n";
  }
Esempio n. 8
0
 static function Display($itemID, $data)
 {
   $prod = PouetProd::Spawn( $itemID );
   $s = "<b>current</b>: ";
   $s .= "<a href='"._html($prod->download)."'>"._html(shortify_cut($prod->download,50))."</a>";
   if ($prod->download != $data["oldDownloadLink"])
   {
     $s .= "<br/><b>old</b>: ";
     $s .= "<a href='"._html($data["oldDownloadLink"])."'>"._html(shortify_cut($data["oldDownloadLink"],50))."</a>";
   }
   $s .= "<br/><b>new</b>: ";
   $s .= "<a href='"._html($data["downloadLink"])."'>"._html(shortify_cut($data["downloadLink"],50))."</a>";
   $s .= "<br/><b>reason</b>: ";
   $s .= _html($data["reason"]);
  
   return $s;
 }