Ejemplo n.º 1
0
  function Render() {
    echo "<table id='".$this->uniqueID."' class='boxtable pagedtable'>\n";
    $headers = array(
      "type"=>"type",
      "name"=>"prodname",
      "platform"=>"platform",
      "group"=>"group",
      "party"=>"release party",
      "release"=>"release date",
      "added"=>"added",
      "thumbup"=>"<img src='".POUET_CONTENT_URL."gfx/rulez.gif' alt='rulez' />",
      "thumbpig"=>"<img src='".POUET_CONTENT_URL."gfx/isok.gif' alt='piggie' />",
      "thumbdown"=>"<img src='".POUET_CONTENT_URL."gfx/sucks.gif' alt='sucks' />",
      "avg"=>"avg",
      "views"=>"popularity",
    );
    echo "<tr class='sortable'>\n";
    foreach($headers as $key=>$text)
    {
      $out = sprintf("<th><a href='%s' class='%s%s' id='%s'>%s</a></th>\n",
        adjust_query_header(array("order"=>$key)),$_GET["order"]==$key?"selected":"",($_GET["order"]==$key && $_GET["reverse"])?" reverse":"","sort_".$key,$text);
      if ($key == "type" || $key == "name") $out = str_replace("</th>","",$out);
      if ($key == "platform" || $key == "name") $out = str_replace("<th>"," ",$out);
      echo $out;
    }
    echo "</tr>\n";

    foreach ($this->prods as $p) {
      echo "<tr>\n";

      echo "<td>\n";
      echo $p->RenderTypeIcons();
      echo $p->RenderPlatformIcons();
      echo "<span class='prod'>".$p->RenderLink()."</span>\n";
      echo $p->RenderAwards();
      echo "</td>\n";

      echo "<td>\n";
      echo $p->RenderGroupsShortProdlist();
      echo "</td>\n";

      echo "<td>\n";
      if ($p->placings)
        echo $p->placings[0]->PrintResult($p->year);
      echo "</td>\n";

      echo "<td class='date'>".$p->RenderReleaseDate()."</td>\n";
      echo "<td class='date'>".$p->RenderAddedDate()."</td>\n";

      echo "<td class='votes'>".$p->voteup."</td>\n";
      echo "<td class='votes'>".$p->votepig."</td>\n";
      echo "<td class='votes'>".$p->votedown."</td>\n";

      $i = "isok";
      if ($p->voteavg < 0) $i = "sucks";
      if ($p->voteavg > 0) $i = "rulez";
      echo "<td class='votes'>".sprintf("%.2f",$p->voteavg)."&nbsp;<img src='".POUET_CONTENT_URL."gfx/".$i.".gif' alt='".$i."' /></td>\n";

      $pop = (int)calculate_popularity( $p->views );
      echo "<td>".progress_bar_solo( $pop, $pop."%" )."</td>\n";

      echo "</tr>\n";
    }

    $perPage = get_setting("prodlistprods");

    echo "<tr>\n";
    echo "<td class='nav' colspan=".(count($headers)-2).">\n";

    if ($this->page > 1)
      echo "  <div class='prevpage'><a href='".adjust_query(array("page"=>($this->page - 1)))."'>previous page</a></div>\n";
    if ($this->page < ($this->count / $perPage))
      echo "  <div class='nextpage'><a href='".adjust_query(array("page"=>($this->page + 1)))."'>next page</a></div>\n";

    echo "  <select name='page'>\n";
    for ($x=1; $x<=($this->count / $perPage) + 1; $x++)
      printf("    <option value='%d'%s>%d</option>\n",$x,$x==$this->page?" selected='selected'":"",$x);
    echo "  </select>\n";
    echo "  <input type='submit' value='Submit'/>\n";
    echo "</td>\n";
    echo "</tr>\n";
    echo "</table>\n";
    return $s;
  }
Ejemplo n.º 2
0
  function Render()
  {
    echo "<table id='".$this->uniqueID."' class='boxtable'>\n";

    $headers = array(
      "compo"=>"compo",
      "type"=>"type",
      "name"=>"prodname",
/*
      "platform"=>"platform",
      "group"=>"group",
      "party"=>"release party",
      "release"=>"release",
      "added"=>"added",
*/
      "thumbup"=>"<img src='".POUET_CONTENT_URL."gfx/rulez.gif' alt='rulez' />",
      "thumbpig"=>"<img src='".POUET_CONTENT_URL."gfx/isok.gif' alt='piggie' />",
      "thumbdown"=>"<img src='".POUET_CONTENT_URL."gfx/sucks.gif' alt='sucks' />",
      "avg"=>"avg",
      "views"=>"popularity",
    );

    $lastCompo = "*";
    $headerDone = false;
    global $COMPOTYPES;
    foreach($this->prods as $p)
    {
      if ($p->party_compo != $lastCompo && !$headerDone)
      {
        echo "<tr class='sortable'>\n";
        foreach($headers as $key=>$text)
        {
          $out = sprintf("<th><a href='%s' class='%s%s' id='%s'>%s</a></th>\n",
            adjust_query_header(array("order"=>$key)),$_GET["order"]==$key?"selected":"",($_GET["order"]==$key && $_GET["reverse"])?" reverse":"","sort_".$key,$text);
          if ($key == "type" || $key == "name") $out = str_replace("</th>","",$out);
          if ($key == "platform" || $key == "name") $out = str_replace("<th>"," ",$out);
          if ($key == "compo" && $this->sortByCompo) $out = "<th>".$COMPOTYPES[$p->party_compo]."</th>";
          echo $out;
        }
        echo "</tr>\n";
        if (!$this->sortByCompo)
          $headerDone = true;
        $lastCompo = $p->party_compo;
      }
      echo "<tr>\n";
      echo "<td>\n";
      if (!$this->sortByCompo)
        echo $COMPOTYPES[$p->party_compo]." ";
      if ($p->placings[0])
        echo $p->placings[0]->PrintRanking();
      echo "</td>\n";
      echo "<td class='prod'>\n";
      echo $p->RenderTypeIcons();
      echo $p->RenderPlatformIcons();
      echo "".$p->RenderLink()." ";
      if ($p->groups)
        echo "by ".$p->RenderGroupsLong()."\n";
      echo $p->RenderAwards();
      echo "</td>\n";

      echo "<td class='votes'>".$p->voteup."</td>\n";
      echo "<td class='votes'>".$p->votepig."</td>\n";
      echo "<td class='votes'>".$p->votedown."</td>\n";

      $i = "isok";
      if ($p->voteavg < 0) $i = "sucks";
      if ($p->voteavg > 0) $i = "rulez";
      echo "<td class='votes'>".sprintf("%.2f",$p->voteavg)."&nbsp;<img src='".POUET_CONTENT_URL."gfx/".$i.".gif' alt='".$i."' /></td>\n";

      $pop = (int)calculate_popularity( $p->views );
      echo "<td>".progress_bar_solo( $pop, $pop."%" )."</td>\n";

      echo "</tr>\n";
    }
    echo "</table>\n";
    return $s;
  }
Ejemplo n.º 3
0
  function RenderPopularity() {
    $pop = (int)calculate_popularity( $this->prod->views );
    echo "popularity : ".$pop."%<br/>\n";
    echo progress_bar( $pop, $pop."%" );

    $year = substr($this->prod->releaseDate,0,4);
    echo "<div class='awards'>";
    foreach($this->awards as $award)
    {
    	printf("<a href='./awards.php#%s'><img src='".POUET_CONTENT_URL."gfx/sceneorg/%s.gif' title='%s' alt='%s'/></a>",
        $award->type == "viewingtip" ? $year : $year . str_replace(" ","",$award->category),
        $award->type,
        $award->category,
        $award->category);
    }
    echo "</div>";
  }
Ejemplo n.º 4
0
  function Render()
  {
    global $currentUser;

    echo "<table id='pouetbox_groupmain' class='boxtable pagedtable'>\n";
    echo "<tr>\n";
    echo "<th colspan='9' id='groupname'>\n";
    echo sprintf("<a href='groups.php?which=%d'>%s",$this->id,_html($this->group->name));
    if ($this->group->acronym)
      echo sprintf(" [%s]",$this->group->acronym);
    echo "</a>";
    if ($this->group->web)
      echo sprintf(" [<a href='%s'>web</a>]",_html($this->group->web));
    if ($this->group->csdb)
      echo sprintf(" [<a href='http://csdb.dk/group/?id=%d'>csdb</a>]",$this->group->csdb);
    if ($this->group->zxdemo)
      echo sprintf(" [<a href='http://zxdemo.org/author.php?id=%d'>zxdemo</a>]",$this->group->zxdemo);
    if ($this->group->demozoo)
      echo sprintf(" [<a href='http://demozoo.org/groups/%d/'>demozoo</a>]",$this->group->demozoo);

    printf(" [<a href='gloperator_log.php?which=%d&amp;what=group'>glöplog</a>]\n",$this->group->id);

    if ($currentUser && $currentUser->CanEditItems())
    {
      printf("<div id='adminlinks'>");
      printf("[<a href='admin_group_edit.php?which=%d' class='adminlink'>edit</a>]\n",$this->id);
      printf("</div>");
    }

    echo "</th>\n";
    echo "</tr>\n";

    $headers = array(
      "type"=>"type",
      "name"=>"prodname",
      "party"=>"release party",
      "release"=>"release date",
      "thumbup"=>"<img src='".POUET_CONTENT_URL."gfx/rulez.gif' alt='rulez' />",
      "thumbpig"=>"<img src='".POUET_CONTENT_URL."gfx/isok.gif' alt='piggie' />",
      "thumbdown"=>"<img src='".POUET_CONTENT_URL."gfx/sucks.gif' alt='sucks' />",
      "avg"=>"avg",
      "views"=>"popularity",
      "latestcomment"=>"last comment",
    );

    echo "<tr class='sortable'>\n";
    foreach($headers as $key=>$text)
    {
      $out = sprintf("<th><a href='%s' class='%s%s' id='%s'>%s</a></th>\n",
        adjust_query_header(array("order"=>$key)),$_GET["order"]==$key?"selected":"",($_GET["order"]==$key && $_GET["reverse"])?" reverse":"","sort_".$key,$text);
      if ($key == "type") $out = str_replace("</th>","",$out);
      if ($key == "name") $out = str_replace("<th>"," ",$out);
      echo $out;
    }
    echo "</tr>\n";

/*
    foreach($headers as $key=>$text)
    {
      $out = sprintf("<th><a id='%s' href='groups.php?which=%d&amp;order=%s'>%s</a></th>\n","sort_".$key,$this->id,$key,$text);
      if ($key == "type") $out = str_replace("</th>","",$out);
      if ($key == "name") $out = str_replace("<th>"," ",$out);
      echo $out;
    }
    echo "</tr>\n";
*/

    foreach ($this->prods as $p) {
      echo "<tr>\n";

      echo "<td>\n";
      echo $p->RenderTypeIcons();
      echo $p->RenderPlatformIcons();
      echo "<span class='prod'>".$p->RenderLink()."</span>\n";
      $groups = $p->groups;
      foreach($groups as $k=>$g) if ($g->id == $this->id) unset($groups[$k]);
      if ($groups)
      {
        $a = array();
        foreach($groups as $g) $a[] = $g->RenderShort();
        echo " (with ".implode(", ",$a).")";
      }
      echo $p->RenderAwards();
      echo "</td>\n";

      echo "<td>\n";
      if ($p->placings)
        echo $p->placings[0]->PrintResult($p->year);
      echo "</td>\n";

      echo "<td class='date'>".$p->RenderReleaseDate()."</td>\n";

      echo "<td class='votes'>".$p->voteup."</td>\n";
      echo "<td class='votes'>".$p->votepig."</td>\n";
      echo "<td class='votes'>".$p->votedown."</td>\n";

      $i = "isok";
      if ($p->voteavg < 0) $i = "sucks";
      if ($p->voteavg > 0) $i = "rulez";
      echo "<td class='votes'>".sprintf("%.2f",$p->voteavg)."&nbsp;<img src='".POUET_CONTENT_URL."gfx/".$i.".gif' alt='".$i."' /></td>\n";

      $pop = (int)calculate_popularity( $p->views );
      echo "<td>".progress_bar_solo( $pop, $pop."%" )."</td>\n";

      if ($p->user)
      {
        $rating = "isok";
        if ($p->lastcommentrating < 0) $rating = "sucks";
        if ($p->lastcommentrating > 0) $rating = "rulez";
        echo "<td>";
        echo "<span class='vote ".$rating."'>".$rating."</span> ";
        echo $p->lastcomment." ".$p->user->PrintLinkedAvatar()."</td>\n";
      }
      else
        echo "<td>&nbsp;</td>";

      echo "</tr>\n";
    }
    if ($this->affil)
    {
      echo "<tr>\n";
      echo " <td colspan='9' class='affil'>";
      echo " <ul>\n";
      foreach($this->affil as $v)
        echo sprintf("<li><a href='boards.php?which=%d'>%s</a> (%s)</li>",$v->id,_html($v->name),_html($v->type));
      echo " </ul>\n";
      echo " </td>\n";
      echo "</tr>\n";
    }
    echo "<tr>\n";
    echo " <td class='foot' colspan='9'>added on the ".$this->group->addedDate." by ".($this->addeduser?$this->addeduser->PrintLinkedName():"")." ".($this->addeduser?$this->addeduser->PrintLinkedAvatar():"")."</td>\n";
    echo "</tr>\n";
    echo "</table>\n";
    return $s;
  }