\r\n"; mail('jim.rolt@googlemail.com', $subject, $error, $headers); //echo $error; } $timestart = microtime(); include('dataedit/sql.php'); if(is_numeric($_GET['county'])){$county = intval($_GET['county']);}else{$county = 1;} $town = mysql_real_escape_string($_GET['town']); $books = mysql_query("SELECT * FROM Books WHERE CountyID = $county AND townname IS NULL GROUP BY id")or mailjim('Books', mysql_error()); $lbooks = mysql_query("SELECT * FROM Books WHERE townname = '$town' AND CountyID = $county")or mailjim('Lbooks', mysql_error()); $rev= mysql_query("SELECT countyreviews.id FROM countyreviews WHERE county = $county LIMIT 1"); $townpix = mysql_query("SELECT townpix.clientid, EstDetails.Name FROM townpix INNER JOIN EstDetails ON EstDetails.RecordID = townpix.clientid WHERE townpix.town = '$town' AND townpix.county = $county")or mailjim('townpix', mysql_error()); $act = mysql_query("SELECT Activities.ID, Activities.Name, ActivityTypes.TYPE FROM Activities INNER JOIN ActivityTypes ON ActivityTypes.ID = Activities.TYPE WHERE County = $county AND Town = '$town' Order by TYPE, Name ")or mailjim('act', mysql_error()); $shops = mysql_query("SELECT ID, Name, TYPE FROM Shops WHERE county = $county AND Town = '$town' AND TYPE NOT IN(1,29) ")or mailjim('shops', mysql_error()); $ant = mysql_query("SELECT ID, Name, TYPE FROM Shops WHERE county = $county AND Town = '$town' AND TYPE = 1 ")or mailjim('ant', mysql_error()); $events = mysql_query("SELECT COUNT(*) AS num FROM events WHERE county = $county")or mailjim('events', mysql_error()); $famous = mysql_query("SELECT id, name FROM famous WHERE birthplace = '$town' ORDER BY name")or mailjim('famous', mysql_error()); $update = mysql_query("UPDATE didyouknow SET visits = visits+1 WHERE town = '$town' AND county = $county")or mailjim('visits', mysql_error()); $didyouknow = mysql_query("SELECT didyouknow.*, Towns.ID AS tid, Towns.clientpic, EstDetails.Name, CountyName, CountyDetails.CountryID, CountyNameCut, bcomregion FROM didyouknow INNER JOIN CountyDetails ON county = CountyDetails.RecordID LEFT JOIN Towns ON Towns.Name = town AND Towns.county = didyouknow.county LEFT JOIN EstDetails ON EstDetails.RecordID = Towns.clientpic WHERE didyouknow.town = '$town' AND didyouknow.county = $county")or die(mysql_error()); $did = mysql_fetch_object($didyouknow); mysql_data_seek($didyouknow, 0); $create = mysql_query("CREATE TEMPORARY TABLE tmp ( RecordID int(11), EstType tinyint(2), EstTypeAlt tinyint(2), EstType2 tinyint(2) default NULL, EstType3 tinyint(2) default NULL )")or mailjim('tmp create', mysql_error()); $poptemp = mysql_query("INSERT INTO tmp SELECT EstDetails.RecordID, EstType, EstTypeAlt, EstType2, EstType3 FROM EstDetails WHERE List = 1 AND County = $county AND Town = '$town' ORDER BY RAND() ")or mailjim('tmp insert', mysql_error()); $hotels = mysql_query("SELECT RecordID FROM tmp WHERE EstType = 1 OR EstType = 12 OR EstTypeAlt = 1 OR EstType2 = 1 OR EstType3 = 1")or mailjim('hotel', mysql_error()); $bnb = mysql_query("SELECT RecordID FROM tmp WHERE EstType = 2 OR EstTypeAlt = 2 OR EstType2 = 2")or mailjim('bnb', mysql_error()); $drop = mysql_query("DROP TABLE tmp"); $cott2 = mysql_query("SELECT RecordID FROM EstDetails WHERE Name LIKE '%Cottages in%' AND county = $county"); $cottlink = mysql_fetch_object($cott2); echo << Interesting facts about $town, $did->CountyName EOT; ?>
CountyNameCut); include'locallinks.php'; $llins = new locallinks($county,$did->CountryID); echo $llins->output; /*include'featuredhotels.php'; feature($county);*/ include'adviva.txt'; include'burstmedia.txt';; ?>
"; if($trow->caption){echo"$trow->caption";} } elseif(mysql_num_rows($townpix) > 0){ echo"$trow->Name
$trow->Name"; } elseif($did->clientpic > 0){ echo"$did->Name
$did->Name"; } include'yellowbcombox.php'; yellowbox($town,$did->bcomregion); /*include'connect.php'; connect('', '', "Rather interesting $town facts"); $bchk = 0; while($didyou = mysql_fetch_object($didyouknow)){ if(file_exists("images/didyouknow/$didyou->id.jpg")){ echo"\n"; if(!empty($didyou->caption)){echo"
$didyou->caption\n";} } if($bchk == 0){ ?>
Rather interesting $town facts\n"; include'linkunit.txt'; echo"

"; if($did->tid){ $townurl = str_replace(' ', '-', $town); echo "Click for places to stay in $town | "; if($county != 16){echo"Today's best rates | \n";} } echo "Send in your views of $town"; if(mysql_num_rows($rev) > 0){echo" | Read visitor reports";} ?>

$didyou->detail"; if(!empty($didyou->link)){echo" Link: $didyou->comment\n";} if(!empty($didyou->link2)){echo"
Link: $didyou->comment2\n";} if(!empty($didyou->link3)){echo"
Link: $didyou->comment3\n";} if(!empty($didyou->link4)){echo"
Link: $didyou->comment4\n";} if(!empty($didyou->link5)){echo"
Link: $didyou->comment5\n";} echo'

'; } include'showlove.txt'; if(mysql_num_rows($famous) > 0){ echo"\n

Famous $town people:

\n

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

More famous Britons here

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