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)." <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; }
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; }
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)." <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; }
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&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&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)." <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> </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; }