BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

top10view.class.php 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. class Top10View
  3. {
  4. public static function render_linkbox($Selected)
  5. {
  6. ?>
  7. <div class="linkbox">
  8. <a href="top10.php?type=torrents" class="brackets"><?=self::get_selected_link("Torrents", $Selected === "torrents")?></a>
  9. <a href="top10.php?type=users" class="brackets"><?=self::get_selected_link("Users", $Selected === "users")?></a>
  10. <a href="top10.php?type=tags" class="brackets"><?=self::get_selected_link("Tags", $Selected === "tags")?></a>
  11. <?php if (FEATURE_DONATE) { ?>
  12. <a href="top10.php?type=donors" class="brackets"><?=self::get_selected_link("Donors", $Selected === "donors")?></a>
  13. <?php } ?>
  14. </div>
  15. <?php
  16. }
  17. private static function get_selected_link($String, $Selected)
  18. {
  19. if ($Selected) {
  20. return "<strong>$String</strong>";
  21. } else {
  22. return $String;
  23. }
  24. }
  25. public static function render_artist_tile($Artist, $Category)
  26. {
  27. if (self::is_valid_artist($Artist)) {
  28. switch ($Category) {
  29. case 'weekly':
  30. case 'hyped':
  31. self::render_tile("artist.php?artistname=", $Artist['name'], $Artist['image'][3]['#text']);
  32. break;
  33. default:
  34. break;
  35. }
  36. }
  37. }
  38. private static function render_tile($Url, $Name, $Image)
  39. {
  40. if (!empty($Image)) {
  41. $Name = display_str($Name); ?>
  42. <li>
  43. <a
  44. href="<?=$Url?><?=$Name?>">
  45. <img class="tooltip large_tile" alt="<?=$Name?>"
  46. title="<?=$Name?>"
  47. src="<?=ImageTools::process($Image)?>" />
  48. </a>
  49. </li>
  50. <?php
  51. }
  52. }
  53. public static function render_artist_list($Artist, $Category)
  54. {
  55. if (self::is_valid_artist($Artist)) {
  56. switch ($Category) {
  57. case 'weekly':
  58. case 'hyped':
  59. self::render_list("artist.php?artistname=", $Artist['name'], $Artist['image'][3]['#text']);
  60. break;
  61. default:
  62. break;
  63. }
  64. }
  65. }
  66. private static function render_list($Url, $Name, $Image)
  67. {
  68. if (!empty($Image)) {
  69. $Image = ImageTools::process($Image);
  70. $Title = "title=\"&lt;img class=&quot;large_tile&quot; src=&quot;$Image&quot; alt=&quot;&quot; /&gt;\"";
  71. $Name = display_str($Name); ?>
  72. <li>
  73. <a class="tooltip_image" data-title-plain="<?=$Name?>" <?=$Title?> href="<?=$Url?><?=$Name?>"><?=$Name?></a>
  74. </li>
  75. <?php
  76. }
  77. }
  78. private static function is_valid_artist($Artist)
  79. {
  80. return $Artist['name'] !== '[unknown]';
  81. }
  82. }