\r\n"; mail('jim.rolt@googlemail.com', $subject, $error, $headers); } include'dataedit/sql.php'; if(isset($_GET['id']) && is_numeric($_GET['id'])){$id = $_GET['id'];}else{$id = 1;} $update = mysql_query("UPDATE famousdates SET visits = visits+1 WHERE id =$id")or mailjim("update", mysql_error()); $q = mysql_query("SELECT famousdates.*, CountyName, bcomregion, Towns.ID AS tid FROM famousdates LEFT JOIN CountyDetails ON CountyDetails.RecordID = famousdates.county LEFT JOIN Towns ON Towns.Name = famousdates.town AND Towns.County = famousdates.county WHERE famousdates.id = $id GROUP BY tid DESC")or mailjim("q", mysql_error()); $title = mysql_fetch_object($q); $fdyear = substr($title->fdate, 0, 4); if(!empty($title->id)){ $o = mysql_query("SELECT id, name FROM famousdates WHERE LEFT(fdate, 4) = $fdyear AND id != $title->id")or mailjim("o", mysql_error()); } $fdyear = (substr($fdyear, 0, 1) == 0) ? substr($fdyear, 1) : $fdyear; $months= array('01'=>"January",'02'=>"February",'03'=>"March",'04'=>"April",'05'=>"May",'06'=>"June",'07'=>"July",'08'=>"August",'09'=>"September",'10'=>"October",'11'=>"November",'12'=>"December"); $fmonth = $months[substr($title->fdate, 5, 2)]; $fday = substr($title->fdate, 8, 2); $fday = (substr($fday, 0, 1) == 0) ? substr($fday, 1) : $fday; //echo'1st:'.substr($fday, 0, 1).', 2nd:'.substr($fday, 0, 1); switch($fday){ case substr($fday, -1) == 1 && substr($fday, -2, 1) != 1 : case 1: $suffix = 'st'; break; case substr($fday, -1) == 2 && substr($fday, -2, 1) != 1: $suffix = 'nd'; break; case substr($fday, -1) == 3 && substr($fday, -2, 1) != 1 : $suffix = 'rd'; break; default: $suffix = 'th'; } $monthday = substr($title->fdate, 5, 5); $sql = "SELECT SQL_CACHE id, name FROM famousdates WHERE RIGHT(fdate, 5) = '$monthday' ORDER BY RAND() LIMIT 3"; $mi = mysql_query($sql)or die(mysql_error()); $fdate = "The $fday$suffix of $fmonth $fdyear AD"; $sql = "SELECT content, Entered, reviewer FROM Feedback WHERE link = '".mysql_real_escape_string($_SERVER['REQUEST_URI'])."' AND displayed = 1 ORDER BY Entered DESC"; $fb = mysql_query($sql)or mailjim('Feedback', "$sql\n".mysql_error()); echo << $fdate, $title->name EOT; ?>
name'>"; } $date = date('jS F Y', strtotime($title->entered)); //include'connect.php'; //connect('', '', $title->name, $title->visits, $date); if($title->county > 0){ include'yellowbcombox.php'; yellowbox($title->CountyName,$title->bcomregion); } else{include'lrform.php';} include'google250.txt'; if(mysql_num_rows($mi) > 1){ $image = array(); exec("/usr/bin/s3cmd --config=/var/www/html/dataedit/.s3cfg ls s3://ib-website-files/images/famdates/", $list); foreach($list as $line){ $image[] = substr($line, 67, -4); } if(count($image) > 0){ $imcount = 0; echo"

History on $fday$suffix $fmonth

"; shuffle($image); $titles = array(); while($trow = mysql_fetch_object($mi)){ $titles[$trow->id] = $trow->name; } //print_r($titles); foreach($titles as $key=>$caption){ if(in_array($key, $image) && $key != $id){ if($imcount == 3){break;} echo"
$caption
"; $imcount ++; } } } } ?>
$title->name"; include'linkunit.txt'; if(isset($title->amazon)){echo"
$title->amazon
";} ?>

tid)){echo"$title->town";} else{echo $title->town;} if(!empty($title->town) && !empty($title->CountyName)){echo', ';} if(!empty($title->CountyName)){echo"$title->CountyName\n";} //if(!empty($title->town) || !empty($title->CountyName)){echo' | ';} //echo"Your feedback on this Article.
$fdate"; $ylink = mysql_num_rows($o) > 0 ? "$fdyear" : $fdyear; echo"The $fday$suffix of $fmonth $ylink AD"; if(!empty($title->detail)){echo'

'.nl2br($title->detail)."

\n";} if(!empty($title->link) || !empty($title->link2) || !empty($title->link3) || !empty($title->link4) || !empty($title->link5)){ echo"

Links:\n"; if(!empty($title->link)){ if(strpos($title->link, 'showPlace')){echo"
internal link";} else{echo" $title->link";} echo' '; if(!empty($title->comment)){echo"$title->comment\n";} } if(!empty($title->link2)){echo"
link2, 'showPlace')){echo">internal link";} else{echo" class='trk'> $title->link2";} echo' '; if(!empty($title->comment2)){echo"$title->comment2\n";} } if(!empty($title->link3)){echo"
link3, 'showPlace')){echo">internal link";} else{echo" class='trk'> $title->link3";} echo' '; if(!empty($title->comment3)){echo"$title->comment3\n";} } if(!empty($title->link4)){echo"
link4, 'showPlace')){echo">internal link";} else{echo"class='trk'> $title->link4";} echo' '; if(!empty($title->comment4)){echo"$title->comment4\n";} } if(!empty($title->link5)){echo"
link5, 'showPlace')){echo">internal link";} else{echo" class='trk'> $title->link5";} echo' '; if(!empty($title->comment5)){echo"$title->comment5\n";} } } ?>

More famous dates here

entered)); echo"

$title->visits views since $date

\n"; //include'showlove.txt'; if(mysql_num_rows($fb) > 0){ //$feednum = mysql_num_rows($fb); $response = $feednum > 1 ? 'Comments' : 'Comment'; echo"

$response

\n"; while($feed = mysql_fetch_object($fb)){ $edate = date('jS F Y', strtotime($feed->Entered)); echo"

From $feed->reviewer on $edate
$feed->content

\n"; } } /* if(mysql_num_rows($o) > 0){ echo"

More History from the year $fdyear

\n

"; while($odate = mysql_fetch_object($o)){ echo"$odate->name
\n"; } echo'

'; } */ include'dailyfeature.php'; ?>