Oppaitime'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.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 href="<?=$Url?><?=$Name?>">
  44. <img class="tooltip large_tile" alt="<?=$Name?>" title="<?=$Name?>" src="<?=ImageTools::process($Image)?>" />
  45. </a>
  46. </li>
  47. <?php
  48. }
  49. }
  50. public static function render_artist_list($Artist, $Category)
  51. {
  52. if (self::is_valid_artist($Artist)) {
  53. switch ($Category) {
  54. case 'weekly':
  55. case 'hyped':
  56. self::render_list("artist.php?artistname=", $Artist['name'], $Artist['image'][3]['#text']);
  57. break;
  58. default:
  59. break;
  60. }
  61. }
  62. }
  63. private static function render_list($Url, $Name, $Image)
  64. {
  65. if (!empty($Image)) {
  66. $Image = ImageTools::process($Image);
  67. $Title = "title=\"&lt;img class=&quot;large_tile&quot; src=&quot;$Image&quot; alt=&quot;&quot; /&gt;\"";
  68. $Name = display_str($Name); ?>
  69. <li>
  70. <a class="tooltip_image" data-title-plain="<?=$Name?>" <?=$Title?> href="<?=$Url?><?=$Name?>"><?=$Name?></a>
  71. </li>
  72. <?php
  73. }
  74. }
  75. private static function is_valid_artist($Artist)
  76. {
  77. return $Artist['name'] != '[unknown]';
  78. }
  79. }