Beispiel #1
0
 function RenderBody()
 {
   $title = "nfo added by "._html($this->nfo->user->nickname)." on "._html($this->nfo->added);
   echo "<div class='content' title='".$title."'>\n";
   if ($_GET["font"]=="none")
   {
     echo "<pre>";
     $text = file_get_contents( get_local_nfo_path( $_GET["which"] ) );
     echo _html( process_ascii( $text ) );
     echo "</pre>";
   }
   else
     printf("<img src='img_ascii.php?nfo=%d&amp;font=%d' alt='nfo'/>\n",$_GET["which"],$_GET["font"]);
   echo "</div>\n";
 }
Beispiel #2
0
  function Render()
  {
    global $currentUser;

    $timer[$this->uniqueID." render"]["start"] = microtime_float();

    echo "<table id='pouetbox_prodmain'>\n";
    echo "<tr id='prodheader'>\n";
    echo "<th colspan='3'>\n";
    echo " <span id='title'><big>"._html($this->prod->name)."</big>";
    if ($this->prod->groups)
      echo " by ".$this->prod->RenderGroupsLong();
    echo "</span>\n";
    printf("<div id='nfo'>");
    if ($currentUser && $currentUser->CanEditItems())
    {
      printf("[<a href='admin_prod_edit.php?which=%d' class='adminlink'>admin</a>]\n",$this->id);
    }
    if ($currentUser && $currentUser->CanSubmitItems())
    {
      printf("[<a href='submit_modification_request.php?prod=%d'>edit</a>]\n",$this->prod->id);
    }
    if (file_exists(get_local_nfo_path($this->id)))
    {
      $isAmiga = false;
      foreach($this->prod->platforms as $v)
      {
        if (stristr($v["name"],"amiga")!==false)
          $isAmiga = true;
      }
      if ($isAmiga)
        printf("[<a href='prod_nfo.php?which=%d&amp;font=4'>nfo</a>]\n",$this->id);
      else
        printf("[<a href='prod_nfo.php?which=%d'>nfo</a>]\n",$this->id);
    }
    else if ($currentUser && $currentUser->CanSubmitItems())
    {
      printf(" <small>[<a class='submitadditional' href='submit_prod_info.php?which=%d'>+nfo</a>]</small>",$this->prod->id);
    }
    printf("</div>");
    echo "</th>\n";
    echo "</tr>\n";

    echo "<tr>\n";
    echo " <td rowspan='3' id='screenshot'>".$this->RenderScreenshot()."</td>\n";
    echo " <td colspan='2'>\n";
    $this->RenderDetails();
    echo " </td>\n";
    echo "</tr>\n";

    echo "<tr>\n";
    echo " <td class='r2'>\n";
    $this->RenderThumbs();
    echo " </td>\n";
    echo " <td id='popularity'>\n";
    $this->RenderPopularity();
    echo " </td>\n";
    echo "</tr>\n";

    echo "<tr>\n";
    echo " <td class='r2'>\n";
    $this->RenderAverage();
    echo " </td>\n";
    echo " <td id='links'>\n";
    $this->RenderLinks();
    echo " </td>\n";
    echo "</tr>\n";

    if ($this->credits)
    {
      echo "<tr>\n";
      echo " <td id='credits' colspan='3' class='r2'>";
      $this->RenderCredits();
      echo "</td>\n";
      echo "</tr>\n";
    }
    else if ($currentUser)
    {
      echo "<tr>\n";
      echo " <td id='credits' colspan='3' class='r2'>";
      echo " <p>this prod has no credits assigned yet! <a href='submit_modification_request.php?prod=".$this->id."&amp;requestType=prod_add_credit'>click here</a> to add some !</p>";
      echo "</td>\n";
      echo "</tr>\n";
    }


    if($this->prod->addeduser)
    {
      echo "<tr>\n";
      echo " <td class='foot' colspan='3'>added on the ".$this->prod->addedDate." by ".$this->prod->addeduser->PrintLinkedName()." ".$this->prod->addeduser->PrintLinkedAvatar()."</td>\n";
      echo "</tr>\n";
    }

    echo "</table>\n";
    $timer[$this->uniqueID." render"]["end"] = microtime_float();
  }
  function LoadFromDB()
  {
    parent::LoadFromDB();

    $prod = $this->prod;

    $a = array();
    unset($this->fields["name"]);
    unset($this->fields["download"]);

    unset($this->fields["group1"]);
    unset($this->fields["group2"]);
    unset($this->fields["group3"]);

    if ($prod->releaseDate)
      unset($this->fields["releaseDate"]);

    unset($this->fields["platform"]);
    unset($this->fields["type"]);

    if ($prod->party)
    {
      unset($this->fields["partyID"]);
      unset($this->fields["partyYear"]);
    }
    if ($prod->party->id == NO_PARTY_ID || $prod->placings[0]->compo)
      unset($this->fields["partyCompo"]);
    if ($prod->party->id == NO_PARTY_ID || $prod->placings[0]->ranking)
      unset($this->fields["partyRank"]);

    //unset($this->fields["sceneOrgID"]);
    unset($this->fields["zxdemoID"]);
    unset($this->fields["csdbID"]);
    unset($this->fields["demozooID"]);
    unset($this->fields["invitationParty"]);
    unset($this->fields["invitationYear"]);
    if ( file_exists( get_local_nfo_path( $prod->id ) ) )
      unset($this->fields["nfofile"]);
    if ( glob( get_local_screenshot_path( $prod->id, "*" ) ) )
      unset($this->fields["screenshot"]);
  }
Beispiel #4
0
  function Commit($data)
  {
    SQLLib::Query(sprintf_esc("DELETE FROM downloadlinks WHERE prod=%d",$this->prod->id));
    SQLLib::Query(sprintf_esc("DELETE FROM comments WHERE which=%d",$this->prod->id));
    SQLLib::Query(sprintf_esc("DELETE FROM nfos WHERE prod=%d",$this->prod->id));
    SQLLib::Query(sprintf_esc("DELETE FROM screenshots WHERE prod=%d",$this->prod->id));
    SQLLib::Query(sprintf_esc("DELETE FROM prods_platforms WHERE prod=%d",$this->prod->id));
    SQLLib::Query(sprintf_esc("DELETE FROM sceneorgrecommended WHERE prodid=%d",$this->prod->id));
    SQLLib::Query(sprintf_esc("DELETE FROM users_cdcs WHERE cdc=%d",$this->prod->id));
    SQLLib::Query(sprintf_esc("DELETE FROM affiliatedprods WHERE original=%d or derivative=%d",$this->prod->id,$this->prod->id));
    SQLLib::Query(sprintf_esc("DELETE FROM prods_refs WHERE prod=%d",$this->prod->id));
    SQLLib::Query(sprintf_esc("DELETE FROM prodotherparty WHERE prod=%d",$this->prod->id));
    SQLLib::Query(sprintf_esc("DELETE FROM cdc WHERE which=%d",$this->prod->id));
    SQLLib::Query(sprintf_esc("DELETE FROM credits WHERE prodID=%d",$this->prod->id));
    SQLLib::Query(sprintf_esc("DELETE FROM watchlist WHERE prodID=%d",$this->prod->id));
    SQLLib::Query(sprintf_esc("DELETE FROM listitems WHERE itemid=%d AND type='prod'",$this->prod->id));
    SQLLib::Query(sprintf_esc("DELETE FROM prods_linkcheck WHERE prodID=%d LIMIT 1",$this->prod->id));
    SQLLib::Query(sprintf_esc("DELETE FROM prods WHERE id=%d LIMIT 1",$this->prod->id));

    @unlink( get_local_nfo_path( (int)$this->prod->id ) );
    foreach( array( "jpg","gif","png" ) as $v )
      @unlink( get_local_screenshot_path( (int)$this->prod->id, $v ) );

    gloperator_log( "prod", (int)$this->prod->id, "prod_delete", get_object_vars($this->prod) );

    return array();
  }
Beispiel #5
0
$b1=0xff;
$r2=0x44;
$g2=0x66;
$b2=0x88;

$r3=$r2-32;
$g3=$g2-32;
$b3=$b2-32;
if($r3<0) $r3=0;
if($g3<0) $g3=0;
if($b3<0) $b3=0;

$path = "";
if ($_GET["nfo"])
{
  $path = get_local_nfo_path($_GET["nfo"]);
}
elseif ($_GET["results"])
{
  $path = get_local_partyresult_path($_GET["results"],$_GET["year"]);
}
elseif ($_GET["boardnfo"])
{
  $path = get_local_boardnfo_path($_GET["boardnfo"]);
}

if(!$path || !file_exists($path))
{
  $txt=array(
    "ÚÄÄÄÄÄÄÄÄÄ¿  ",
    "³WRONG URL³  ",
Beispiel #6
0
  function Commit($data)
  {
    //////////////////////////////////////////////////////////////////
    // everything has been validated (..., the new album by BT!)

    $a = array();
    $a["name"] = $data["name"];
    $a["download"] = $data["download"];

    $a["addedUser"] = get_login_id();
    $a["addedDate"] = date("Y-m-d H:i:s");

    if( $data["releaseDate_year"] && $data["releaseDate_month"] && checkdate( (int)$data["releaseDate_month"], 15, (int)$data["releaseDate_year"]) )
      $a["releaseDate"] = sprintf("%04d-%02d-15",$data["releaseDate_year"],$data["releaseDate_month"]);
    else if ($data["releaseDate_year"])
      $a["releaseDate"] = sprintf("%04d-00-15",$data["releaseDate_year"]);

    $a["type"] = implode(",",$data["type"]);

    $groups = array();
    if ($data["group1"]) $groups[] = (int)$data["group1"];
    if ($data["group2"]) $groups[] = (int)$data["group2"];
    if ($data["group3"]) $groups[] = (int)$data["group3"];
    $groups = array_unique($groups);
    $a["group1"] = nullify( array_shift($groups) );
    $a["group2"] = nullify( array_shift($groups) );
    $a["group3"] = nullify( array_shift($groups) );

    $a["csdb"] = $data["csdbID"];
    //$a["sceneorg"] = $data["sceneOrgID"];
    //$a["zxdemo"] = $data["zxdemoID"];
    $a["demozoo"] = $data["demozooID"];
    $a["party"] = nullify($data["partyID"]);
    $a["party_year"] = $data["partyYear"];
    $a["party_compo"] = nullify($data["partyCompo"]);
    $a["party_place"] = $data["partyRank"];
    $a["invitation"] = nullify($data["invitationParty"]);
    $a["invitationyear"] = $data["invitationYear"];
    $a["boardID"] = nullify($data["boardID"]);

    $this->prodID = SQLLib::InsertRow("prods",$a);

    $data["platform"] = array_unique($data["platform"]);
    foreach($data["platform"] as $k=>$v)
    {
      $a = array();
      $a["prod"] = $this->prodID;
      $a["platform"] = $v;
      SQLLib::InsertRow("prods_platforms",$a);
    }

    if(is_uploaded_file($_FILES["screenshot"]["tmp_name"]))
    {
      list($width,$height,$type) = GetImageSize($_FILES["screenshot"]["tmp_name"]);
      $extension = "_";
      switch($type) {
        case 1:$extension="gif";break;
        case 2:$extension="jpg";break;
        case 3:$extension="png";break;
      }
      move_uploaded_file_fake( $_FILES["screenshot"]["tmp_name"], get_local_screenshot_path( $this->prodID, $extension ) );

      $a = array();
      $a["prod"] = $this->prodID;
      $a["user"] = get_login_id();
      $a["added"] = date("Y-m-d H:i:s");
      SQLLib::InsertRow("screenshots",$a);
    }
    if(is_uploaded_file($_FILES["nfofile"]["tmp_name"]))
    {
      move_uploaded_file_fake( $_FILES["nfofile"]["tmp_name"], get_local_nfo_path( $this->prodID ) );

      $a = array();
      $a["prod"] = $this->prodID;
      $a["user"] = get_login_id();
      $a["added"] = date("Y-m-d H:i:s");
      SQLLib::InsertRow("nfos",$a);
    }

    @unlink("cache/pouetbox_latestadded.cache");
    @unlink("cache/pouetbox_latestreleased.cache");
    @unlink("cache/pouetbox_latestparties.cache");

    return array();
  }