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

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