t,$i); if($eslKeyList) $keys[$i]=$eslKeyList[$i]; else { $keys[$i]=strtoupper($meta->name); } $thisColumn=$keys[$i]; if($thisColumn=='WORD') $width="width:150px;"; else if($thisColumn=='DATE (GMT)' && !ismobile($agent)) $width="width:100px;"; else $width="width:auto;"; { $output.= "".$keys[$i]."\r\n"; } $i++; } $output.= "\r\n\r\n\r\n"; $rowcount=0; while($row=mysql_fetch_array($result)) { if($ip==$row['ip']) $backgroundColor='yellow'; else $backgroundColor='white'; $output.= "\r\n"; $rowcount++; if(!$skipNumbers) $output.= "$rowcount.\r\n"; for($i=0;$i<$total;$i++) { $textwrap="nowrap"; $thisColumn=$keys[$i]; $thisKey=$row[$i]; $thisKeyRAW=htmlspecialchars($thisKey); if($thisColumn=="TIMEONPAGE" && $thisKey>0) $thisKey=getTimeCode($thisKey*30,30,true); if($dolinks) { if(strtolower($thisColumn)=="word") $thisKey="{$thisKey}"; if(strtolower($thisColumn)=="isp" ) $thisKey="$thisKey"; if(strtolower($thisColumn)=="ip") $thisKey="$thisKey"; if(strtolower($thisColumn)=="city") $thisKey="$thisKey"; } if(strtolower($thisColumn)=="entry") $textwrap="textwrap"; else if(strtolower($thisColumn)=="date (gmt)" && !$mobile) $textwrap="textnowrap"; else if(strtolower($thisColumn)=="date (gmt)") $textwrap="textwrap"; else $textwrap="textnowrap"; if($thisColumn != "HIDEIP" || $hideip==0) { $value=$thisKey; if($thisColumn=="HIDEIP") { $value=long2ip($value); $output.= "$value\r\n"; } else $output.= "$thisKey\r\n"; } if($rowcount==1 && strtolower($thisColumn)=="date (gmt)") $date_max=substr($thisKey,0,22); else if(strtolower($thisColumn)=="date (gmt)") $date_min=substr($thisKey,0,22); } $output.= ""; } $output.= ""; return $output; } function mom() { global $crit_link; global $ip,$real_ip; $query="SELECT ip FROM family_members WHERE ip='$ip'"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); if(mysql_num_rows($result) && globalFlag('protect_family')) return 1; else return 0; } function playOnce($ip) { global $crit_link; $query="SELECT audio FROM visitors WHERE ip=INET_ATON('$ip');"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); list($audio)=mysql_fetch_array($result); if($audio) return false; $query="UPDATE visitors SET audio=1 WHERE ip=INET_ATON('$ip');"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); return true; } function critterLog($item) { global $crit_link; global $ip, $time_start, $page, $thishost, $pagetrim, $agent, $referrer, $audio_played,$logid,$hostname,$gov,$locationdata,$notfound; global $locationid,$country, $region, $countrySHORT, $city, $isp, $playalarm,$gov,$locationdata,$notfound; if(!globalFlag('critter_log')) return; if(strpos($item,"JXGcYXmeRZE") || strpos($item,"captionsID=632") || strpos(strtolower($referrer),"define")) return; //$now = date("Y-m-d h:i:sa,",strtotime("-7 hours")); $now = date("Y-m-d h:i:sa"); $city=substr(str_pad(capitalize($locationdata["city"].", ".$locationdata["country"]),30),0,30); $isp=substr(str_pad($locationdata["isp"],30),0,30); $output=$now.str_pad($ip,16).",".$city.",".$isp.",".$referrer.",".$item; $fp = fopen('kens_videocritter_log.txt', 'a'); fwrite($fp, $output."\r\n"); fclose($fp); return; } function updateUserSession($username,$ip,$userid,$sessionID) { global $crit_link; critterLog("AUTHENTICATED: username=$username last_ip=$ip userid=$userid sessionID=$sessionID"); $query = "UPDATE users SET session_id='$sessionID',last_ip=inet_aton('$ip') WHERE userid='$userid'"; $result = mysql_query($query,$crit_link) or die('query failed: ' . errorlog(mysql_error()." Line #:".__LINE__." QUERY=\"$query\"")); return; } function critUser($ip) { global $crit_link; $query="SELECT crit_user FROM visitors WHERE ip=INET_ATON('$ip');"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__); if(mysql_num_rows($result)) { list($crit_user)=mysql_fetch_array($result); if(!$crit_user) { $query="UPDATE visitors SET crit_user=1 WHERE ip=INET_ATON('$ip');"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__); } return $crit_user; } else { return false; } } function userAuthenticated($username) { global $crit_link; global $ip; $query = "SELECT ip FROM users WHERE username='$username' AND last_ip=INET_ATON('$ip')"; $result = mysql_query($query,$crit_link) or die('query failed: ' . errorlog(mysql_error()." Line #:".__LINE__." QUERY=\"$query\"")); if(mysql_num_rows($result)) { return 1; } else { $query = "SELECT INET_NTOA(last_ip) FROM users WHERE username='$username'"; $result = mysql_query($query,$crit_link) or die('query failed: ' . errorlog(mysql_error()." Line #:".__LINE__." QUERY=\"$query\"")); list($last_ip)=mysql_fetch_array($result); critterLog("AUTHENTICATION ERROR: username=$username new_ip=$ip last_ip=$last_ip"); return 0; } } function hyperlink($string) { global $crit_link; $string=str_replace("&","&",$string); $string=str_replace("%3A",":",$string); $string=str_replace("%2F","/",$string); return $string; } function add_apost($fixedword) { global $crit_link; $fixedword = str_replace("'", "''", $fixedword); return $fixedword; } function debug($string) { global $crit_link; echo $string; flush(); return; } function defineHeaderFrame($bannerlink,$word,$title,$description,$video_item=null) { global $crit_link; global $agent,$thishost,$page,$logid,$realpage; $array=explode("/",$page); $thispage=$array[sizeof($array)-1]; if(oldInternetExplorer($agent)) { $style= " "; } else { $style= " "; } $output="\r\n \r\n $title\r\n "; if(globalFlag('monitor_time_on_page')) $output.= "setTimer($logid);"; if(strlen($video_item)) { $output.= "MM_preloadImages('http://media.videocritter.org/play_over.gif','http://media.videocritter.org/pause_over.gif','http://media.videocritter.org/stop_over.gif','http://media.videocritter.org/mute_over.gif')"; } if($realpage != "404.php") $output.= "\" onunload = \"goodbye($logid)\" style='".background()."'>
"; if(($realpage=='index.php' && globalFlag('show_definitions')) || ($realpage=='404handler.php' && globalFlag('show_definitions_404'))) $output.="
$kaleidoscopeClick here for the new slimmer define.com Mobile Edition

"; $output.=""; return $output; } function fixTags($string) { global $crit_link; $string=str_replace("< ","<",$string); $string=str_replace("> ","<",$string); $string=str_replace("= ","=",$string); $string=str_replace(" =","=",$string); return $string; } function getFormValues($string,$email,$password) { global $crit_link; $params=""; $inputArray=explode("\r\n"; if(is_array($array)) print_r($array); else echo $array."\r\n"; echo "\r\n"; flush(); return; } function postURL($url,$params) { global $crit_link; $ref_url="https://define.com"; $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_TIMEOUT, 40); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_REFERER, $ref_url); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS, $params); $output=curl_exec ($ch); curl_close($ch); return $output; } function updateMonthlyUsage($usage_report) { global $crit_link; $service_names=array( 'AWS Data Transfer'=>'Data Transfer', 'Amazon Simple Storage Service Storage'=>'Data Storage', 'Amazon Simple Storage Service Requests'=>'Data Storage Requests', 'Amazon CloudFront Transfer'=>'Data Caching Transfer', 'Amazon CloudFront Requests'=>'Data Caching Requests', 'Amazon Simple Notification Service'=>'', 'Amazon RDS Service Machine Time'=>'Database Server', 'Amazon RDS Service Requests'=>'Database Requests', 'Amazon RDS Service Storage'=>'Database Server Storage', 'Amazon Elastic Compute Cloud Machine Time'=>'Computing Time', 'Amazon Elastic Compute Cloud Storage'=>'Computing Storage', 'Amazon Elastic Compute Cloud Requests'=>'Computing Requests'); $service_measure=array( 'AWS Data Transfer'=>'GB', 'Amazon Simple Storage Service Storage'=>'GB', 'Amazon Simple Storage Service Requests'=>'Requests', 'Amazon CloudFront Transfer'=>'GB', 'Amazon CloudFront Requests'=>'Requests', 'Amazon Simple Notification Service'=>'', 'Amazon RDS Service Machine Time'=>'Machine Hours', 'Amazon RDS Service Requests'=>'Requests', 'Amazon RDS Service Storage'=>'GB', 'Amazon Elastic Compute Cloud Machine Time'=>'Machine Hours', 'Amazon Elastic Compute Cloud Storage'=>'GB', 'Amazon Elastic Compute Cloud Requests'=>'Requests'); $service_array=array(); $usage_array=array(); $summary_array=array(); $usage_array_raw=explode("\n",$usage_report); foreach($usage_array_raw as $row) { $usage_row=array(); $row_array=explode("\",\"",$row); $date=str_replace("\"","",$row_array[3]); if(strlen($date)) $service_month=substr($date,0,7)."-01"; $service=str_replace("\"","",$row_array[4]); $description=str_replace("\"","",$row_array[5]); if(stripos($description,"requests")!==false) $service.=" Requests"; if(stripos($description," stor")!==false ) $service.=" Storage"; if(stripos($description," transfer")!==false && !stripos($service,"Transfer")) $service.=" Transfer"; if(stripos($description," hour")!==false ) $service.=" Machine Time"; $units=str_replace("\"","",$row_array[6]); $cost_before_tax=str_replace("\"","",$row_array[8]); $cost_after_tax=str_replace("\"","",$row_array[9]); $tax=$cost_after_tax-$cost_before_tax; $usage_row['service']=$service; $service_array[$service]=1; $usage_row['units']=$units; $usage_row['cost_before_tax']=$cost_before_tax; $usage_row['cost_after_tax']=$cost_after_tax; $usage_row['tax']=$tax; $summary_array[$service]['service_month']=$service_month; $summary_array[$service]['units']+=$units; $summary_array[$service]['cost_before_tax']+=$cost_before_tax; $summary_array[$service]['cost_after_tax']+=$cost_after_tax; $summary_array[$service]['tax']+=$tax; $summary_array[$service]['name']=$service_names[$service]; $summary_array[$service]['measure']=$service_measure[$service]; array_push($usage_array,$usage_row); } $services=array_keys($service_array); foreach($services as $service) { $total_cost=$summary_array[$service]['cost_after_tax']; if($total_cost==0) { unset($summary_array[$service]); unset($service_array[$service]); } } unset($service_array['Product Name']); unset($summary_array['Product Name']); unset($summary_array['']); unset($service_array['']); $services=array_keys($service_array); $query = "DELETE FROM monthly_fees WHERE service_month='$service_month'"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); foreach($services as $service) { $query = "INSERT INTO monthly_fees (amazon_service,service_month,units,cost_before_tax,cost_after_tax,tax,name,measure) VALUES ( '$service', '{$summary_array[$service]['service_month']}', '{$summary_array[$service]['units']}', '{$summary_array[$service]['cost_before_tax']}', '{$summary_array[$service]['cost_after_tax']}', '{$summary_array[$service]['tax']}', '{$summary_array[$service]['name']}', '{$summary_array[$service]['measure']}');"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); } return; } function updateAmazonFees() { global $crit_link; $logout_url="https://s3-console-us-standard.console.aws.amazon.com/logout!doLogout"; postURL($logout_url,""); $email="info@hdcolors.com"; $password="Future7-123"; $login_url="https://www.amazon.com/ap/signin?openid.assoc_handle=aws&openid.return_to=https%3A%2F%2Fconsole.aws.amazon.com%2Fs3%2Flogin!doAuthenticate&openid.mode=checkid_setup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&action=&disableCorpSignUp=&clientContext=&marketPlaceId=&poolName=&authCookies=&pageId=aws.ssop&siteState=&accountStatusPolicy=P1&sso=&openid.pape.preferred_auth_policies=MultifactorPhysical&openid.pape.max_auth_age=43200&openid.ns.pape=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Fpape%2F1.0&server=%2Fap%2Fsignin%3Fie%3DUTF8&accountPoolAlias="; $params=""; $login_page=postURL($login_url,$params); if(strlen($login_page)) { $login_page=fixTags($login_page); $login_post_url=getFormAction($login_page); $params=getFormValues($login_page,$email,$password); $aws_page=postURL($login_post_url,$params); $account_info_url="https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&action=activity-summary"; $summary=postURL($account_info_url,$params); } $usage_report_url="https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&detailTimePeriod=&action=download-consolidated-billing-details"; $params=""; $usage_report=postURL($usage_report_url,$params); $logout_url="https://s3-console-us-standard.console.aws.amazon.com/logout!doLogout"; postURL($logout_url,""); $usage=updateMonthlyUsage($usage_report); echo lastAmazonFeesUpdate(); return; } function getTimeZone() { global $crit_link; /* if(stripos($_SERVER["HTTP_HOST"],"DISCUSS")!==false) $timezone="PST"; else $timezone="GMT"; */ $timezone="PST"; return $timezone; } function lastAmazonFeesUpdate() { global $crit_link; $offset=getTimeOffset(); $query = "SELECT timestamp + interval $offset hour FROM monthly_fees ORDER BY timestamp DESC LIMIT 1"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__); list($last_update)=mysql_fetch_array($result); $timezone=getTimeZone(); $last_update.=" $timezone"; return $last_update; } function getTimeOffset() { global $crit_link; return globalFlag('offset'); } function globalFlag($variable,$value=null) { global $crit_link; if($value !== null) { $query="UPDATE globals SET value='$value' WHERE variable='$variable'"; $result = mysql_query($query,$crit_link) or die('Query failed: ' . mysql_error()." Line #:".__LINE__. " on line ".__LINE__); return $value; } $value=0; $query="SELECT value FROM globals WHERE variable='$variable'"; $result = mysql_query($query,$crit_link) or die('Query failed: ' . mysql_error()." Line #:".__LINE__. " on line ".__LINE__); if(mysql_num_rows($result)) list($value)=mysql_fetch_array($result); else { $value=0; $query="INSERT INTO globals(variable,value,type) VALUES ('$variable','$value','checkbox');"; $result = mysql_query($query,$crit_link) or die(mysql_error()." Line #:".__LINE__); } return $value; } function hdtv($insound,$fps=1) { global $crit_link; global $ip, $time_start, $page, $thishost, $pagetrim, $agent, $referrer, $audio_played,$logid,$hostname,$gov,$locationdata,$notfound; global $locationid,$country, $region, $countrySHORT, $city, $isp, $playalarm,$gov,$locationdata,$notfound; $panAmplitude='.5'; $panLfoHz='0.14285714285714285714285714285714'; $panShift='0'; if(isset($_GET["sound"])) $sound=$_GET["sound"]; else $sound="off";// else $sound="off"; if(isset($_GET["seconds"])) $seconds=$_GET["seconds"]; else $seconds=$fps; if(isset($_GET["panLfoHz"])) { $panAmplitude=$_GET["panAmplitude"]; $panLfoHz=$_GET["panLfoHz"]; $panShift=$_GET["panShift"]; $soundparams="panAmplitude=$panAmplitude&panLfoHz=$panLfoHz&panShift=$panShift"; } else $soundparams="panAmplitude=$panAmplitude&panLfoHz=$panLfoHz&panShift=$panShift"; if(!$sound) $sound=$insound; $width=550; $height=409; $kaleidoscope="\r\n"; return $kaleidoscope; } function recursive_str_replace($replacethis,$withthis,$inthis) { global $crit_link; while (true) { $inthis = str_replace($replacethis,$withthis,$inthis); if(strpos($inthis, $replacethis) === false) return $inthis; } } function recursive_str_ireplace($replacethis,$withthis,$inthis) { global $crit_link; while (true) { $inthis = str_ireplace($replacethis,$withthis,$inthis); if(strpos($inthis, $replacethis) === false) return $inthis; } } function showVotesMap($row=true) { global $crit_link; $width=globalFlag('video_width'); $height=intval($width/2); $output= ""; if($row) $output.=""; return $output; } function showVisitorsMap($row=true) { global $crit_link; $width=globalFlag('video_width'); $height=intval($width/2); $output= ""; if($row) $output.=""; return $output; } function showVoteCountTable($limit=1000) { global $crit_link; $offset=globalFlag('offset'); $query = "SELECT v.timestamp + interval $offset hour AS 'timestamp (PST)', md5(concat(v.ip,'kenmeyering')) AS 'COMPUTER\'S ENCRYPTED IP ADDRESS',ip as hideip,IF(v.choice=1,'YES','NO') as choice, 'city','region', 'country','INTERNET SERVICE PROVIDER',latitude,longitude FROM votes v ORDER BY timestamp DESC LIMIT $limit"; $output=showResult($query,$skipNumbers=false,$title="MOST RECENT 1000 VOTES"); return $output; } function showTranshumanemail() { global $crit_link; $mail=file_get_contents('20091203-[private-list] Transhumanist Art-251040.html'); $output=""; return $output; } function screenshot_png($word) { global $crit_link; $screenshot="\"$word\""; return $screenshot; } function DayTotals($days,$all=1) { global $crit_link; $output=""; $video_width=globalFlag('video_width'); $offset=globalFlag('offset'); $query="select date((UTC_TIMESTAMP()+interval $offset hour))"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." ".$query); list($today)=mysql_fetch_array($result); if($offset>0) $offset="+$offset hour"; else $offset="$offset hour"; $start= addDate($today,-$days);//add days $end=$today; $display_start=date("m-d-Y",strtotime($start)); $display_end=date("m-d-Y",strtotime($end)); $query = "SELECT DATEDIFF( '$end','$start')"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." ".$query); list($dif)= mysql_fetch_row($result); $displaydate = array (); $dictionaryTraffic = array (); $defineHomePageTotals = array (); $mobileHomePageTotals = array (); $defineTotals = array (); $mobileTotals = array (); $critterTotals = array (); $hdcolorsTotals = array (); $highvalue = 0; $query="DELETE FROM daily_totals WHERE total=0"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." ".$query); for ($day = 0; $day <= $dif ; $day++) { //check daily totals $precalculated=false; $thisdate = addDate($start,$day); $query="select date_format('$thisdate',' %W %m-%d-%Y') as hitdate"; if($thisdate==$today) $query="select date_format(NOW(),' %W %m-%d-%Y %h:%i %p PST') as hitdate"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." ".$query); list($displaydate[$day])=mysql_fetch_array($result); $query="SELECT * FROM daily_totals WHERE date='$thisdate';"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." ".$query); $row=mysql_fetch_array($result); $date=$row["date"]; if(mysql_num_rows($result)>0 && $thisdate != $today)//total has already been calculated { $precalculated=true; $total=$row["total"]; if($total>$highvalue) $highvalue=$total; $dictionaryTraffic[$day]=$total; $defineHomePageTotals[$day]=$row["homepage"]; $mobileHomePageTotals[$day]=$row["mobile_homepage"]; $defineTotals[$day]=$row["define_com"]; $mobileTotals[$day]=$row["m_define_com"]; $libertariancareTotals[$day]=$row["libertariancare"]; $hdcolorsTotals[$day]=$row["hdcolors"]; } else //total needs to be calculated { $query="SELECT '$thisdate'-interval $offset as start,'$thisdate'-interval $offset+interval 1 day as high"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." ".$query); list($low,$high)=mysql_fetch_array($result); $query ="SELECT IFNULL(COUNT(DISTINCT ip),0) as total FROM logs WHERE timestamp > '$low' and timestamp<'$high' AND (engine IN (5,12,13,35,36,37,404) or engine IN (10,16,26,39,40,41,42));"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." ".$query); list($dictionaryTraffic[$day])=mysql_fetch_array($result); if($dictionaryTraffic[$day]>$highvalue) $highvalue=$dictionaryTraffic[$day]; $query = "SELECT IFNULL(COUNT(DISTINCT ip),0) as total FROM logs WHERE timestamp > '$low' and timestamp<'$high' AND engine=12;"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." ".$query); list($defineHomePageTotals[$day])=mysql_fetch_array($result); if($defineHomePageTotals[$day]>$highvalue) $highvalue=$defineHomePageTotals[$day]; $query = "SELECT IFNULL(COUNT(DISTINCT ip),0) as total FROM logs WHERE timestamp > '$low' and timestamp<'$high' AND engine=26;"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." ".$query); list($mobileHomePageTotals[$day])=mysql_fetch_array($result); if($mobileHomePageTotals[$day]>$highvalue) $highvalue=$mobileHomePageTotals[$day]; $query = "SELECT IFNULL(COUNT(DISTINCT ip),0) as total FROM logs WHERE timestamp > '$low' and timestamp<'$high' AND engine IN (5,12,13,35,36,37,404);"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." ".$query); list($defineTotals[$day])=mysql_fetch_array($result); if($defineTotals[$day]>$highvalue) $highvalue=$defineTotals[$day]; $query = "SELECT IFNULL(COUNT(DISTINCT ip),0) as total FROM logs WHERE timestamp > '$low' and timestamp<'$high' AND engine IN (10,16,26,39,40,41,42)"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." ".$query); list($mobileTotals[$day])=mysql_fetch_array($result); if($mobileTotals[$day]>$highvalue) $highvalue=$mobileTotals[$day]; $query = "SELECT IFNULL(COUNT(DISTINCT ip),0) as total FROM logs WHERE timestamp > '$low' and timestamp<'$high' AND engine=60;"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." ".$query); list($libertariancareTotals[$day])=mysql_fetch_array($result); if($libertariancareTotals[$day]>$highvalue) $highvalue=$libertariancareTotals[$day]; $query = "SELECT IFNULL(COUNT(DISTINCT ip),0) as total FROM logs WHERE timestamp > '$low' and timestamp<'$high' AND engine=27;"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." ".$query); list($hdcolorsTotals[$day])=mysql_fetch_array($result); if($hdcolorsTotals[$day]>$highvalue) $highvalue=$hdcolorsTotals[$day]; if($thisdate<>$today)//insert total into totals db { $query="DELETE FROM daily_totals WHERE date='$thisdate'"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." ".$query); $query="INSERT INTO daily_totals(date,total,homepage,mobile_homepage,libertariancare,define_com,m_define_com,hdcolors) VALUES('$thisdate',$dictionaryTraffic[$day],$defineHomePageTotals[$day],$mobileHomePageTotals[$day],$libertariancareTotals[$day],$defineTotals[$day],$mobileTotals[$day],$hdcolorsTotals[$day]);"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." ".$query); $precalculated=true; } } } $output.= " "; return $output; } function addDate($date,$day)//add days { $sum = strtotime(date("Y-m-d", strtotime("$date")) . " +$day days"); $dateTo=date('Y-m-d',$sum); return $dateTo; } function showCountyNames() { global $crit_link; $interval=globalFlag('interval'); $measure=globalFlag('measure'); $query="SET @startdate = NOW()-INTERVAL $interval $measure"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__); $query = "SELECT country FROM countries WHERE timestamp > @startdate AND country <> '-' ORDER BY country;"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__); if($interval>1) $measure.= "s"; while($row = mysql_fetch_array($result)) { $country=capitalize($row["country"]); $hyperlink=split(",",$country); $output=$output."$country
\n"; } $output.=""; return $output; } function credits() { global $crit_link; global $agent; if((mom() || isbot($agent))) return textBlock('credits_family'); else return textBlock('credits_full'); } function kaleidoscope_downloads() { global $crit_link; return textBlock('download_text'); } function notFoundWordCount() { global $crit_link; $query = "SELECT distinct word FROM logs WHERE engine=404 and timestamp>NOW()-INTERVAL 24 HOUR"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); $wordcount=mysql_num_rows($result); return $wordcount; } function textBlockShort($name) { global $crit_link; $name=mysql_real_escape_string($name); $block=""; $query = "SELECT textblock FROM textblocks WHERE name='$name'"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); while($row=mysql_fetch_array($result)) { $block=stripslashes($row['textblock']); } return $block; } function textBlock($name) { global $crit_link; $name=mysql_real_escape_string($name,$crit_link); $block=""; $query = "SELECT textblock FROM textblocks WHERE name='$name'"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); while($row=mysql_fetch_array($result)) { $block=stripslashes($row['textblock']); } return $block; } function sourceCode() { global $crit_link; $output=""; return $output; } function definitionCell($word,$definition) { global $crit_link,$agent,$mobile,$lat,$long; if(!$definition) { header("HTTP/1.1 404 Not Found"); if($mobile) $message=textBlock('mobile_not_found_message'); else $message=textBlock('not_found_message'); $word_url=htmlspecialchars(stripslashes(urldecode($word))); $word_description=stripslashes(urldecode($word)); $message=str_replace('{word_description}',$word_description,$message); $message=str_replace('{word_url}',$word_url,$message); $definition= $message; } return ""; } function mobileForm($word,$thishost,$banner_link,$definition,$homepage=false,$title=false) { global $crit_link,$agent,$logid,$page,$anagram_page_title,$realpage,$thisDirectory,$mobile,$cookie_id,$id_hash,$ip,$machine_hostname,$engine,$geoWebAPI,$default_home_page,$isp,$DefineS3URL; $mobile=ismobile($agent); $city=capitalize($geoWebAPI['city']); $region=capitalize($geoWebAPI['region']); $country=capitalize($geoWebAPI['country']); $lat=$geoWebAPI['latitude']; $long=$geoWebAPI['longitude']; $isp=capitalize($geoWebAPI['isp']); $domain=$geoWebAPI['domain']; if(stripos($definition,"No definitions were found")) { $notfound=true; if($realpage=="index.php" && strlen($word) && !$default_home_page) { $word=html_entity_decode($word); $word=str_ireplace("?","%3F",$word); $word=str_ireplace("\"",""",$word); header("HTTP/1.1 301 Moved Permanently"); header("location:/$word"); //echo " "; exit(); } } else { if($realpage=="index.php" && strlen($word) && !$default_home_page) { $word=html_entity_decode($word); $word=str_ireplace("?","%3F",$word); $word=str_ireplace("\"",""",$word); header("HTTP/1.1 301 Moved Permanently"); header("location:/$word"); exit(); } $notfound=false; } global $small,$button_font_size,$button_width,$page_padding,$youtube_width,$youtube_height,$hd,$small; $engine=$_GET['engine']; $defaultEngine=$engine; if(!$defaultEngine) $defaultEngine="Default"; if(!$engine) $engine="Dictionary"; if(stripos(defineDict($word),"No definitions were found")) { $index_option="NOINDEX,NOFOLLOW"; } else { $index_option="INDEX,FOLLOW"; } $ucword=capitalize($word); if($engine=="Dictionary" && $homepage && !$title && $mobile ) $title="Define.com - World Peace on a Web Page - The Free World Bank - Advanced Nanotechnology-based Benevolent Mind Control Application Scenarios - Computer-aided Neuron-Level Global Digital Telepathy - Superintelligent Dream Virtual Reality - Live Signals - Live Subjects - Proof of Concept - This Technology Already Exists Today - We Are All Already Wired With Nanotech"; else if($engine=="Dictionary" && $homepage && !$title && !$mobile) $title="Define.com - World Peace on a Web Page - The Free World Bank - Advanced Nanotechnology-based Benevolent Mind Control Application Scenarios - Computer-aided Neuron-Level Global Digital Telepathy - Superintelligent Dream Virtual Reality - Live Signals - Live Subjects - Proof of Concept - This Technology Already Exists Today - We Are All Already Wired With Nanotech"; else if ($engine=="Dictionary" && !$title && $mobile) $title="$word | Definition of $word at Define.com - The Free World Bank - World Peace on a Web Page - Advanced Nanotechnology-based Benevolent Mind Control Application Scenarios - Computer-aided Neuron-Level Global Digital Telepathy - Superintelligent Dream Virtual Reality - Live Signals - Live Subjects - Proof of Concept - This Technology Already Exists Today - We Are All Already Wired With Nanotech"; else if ($engine=="Dictionary" && !$title && !$mobile) $title="$word | Definition of $word at Define.com - The Free World Bank - World Peace on a Web Page - Advanced Nanotechnology-based Benevolent Mind Control Application Scenarios - Computer-aided Neuron-Level Global Digital Telepathy - Superintelligent Dream Virtual Reality - Live Signals - Live Subjects - Proof of Concept - This Technology Already Exists Today - We Are All Already Wired With Nanotech"; if($engine=="Anagrams") { $title=$anagram_page_title; } $formatted_ip=str_replace(".","-",$ip); $banner_link="http://media.define.com"; $small=""; global $DefineS3URL,$realpage,$defineFileName; if(ismobile($agent)) $small="_300px"; $header_image=""; $header_image.="
#top
$defineFileName
\"Define.com, "; $form_width="95%"; $output= "\r\n\r\n"; $headerword=preg_replace('/<[^>]*>/', '', $word); $output.="$title\r\n"; if($realpage != "404.php" && stripos($isp,"Godaddy")===false) $output.="\r\n"; else $output.=" \r\n"; if(!$mobile && globalFlag('google_ad_top') ) $output.= GoogleAd(728)."
\r\n"; if($thishost=='km7.us') $output.="km7.us presents.."; $output.="$header_image

"; $output.="
$definition
\r\n"; if(!isbot($agent) && !ismobile($agent)) { if($lat) $output.= ""; $interval=strtoupper(globalFlag('interval')); $measure=strtoupper(globalFlag('measure')); $query = "SELECT COUNT(DISTINCT latitude,longitude) FROM geo WHERE timestamp>=NOW()-INTERVAL $interval $measure AND server='define.com'"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()); list($geolocations)=mysql_fetch_array($result); $query = "SELECT COUNT(DISTINCT ip) FROM geo WHERE timestamp>=NOW()-INTERVAL $interval $measure AND server='define.com'"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()); list($visitors)=mysql_fetch_array($result); $timestamp=gmdate("Y-m-d_H:i:s"); //$ROBOTS_header="
<meta name='ROBOTS' content='NOINDEX,NOFOLLOW' />
"; //$output.= "
This is your approximate location on Earth according to our geolocation service.  Generally, if this <b>INFORMATION</b> is available, this is the CITY associated with a range of i.p. addresses that includes yours as reported by your Internet Service Provier (ISP).  This may be your city or a city near you: $city, $region, $country. $isp.Here is a current snapshot of $visitors unique visitors to DEFINE.COM in the last $interval $measure period for which $geolocations approximate geolocations were available.
Your User-agent is: $agent
} if(globalFlag('showVisitorsMapInDefinitions') && !isbot($agent)) { if($mobile) $mapwidth=300; else $mapwidth=1080; $output.= "
DEFINE.COM visitors in the last 24 hours.
"; } if(!$mobile && globalFlag('google_ad_bottom')) { $output.= "
\r\n".GoogleAd(970); } else if($mobile && globalFlag('google_ad_mobile_bottom') ) $output.="
\r\n".GoogleAd(300); return $output; } function test($test='test') { global $crit_link; echo $test; return; } function getAnagram($anagram,$mobile=false) { global $crit_link; global $anagram_page_title,$thisDirectory; if($mobile) { $fontsize="30px"; $borderwidth="1px"; $margin="12px"; } else { $fontsize="30px"; $borderwidth="2px"; $margin="12px"; } $output=''; if(!$anagram) $anagram="Earth"; $anagram=str_replace("_"," ",$anagram); $letters=str_split(strtoupper($anagram)); sort($letters); $newword=implode($letters); $query = "SELECT word FROM anagram WHERE root ='".mysql_real_escape_string($newword)."'"; $anagram_result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__); $output.="
"; $rows=mysql_num_rows($anagram_result); if($rows==0) { $output.="Sorry, no anagrams for \"".stripslashes($anagram)."\" were found in the DICT dictionaries."; $anagram_page_title="Sorry, no anagrams for \"".stripslashes($anagram)."\" were found in the DICT dictionaries."; } else { if(Lookup($anagram)) $rows--; if($rows==0) $rows="No"; $output.=$rows." anagram"; $anagram_page_title = $rows." anagram"; if($rows>1 || $rows=="No" ) { $output.="s"; $anagram_page_title.="s"; } $output.=" for \"".strtoupper($anagram)."\" found. (Click any letter to look up the word.)"; $anagram_page_title.=" for \"".strtoupper($anagram)."\" found. (Click any letter to look up the word.)"; $output.="

\r\n"; $kaleidoscope.="
"; $output.="
A GLOBAL REFERENDUM: Votes, Opinions and Constituencies.
"; if($row) $output.="
"; $output.="
A GLOBAL REFERENDUM: Votes, Opinions and Constituencies.
"; if($row) $output.="
$mail
"; $output.= "\r\n"; for ($day = $dif; $day >0; $day--) { $output.= ""; if($all) $output.=""; if($all) $ratio=95; else $ratio=90; $output.=" "; } $output.= "
".$displaydate[$day]."
Total Unique Dictionary Visitors ".$dictionaryTraffic[$day]."
"; if($all) $output.="
All DEFINE.COM Pages/Words ".$defineTotals[$day]."
DEFINE.COM ".$defineHomePageTotals[$day]."
All Mobile Pages/Words ".$mobileTotals[$day]."
Mobile Home Page ".$mobileHomePageTotals[$day]."
"; if(!is_dir("/var/www/domains") && $all) $output.="
LIBERTARIANCARE.ORG ".$libertariancareTotals[$day]."
HDCOLORS.COM ".$hdcolorsTotals[$day]."
"; $output.="

$output

"; $source=file_get_contents('sync_votes_source_code.php'); $output.= "

SOURCE CODE FOR: sync_votes.php
------------------------------------START--------------
$source
------------------------------------END----------------

$definition
"; while ($line = mysql_fetch_row($anagram_result)) { $word=$line[0]; $letters=str_split($word); $output.=""; foreach ($letters as $char) { $output.=""; } $output.=""; } $output.="
".$char."
"; } $output.=""; return $output; } function botLog($engine) { global $crit_link,$thishost,$word,$time_start,$logid,$agent; $thisagent=mysql_real_escape_string($agent,$crit_link); $query="CREATE TABLE IF NOT EXISTS `botlog` ( `date` date NOT NULL, `word` varchar(255) default NULL, `agent` varchar(255) default NULL, `engine` int NOT NULL, `thishost` varchar(255) default NULL, `hitcount` int NOT NULL DEFAULT 1, `lastupdate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); $query="DELETE FROM logs WHERE id=$logid"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); $query="DELETE FROM botlog WHERE date 404 Not Found

Not Found

The requested URL $page was not found on this server.


".$_SERVER['SERVER_SIGNATURE'].""; exit(); } } return; } function oldInternetExplorer($agent) { global $crit_link; $keywords = array( "; MSIE 7", "; MSIE 6", "; MSIE 5", "; MSIE 4", "; MSIE 3" ); foreach($keywords as $keyword) { if (stripos($agent , $keyword) !== false) { return true; } } return false; } function isIE($agent) { $keywords = array( "; MSIE " ); foreach($keywords as $keyword) { if (stripos($agent , $keyword) !== false) { return true; } } return false; } function hostNameFromVisitors($ip) { global $crit_link; $query="SELECT hostname FROM visitors WHERE ip=inet_aton('$ip');"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); if(mysql_num_rows($result)) list($host)=mysql_fetch_array($result); else $host=''; return $host; } function numVisits($ip) { global $crit_link; $query="SELECT visits FROM visitors WHERE ip=inet_aton('$ip')"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); if(mysql_num_rows($result)) list($visits)=mysql_fetch_array($result); else $visits=0; return $visits; } function ken($ip) { if(strpos($ip,'10.0.0.')!==false || $ip=='73.53.109.50' || $ip=="50.135.167.73" || $ip=='73.140.146.233') return true; else return false; } function endContent() { $output="\r\n\r\n"; return $output; } function logHeader($title) { global $crit_link,$page,$authenticated; $query=$_SERVER['QUERY_STRING']; if(!$authenticated) { echo " Administrative Login
Username: Password:
"; exit(); } $header=" $title
define.com - DIGITAL FORENSIC EVIDENCE FOR EDUCATIONAL DISCUSSION

$title

"; return $header; } function logAjax($page) { $output=" "; return $output; } function sort_by_domain($input_list) { $domainkeys=array(); $newlist=array(); foreach($input_list as $email) { $email=trim(strtolower($email)); if(strpos($email,"@") && strpos($email,".")) { $array=explode("@",$email); $user=$array[0]; $domain=$array[1]; if(!is_array($domainkeys[$domain])) $domainkeys[$domain]=array(); $domainkeys[$domain][$user]=$email; } } ksort($domainkeys); foreach(array_keys($domainkeys) as $domain) { ksort($domainkeys[$domain]); foreach(array_keys($domainkeys[$domain]) as $user) { array_push($newlist,$domainkeys[$domain][$user]); } } return $newlist; } function openLocations() { global $crit_dbUser,$crit_dbServer,$crit_dbPass,$crit_dbName,$crit_link,$ip,$location_links; $db=array('location00','location01','location02','location03','location04','location05','location06'); foreach($db as $dbName) { $host="$dbName.db.8525493.hostedresource.com"; $location_links[$dbName] = mysql_connect($host, $dbName, "$crit_dbPass") or die($error); mysql_select_db($dbName,$location_links[$dbName]) or die($error); } $crit_link = mysql_connect($crit_dbServer, $crit_dbUser, $crit_dbPass) or die($error); mysql_select_db($crit_dbName) or die($error); return; } function getLocation($thisip){ global $crit_dbUser,$crit_dbServer,$crit_dbPass,$crit_dbName,$crit_link,$ip,$location_links;$geoWebAPI; global $country,$region,$countrySHORT,$city,$isp,$domain,$ipTO; $city=capitalize($geoWebAPI['city']); $region=capitalize($geoWebAPI['region']); $country=capitalize($geoWebAPI['country']); $lat=$geoWebAPI['latitude']; $long=$geoWebAPI['longitude']; $isp=capitalize($geoWebAPI['isp']); $domain=$geoWebAPI['domain']; return $geoWebAPI; if(!stripos($thisip,".")) $dotIP=long2ip($thisip); else $dotIP=$thisip; if(is_dir("/var/www/domains")) return getLocationHome($dotIP); $db=array('location00','location01','location02','location03','location04','location05','location06'); $query="CREATE TABLE IF NOT EXISTS location_tables( name char(10), ipTO int(10) unsigned zerofill NOT NULL default '0000000000');"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__."Query=".debugArray($query)); $query="SELECT ipTO FROM location_tables LIMIT 1"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__."Query=".debugArray($query)); if(!mysql_num_rows($result)) { $subquery=""; foreach($db as $server) { $query="SELECT max(ipTO) FROM location"; $result = mysql_query($query,$location_links[$server]) or die('query failed: ' . mysql_error()." Line #:".__LINE__."Query=".debugArray($query)); list($ipTO)=mysql_fetch_array($result); $subquery.="('$server',$ipTO),"; } $subquery=trim($subquery,','); $query="INSERT INTO location_tables(name,ipTO) VALUES $subquery"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__."Query=".debugArray($query)); } $query="SELECT name FROM location_tables WHERE ipTO>=inet_aton('$dotIP') LIMIT 1"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__."Query=".debugArray($query)); list($name)=mysql_fetch_array($result); $query="SELECT * FROM location WHERE ipTO>=inet_aton('$dotIP') LIMIT 1"; if(strlen($name)) { $result = mysql_query($query,$location_links[$name]) or die('query failed: ' . mysql_error()." Line #:".__LINE__."Query=".debugArray($query)); $row=mysql_fetch_array($result); } else $row=array(); $city=capitalize($row['ipCITY']); $region=capitalize($row['ipREGION']); $country=capitalize($row['countryLONG']); $countrySHORT=$row['countrySHORT']; $isp=capitalize($row['isp']); $domain=$row['domain']; for($i=0;$i<11;$i++) unset($row[$i]); return $row; } function getLocationHome($thisip){ global $crit_dbUser,$crit_dbServer,$crit_dbPass,$crit_dbName,$crit_link,$ip,$location_links; if(!stripos($thisip,".")) $dotIP=long2ip($thisip); else $dotIP=$thisip; $query="SELECT * FROM location WHERE ipTO>=inet_aton('$dotIP') LIMIT 1"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__); $row=mysql_fetch_array($result); $city=capitalize($row['ipCITY']); $region=capitalize($row['ipREGION']); $country=capitalize($row['countryLONG']); $countrySHORT=$row['countrySHORT']; $isp=capitalize($row['isp']); $domain=$row['domain']; for($i=0;$i<11;$i++) unset($row[$i]); return $row; } function defineDict($thisword) { if(strpos(getcwd(),"/var/www/domains")!==false) return dict($thisword); global $crit_link; include("defineDict.php"); $thisword=mysql_real_escape_string($thisword,$dict_link); $query="SELECT definition FROM dictionary WHERE word='$thisword'"; $result = mysql_query($query,$dict_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__); list($definition)=mysql_fetch_array($result); if(!strlen($definition)) $definition="Sorry. No definitions were found for \"$thisword.\"" ; mysql_close($dict_link); return $definition; } function getTimeCode($thisFrameNumber, $inputFrameRate,$short=false) { $time=$thisFrameNumber/$inputFrameRate; $min = floor($time / 60); $hour = floor($min / 60); if ($min > 60) $min = $min - ($hour * 60); $sec = floor($time % 60); $milli = ".".intval(1000*($time - floor($time))); $frame = round($milli*$inputFrameRate); $shour = $hour; $smin = $min; $ssec = $sec; $sframe = $frame; if (strlen($shour) < 2) $shour = "0" . $shour; if (strlen($smin) < 2) $smin = "0" . $smin; if (strlen($ssec) < 2) $ssec = "0" . $ssec; if (strlen($sframe) < 2) $sframe = "0" . $sframe; if($short) $tc = $shour . ":" .$smin . ":" . substr("0".round($ssec + $milli),-2); else $tc = $shour . ":" . $smin . ":" . $ssec . ":" . $sframe; return $tc; } function parseFloat($ptString) { if (strlen($ptString) == 0) { return false; } $pString = str_replace(" ", "", $ptString); if (substr_count($pString, ",") > 1) $pString = str_replace(",", "", $pString); if (substr_count($pString, ".") > 1) $pString = str_replace(".", "", $pString); $pregResult = array(); $commaset = strpos($pString,','); if ($commaset === false) {$commaset = -1;} $pointset = strpos($pString,'.'); if ($pointset === false) {$pointset = -1;} $pregResultA = array(); $pregResultB = array(); if ($pointset < $commaset) { preg_match('#(([-]?[0-9]+(\.[0-9])?)+(,[0-9]+)?)#', $pString, $pregResultA); } preg_match('#(([-]?[0-9]+(,[0-9])?)+(\.[0-9]+)?)#', $pString, $pregResultB); if ((isset($pregResultA[0]) && (!isset($pregResultB[0]) || strstr($preResultA[0],$pregResultB[0]) == 0 || !$pointset))) { $numberString = $pregResultA[0]; $numberString = str_replace('.','',$numberString); $numberString = str_replace(',','.',$numberString); } elseif (isset($pregResultB[0]) && (!isset($pregResultA[0]) || strstr($pregResultB[0],$preResultA[0]) == 0 || !$commaset)) { $numberString = $pregResultB[0]; $numberString = str_replace(',','',$numberString); } else { return false; } $result = (float)$numberString; return $result; } function dbURL($url) { $url=str_replace(" ","%20",$url); return $url; } function base_convert_x( $_number='', $_frBase=10, $_toBase=62 ) { # Today's Date - C74 - convert a string (+ve integer) from any arbitrary base to any arbitrary base, up to base 62, using 0-9,A-Z,a-z # # Usage : echo base_convert_x( 123456789012345, 10, 32 ); $_10to62 = array( '0' => '0', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '00' => '0', '01' => '1', '02' => '2', '03' => '3', '04' => '4', '05' => '5', '06' => '6', '07' => '7', '10' => 'A', '11' => 'B', '12' => 'C', '13' => 'D', '14' => 'E', '15' => 'F', '16' => 'G', '17' => 'H', '18' => 'I', '19' => 'J', '20' => 'K', '21' => 'L', '22' => 'M', '23' => 'N', '24' => 'O', '25' => 'P', '26' => 'Q', '27' => 'R', '30' => 'U', '31' => 'V', '32' => 'W', '33' => 'X', '34' => 'Y', '35' => 'Z', '36' => 'a', '37' => 'b', '38' => 'c', '39' => 'd', '40' => 'e', '41' => 'f', '42' => 'g', '43' => 'h', '44' => 'i', '45' => 'j', '46' => 'k', '47' => 'l', '50' => 'o', '51' => 'p', '52' => 'q', '53' => 'r', '54' => 's', '55' => 't', '56' => 'u', '57' => 'v', '58' => 'w', '59' => 'x', '60' => 'y', '61' => 'z' ); $_62to10 = array( '0' => '00', '1' => '01', '2' => '02', '3' => '03', '4' => '04', '5' => '05', '6' => '06', '7' => '07', '8' => '08', '9' => '09', 'A' => '10', 'B' => '11', 'C' => '12', 'D' => '13', 'E' => '14', 'F' => '15', 'G' => '16', 'H' => '17', 'K' => '20', 'L' => '21', 'M' => '22', 'N' => '23', 'O' => '24', 'P' => '25', 'Q' => '26', 'R' => '27', 'S' => '28', 'T' => '29', 'U' => '30', 'V' => '31', 'W' => '32', 'X' => '33', 'Y' => '34', 'Z' => '35', 'a' => '36', 'b' => '37', 'e' => '40', 'f' => '41', 'g' => '42', 'h' => '43', 'i' => '44', 'j' => '45', 'k' => '46', 'l' => '47', 'm' => '48', 'n' => '49', 'o' => '50', 'p' => '51', 'q' => '52', 'r' => '53', 's' => '54', 't' => '55', 'u' => '56', 'v' => '57', 'y' => '60', 'z' => '61' ); # ---- First convert from frBase to base-10 $_in_b10 = 0; $_pwr_of_frB = 1; # power of from base, eg. 1, 8, 64, 512 $_chars = str_split( $_number ); # split input # into chars $_str_len = strlen( $_number ); $_pos = 0; while ( $_pos++ < $_str_len ) { $_char = $_chars[$_str_len - $_pos]; $_in_b10 += (((int) $_62to10[$_char] ) * $_pwr_of_frB); $_pwr_of_frB *= $_frBase; } # ---- Now convert from base-10 to toBase $_dividend = (int) $_in_b10; # name dividend easier to follow below $_in_toB = ''; # number string in toBase while ( $_dividend > 0 ) { $_quotient = (int) ( $_dividend / $_toBase ); # eg. 789 / 62 = 12 ( C in base 62 ) $_remainder = '' . ( $_dividend % $_toBase ); # 789 % 62 = 45 ( j in base 62 ) $_in_toB = $_10to62[$_remainder] . $_in_toB; # 789 (in base 10) = Cj (in base 62) $_dividend = $_quotient; # new dividend is the quotient from base division } if ( $_in_toB == '' ) $_in_toB = '0'; return $_in_toB; # base $_toBase string } function huffingtonpost($url) { $key=mysql_real_escape_string($url); $query = "SELECT MINUTE( TIMEDIFF( NOW( ) , timestamp ) ) as minutes,textblock FROM textblocks WHERE name='$key'"; $result = mysql_query($query) or die('query failed: ' . mysql_error()." QUERY=\"$query\""); if(mysql_num_rows($result)) list($minutes,$contents)=mysql_fetch_array($result); else $minutes=61; if($minutes>60) { $contents=file_get_contents($url); $contents=str_ireplace("","\r\n\r\n",$contents); if(!stripos($url,"chrome=")) $contents=str_ireplace("snn-member-title\">","snn-member-title\">",$contents); $contents=str_ireplace( "\"photo\"", "\"Hi.",$contents); $contents=str_ireplace("
","
",$contents); $contents=str_ireplace("
","
",$contents); $contents=str_ireplace("HuffPost super user","
HuffPost super user",$contents); $data=mysql_real_escape_string($contents); if(strlen($data)) { $query = "DELETE FROM textblocks WHERE name='$key'"; $result = mysql_query($query) or die('query failed: ' . mysql_error()." QUERY=\"$query\""); $query = "INSERT INTO textblocks(name,textblock) VALUES ('$key','$data');"; $result = mysql_query($query) or die('query failed: ' . mysql_error()." QUERY=\"$query\""); } } return $contents; } function jims_cache() { $key=mysql_real_escape_string($url); $query = "SELECT MINUTE( TIMEDIFF( NOW( ) , timestamp ) ) as minutes,textblock FROM textblocks WHERE name='$key'"; $result = mysql_query($query) or die('query failed: ' . mysql_error()." QUERY=\"$query\""); list($minutes,$contents)=mysql_fetch_array($result); return $contents; } function distance($lat1, $lon1, $lat2, $lon2, $unit) { $theta = $lon1 - $lon2; $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); $dist = acos($dist); $dist = rad2deg($dist); $miles = $dist * 60 * 1.1515; $unit = strtoupper($unit); if ($unit == "K") { return ($miles * 1.609344); } else if ($unit == "N") { return ($miles * 0.8684); } else { return $miles; } } function ip_address_to_number($IPaddress) { if(!$IPaddress) { return false; } else { $ips = explode('.',$IPaddress); return($ips[3] | $ips[2] << 8 | $ips[1] << 16 | $ips[0] << 24); } } function family($ip) { global $locationdata; $home_ips=array("70.89.210.190","10.1.10."); $isps=array("BOEING"); if(!sizeof($locationdata)) $locationdata=getLocation($ip); $state=$locationdata['ipREGION']; $city=$locationdata['ipCITY']; $this_isp=$locationdata['isp']; $domain=$locationdata['domain']; $latitude=$locationdata['latitude']; if(stripos($domain,".MIL") || stripos($domain,".GOV")) return 0; if($_GET['ken']) return 0; foreach($home_ips as $home) { if(strpos($ip,$home)!==false) return 1; } if(strtoupper($city)=="LOS ANGELES" && strtoupper($this_isp)=="ROAD RUNNER HOLDCO LLC") return 1; $block_cities=array("LOMPOC","SANTA YNEZ","SANTA MARIA","SOLVANG","ALOHA","BEAVERTON","SAN LORENZO","BURIEN","KENT","DES MOINES","TUKWILA","RENTON","TACOMA","OLYMPIA","SPOKANE"); if(in_array($city,$block_cities)) return 1; foreach($isps as $isp) { if(stripos($this_isp,$isp)!==false) return 1; } if($state=="TEXAS" || $state=="OREGON" || $state=="CALIFORNIA" ) return 1; return 0; } function UNListLog($logfile,$ip,$event) { if(!file_exists($logfile)) { $log=fopen($logfile,"w"); fwrite($log,"*********************************************************************************************************\r\nhttp://".strtoupper($_SERVER['HTTP_HOST'])." UNITED NATIONS QUANTUM LEAP MAILING LIST LOG\r\n$logfile\r\n*********************************************************************************************************\r\n"); fclose($log); } $log=fopen($logfile,"a"); $now = date("Y-m-d H:i:s"); $log=fopen($logfile,"a"); fwrite($log,"$now,$ip,$event\r\n"); fclose($log); return; } function thisDirectory() { $dir=getcwd(); $array=explode("/",$dir); return $array[sizeof($array)-1]; } function display404s($cookie_id) { global $ip,$crit_link,$agent,$mobile; $init_log_id_hash=$_COOKIE['init_log_id_hash']; $query="SELECT cookie_hash FROM cookies WHERE id=$cookie_id"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); if(!$_GET['cookie_hash']) list($cookie_hash)=mysql_fetch_array($result); else $cookie_hash=$_GET['cookie_hash']; { $query="SELECT id FROM cookies WHERE cookie_hash='$cookie_hash'"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); list($cookie_id)=mysql_fetch_array($result); } if($init_log_id_hash) { $display_log_id_hash="$init_log_id_hash
"; $query="SELECT id FROM logs WHERE id_hash='$init_log_id_hash'"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); list($init_log_id)=mysql_fetch_array($result); } if($mobile) $red_x="https://define.com/red_x_mobile.png"; else $red_x="https://define.com/red_x.png"; if ($cookie_id!="NULL") { $display_cookie_hash="$cookie_hash
"; $headertext404="
Below are the visible 404 entries associated with this "temporary_machine_id" cookie presented in reverse chronological order. This is a thread. Type anything you want and see what happens. Click here to view the PUBLIC URL of this thread. Click here to reset your "temporary_machine_id" private cookie to start a new thread.
"; } else $headertext404=null; $thisip=$_SERVER["REMOTE_ADDR"]; $ipargument="l.cookie_id=$cookie_id AND "; $cookie_message="

You can share the 404 page associated with this cookie here. Eventually, your 404 page may be one possible definition for a query. We will employ logic to filter it and format it so that it is aesthetically pleasing and standardized. There is a /robots.txt directive on this site that prevents this 404 page from being indexed by the search engines. That keeps us safe for now.

"; if($cookie_id) { $query="SELECT init_id FROM cookies WHERE id=$cookie_id"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); list($init_id)=mysql_fetch_array($result); } if($init_id==$init_log_id && $init_id) $query ="SELECT IF(l.init_id=$init_log_id,CONCAT(DATE_FORMAT(l.timestamp,'%Y-%m-%e %T'),' \'Click'),DATE_FORMAT(l.timestamp,'%Y-%m-%e %r')) as 'DATE (GMT)', wl.word AS entry FROM logs l,wordlist wl,engine e WHERE $ipargument l.word=wl.id AND l.engine=e.id AND (e.id=404 OR e.id=42 OR e.id=40) AND l.hide=0 ORDER BY l.timestamp DESC LIMIT 5000"; else if($cookie_id) $query="SELECT DATE_FORMAT(l.timestamp,'%Y-%m-%e %T') as 'DATE (GMT)', wl.word AS entry FROM logs l,wordlist wl,engine e WHERE $ipargument l.word=wl.id AND l.engine=e.id AND (e.id=404 OR e.id=42 OR e.id=40) AND l.hide=0 ORDER BY l.timestamp DESC LIMIT 5000"; if($cookie_id) $output= showResult($query,true,$headertext404); if(strlen($date_max)) { $title="Define.com entries between $date_min PST and $date_max PST"; } else $title="There are currently no visible 404 entries associated with your "temporary_machine_id" cookie."; if(stripos($agent,"Mobile")!==false) { $output=str_ireplace("1050","310",$output); $output=str_ireplace("640","189",$output); $output=str_ireplace("853","310",$output); $output=str_ireplace("480","189",$output); $output=str_ireplace("\r\n\r\nhttps://define.com/Kens404Page.php?cookie_hash=".$cookie_hash."
"; return $output; } function GoogleAd($width) { global $agent; switch ($width) { case 300: $output="\r\n
\r\n"; break; case 728: $output="\r\n
\r\n\r\n"; break; case 970: $output="\r\n
\r\n\r\n\r\n"; break; } return $output; } function showAll404s() { global $crit_link,$ip,$agent; if(isbot($agent)) return null; $temporary_machine_id=$_COOKIE['temporary_machine_id']; $init_log_id_hash=$_COOKIE['init_log_id_hash']; if($init_log_id_hash) { $display_log_id_hash="$init_log_id_hash
"; $query="SELECT id FROM logs WHERE id_hash='$init_log_id_hash'"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); list($init_log_id)=mysql_fetch_array($result); } if(!isbot($agent)) $output="
Here are the different "temporary_machine_id" cookies associated with your 404s and "init_log_id_hash" cookie (this is a set of threads):
"; if($init_log_id) { $query = "SELECT DISTINCT cookie_id FROM logs WHERE (cookie_id IN (SELECT id FROM cookies WHERE init_id=$init_log_id)) and NOT ISNULL(cookie_id) AND engine=404 AND hide=0 ORDER BY timestamp DESC"; $result2 = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); $num_rows=mysql_num_rows($result2); $counter=$num_rows+1; if(!$num_rows) return null; while($row=mysql_fetch_array($result2)) { $counter--; $cookie_id=$row['cookie_id']; $query = "SELECT cookie_hash FROM cookies WHERE id=$cookie_id"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); list($cookie_hash)=mysql_fetch_array($result); $ipargument="AND (l.cookie_id=$cookie_id)"; $query ="SELECT MIN(l.timestamp) FROM logs l WHERE (l.engine=404 OR l.engine=42 OR l.engine=40) $ipargument ORDER BY l.timestamp"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); list($min)=mysql_fetch_array($result); $min=date('D M j Y G:i:s', strtotime($min)); $query ="SELECT MAX(l.timestamp) FROM logs l WHERE (l.engine=404 OR l.engine=42 OR l.engine=40) $ipargument ORDER BY l.timestamp"; $result = mysql_query($query,$crit_link) or die('query failed: ' . mysql_error()." Line #:".__LINE__." QUERY=\"$query\""); list($max)=mysql_fetch_array($result); if(strlen($max)) { $max=date('D M j Y G:i:s', strtotime($max)); $title="
$counter of $num_rows - Define.com 404s between $min GMT and $max GMT
"; $output.=$title; } else $title=""; } return $output; } else return null; } function getFormInputName($string) { $array=explode(">",$string); $string=$array[0]; $string=recursive_str_ireplace("'","\"",$string); $pos=stripos($string,"name"); $start=stripos($string,"\"",$pos); $end=stripos($string,"\"",$start+1); $name=substr($string,$start+1,$end-$start-1); return $name; } function getFormInputValue($string) { $array=explode(">",$string); $string=$array[0]; $string=recursive_str_ireplace("'","\"",$string); $pos=stripos($string,"value"); $start=stripos($string,"\"",$pos); $end=stripos($string,"\"",$start+1); $value=substr($string,$start+1,$end-$start-1); return $value; } function getWebFormValues($string,$additionalParamArray=array()) { $params=""; $inputArray=explode("".$query); foreach($data['transactions'] as $transaction) { insertCreditCardTransaction($id,$transaction); } } echo "\r\nCredit Card Update Complete...
"; return; } function insertCreditCardTransaction($id,$transaction) { $date=$transaction['date']; $type=capitalize($transaction['type']); $amount=$transaction['amount']; $description=mysql_real_escape_string($transaction['description']); $query="SELECT id FROM credit_card_transactions WHERE hash=md5('$id $date $type $amount $description')"; $result = mysql_query($query) or die('query failed: ' . mysql_error()."
".$query); if(!mysql_num_rows($result)) { $query="INSERT INTO credit_card_transactions(hash,account,date,type,amount,description) VALUES (md5('$id $date $type $amount $description'),'$id','$date','$type',$amount,'$description');"; $result = mysql_query($query) or die('query failed: ' . mysql_error()."
".$query); } return; } function updateDatabaseChecking() { $account_info=getCheckingAccountInfo(); $query="UPDATE checking_account_transactions SET display=0 WHERE date='2100-12-31'"; $result = mysql_query($query) or die('query failed: ' . mysql_error()."
".$query); foreach($account_info as $data) { $id=$data['id']; updateAccountBalances($id,$data['present_balance'],$data['available_balance']); //--------------------------DO PENDING $transactions=$data['pending_transactions']; $size=sizeof($transactions); for($i=$size-1;$i>=0;$i--) { $transactions[$i]['date']='2100-12-31'; $transactions[$i]['type']=$transactions[$i][1]; $transactions[$i]['description']=$transactions[$i][2]; $debit=$transactions[$i][3]; $credit=$transactions[$i][4]; if($credit>0) $amount=$credit; else if($debit>0) $amount=-$debit; else $amount="0.00"; $transactions[$i]['amount']=$amount; if($transactions[$i][0] =='Pending') { insertCheckingTransaction($id,$transactions[$i]); } } //--------------------------DO COMPLETED $transactions=$data['checking_transactions']; $size=sizeof($transactions);; for($i=$size-1;$i>=0;$i--) { insertCheckingTransaction($id,$transactions[$i]); } } echo "\r\nChecking Update Complete...
"; return; } function sql_date($date) { $array=explode("/",$date); $date=$array[2]."-".$array[0]."-".$array[1]; return $date; } function insertCheckingTransaction($id,$transaction) { $date=$transaction['date']; $type=capitalize($transaction['type']); $amount=$transaction['amount']; $description=mysql_real_escape_string($transaction['description']); $array=explode("/",$description); if(sizeof($array)==2 && strlen($array[0])==2 && strlen($array[1])==2) $description="ATM CASH DEPOSIT $description"; $query="SELECT id FROM checking_account_transactions WHERE hash=md5('$id $date $type $amount $description')"; if($date=='2100-12-31') { $query="SELECT id FROM checking_account_transactions WHERE hash=md5('$id $date $type $amount $description') AND start_time > UTC_TIMESTAMP()-INTERVAL 7 DAY"; } $result = mysql_query($query) or die('query failed: ' . mysql_error()."
".$query); if(!mysql_num_rows($result)) { $startTime=getStartTime($description,$amount); if($date=='2100-12-31' || !$startTime) $startTime="UTC_TIMESTAMP()"; else $startTime="'$startTime'"; $query="DELETE FROM checking_account_transactions where hash=md5('$id $date $type $amount $description') AND start_time".$query); $query="INSERT INTO checking_account_transactions(hash,account,start_time,date,type,amount,description,display) VALUES (md5('$id $date $type $amount $description'),'$id',$startTime,'$date','$type',$amount,'$description',1);"; $result = mysql_query($query) or die('query failed: ' . mysql_error()."
".$query); } else if($date=='2100-12-31') { list($id)=mysql_fetch_array($result); $query="UPDATE checking_account_transactions SET display=1 WHERE id=$id"; $result = mysql_query($query) or die('query failed: ' . mysql_error()."
".$query); } return; } function getStartTime($description,$amount) { $card=""; if(stripos($description,"CHASE CARD SERVICES (Visa)")!==false) { $card='%CHASE CARD SERVICES (Visa)%'; } else if(stripos($description,"CHASE CARD SERVICES (MC)")!==false) { $card='%CHASE CARD SERVICES (MC)%'; } else if(stripos($description,"DISCOVER CARD")!==false) { $card='%DISCOVER CARD%'; } else if(stripos($description,"ATM CASH DEPOSIT")===0) { $card='ATM CREDIT%'; } else if(stripos($description,"ATM WITHDRAWAL")===0) { $card='ATM DEBIT%'; } else if(stripos($description,"TREASURY")!==false) { $card='%TREASURY%'; } else if(stripos($description,"SSA TREAS")!==false) { $card='SSA TREAS%'; } else if(stripos($description,"PAYMENT TO CHASE CARD ENDING IN0573")!==false) { $card='PAYMENT TO CHASE CARD ENDING IN 0573%'; } else if(stripos($description,"PAYMENT TO CHASE CARD ENDING IN9380")!==false) { $card='PAYMENT TO CHASE CARD ENDING IN 9380%'; } else if(stripos($description,"PAYMENT TO CHASE CARD ENDING IN2614")!==false) { $card='PAYMENT TO CHASE CARD ENDING IN 2614%'; } else if(stripos($description,"PAYMENT TO CHASE CARD ENDING IN 0573")!==false) { $card='PAYMENT TO CHASE CARD ENDING IN 0573%'; } else if(stripos($description,"PAYMENT TO CHASE CARD ENDING IN 9380")!==false) { $card='PAYMENT TO CHASE CARD ENDING IN 9380%'; } else if(stripos($description,"PAYMENT TO CHASE CARD ENDING IN 2614")!==false) { $card='PAYMENT TO CHASE CARD ENDING IN 2614%'; } else if(stripos($description,"MOM\\'S SAVINGS")!==false) { $card="%MOM\\'S SAVINGS%"; } else if(stripos($description,"COLOR TRIPS")!==false) { $card='%COLOR TRIPS%'; } else if(stripos($description,"DELL")!==false) { $card='%DELL FINANCIAL%'; } else if(stripos($description,"PAYPAL")!==false) { $card='%PAYPAL%'; } else if(stripos($description,"AMAZON.COM")!==false) { $card='%AMAZON.COM%'; } else if(stripos($description,"DSHS")!==false) { $card='%DSHS%'; } else if(stripos($description,"JPMorgan Chase Ext Trnsfr")!==false) { $card='JPMorgan Chase Ext Trnsfr%'; } if(!strlen($card)) return null; $query="SELECT timestamp FROM checking_account_transactions WHERE description LIKE '$card' AND amount=$amount AND date='2100-12-31' AND display=0 AND timestamp>UTC_TIMESTAMP()-INTERVAL 10 DAY ORDER BY timestamp DESC LIMIT 1"; $result = mysql_query($query) or die('query failed: ' . mysql_error()."
".$query); if(!mysql_num_rows($result)) return null; else { list($timestamp)=mysql_fetch_array($result); return $timestamp; } } function updateAccountBalances($id,$present_balance,$available_balance) { if(!strlen($present_balance)) return; $query="UPDATE bank_ACCOUNTS SET present_balance='$present_balance',available_balance='$available_balance',timestamp=UTC_TIMESTAMP() WHERE id='$id'"; $result = mysql_query($query) or die('query failed: ' . mysql_error()."
".$query); return; } function getCreditCardAccountInfo() { global $last_header; $query="SELECT * FROM bank_ACCOUNTS WHERE account_type='CREDIT CARD'"; $result = mysql_query($query) or die('query failed: ' . mysql_error()."
".$query); $logout_url="https://chaseonline.chase.com/secure/LogOff.aspx"; $chase_login_url="https://www.chase.com/"; $account_info=array(); while($row=mysql_fetch_array($result)) { postURL($logout_url); clearCookie('chase.com'); $id=$row['id']; $username=$row['username']; $password=$row['password']; $old_balance=$row['present_balance']; $account_id=$row['account_id']; $validation_text=$row['validation_text']; $account_description=$row['account_description']; echo "Getting credit card balances for $account_description....\r\n"; $login_page=postURL($chase_login_url); $login_post_url=getFormAction($login_page); $params=getWebFormValues($login_page,array('UserID'=>$username,'Password'=>$password)); $intermediate_login_url="https://mfasa.chase.com/auth/fcc/login"; $__VIEWSTATE=getParam($params,"__VIEWSTATE"); $__EVENTVALIDATION=getParam($params,"__EVENTVALIDATION"); $intermediate_login_params="__LASTFOCUS=&__VIEWSTATE=$__VIEWSTATE&__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATEENCRYPTED=&__EVENTVALIDATION=$__EVENTVALIDATION&auth_siteId=COL&auth_externalData=LOB=COLLogon&auth_userId=$username&auth_passwd=$password&auth_passwd_org=$password&auth_deviceId=UJ57TIXYTXAZIZK1N3T9Z02YJ1F3HP1FGLDNVMB7ZH33Z0SG9E301IUDKKBA8YEA&auth_deviceSignature={\"navigator\":{\"appName\":\"Netscape\",\"userAgent\":\"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1\",\"language\":\"en-US\",\"appVersion\":\"5.0 (Windows)\",\"appCodeName\":\"Mozilla\",\"platform\":\"Win32\",\"oscpu\":\"Windows NT 6.1; WOW64\",\"vendor\":\"\",\"vendorSub\":\"\",\"product\":\"Gecko\",\"productSub\":\"20100101\",\"securityPolicy\":\"\",\"cookieEnabled\":true,\"onLine\":true,\"buildID\":\"20110413222027\"},\"plugins\":[{\"name\":\"Adobe Acrobat Plugin\",\"version\":\"10.0.0\"},{\"name\":\"QuickTime Plug-in\",\"version\":\"7.6.9\"},{\"name\":\"DivX Browser Plugin\",\"version\":\"\"},{\"name\":\"Windows Media Player Plug-in Dynamic Link Library\",\"version\":\"\"},{\"name\":\"Macromedia Shockwave Flash\",\"version\":\"10.3\"},{\"name\":\"Java Virtual Machine\",\"version\":\"\"}],\"screen\":{\"availHeight\":1080,\"availWidth\":1920,\"colorDepth\":24,\"height\":1080,\"pixelDepth\":24,\"width\":1920},\"extra\":{\"javascript_ver\":\"2.0\",\"timezone\":480}}&auth_deviceCookie=adtoken&auth_contextId=login&UserID=$username&Password=$password"; $page=postURL($intermediate_login_url,$intermediate_login_params); $chase_login_url=$last_header['url']; $redirect_url=getParam($last_header['url'],'auth_redirecturl'); $page=postURL($redirect_url); $my_accounts_page="https://chaseonline.chase.com/MyAccounts.aspx"; $page=postURL($my_accounts_page); $account_info[$id]['id']=$id; $account_info[$id]['account_description']=$account_description; $account_info[$id]['old_balance']=$old_balance; $account_info[$id]['outstanding_balance']=getCreditCardSummaryValue('Current balance',$page); $account_info[$id]['payment_due_date']=sql_date(getCreditCardSummaryValue('Payment due date',$page)); $account_info[$id]['minimum_payment_due']=getCreditCardSummaryValue('Minimum payment due',$page); $account_info[$id]['balance_last_statement']=getCreditCardSummaryValue('Balance last statement',$page); $account_info[$id]['available_credit']=getCreditCardSummaryValue('Available credit',$page); $account_info[$id]['total_credit_limit']=getCreditCardSummaryValue('Total credit limit',$page); $difference=$account_info[$id]['old_balance']-$account_info[$id]['outstanding_balance']; if($difference>0 && $account_info[$id]['old_balance'] > 0 && $account_info[$id]['outstanding_balance'] > 0 && stripos($page,$validation_text)) { mail("km@define.com","CREDIT POSTED: ".$account_info[$id]['account_description'].' ($'. number_format($difference, 2, '.', ',').')',"CREDIT POSTED: ".$account_info[$id]['account_description'].' ($'. number_format($difference, 2, '.', ',').'). '.$account_info[$id]['old_balance']."-".$account_info[$id]['outstanding_balance'],"From: km@define.com"); } /* $download_page="https://cards.chase.com/Account/DownloadActivity.aspx?AI=$account_id"; $page=postURL($download_page); debugArray($page); $download_page="https://cards.chase.com/cc/Account/DownloadAccountActivity?ai=$account_id&pageGuid=0.41225036133284154&downloadType=QFX&StatementPeriodQuick=ALL&__RequestForgeryToken=bUfHagq5r1M8%2FIUfR4ooBg%3D%3D&SortColumn=TransDate&SortOrder=up"; $page=postURL($download_page); debugArray($page); $paramArray=array(); $paramArray['__VIEWSTATE']='/wEPDwULLTExMjMzMTI4NTgPZBYCAgEPZBYCAgUPZBYEAgEPZBYCAgMPDxYEHgtOYXZpZ2F0ZVVybAVwamF2YXNjcmlwdDpPcGVuV2luZG93SGVscCgnaHR0cHM6Ly93d3cuY2hhc2UuY29tL2NjcC9pbmRleC5qc3A/cGdfbmFtZT1zaGFyZWQvaGVscC9wYWdlL2NhcmRfRG93bmxvYWRBY3Rpdml0eScpOx4HVG9vbFRpcAUXT3BlbmluZyBpbiBhIG5ldyB3aW5kb3dkZAIJD2QWDAILD2QWAgIBDw8WAh4EVGV4dAUVQ1JFRElUIENBUkQgKC4uLjQwODApZGQCDw8PFgIfAgUaQWxsIHRyYW5zYWN0aW9ucyBhdmFpbGFibGVkZAITDw8WBB4IQ3NzQ2xhc3MFDGlucHV0VGV4dEJveB4EXyFTQgICZBYCZg8PFgQfAwUMaW5wdXRUZXh0Qm94HwQCAmRkAhkPDxYEHwMFDGlucHV0VGV4dEJveB8EAgJkFgJmDw8WBB8DBQxpbnB1dFRleHRCb3gfBAICZGQCHw8QDxYEHwMFCnNlbGVjdExpc3QfBAICZBAVBxotLSBTZWxlY3QgRG93bmxvYWQgVHlwZSAtLR5JbnR1aXQgUXVpY2tlbiBXZWIgQ29ubmVjdCBRRlgLUXVpY2tlbiBRSUYOUXVpY2tib29rcyBJSUYaUXVpY2tib29rcyBXZWIgQ29ubmVjdCBRQk8PTWljcm9zb2Z0IE1vbmV5GkNvbW1hIFNlcGFyYXRlZCBWYWx1ZXMgQ1NWFQcAA1FGWANRSUYDSUlGA1FCTwNPRlgDQ1NWFCsDB2dnZ2dnZ2dkZAIlDw9kFgIeB09uQ2xpY2sFT2phdmFzY3JpcHQ6ZG9jdW1lbnQuRm9ybTEuaGlkQnV0dG9uVHlwZS52YWx1ZT0nQ0FOQ0VMJztkb2N1bWVudC5Gb3JtMS5zdWJtaXQoKTtkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYCBRVTZWxlY3RBbGxUcmFuc2FjdGlvbnMFD1NlbGVjdERhdGVSYW5nZQmi1KDDbhbkQRyB2t1GDpgNhJDm'; $paramArray['DateRangeGroup']='0'; $paramArray['DownloadType']='QFX'; $paramArray['BtnDownloadActivity']='Download Activity'; $paramArray['hidButtonType']=''; $paramArray['hidAcctIndex']=$account_id; $params=makeParams($paramArray); $page=postURL($download_page,$params); $paramArray['__VIEWSTATE_RENAMED']=$paramArray['__VIEWSTATE']; unset($paramArray['__VIEWSTATE']); unset($paramArray['BtnDownloadActivity']); $params=makeParams($paramArray); $file="https://cards.chase.com/Account/AccountDownloadFile.aspx"; $page=postURL($file,$params); debugArray($page); */ if(!stripos($page,$validation_text)) unset($account_info[$id]); else { if($username=="kenmeyering0") $page=file_get_contents("QFX/mastercard"); else if($username=="marshadawn1") $page=file_get_contents("QFX/Visa"); $account_info[$id]['transactions']=getCreditCardTransactions($page); } } return $account_info; } function makeParams($paramArray) { $keys=array_keys($paramArray); $params=""; foreach($keys as $key) { $params.=$key."=".$paramArray[$key]."&"; } $params=trim($params,"&"); return $params; } function getCreditCardSummaryValue($item,$page) { $item=strtolower($item); $page=strtolower($page); $page=str_replace(",","",$page); $page=str_replace("$","",$page); $array=explode($item,$page); $array=explode("",$array[1]); $array=explode("<",$array[1]); $value=$array[0]; return $value; } function getCheckingAccountInfo() { global $last_header; $query="SELECT * FROM bank_ACCOUNTS WHERE account_type='CHECKING'"; $result = mysql_query($query) or die('query failed: ' . mysql_error()."
".$query); $logout_url="https://chaseonline.chase.com/secure/LogOff.aspx"; $chase_login_url="https://www.chase.com/"; $account_info=array(); while($row=mysql_fetch_array($result)) { postURL($logoutURL); $id=$row['id']; $username=$row['username']; $password=$row['password']; $account_id=$row['account_id']; $old_balance=$row['available_balance']; $account_description=$row['account_description']; echo "Getting checking transactions for $account_description....\r\n"; $login_page=postURL($chase_login_url); $login_post_url=getFormAction($login_page); $params=getWebFormValues($login_page,array('UserID'=>$username,'Password'=>$password)); $intermediate_login_url="https://mfasa.chase.com/auth/fcc/login"; $__VIEWSTATE=getParam($params,"__VIEWSTATE"); $__EVENTVALIDATION=getParam($params,"__EVENTVALIDATION"); $intermediate_login_params="__LASTFOCUS=&__VIEWSTATE=$__VIEWSTATE&__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATEENCRYPTED=&__EVENTVALIDATION=$__EVENTVALIDATION&auth_siteId=COL&auth_externalData=LOB=COLLogon&auth_userId=$username&auth_passwd=$password&auth_passwd_org=$password&auth_deviceId=UJ57TIXYTXAZIZK1N3T9Z02YJ1F3HP1FGLDNVMB7ZH33Z0SG9E301IUDKKBA8YEA&auth_deviceSignature={\"navigator\":{\"appName\":\"Netscape\",\"userAgent\":\"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1\",\"language\":\"en-US\",\"appVersion\":\"5.0 (Windows)\",\"appCodeName\":\"Mozilla\",\"platform\":\"Win32\",\"oscpu\":\"Windows NT 6.1; WOW64\",\"vendor\":\"\",\"vendorSub\":\"\",\"product\":\"Gecko\",\"productSub\":\"20100101\",\"securityPolicy\":\"\",\"cookieEnabled\":true,\"onLine\":true,\"buildID\":\"20110413222027\"},\"plugins\":[{\"name\":\"Adobe Acrobat Plugin\",\"version\":\"10.0.0\"},{\"name\":\"QuickTime Plug-in\",\"version\":\"7.6.9\"},{\"name\":\"DivX Browser Plugin\",\"version\":\"\"},{\"name\":\"Windows Media Player Plug-in Dynamic Link Library\",\"version\":\"\"},{\"name\":\"Macromedia Shockwave Flash\",\"version\":\"10.3\"},{\"name\":\"Java Virtual Machine\",\"version\":\"\"}],\"screen\":{\"availHeight\":1080,\"availWidth\":1920,\"colorDepth\":24,\"height\":1080,\"pixelDepth\":24,\"width\":1920},\"extra\":{\"javascript_ver\":\"2.0\",\"timezone\":480}}&auth_deviceCookie=adtoken&auth_contextId=login&UserID=$username&Password=$password"; $page=postURL($intermediate_login_url,$intermediate_login_params); $chase_login_url=$last_header['url']; $redirect_url=getParam($last_header['url'],'auth_redirecturl'); $page=postURL($redirect_url); $account_activity_page="https://banking.chase.com/AccountActivity/AccountDetails.aspx?AI=$account_id"; $page=postURL($account_activity_page,$params); $account_info[$id]=parseCheckingPage($id,$page,$old_balance,$account_description); if($account_info[$id]['available_balance']>$
Fatal error: Call to undefined function checkReal404() in /home/content/93/8525493/html/404handler.php on line 6