/
index.php
147 lines (133 loc) · 4.21 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
// Make sure this array is filled in accordance with the number of hackers in the HTML below. ALWAYS.
$hackerNicks = array("lut4rp", "nirbheek", "kitallis", "Ford_Prefect", "GeneralMaximus", "sid0",
"m1k3y", "ideamonk", "devilsadvocate");
shuffle($hackerNicks);
function get_blurb($nick) {
$directory = "blurbs/";
$nick = strtolower($nick);
$filePath = $directory.$nick.".txt";
if ($file = fopen($filePath, "r")) {
while(!feof($file)) {
echo fgets($file);
}
}
else
echo "No description found";
fclose($file);
}
function get_avatar($nick) {
$directory = "avatars/";
$nick = strtolower($nick);
$filePath = $directory.$nick;
if (file_exists($filePath.".png")) {
echo $filePath.".png";
} elseif (file_exists($filePath.".jpg")) {
echo $filePath.".jpg";
} else {
echo $directory."default.jpg";
}
}
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css" type="text/css" />
<title>#hackers-india</title>
</head>
<body>
<div id="wrapper">
<div id="header">
<a href="/" title="wanna refresh?">
<img src="images/hi.png" alt="#hackers-india" />
</a>
</div>
<div id="content">
<?php
$i = 0;
if($i < count($hackerNicks)) {
?>
<div id="col1">
<h4>
<a href="/path/to/blog">
<?php echo $hackerNicks[$i]; ?>
</a>
</h4>
<p>
<img align="left" src=<?php get_avatar($hackerNicks[$i]); ?> alt="FooMaster" />
<br />
<?php get_blurb($hackerNicks[$i]); $i = $i + 1; ?>
</p>
<!-- end of a hacker -->
<h4><?php echo $hackerNicks[$i]; ?></h4>
<p>
<img align="left" src=<?php get_avatar($hackerNicks[$i]); ?> alt="FooMaster" />
<br />
<?php get_blurb($hackerNicks[$i]); $i = $i + 1; ?>
</p>
<!-- end of a hacker -->
<h4><?php echo $hackerNicks[$i]; ?></h4>
<p>
<img align="left" src=<?php get_avatar($hackerNicks[$i]); ?> alt="FooMaster" />
<br />
<?php get_blurb($hackerNicks[$i]); $i = $i + 1; ?>
</p>
<!-- end of a hacker -->
</div>
<div id="col2">
<h4><?php echo $hackerNicks[$i]; ?></h4>
<p>
<img align="left" src=<?php get_avatar($hackerNicks[$i]); ?> alt="FooMaster" />
<br />
<?php get_blurb($hackerNicks[$i]); $i = $i + 1; ?>
</p>
<!-- end of a hacker -->
<h4><?php echo $hackerNicks[$i]; ?></h4>
<p>
<img align="left" src=<?php get_avatar($hackerNicks[$i]); ?> alt="FooMaster" />
<br />
<?php get_blurb($hackerNicks[$i]); $i = $i + 1; ?>
</p>
<!-- end of a hacker -->
<h4><?php echo $hackerNicks[$i]; ?></h4>
<p>
<img align="left" src=<?php get_avatar($hackerNicks[$i]); ?> alt="FooMaster" />
<br />
<?php get_blurb($hackerNicks[$i]); $i = $i + 1; ?>
</p>
<!-- end of a hacker -->
</div>
<div id="col3">
<h4><?php echo $hackerNicks[$i]; ?></h4>
<p>
<img align="left" src=<?php get_avatar($hackerNicks[$i]); ?> alt="FooMaster" />
<br />
<?php get_blurb($hackerNicks[$i]); $i = $i + 1; ?>
</p>
<!-- end of a hacker -->
<h4><?php echo $hackerNicks[$i]; ?></h4>
<p>
<img align="left" src=<?php get_avatar($hackerNicks[$i]); ?> alt="FooMaster" />
<br />
<?php get_blurb($hackerNicks[$i]); $i = $i + 1; ?>
</p>
<!-- end of a hacker -->
<h4><?php echo $hackerNicks[$i]; ?></h4>
<p>
<img align="left" src=<?php get_avatar($hackerNicks[$i]); ?> alt="FooMaster" />
<br />
<?php get_blurb($hackerNicks[$i]); ?>
</p>
<!-- end of a hacker -->
</div>
<?php } ?>
</div>
<div id="footer">
Warning: The climate of #hackers-india may unknowingly vary from geek to sexist to silence to foo. Humans unaccustomed to sudden change and unparalleled levels of foo might be permanently affected. <br />
©2010 irc.oftc.net#hackers-india
</div>
</div>
</body>
</html>