Example #1
0
 function LoadFromDB()
 {
   global $currentUser;
   $this->fields = array(
     "lastLogin"=>array(
       "name"=>"last logged in",
       "type" => "static",
       "value" => $this->user->lastLogin . " (".dateDiffReadable(time(),$this->user->lastLogin)." ago)",
     ),
     "lastIP"=>array(
       "name"=>"last IP",
       "type" => "static",
       "value" => "<a href='admin_user_edit.php?ip=".rawurlencode($this->user->lastip)."'>"._html($this->user->lastip)."</a> ("._html($this->user->lasthost).") [<a href='http://www.geobytes.com/IpLocator.htm?GetLocation&amp;IpAddress="._html($this->user->lastip)."'>geoip</a>]",
     ),
     "level"=>array(
       "name"=>"level",
       "type" => "select",
       "value" => $this->user->level,
       "fields" => $this->levels,
     ),
     "permissionSubmitItems"=>array(
       "name"=>"allow user to add items",
       "type" => "checkbox",
       "value" => $this->user->permissionSubmitItems,
     ),
   );
   if ($currentUser && !$currentUser->IsAdministrator())
   {
     $this->fields["level"]["type"] = "static";
   }
 }
Example #2
0
  function RenderBody()
  {
    echo "\n\n";
    echo "<table class='boxtable'>\n";
    echo "<tr>\n";
    echo "  <th><img src='".POUET_CONTENT_URL."gfx/rulez.gif'/></th>\n";
    echo "  <th>name</th>\n";
    echo "  <th>group</th>\n";
    echo "  <th>platform</th>\n";
    echo "  <th>time</th>\n";
    echo "  <th>user</th>\n";
    echo "</tr>\n";

    foreach ($this->comments as $row)
    {
      $p = $row->prod;
      echo "<tr>\n";


      $rating = $row->rating>0 ? "rulez" : ($row->rating<0 ? "sucks" : "isok");

      echo "<td>\n";
      echo "<img src='".POUET_CONTENT_URL."gfx/".$rating.".gif'/>";
      echo "</td>\n";

      echo "<td>\n";
//      echo "<img src='".POUET_CONTENT_URL."gfx/sceneorg/".$row->type.".gif' alt='".$row->type."'/>&nbsp;";
      //echo $p->RenderTypeIcons();
      echo "<span class='prod'>".$p->RenderLink()."</span>\n";
      echo "</td>\n";

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

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

      echo "<td class='date'>\n";
      echo dateDiffReadable( time(), $row->addedDate)." ago";
      echo "</td>\n";

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

      echo "</tr>\n";
    }
    echo "</table>\n";
  }
 function RenderBody() {
   global $THREAD_CATEGORIES;
   echo "<table class='boxtable'>\n";
   $n = 0;
   foreach ($this->data as $r) {
     //if (get_setting("indexbbsnoresidue"))
     if ($this->hideResidue)
     {
       if ($r->category == "residue") continue;
     }
     printf("<tr class='%s'>\n",$r->closed?"closed":"");
     echo "  <td class='avatar'>".$r->firstuser->PrintLinkedAvatar()."</td>\n";
     echo "  <td class='category'>"._html($r->category)."</td>\n";
     echo "  <td class='topic'><a href='topic.php?which=".(int)$r->id."'>"._html($r->topic)."</a></td>\n";
     echo "  <td class='count' title='last post "._html(dateDiffReadable(time(),$r->lastpost))." ago - "._html($r->lastpost)."'>".$r->count."</td>\n";
     echo "  <td class='avatar'>".$r->lastuser->PrintLinkedAvatar()."</td>\n";
     echo "</tr>\n";
     if (++$n == $this->limit) break;
   }
   echo "</table>\n";
 }
Example #4
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;
  }