Esempio 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;
  }
Esempio n. 2
0
  function Render() {
    echo "<table id='".$this->uniqueID."' class='boxtable pagedtable'>\n";
    $headers = array(
      "firstpost"=>"started",
      "userfirstpost"=>"by",
      "category"=>"category",
      "topic"=>"bbs topic",
      "count"=>"replies",
      "lastpost"=>"last post",
      "userlastpost"=>"by",
    );
    echo "<tr><th colspan='".count($headers)."'><h2>the oldskool pouët.net bbs</h2></th></tr>\n";
    echo "<tr class='sortable'>\n";
    foreach($headers as $key=>$text)
    {
      $out = sprintf("<th id='th_%s'><a href='%s' class='%s%s' id='%s'>%s</a></th>\n",
        $key,adjust_query_header(array("order"=>$key)),$_GET["order"]==$key?"selected":"",($_GET["order"]==$key && $_GET["reverse"])?" reverse":"","prodlistsort_".$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->topics as $p) {
      echo "<tr>\n";

      echo " <td>";
      echo $p->firstpost;
      echo "</td>\n";

      echo " <td>";
      echo $p->firstuser->PrintLinkedAvatar()." ";
      echo $p->firstuser->PrintLinkedName();
      echo "</td>\n";

      echo " <td>"._html($p->category)."</td>\n";

      echo " <td class='topic'>";
      echo "<a href='topic.php?which=".(int)$p->id."'>"._html($p->topic)."</a>";
      echo "</td>\n";

      echo " <td>".$p->count."</td>\n";

      echo " <td title='"._html(dateDiffReadable(time(),$p->lastpost))." ago'>";
      echo $p->lastpost;
      echo "</td>\n";

      echo " <td>";
      echo $p->lastuser->PrintLinkedAvatar()." ";
      echo $p->lastuser->PrintLinkedName();
      echo "</td>\n";

      echo "</tr>\n";
    }

    $perPage = get_setting("bbsbbstopics");

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

    $this->page = ((int)$_GET["page"] ? $_GET["page"] : 1);
    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";
?>
<script type="text/javascript">
<!--
var threadCategories = $A([<?
foreach($this->categories as $v) echo "'"._js($v)."',";
?>]);
document.observe("dom:loaded",function(){
  var sel = new Element("select",{"id":"categoryFilter"});
  $("th_category").insert(sel);

  var q = location.href.toQueryParams();

  sel.add( new Option("-- filter to","") );
  threadCategories.each(function(item){
    sel.add( new Option(item,item) );
    if (item == q["category"])
      sel.selectedIndex = sel.options.length - 1;
  });
  sel.observe("change",function(){
    if (sel.selectedIndex == 0)
      location.href = "bbs.php";
    else
      location.href = "bbs.php?category=" + sel.options[ sel.selectedIndex ].value;
  });
});
//-->
</script>
<?
    return $s;
  }
Esempio n. 3
0
  function Render() {
    echo "<table id='".$this->uniqueID."' class='boxtable pagedtable'>\n";
    $headers = array(
      "nickname"=>"nickname",
      "age"=>"age",
      "level"=>"level",
      "glops"=>"glöps",
    );
    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->users as $p) {
      echo "<tr>\n";

      echo "<td>\n";
      echo $p->PrintLinkedAvatar()." ";
      echo $p->PrintLinkedName();
      echo "</td>\n";

      echo "<td class='date'>\n";
      echo dateDiffReadableDays(time(),$p->registerDate);
      echo "</td>\n";

      echo "<td>\n";
      echo $p->level;
      echo "</td>\n";

      $pop = (int)($p->glops * 100 / $this->maxglops);
      echo "<td>".progress_bar_solo( $pop, $p->glops." glöps")."</td>\n";

      echo "</tr>\n";
    }

    $perPage = get_setting("userlistusers");

    echo "<tr>\n";
    echo "<td class='nav' colspan=".(count($headers)).">\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;
  }