- <?php
- $counter = 100;
- $write = false;
- $filename = "hitcounter.txt";
- $ip = $_SERVER['REMOTE_ADDR'];
- $file = fopen($filename, 'r');
- $content = file_get_contents($filename);
- $file_content = explode(" ", $content);
- fclose($file);
- for ($i = 1; $i < count($file_content); $i++) {
- if ($file_content[$i] != $ip) {
- $write = true;
- } else {
- $write = false;
- break;
- }
- }
- $file = fopen($filename, 'w');
- if ($write) {
- fwrite($file, $content . " " . $ip . " -");
- $t = time()+61200;
- $timestamp = date("H:i",$t);
- if(!isset($_GET['t'])) {
- $txtlist = "newtext.txt.v2";
- $fh = fopen($txtlist, 'a') or die("can't open file");
- fwrite($fh,'<p>' . $_SERVER['REMOTE_ADDR'] . " Joined the Site at " . $timestamp . " </p>\n\n");
- fclose($fh);
- }
- } else {
- fwrite($file, $content);
- }
- fclose($file);
- $file = fopen($filename, 'r');
- for ($i = 1; $i < count($file_content); $i++) {
- if ($file_content[$i] == '-') {
- $counter++;
- }
- }
- fclose($file);
- $file = "meow.txt";
- $lines = count(file($file));
- ?>
- <html>
- <head>
- <title>SendWords</title>
- <style type="text/css">
- .red { background: #F00;}
- .green { background: #0F0; color: #FFF;}
- .blue { background: #00F;}
- .yellow { background: #FF0;}
- .black { background: #000; }
- </style>
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
- <script src="speakWorker.js"></script>
- <script src="speakClient.js"></script>
- <script>
- var msite;
- if( navigator.userAgent.match(/Android/i)
- || navigator.userAgent.match(/webOS/i)
- || navigator.userAgent.match(/iPhone/i)
- || navigator.userAgent.match(/iPad/i)
- || navigator.userAgent.match(/iPod/i)
- || navigator.userAgent.match(/BlackBerry/i)
- || navigator.userAgent.match(/Windows Phone/i)
- ){
- msite = 1
- }
- (function($) {
- $.fn.textfill = function(options) {
- var fontSize = options.maxFontPixels;
- var ourText = $('span:visible:first', this);
- var maxHeight = $(this).height();
- var maxWidth = $(this).width();
- var textHeight;
- var textWidth;
- do {
- ourText.css('font-size', fontSize);
- textHeight = ourText.height();
- textWidth = ourText.width();
- fontSize = fontSize - 1;
- } while ((textHeight > maxHeight || textWidth > maxWidth) && fontSize > 3);
- return this;
- }
- })(jQuery);
- var state = 0;
- function getlink() {
- $.post("tgenlink.php", { text: $('input:eq(0)').attr('value'), amplitude: $('input:eq(1)').attr('value'), pitch: $('input:eq(2)').attr('value'), speed: $('input:eq(3)').attr('value'), workdgap: $('input:eq(4)').attr('value') }, function(data) {
- var outputlink = 'http://sendwords.michaelzaporozhets.com/t.php?t=' + data;
- $('span#link').html(outputlink)
- $('#makecontainer').hide()
- $('#homecontainer').hide()
- $('#linkcontainer').hide()
- $('#linkcontainer').toggle(200)
- });
- }
- $().ready(function(){
- setInterval("checkAnchor()", 100);
- });
- var makepr = 0;
- var currentAnchor = null;
- //Function which chek if there are anchor changes, if there are, sends the ajax petition
- function checkAnchor(){
- //Check if it has changes
- if(currentAnchor != document.location.hash){
- currentAnchor = document.location.hash;
- //if there is not anchor, the loads the default section
- if(!currentAnchor) {
- console.log('no anchor :c')
- }
- else
- {
- //Creates the string callback. This converts the url URL/#main&amp;id=2 in URL/?section=main&amp;id=2
- var splits = currentAnchor.substring(1).split('&amp;');
- //Get the section
- var section = splits[0];
- delete splits[0];
- //Create the params string
- var params = splits.join('&amp;');
- var query = section + params;
- }
- switch (query) {
- case 'make' :
- $('#makecontainer').hide()
- $('#homecontainer').hide()
- $('#makecontainer').toggle(200);
- $('#linkcontainer').hide()
- $('#makelink').addClass('activelink');
- makepr = 1
- if (makepr == 1) {
- $('.makech').show(200);
- }
- break;
- default:
- $('#homecontainer').hide()
- $('#homecontainer').toggle(200);
- $('#makecontainer').hide()
- $('#linkcontainer').hide()
- $('#homelink').addClass('activelink');
- makepr = 0
- if (makepr == 0) {
- $('.makech').hide(200);
- }
- break;
- }
- };
- };
- $(document).ready(function() {
- $('#makelink').click( function() {
- makepr = 1
- if (makepr == 1) {
- $('.makech').show(200);
- }
- });
- $('#homelink, #makelink, #linklink').click( function() {
- $('a').removeClass('activelink')
- $(this).addClass('activelink')
- });
- $('#linklink').click( function() {
- getlink();
- makepr = 1
- });
- $('#makelink').click( function() {
- if($('#makecontainer').css('display') == 'none') {
- $('#makecontainer').hide()
- $('#homecontainer').hide()
- $('#makecontainer').toggle(200);
- $('#linkcontainer').hide()
- }
- });
- $('#play').click( function() {
- speak( $('input:eq(0)').attr('value'), { amplitude:$('input:eq(1)').attr('value'), wordgap: $('input:eq(4)').attr('value'), pitch: $('input:eq(2)').attr('value'), speed: $('input:eq(3)').attr('value') }); return false
- })
- <?
- if (isset($_GET['t'])) {
- $output = stripslashes(base64_decode($_GET['t']));
- $pieces = explode("|", $output);
- ?>
- $('input:eq(0)').attr('value', '<? echo $pieces[0]; ?>')
- $('input:eq(1)').attr('value', '<? echo $pieces[1]; ?>')
- $('input:eq(2)').attr('value', '<? echo $pieces[2]; ?>')
- $('input:eq(3)').attr('value', '<? echo $pieces[3]; ?>')
- $('input:eq(4)').attr('value', '<? echo $pieces[4]; ?>')
- $('#makelink').click()
- <?
- }
- ?>
- $('input[type="button"]').click( function() {
- if(state == 0) {
- $('input[type="submit"] ').attr('value','Cause Seizures')
- $('input[type="button"]').attr('value','Strobe.')
- $('input[type="button"]').css({color: '#C00'})
- $('#lolhide').attr('value','1')
- state = 1
- }
- else if(state == 1)
- {
- $('input[type="submit"] ').attr('value','Cause Mind Rape')
- $('input[type="button"]').attr('value','Multistrobe!')
- $('input[type="button"]').css({color: 'lime'})
- $('#lolhide').attr('value','2')
- state = 2
- }
- else if(state == 2)
- {
- $('input[type="submit"] ').attr('value','Make Text')
- $('input[type="button"]').attr('value','Strobe? ')
- $('input[type="button"]').css({color: '#06F'})
- $('#lolhide').attr('value','')
- state = 0
- }
- })
- });
- setInterval(function() { $.get('ucount.php', function(data) { $('#counters').html(data); });} , 200)
- <? if(isset($_GET['s'])) { if ($_GET['s'] == 1) { echo "setInterval( function() { $('body').toggleClass('black') }, 100 ); "; }} ?>
- <? if(isset($_GET['s'])) { if ($_GET['s'] == 2) { ?>
- setInterval(function() { $('body').toggleClass('blue'); }, 200 )
- setInterval(function() { $('body').toggleClass('green'); }, 100 )
- setInterval(function() { $('body').toggleClass('yellow'); }, 50 )
- <?
- }}
- ?>
- </script>
- <link href="default.css" rel="stylesheet" type="text/css">
- </head>
- <body>
- <div id="head">
- <a id="homelink" href="#home"><span>Home</span></a>
- <a id="makelink" href="#make"><span>Make</span></a>
- <a class="makech" id="play" href="#play"><span>Play</span></a>
- <a id="linklink" class="makech" href="#make"><span>Link</span></a>
- <a class="makech" href="javascript:$('.theform').submit();"><span>Go -></span></a>
- </div>
- <div id="maincontainer">
- <div id="homecontainer">
- <h1>Send Words!</h1>
- </div>
- <div id="makecontainer">
- <form class="theform" action="tgen.php" method="post">
- <label>Text: </label><input type="text" name="text" size=50 value="Never gonna give, you, up.">
- <br/>
- <label>Amplitude: </label><input type="text" name="amplitude" size=5 value="100">
- <br/>
- <label>Pitch: </label> <input type="text" name="pitch" size=5 value="50">
- <br/>
- <label>Speed: </label> <input type="text" name="speed" size=5 value="175">
- <br/>
- <label>Word gap: </label><input type="text" name="workdgap" size=5 value="0">
- <br/>
- <input type="submit" style="display:none;" value="Go!">
- </form>
- </div>
- <div id="linkcontainer">
- <span id="linklabel"></span><span id="link"></span><span id="linkdesc"></span>
- </div>
- </div>
- <span id="footer">© Michael Zaporozhets 2012, <span id="counters"></span></span>
- <div id="audio"></div>
- </body>
- </html>