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.3KB

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