No Description
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.

index.php 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <?php
  4. ///////////////////////////////////////////
  5. // Originally written by kitallis. //
  6. // Un-failed and featurized by nirbheek. //
  7. ///////////////////////////////////////////
  8. $hacker_links = array(
  9. "beachbrake" => "http://www.priyakuber.in/",
  10. "devilsadvocate" => "http://blog.chintal.in/",
  11. "Ford_Prefect" => "http://arunraghavan.net",
  12. "GeneralMaximus" => "http://uncool.in",
  13. "Gurpartap" => "http://gurpartap.com",
  14. "ideamonk" => "http://ideamonk.in/",
  15. "iwikiwi" => "http://blog.vdavuluri.info/",
  16. "jai" => "http://www.retroficial.org/",
  17. "kitallis" => "http://code.scrapcrap.org",
  18. "kstar" => "http://kstars.wordpress.com/",
  19. "lifeeth" => "http://lifeeth.in",
  20. "lut4rp" => "http://pratul.in",
  21. "nikkar" => "http://github.com/Gurpartap/nikkar/",
  22. "nirbheek" => "http://bheekly.blogspot.com",
  23. "sid0" => "http://monogatari.doukut.su",
  24. "Stattrav" => "http://suryajith.in/",
  25. "Sup3rkiddo" => "http://sudharsh.wordpress.com/",
  26. "t3rmin4t0r" => "http://notmysock.org",
  27. "YuviPanda" => "http://yuvi.in",
  28. "shadeslayer" => "http://kshadeslayer.wordpress.com/",
  29. );
  30. $hacker_alts = array("Gurpartap" => "balle balle?",
  31. "nirbheek" => "did your mom.",
  32. "lut4rp" => "The Quintessential Nice Guy ®");
  33. $known_pic_types = array("gif", "jpg", "png", "svg");
  34. // We use a comma because that isn't allowed in OFTC nicks
  35. $default_avatar_dir = "default,";
  36. // no. of columns to divide the nicks into; must exist in CSS
  37. $num_cols = 3;
  38. $hacker_nicks = array_keys($hacker_links);
  39. shuffle($hacker_nicks);
  40. function get_default_avatar($nick) {
  41. global $default_avatar_dir;
  42. // Prevent infinite recursion
  43. if ($nick != $default_avatar_dir)
  44. get_avatar($default_avatar_dir);
  45. return;
  46. }
  47. function get_avatar($nick) {
  48. global $known_pic_types;
  49. $dir = "avatars/";
  50. $avatar_dir = $dir.$nick."/";
  51. if (!is_dir($avatar_dir)) {
  52. // lolwat no avatar dir, try default dir
  53. get_default_avatar($nick);
  54. return;
  55. }
  56. $avatars = scandir($avatar_dir);
  57. shuffle($avatars);
  58. // Avatars list contains '.' and '..'
  59. if (count($avatars) === 2) {
  60. // lolwat empty avatar dir, try default dir
  61. get_default_avatar($nick);
  62. return;
  63. }
  64. foreach ($avatars as $avatar) {
  65. if (in_array(substr($avatar, -3), $known_pic_types)) {
  66. echo $avatar_dir.$avatar;
  67. return;
  68. }
  69. }
  70. }
  71. function get_blurb($nick) {
  72. $file_path = "blurbs/".$nick;
  73. if (file_exists($file_path)) {
  74. $b = file($file_path);
  75. echo array_rand(array_flip($b), 1);
  76. } else {
  77. echo "Description-less nub this person is.";
  78. }
  79. }
  80. function get_nick_with_link($nick) {
  81. global $hacker_links;
  82. if (array_key_exists($nick, $hacker_links))
  83. echo '<a href="'.$hacker_links[$nick].'">'.$nick.'</a>';
  84. }
  85. function get_nick_url($nick) {
  86. global $hacker_links;
  87. if (array_key_exists($nick, $hacker_links))
  88. echo '<a href="'.$hacker_links[$nick].'">';
  89. }
  90. function get_title($nick) {
  91. global $hacker_alts;
  92. if (array_key_exists($nick, $hacker_alts))
  93. echo $hacker_alts[$nick];
  94. }
  95. ?>
  96. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
  97. <head>
  98. <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
  99. <link rel="stylesheet" href="style.css" type="text/css"/>
  100. <link href="favicon.ico" rel="icon" type="image/x-icon" />
  101. <title>Hackers India • Indian F/OSS Hackers Collective</title>
  102. </head>
  103. <body>
  104. <div id="wrapper">
  105. <div id="header">
  106. <a href=""><img src="images/hi.png" title="#hackers-india"/></a>
  107. </div>
  108. <div id="content">
  109. <?php for($n = 1; $n < $num_cols+1; $n++) { ?>
  110. <div id="col<?php echo $n; ?>">
  111. <?php
  112. foreach($hacker_nicks as $i => $nick) {
  113. if ((($i+1) % $num_cols) != ($n % $num_cols))
  114. continue; // distribute nicks equally amongst the columns
  115. ?>
  116. <h4><?php get_nick_with_link($nick); ?></h4>
  117. <p>
  118. <?php get_nick_url($nick); ?>
  119. <img align="left" src="<?php get_avatar($nick); ?>" title="<?php get_title($nick) ?>"/>
  120. </a><br/>
  121. <?php get_blurb($nick); ?>
  122. </p>
  123. <!-- end of a hacker -->
  124. <?php } ?>
  125. </div>
  126. <?php } ?>
  127. </div>
  128. <div id="footer">
  129. <h3><a href="http://ha.ckers.in/rules.html">The Constitution of hackers-india lies here.</a></h3><br/><br/>
  130. <p>Warning: The climate of Hackers India may unknowingly vary from geek to sexist to silence to foo. Lifeforms unaccustomed to sudden change and unforseen levels of behaviour might be permanently affected.</p><br/>
  131. <p>All rights reserved till the end of Time &mdash; #hackers-india @ irc.oftc.net</p><br/>
  132. <p>Design by ideamonk, code by kitallis and nirbheek.</p>
  133. </div>
  134. </div>
  135. </body>
  136. </html>