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

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