• Willkommen im Geoclub - dem größten deutschsprachigen Geocaching-Forum. Registriere dich kostenlos, um alle Inhalte zu sehen und neue Beiträge zu erstellen.

Stats zum Feld "Category"

Torsten-

Geomaster
Hab heute wieder n bissl gebastelt. Ich hab bei Category jeweils "Nachtcache", "LostPlace" bzw "LostPlace Nachtcache" eingetragen und hab mir nun eine Tabelle gebaut, die das anzeigt.

Code:
<div ##caption-style##>Kategorien</div>
<table ##table-style##>
  <tr>
   <td bgcolor="#DCDCDC" colspan="2"><b>Nachtcache</b></td>
   <td bgcolor="#DCDCDC" colspan="2"><b>LostPlace</b></td>
   <td bgcolor="#DCDCDC" colspan="2"><b>LostPlace Nachtcache</b></td>
  </tr>
  <tr>
   <td bgcolor="#DCDCDC">Gefunden</td>
   <td bgcolor="#DCDCDC">Cache</td>
   <td bgcolor="#DCDCDC">Gefunden</td>
   <td bgcolor="#DCDCDC">Cache</td>
   <td bgcolor="#DCDCDC">Gefunden</td>
   <td bgcolor="#DCDCDC">Cache</td>
  </tr>

  ##eval(
  sub StatCat {
    my($x,$count,$text,@nc,@lp,@lpnc,$cache);
    foreach $cache (keys(%found)) {
      if ($found{$cache}->{'Category'} =~ /Nachtcache/i) {
          push(@nc,"<td bgcolor=\"#DCDCDC\">$found{$cache}->{'Found'}</td><td bgcolor=\"#DCDCDC\">$found{$cache}->{'Name'}</td>");
      } elsif ($found{$cache}->{'Category'} =~ /LostPlace/i) {
          push(@lp,"<td bgcolor=\"#DCDCDC\">$found{$cache}->{'Found'}</td><td bgcolor=\"#DCDCDC\">$found{$cache}->{'Name'}</td>");
      } elsif ($found{$cache}->{'Category'} =~ /LostPlace Nachtcache/i) {
          push(@lpnc,"<td bgcolor=\"#DCDCDC\">$found{$cache}->{'Found'}</td><td bgcolor=\"#DCDCDC\">$found{$cache}->{'Name'}</td>");
      }
    }

    $count = @nc;
    if(@lp > $count){ $count = @lp; }
    if(@lpnc > $count){ $count = @lpnc; }

    $text = "";
    for($x=0;$x<$count;$x++){
      $text .= "<tr>";
      if($nc[$x]){ $text .= $nc[$x]; }
      else{ $text .= "<td bgcolor=\"#DCDCDC\"> </td><td bgcolor=\"#DCDCDC\"> </td>"; }
      if($lp[$x]){ $text .= $lp[$x]; }
      else{ $text .= "<td bgcolor=\"#DCDCDC\"> </td><td bgcolor=\"#DCDCDC\"> </td>"; }
      if($lpnc[$x]){ $text .= $lpnc[$x]; }
      else{ $text .= "<td bgcolor=\"#DCDCDC\"> </td><td bgcolor=\"#DCDCDC\"> </td>"; }
      $text .= "</tr>";
    }
    return $text;
  }
  StatCat();
  )##
</table>

Da ich noch keinen LP NC gefunden hab, hatte ich grad auch noch keine Lust, die dritte Spalte anders zu platzieren - wenn da auch noch Caches angezeigt werden, wirds wohl zu eng. Und sortieren nach Datum könnt man auch noch, und Links rein auch - aber da hab ich grad keine Lust zu :)
Zu sehen ist es hier: http://geolog.amshove.net/stat.html
Einfach nach "Kategorien" suchen.
 

korla84

Geocacher
Die Tabelle finde ich gut. Habe sie auch in meine Statistik eingebaut. Nun meine Frage: Wie kriege ich es hin, dass die Caches verlinkt werden und dass sie nach Datum sortiert werden? Ich habe noch eine Spalte für Klettercaches eingefügt. Jetzt werden aber alle 4 Tabellen hinter einander angezeigt. Ist es möglich die irgendwie unter einander anzuzeigen?
Vielleicht kann mir ja jemand helfen.
 
Oben