v 0. Pasted by 0m1cr0n as php at 2009-10-17 06:04:48 MSK and set expiration to never.

Paste will expire never.

  1. // The headings, with sort links...
  2. $uparr="<img src='images/uparrow.gif' height=8 width=5 alt='Descending' />";
  3. $downarr="<img src='images/downarrow.gif' height=8 width=5 alt='Ascending' />";
  4.  
  5. $headcols = array(
  6.     'Name'   => 'name',
  7.     'Status' => 'status_string',
  8.     'Done'   => 'percent_complete',
  9.     'Remain' => 'bytes_diff',
  10.     'Size'   => 'size_bytes',
  11.     'Down'   => 'down_rate',
  12.     'Up'     => 'up_rate',
  13.     'Seeded' => 'up_total',
  14.     'Ratio'  => 'ratio',
  15.     'Peers'  => 'peers_connected'
  16. );
  17.  
  18. foreach ($headcols as $title => $name)
  19. {
  20.     if ($_SESSION['sortkey'] == $name) {
  21.         $newso = ($_SESSION['sortord'] == "asc") ? "desc" : "asc";
  22.         $newarr = ($_SESSION['sortord'] == "asc") ? "$downarr" : "$uparr";
  23.     } else {
  24.         $newso = 'asc';
  25.         $newarr = '';
  26.     }
  27.     print("<div class='headcol' style='width:89px;'><a href='?setsortkey=$name&amp;setsortord=$newso'>$title</a> $newarr</div>\n");
  28. }
  29.  
  30. echo "<div class='headcol' style='width:84px;'>";
  31. if ($_SESSION['sortkey'] == 'priority_str') $newso = ($_SESSION['sortord'] == "asc") ? "desc" : "asc";
  32. else $newso = 'asc';
  33. echo "<a href='?setsortkey=priority_str&amp;setsortord=$newso'>Pri</a> ".($_SESSION['sortkey']=="priority_str" ? ($_SESSION['sortord']=="asc" ? "$downarr" : "$uparr") :"");
  34. if ($displaytrackerurl==TRUE) {
  35.     if ($_SESSION['sortkey'] == 'tracker_url') $newso = ($_SESSION['sortord'] == "asc") ? "desc" : "asc";
  36.     else $newso = 'asc';
  37.     echo "/ <a href='?setsortkey=tracker_url&amp;setsortord=$newso'>Trk</a> ".($_SESSION['sortkey']=="tracker_url" ? ($_SESSION['sortord']=="asc" ? "$downarr" : "$uparr") :"");
  38. }
  39. echo "</div>\n";
  40. // End of headings
  41.  


Editing is locked.