array( 'db' => true ) ); $template = 'centered'; $height = '100%'; require_once( 'scripts/start.php' ); function testMessageForSPAM( &$msg ){ $points = 0; $newmsg = strip_tags(stripslashes($msg),'

'); $d = strlen($msg) - strlen($newmsg); if( $d > 0 ){ $p = round(100/strlen($msg) * $d); $points += round(5/100*$p); } $msg = $newmsg; $newmsg = preg_replace('#\[(url|link)=[^\]]+\].*?\[/(link|url)\]#i','',$msg); if( strlen($newmsg) != strlen($msg) ){ $points += 1; } $msg = $newmsg; if( preg_match_all( '/asd|sdf|dfg|fgh|ghj|hjk|jkl|lkj|kjh|jhg|hgf|gfd'. '|fds|dsa|ads|sfd|dgf|fhg|gjh|hkj|jlk|ljk|khj|jgh'. '|hfg|gdf|fsd|das|zxc|xcv|cvb|vbn|bnm|mnb|nbv|bvc'. '|vcx|cxz/', $msg, $found ) ){ $found = reset($found); if( ($c=count($found)) > 3 ){ $points += $c; } } if( preg_match('/valium|sex|sexy|girls|blonde|fuck|dick|cock|pussy|buy|viagra|discount|cialis/i',$msg) ){ $points += 5; } if( $points > 3 ){ return $points; }else{ return 0; } } if( $DB && 0 ){ if( $_REQUEST['request'] == 'thanks' ){ echo '

Thank you..

Your message has been received

Thanks a lot for taking the time to say something, there currently isn\'t a way to view comments just yet.. but there will be soon. I\'ll keep you all posted (excuse the pun).


[ back home ]

[ news ]

[ play demo ]

'; require_once( 'scripts/end.php' ); exit; }else if( $_REQUEST['msg'] && $_REQUEST['chk'] ){ $msg = $_REQUEST['msg']; $thanks = false; $markAsSPAM = false; $markREGS = false; $requestIPS = false; if($_SERVER['REMOTE_ADDR'] == '81.187.46.163'){ $markAsSPAM = preg_match( '/^MARK AS SPAM (.+)$/', $msg, $markREGS ); $requestIPS = preg_match( '/^REQUEST IPS$/', $msg ); } if( $requestIPS ){ $res = $DB->query( 'SELECT `ip` FROM `comment` WHERE `display`="" AND NOT `spam` AND `visible`=1'); $err = ''; $first = true; while( $ip = $DB->fetch($res,false,true) ){ $err .= ( $err ? ',' : '' ).$ip; } if($err){ $err = 'MARK AS SPAM '.$err; }else{ $err = 'No IPs to display'; } }else if( $markAsSPAM && $markREGS[1] ){ $ips = explode(',',$markREGS[1]); $sql = ''; foreach( $ips AS $key => $ip ){ $sql .= ( $sql ? ' OR ' : '' ) . 'ip="'.$DB->mes(trim($ip)).'"'; } $DB->query( 'UPDATE `comment` SET `spam`=5,`visible`=0 WHERE '.$sql.''); if( $n = $DB->affected() ){ $err = $n . ' Messages marked as SPAM'; }else{ $err = 'MARK AS SPAM failed..'; } }else if( $isSpamIP = $DB->fetchQuery('SELECT 1 FROM `comment` WHERE `ip`="'.mes($_SERVER['REMOTE_ADDR']).'" AND `spam`!=0 LIMIT 0,1',false,true) ){ $err = 'Your message has been flagged as SPAM!
sorry i do not tolerate IDIOTS..'; }else if( strlen($_REQUEST['msg'])>500 ){ $err = 'Sorry your message is to long.. it needs to be under 500 letters'; if( $isSPAM = testMessageForSPAM( $_REQUEST['msg'] ) ){ $DB->query('INSERT INTO `comment` SET `datetime`=NOW(),`message`="SPAMMER",`spam`="'.$DB->mes( $isSPAM ).'",`visible`=0,`ip`="'.$DB->mes( $_SERVER['REMOTE_ADDR'] ).'"'); } $isSPAM = 'oversized'; }else{ if( !$_REQUEST['prv'] ){ $isSPAM = 10; }else{ $isSPAM = testMessageForSPAM( $msg ); } $ts = new tsession( $DB ); if( $ts->useOnce( $_REQUEST['chk'], 'check:comment' ) ){ $ts->clearSpecific($_REQUEST['chk']); if( $_REQUEST['prv'] && ($fp = @fopen('http://www.icicle.me.uk/sentience.php?check='.urlencode($_REQUEST['chk']).'&code='.urlencode($_REQUEST['prv']),'r')) ){ $codecheck = @fread($fp,6); @fclose($fp); if( $codecheck != 'passed' ){ $isSPAM = 10; } } $DB->query( 'INSERT INTO `comment` SET '. '`message`="'.$DB->mes( $msg ).'", '. '`datetime`=NOW(), '. '`ip`="'.$DB->mes( $_SERVER['REMOTE_ADDR'] ).'", '. '`uniques`="'.$DB->mes( $_COOKIE['gju'] ).'", '. '`spam`="'.(is_numeric($isSPAM)?$isSPAM:'0').'"'. '' ); $thanks = true; }else{ $err = 'Sorry your message could not be authorized. SENDER UNKNOWN'; $ts->clearSpecific($_REQUEST['chk']); } } if( $isSpamIP ){ sleep(10); header('location:thanks.php'); exit; }else if( $isSPAM ){ sleep(10); }else{ $body = ''. 'Hi,'."\n\n". 'Someone has left a new comment:'."\n\n". $msg."\n\n".'---'."\n\n". 'Thanks,'."\n\n". 'Mr Script'."\n".'---'."\n".'gravityjam.co.uk'. ''; mail( 'phil@unabacus.net', 'New Comment', $body, 'From: Gravity Jam ','-fscript@gravityjam.co.uk' ); } if( $thanks ){ header('location:comments.php?request=thanks'); exit; } } $ts = new tsession( $DB ); $ts->create( 'check:comment', 1 ); echo '

Leave a Comment..

just so i know i\'m not the only one out here??

Yep, whilst talking to - and building games for - myself; is all well and good it would be even nicer to see that people are actually playing GravityJAM at all..? any one there? ps. if there is anyone not out there then bear in mind this message is especially for you :)

pps. oh please limit your message to under 500 characters as letters are a finite resource, some people don\'t even have enough to complete a full sentence... thanks

ppps. also.. please don\'t use HTML or BBCode tags as they will increase the likely hood of your message being marked as spam

'.($err?'

'.$err.'

':'').'
If you see this message you need to install flash (otherwise you can\'t comment)
message will be tagged with:
'.$_SERVER['REMOTE_ADDR'].' '.date('Y-m-d H:i:s').'
'; $qry = $DB->query( 'SELECT * FROM `comment` WHERE `visible`=1 AND `spam`=0' ); $comments = ''; while( $f = $DB->fetch( $qry ) ){ $comments .= '

'.$f['datetime'].'

'; $comments .= '

'.htmlspecialchars(stripslashes($f['message'])).'

'; $comments .= '

left by '.($f['display']?$f['display']:$f['ip']).'

'; $comments .= '

'; } if( $comments ){ echo '



Existing Comments..

words of wisdom from you lot "out there"

'.$comments.'
'; } /* echo '

[ back ]

[ back home ]

[ news ]

[ play demo ]

'; */ } else { echo '
Comments disabled for now...
'; } require_once( 'scripts/end.php' ); ?>