"Arts_and_Culture%", "Art_and_Culture/Art_Galleries_and_Dealers" => "Arts_and_Culture/Art_Galleries_and_Dealers", "Art_and_Culture/Cinemas" => "Arts_and_Culture/Cinemas", "Art_and_Culture/Museums" => "Arts_and_Culture/Museums", "Art_and_Culture/Photography" => "keyword:Photograph", "Art_and_Culture/Theatres" => "Arts_and_Culture/Theatre", "Building_and_Construction" => "Building_and_Construction", "Building_and_Construction/Architects" => "Building_and_Construction/Architects", "Building_and_Construction/Cleaners" => "keyword:Clean", "Building_and_Construction/Electricians" => "Building_and_Construction/Electricians", "Building_and_Construction/Gas_Installers" => "Building_and_Construction/Gas_Service_Engineers/Gas_Installers", "Building_and_Construction/Interior_Design" => "Building_and_Construction/Interior_Design", "Building_and_Construction/Landscape_Gardening" => "Building_and_Construction/Landscape_Gardening", "Building_and_Construction/Materials_and_Supplies" => "Building_and_Construction/Materials_and_Supplies", "Building_and_Construction/Painters_and_Decorators" => "Building_and_Construction/Painters_and_Decorators", "Building_and_Construction/Plumbing_and_Heating" => "Building_and_Construction/Plumbing_and_Heating", "Building_and_Construction/Property_Developers" => "Property_and_Accommodation/Property_Developers", "Building_and_Construction/Roofers" => "Building_and_Construction/Roofing", "Building_and_Construction/Surveyors_and_Valuers" => "keyword:surveyor", "Computers_and_Internet" => "keyword:computer", "Computers_and_Internet/Computer_Retail" => "Computers_and_Software/Computer_Retail", "Computers_and_Internet/Domain_Name_Registration" => "Internet/ISPs", "Computers_and_Internet/Ecommerce" => "Internet/Web_Design", "Computers_and_Internet/Hardware" => "keyword:computer systems", "Computers_and_Internet/Information_Technology_Consultants" => "Computers_and_Software/IT_Consultants", "Computers_and_Internet/Internet_Service_Providers" => "Internet/ISPs", "Computers_and_Internet/Repairs" => "keyword:computer maintenance", "Computers_and_Internet/Software_Applications" => "keyword:software", "Computers_and_Internet/Web_Design" => "Internet/Web_Design", "Computers_and_Internet/Web_Hosting" => "Internet/ISPs", "Consultancies" => "keyword:consult", "Consultancies/Advertising_Agencies" => "Consultancies/Advertising_and_Marketing/Advertising_Agencies", "Consultancies/Health_and_Safety_Consultants" => "Consultancies/Health_and_Safety_Consultants", "Consultancies/Legal_Services" => "Legal_Services", "Consultancies/Management_Consultants" => "Consultancies/Management_Consultants", "Consultancies/Marketing_Consultants" => "Consultancies/Advertising_and_Marketing/Marketing_Consultants", "Consultancies/Small_Business_Support" => "Consultancies/Small_Business_Support", "Consultancies/Solicitors" => "Legal_Services/Solicitors", "Consultancies/Technology_Consultants" => "Consultancies/Technology_Consultants", "Consultancies/Transport_Consultants" => "Consultancies/Transport_Consultants", "Consultancies/Web_Site_Promotion_Consultants" => "Internet/Web_Design", "Education_and_Training" => "Education_and_Training", "Education_and_Training/Adult_and_Continuing_Education" => "Education_and_Training/Adult_Education", "Education_and_Training/Careers_Guidance" => "Jobs_and_Recruitment/careers_Advice", "Education_and_Training/Language_Schools" => "Education_and_Training/Language_Schools", "Education_and_Training/Primary_Schools" => "keyword:primary school", "Education_and_Training/Reunions_and_Alumni" => "", "Education_and_Training/Secondary_Schools" => "Education_and_Training/Schools", "Education_and_Training/Sixth_Form_Colleges" => "Education_and_Training/Sixth_Form_Colleges", "Education_and_Training/Training_and_Courses" => "Education_and_Training", "Education_and_Training/Universities" => "Education_and_Training/Universities", "Financial_Services" => "Financial_Services", "Financial_Services/Accountants" => "Financial_Services/Accountants", "Financial_Services/Banks_and_Building_Societies" => "Financial_Services/Banks_and_Building_Societies", "Financial_Services/Cash_ISAs" => "keyword:bank", "Financial_Services/Credit_Cards" => "keyword:bank", "Financial_Services/Foreign_Exchange" => "keyword:bank", "Financial_Services/Insurance" => "Financial_Services/Insurance", "Financial_Services/Investment" => "Financial_Services/Investment", "Financial_Services/Loans" => "Financial_Services/Loans", "Financial_Services/Mortgages" => "keyword:mortgage", "Financial_Services/Pensions" => "Financial_Services/Pensions", "Food_and_Drink" => "keyword:food", "Food_and_Drink/Butchers" => "Food_and_Drink/Butchers", "Food_and_Drink/Cafes" => "Food_and_Drink/Cafes", "Food_and_Drink/Caterers" => "Food_and_Drink/Caterers", "Food_and_Drink/Cyber_Cafes" => "Food_and_Drink/Internet_Cafes", "Food_and_Drink/Delicatessens" => "Food_and_Drink/Delicatessens", "Food_and_Drink/Off_Licenses" => "Food_and_Drink/Alcohol_and_Spirits/Off_Licenses", "Food_and_Drink/Pubs_and_Bars" => "Food_and_Drink/Pubs_and_Bars", "Food_and_Drink/Restaurants" => "Food_and_Drink/Restaurants", "Food_and_Drink/Restaurants/American_Restaurants" => "Food_and_Drink/Restaurants/American_Restaurants", "Food_and_Drink/Restaurants/Chinese_Restaurants" => "Food_and_Drink/Restaurants/Chinese_Restaurants", "Food_and_Drink/Restaurants/English_Restaurants" => "Food_and_Drink/Restaurants/English_Restaurants", "Food_and_Drink/Restaurants/French_Restaurants" => "Food_and_Drink/Restaurants/French_Restaurants", "Food_and_Drink/Restaurants/Greek_Restaurants" => "Food_and_Drink/Restaurants/Greek_Restaurants", "Food_and_Drink/Restaurants/Indian_Restaurants" => "Food_and_Drink/Restaurants/Indian_Restaurants", "Food_and_Drink/Restaurants/Italian_Restaurants" => "Food_and_Drink/Restaurants/Italian_Restaurants", "Food_and_Drink/Restaurants/Mexican_Restaurants" => "Food_and_Drink/Restaurants/Mexican_Restaurants", "Food_and_Drink/Restaurants/Oriental_Restaurants" => "Food_and_Drink/Restaurants/Oriental_Restaurants", "Food_and_Drink/Restaurants/Seafood_Restaurants" => "Food_and_Drink/Restaurants/Seafood_Restaurants", "Food_and_Drink/Restaurants/Spanish_Restaurants" => "Food_and_Drink/Restaurants/Spanish_Restaurants", "Food_and_Drink/Restaurants/Thai_Restaurants" => "Food_and_Drink/Restaurants/Thai_Restaurants", "Food_and_Drink/Restaurants/Turkish_Restaurants" => "Food_and_Drink/Restaurants/Turkish_Restaurants", "Food_and_Drink/Restaurants/Vegetarian_Restaurants" => "Food_and_Drink/Restaurants/Vegetarian_Restaurants", "Food_and_Drink/Sandwich_Shops_and_Bakers" => "Food_and_Drink/Bakers", "Food_and_Drink/Take_Aways" => "Food_and_Drink/Take_Aways", "Health" => "Health%", "Health/Acupuncture" => "Health/Alternative_Medicine/Acupuncture_and_Acupressure", "Health/Dentists_and_Dental_Practices" => "Health/Dentists", "Health/General_Practitioners" => "Health/General_Practitioners", "Health/Healthcare" => "Health/Healthcare_Industry/Private_Clinics", "Health/Hospitals_and_Clinics" => "Health/Hospitals_and_Clinics", "Health/Hypnotherapy" => "Health/Hypnotherarpists", "Health/Massage_Therapy" => "", "Health/Opticians" => "keyword:optician", "Health/Osteopaths" => "Health/Osteopaths_and_Chiropractors", "Health/Psychotherapy_and_Counselling" => "Health/Psychotherapists", "Health/Reflexology" => "Health/Alternative_Medicine/Reflexologists", "Health/Veterinary_Surgeons" => "Shopping/Animals/Veterinary_Surgeons", "Health/Yoga_Classes" => "Health/Yoga", "Jobs_and_Recruitment" => "Jobs_and_Recruitment", "Jobs_and_Recruitment/Accounting_and_Finance_Jobs" => "", "Jobs_and_Recruitment/Banking_and_Financial_Jobs" => "", "Jobs_and_Recruitment/Building_Jobs" => "", "Jobs_and_Recruitment/Construction_Jobs" => "", "Jobs_and_Recruitment/Consultancy_Jobs" => "", "Jobs_and_Recruitment/Customer_Service_Jobs" => "", "Jobs_and_Recruitment/Dental_Jobs" => "", "Jobs_and_Recruitment/Engineering_Jobs" => "", "Jobs_and_Recruitment/Health_Jobs" => "Jobs_and_Recruitment/Nursing_Agencies", "Jobs_and_Recruitment/Health_and_Safety_Jobs" => "", "Jobs_and_Recruitment/Human_Resources_Jobs" => "", "Jobs_and_Recruitment/Information_Technology_Jobs" => "", "Jobs_and_Recruitment/Management_and_Executive_Jobs" => "", "Jobs_and_Recruitment/Manufacture_and_Production_Jobs" => "", "Jobs_and_Recruitment/Marketing_Jobs" => "", "Jobs_and_Recruitment/Project_Management_Jobs" => "", "Jobs_and_Recruitment/Public_Sector_Jobs" => "", "Jobs_and_Recruitment/Retail_Jobs" => "", "Jobs_and_Recruitment/Sales_and_Business_Development_Jobs" => "", "Jobs_and_Recruitment/Secretarial_and_Administration_Jobs" => "", "Jobs_and_Recruitment/Travel_and_Hospitality_Jobs" => "", "Legal_Services" => "Legal_Services", "Legal_Services/Barristers" => "Legal_Services/Barristers", "Legal_Services/Compensation_Claims" => "Legal_Services/Compensation_Claims", "Legal_Services/Conveyancing" => "Legal_Services/Conveyancing", "Legal_Services/Insolvency_Practitioners" => "Legal_Services/Insolvency_Practitioners", "Legal_Services/Patent_Agents" => "keyword:patent", "Legal_Services/Solicitors" => "Legal_Services/Solicitors", "Legal_Services/Trade_Mark_Agents" => "keyword:patent", "Legal_Services/Wills" => "Legal_Services/Wills_and_Probate", "Media" => "Media%", "Media/Book_Binders" => "Media/Book_Binders", "Media/Graphic_Design_Consultants" => "Media/Graphic_Design", "Media/Music_and_Audio" => "Media/Audio_and_Music_Production", "Media/News" => "Media/News", "Media/Photography" => "keyword:photograph", "Media/Printers" => "Computers_and_Software/Computer_Retail/Printers", "Media/Publishers" => "Media/Publishers", "Media/Radio" => "Media/Radio", "Media/Technical_Writing" => "Media/Technical_Writing", "Media/Television" => "Media/Television", "Media/Translation_Services" => "Media/Translators", "Motoring" => "Motoring/Car_Dealers", "Motoring/Car_Dealers" => "Motoring/Car_Dealers", "Motoring/Car_Rental" => "Motoring/Vehicle_Rental/Car_Hire", "Motoring/Car_Repairs" => "Motoring/Car_Repairs", "Motoring/Car_Spares_and_Accessories" => "Motoring/Car_Accessories", "Motoring/Driving_Schools" => "Motoring/Driving_Schools", "Motoring/Motorcycles" => "Motoring/Motorcycles", "Music_and_Entertainment" => "keyword:music", "Music_and_Entertainment/Artists" => "Music/Artists", "Music_and_Entertainment/Bands" => "Music/Music_Management_and_Promotion", "Music_and_Entertainment/Brass_Bands" => "", "Music_and_Entertainment/Choirs" => "", "Music_and_Entertainment/Classical_Music" => "", "Music_and_Entertainment/Clubbing" => "Music/Night_Clubs", "Music_and_Entertainment/Festivals_and_Events" => "Media/Entertainment/Corporate_Events", "Music_and_Entertainment/Folk_Music" => "", "Music_and_Entertainment/Jazz_Music" => "", "Music_and_Entertainment/Tuition_and_Music_Lessons" => "Music/Music_Tuition", "Music_and_Entertainment/Venues" => "Music/Venues/Concert_Halls", "Property_and_Accommodation" => "keyword:property", "Property_and_Accommodation/Bed_and_Breakfast" => "Property_and_Accommodation/Guest_Houses", "Property_and_Accommodation/Chartered_Surveyors" => "keyword:Surveyors", "Property_and_Accommodation/Estate_Agents" => "Property_and_Accommodation/Estate_Agents", "Property_and_Accommodation/Guest_Houses" => "Property_and_Accommodation/Guest_Houses", "Property_and_Accommodation/Hotels" => "Property_and_Accommodation/Hotels", "Property_and_Accommodation/Renting_and_Letting_Agents" => "Property_and_Accommodation/Letting_Agents", "Shopping_and_Retail" => "keyword:retail", "Shopping_and_Retail/Antiques" => "Shopping/Antiques", "Shopping_and_Retail/Arts_and_Crafts_Shops" => "Shopping/Arts_and_Crafts_Shops", "Shopping_and_Retail/Baby_Products" => "Shopping/Baby_Products", "Shopping_and_Retail/Beauty_and_Cosmetics" => "Shopping/Cosmetics_and_Beauty_Products", "Shopping_and_Retail/Beds_and_Futons" => "Home_and_Garden/Beds_and_Futons", "Shopping_and_Retail/Bicycles_and_Bicycle_Repairs" => "Shopping/Bicycles_and_Bicycle_Repairs", "Shopping_and_Retail/Book_Shops" => "Shopping/Book_Shops", "Shopping_and_Retail/Bookmakers_and_Gambling" => "keyword:Bookmaker", "Shopping_and_Retail/Camera_Shops" => "Shopping/Camera_Shops", "Shopping_and_Retail/Cards_and_Gifts" => "Shopping/Cards_and_Gifts", "Shopping_and_Retail/Clothing_Accessories" => "Shopping/Fashion_and_Clothing/Accessories", "Shopping_and_Retail/Computer_Games" => "Shopping/Consumer_Electronics/Computer_Games", "Shopping_and_Retail/Confectioners_and_Sweets" => "keyword:Confectioner", "Shopping_and_Retail/Consumer_Electronics" => "keyword:Electrical Goods", "Shopping_and_Retail/Fashion_and_Clothing" => "Shopping/Fashion_and_Clothing", "Shopping_and_Retail/Florists_and_Flowers" => "Shopping/Florists_and_Flowers", "Shopping_and_Retail/Food_and_Drink_Shops" => "keyword:food", "Shopping_and_Retail/Furniture" => "Home_and_Garden/Furniture", "Shopping_and_Retail/Games_and_Puzzles" => "Shopping/Games_and_Puzzles", "Shopping_and_Retail/Health_Foods_and_Vegetarian_Shops" => "Food_and_Drink/Health_Foods_and_Products", "Shopping_and_Retail/Hiking_and_Outdoor" => "Shopping/Hiking_and_Outdoor", "Shopping_and_Retail/Home_and_Garden" => "Home_and_Garden", "Shopping_and_Retail/Jewellers" => "Shopping/Jewellers", "Shopping_and_Retail/Kitchens_and_Bathrooms" => "keyword:kitchen,bathroom", "Shopping_and_Retail/Mens_Clothing" => "Shopping/Fashion_and_Clothing/Mens_Clothing", "Shopping_and_Retail/Mobile_Phones" => "Shopping/Mobile_Phones", "Shopping_and_Retail/Music_and_Records" => "Shopping/CDs_and_Records", "Shopping_and_Retail/Musical_Instruments" => "keyword:musical instrument", "Shopping_and_Retail/Office_Supplies" => "Shopping/Office_Supplies", "Shopping_and_Retail/Pet_Shops" => "Shopping/Animals/Pet_Shops", "Shopping_and_Retail/Shoes_and_Footwear" => "keyword:shoe", "Shopping_and_Retail/Sports_Shops" => "keyword:sports goods", "Shopping_and_Retail/Supermarkets" => "Shopping/Supermarkets", "Shopping_and_Retail/TV_and_Video" => "Shopping/TV_and_Video", "Shopping_and_Retail/Toys" => "Shopping/Toys", "Shopping_and_Retail/Travel_Agents" => "Travel_and_Tourism/Travel_Agents", "Shopping_and_Retail/Windows_and_Conservatories" => "keyword:double glazing", "Shopping_and_Retail/Womens_Clothing" => "Shopping/Fashion_and_Clothing/Womens_Clothing", "Travel_and_Tourism" => "Travel_and_Tourism", "Travel_and_Tourism/Holiday_Accommodation" => "Travel_and_Tourism/Self_Catering_Accommodation", "Travel_and_Tourism/Local_Attractions" => "Travel_and_Tourism/Local_Attractions", "Travel_and_Tourism/Transport" => "keyword:travel" ); //------------------------------------ // what colour tables do we want? // the main central paragraph table $mainParagraphTableColour="lightgrey"; // all others $mainTableColour="orange"; //------------------------------------ $freeMiragoListingsFilename="free2.inc.php"; $paidMiragoListingsFilename="paid2.inc.php"; //------------------------------------------------------------------------------------------------------------------ // The user is either asking for the main city homepage e.g. /Cambridge/ or a subcategory e.g. /Cambridge/Building_And_Construction/Architects // Will be set to either 'homepage' or 'category' $typeOfPage=""; $path=$_SERVER['PHP_SELF']; if($_GET["jason"]) { print"city=$city cityUnderscored=$cityUnderscored path=$path"; } // Remove any trailing slash, as our virtual server emulator should ignore it $path = preg_replace("/\/$/","",$path); // Is this a city homepage or is it a city top level category or a city subcategory? // e.g. is it ukcities.co.uk/cambridge or ukcities.co.uk/cambridge/Jobs or ukcities.co.uk/cambridge/Jobs/IT $pathComponents = explode("/",$path); // pathComponents[0] is always empty as the path starts with a slash $city=$pathComponents[1]; // $category is now the full path without the $city/ or $city $category=str_replace("/$city/","",$path); $category=str_replace("/$city","",$category); $city = str_replace("_"," ",$city); $cityUnderscored=str_replace(" ","_",$city); if($_GET[jason]) { print"city=$city cityUnderscored=$cityUnderscored path=$path"; } // But do we have a top level category or not? $topLevelCategoryComponents = explode("/",$category); $numberOfCategoryLevels = sizeof($topLevelCategoryComponents); // Now we can set uor flag if($numberOfCategoryLevels == 1) { $isTopLevelCategory=1; } else { $isTopLevelCategory=0; } #print""; $topLevelCategory =$topLevelCategoryComponents[0]; //-------------------------------------------------------------------------------------------------- // Get searchTerms include("SentenceFactory.inc.php"); // This was the old searchTerms. It took the lowest level category component and replaced _ with space #$searchTerms = str_replace("_"," ",$topLevelCategoryComponents[sizeof($topLevelCategoryComponents)-1] ); // In the new search terms we use the SentenceFactory.inc.php functionality to take the primary keyword $keywordsSeparatedByCommas = $arrayOfCategoryNounMappings[$category]; // Replace 'comma space' with 'comma' so we do not have whitespace in our array elements $keywordsSeparatedByCommas = str_replace(", ",",",$keywordsSeparatedByCommas); $arrayOfKeywords = explode(",",$keywordsSeparatedByCommas); $searchTerms = returnPrimaryKeywordFromArrayOfKeywords($arrayOfKeywords); //-------------------------------------------------------------------------------------------------- // Let's make a makeshift title tag #$titleTag = "$city ".str_replace("_"," ",$topLevelCategoryComponents[sizeof($topLevelCategoryComponents)-1] ); $titleTag = "$city ".$searchTerms; #print"searchTerms=$searchTerms"; #print"category=$category topLevelCategory = $topLevelCategory"; if ($category) { $typeOfPage="category"; } else { $typeOfPage="homepage"; $titleTag = "$city City Guide"; } ############################################################################### # # # $city has now been set to the name of the city # # # # $typeOfPage has either been set to "category" or "homepage" # # # # if $typeOfPage is set to "category", $category is set to reflect it. # # # ############################################################################### //================================================================================================== $SITE_LOCATION = "$city"; // Directory Database & Advertising Feeds // Directory stuff $DISPLAY_DMOZ_LISTINGS = 1; $DISPLAY_CATEGORIES = 1; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Mirago $DISPLAY_FREE_MIRAGO_WEBSITE_LISTINGS = 0; $DISPLAY_PAID_MIRAGO_WEBSITE_LISTINGS = 1; $MIRAGO_MAXIMUM_NUMBER_OF_FREE_WEB_LISTINGS = 3; $MIRAGO_MAXIMUM_NUMBER_OF_PAID_WEB_LISTINGS = 3; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Thomson $DISPLAY_FREE_THOMSON_WEBSITE_LISTINGS = 0; $DISPLAY_FREE_THOMSON_TEXT_LISTINGS = 0; $DISPLAY_PAID_THOMSON_WEBSITE_LISTINGS = 0; $DISPLAY_FREE_THOMSON_WEBSITE_LISTINGS_IF_NO_DMOZ_RESULTS = 0; $THOMSON_MAXIMUM_NUMBER_OF_FREE_WEBSITE_LISTINGS = 0; $THOMSON_MAXIMUM_NUMBER_OF_PAID_WEBSITE_LISTINGS = 0; $THOMSON_MAXIMUM_NUMBER_OF_FREE_TEXT_LISTINGS = 0; //================================================================================================== //------------------------------------------------------------------------------------------------------------------ // Now that we have the fundamental page variables we can load include files include("categories.inc.php"); include("city.config.inc.php"); include("city.functions.inc.php"); $linkRoot = "https://www.ukcities.co.uk/$city/"; $youAreHere = "You are here: ".convertCategoryToCategoryLinked($city, $linkRoot,$category); $topOfScreenSentence = returnTopOfScreenSentenceFromCategory($city,$category); //================================================================================================================== //================================================================================================================== //================================================================================================================== //------------------------------------------- // Some exceptions to city name for the search feeds. NB this must be done after the breadcrumb, // or links will be wrong $city = str_replace("Brighton And Hove","Brighton",$city); $city = str_replace("Brighton and Hove","Brighton",$city); $SITE_LOCATION = "$city"; //------------------------------------------- //-------------------------------------------------------------------------------------------------------------------- if($typeOfPage == "homepage") { // Let's get the city info $cityDataAssociativeArray = $arrayMappingCityToFieldsAssociativeArray["$city"]; $cityId = $cityDataAssociativeArray["cityId"]; $country = $cityDataAssociativeArray["country"]; $county = $cityDataAssociativeArray["county"]; $city = $cityDataAssociativeArray["city"]; $description = $cityDataAssociativeArray["description"]; $population = $cityDataAssociativeArray["population"]; $yearFounded = $cityDataAssociativeArray["yearFounded"]; $state = $cityDataAssociativeArray["state"]; if (!$description) { if ($county) { $description = "$city is a city in the county of $county. "; } if ($population) { $description .= "The current population of $city is estimated to be $population. "; } if ($yearFounded) { $description .= "$city was granted city status in $yearFounded. "; } $description .= "Full details about this city will be available on this page shortly."; } // end if } // end if($typeOfPage == "homepage") //-------------------------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------------------------ // Let's create the About Cambridge box $aboutCityTableContents=" $description"; $aboutCityTableColour="$mainTableColour"; $aboutCityTitleText="$city City Guide"; $aboutCityTableHTML = createTable(120,$aboutCityTitleText,$aboutCityTableColour,$aboutCityTableContents); //------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------ // Let's create the Statistics box $cityNoSpaces = str_replace(" ", "", $city); $linkToCityCouncil = ''.$city.' City Council'; // Eceptions if ($city == "Brighton"){$linkToCityCouncil="Brighton & Hove City Council";} if ($city == "City of London"){$linkToCityCouncil="Corporation of London";} if ($city == "Hull"){$linkToCityCouncil="Hull City Council";} if ($city == "Newcastle upon Tyne"){$linkToCityCouncil="Newcastle City Council";} if ($city == "Stoke-on-Trent"){$linkToCityCouncil="Stoke Online";} // Let's create the Statistics box $statisticsTableContents=" Population: $population
"; if($yearFounded) { $statisticsTableContents .= 'City Status Granted: '.$yearFounded; } # Kingston upon Hull - listed under Hull # Tyneside? $arrayMappingCityToWebLink["Aberdeen"] = 'Aberdeen Online'; #$arrayMappingCityToWebLink["Armagh"] = 'Armagh Online'; #$arrayMappingCityToWebLink["Bangor"] = 'Bangor Online'; $arrayMappingCityToWebLink["Bath"] = 'Bath Online'; $arrayMappingCityToWebLink["Belfast"] = 'Belfast Online
Book Accommodation: Belfast Hotels'; $arrayMappingCityToWebLink["Birmingham"] = 'Birmingham Online'; $arrayMappingCityToWebLink["Bradford"] = 'Bradford Online'; $arrayMappingCityToWebLink["Brighton"] = 'Brighton City'; $arrayMappingCityToWebLink["Bristol"] = 'Bristol'; $arrayMappingCityToWebLink["Cambridge"] = 'Cambridge Online'; $arrayMappingCityToWebLink["Canterbury"] = 'Canterbury Online'; $arrayMappingCityToWebLink["Cardiff"] = 'Cardiff Online'; $arrayMappingCityToWebLink["Carlisle"] = 'Carlisle'; $arrayMappingCityToWebLink["Chester"] = 'Chester'; $arrayMappingCityToWebLink["Chichester"] = 'Chichester'; $arrayMappingCityToWebLink["Coventry"] = 'Coventry Online'; $arrayMappingCityToWebLink["Derby"] = 'Derby'; $arrayMappingCityToWebLink["Dundee"] = 'Dundee'; #$arrayMappingCityToWebLink["Durham"] = 'Durham'; $arrayMappingCityToWebLink["Edinburgh"] = 'Edinburgh Online'; $arrayMappingCityToWebLink["Ely"] = 'Ely'; $arrayMappingCityToWebLink["Exeter"] = 'Exeter'; $arrayMappingCityToWebLink["Glasgow"] = 'Glasgow Online'; $arrayMappingCityToWebLink["Gloucester"] = 'Gloucester'; $arrayMappingCityToWebLink["Hereford"] = 'Hereford'; $arrayMappingCityToWebLink["Hull"] = 'Kingston upon Hull'; $arrayMappingCityToWebLink["Inverness"] = 'Inverness'; $arrayMappingCityToWebLink["Lancaster"] = 'Lancaster'; $arrayMappingCityToWebLink["Leeds"] = 'Leeds Online'; $arrayMappingCityToWebLink["Leicester"] = 'Leicester'; $arrayMappingCityToWebLink["Lichfield"] = 'VisitLichfield'; $arrayMappingCityToWebLink["Lincoln"] = 'Lincoln'; #$arrayMappingCityToWebLink["Lisburn"] = 'Lisburn'; $arrayMappingCityToWebLink["Liverpool"] = 'Merseyside'; $arrayMappingCityToWebLink["Londonderry"] = 'Londonderry'; $arrayMappingCityToWebLink["Manchester"] = 'Manchester Directory'; $arrayMappingCityToWebLink["Newcastle"] = 'Newcastle/ Tyneside'; $arrayMappingCityToWebLink["Newport"] = 'Newport'; $arrayMappingCityToWebLink["Newry"] = 'Newry'; $arrayMappingCityToWebLink["Norwich"] = 'Norwich Online'; $arrayMappingCityToWebLink["Oxford"] = 'Oxford Online'; $arrayMappingCityToWebLink["Nottingham"] = 'Nottingham Online'; $arrayMappingCityToWebLink["Peterborough"] = 'Peterborough'; $arrayMappingCityToWebLink["Plymouth"] = 'Plymouth'; $arrayMappingCityToWebLink["Portsmouth"] = 'Portsmouth'; $arrayMappingCityToWebLink["Preston"] = 'Preston'; $arrayMappingCityToWebLink["Ripon"] = 'Ripon'; $arrayMappingCityToWebLink["Salford"] = 'Salford'; $arrayMappingCityToWebLink["Salisbury"] = 'Salisbury'; $arrayMappingCityToWebLink["Sheffield"] = 'Sheffield Online'; $arrayMappingCityToWebLink["Southampton"] = 'Southampton Online'; $arrayMappingCityToWebLink["St Albans"] = 'St Albans'; $arrayMappingCityToWebLink["St Davids"] = 'St Davids'; $arrayMappingCityToWebLink["Stirling"] = 'Stirling'; $arrayMappingCityToWebLink["Stoke-on-Trent"] = 'Stoke on Trent Online'; $arrayMappingCityToWebLink["Sunderland"] = 'Sunderland'; $arrayMappingCityToWebLink["Swansea"] = 'Swansea Online'; $arrayMappingCityToWebLink["Truro"] = 'Truro'; $arrayMappingCityToWebLink["Wakefield"] = 'Wakefield'; $arrayMappingCityToWebLink["Wells"] = 'Wells'; #$arrayMappingCityToWebLink["Westminster"] = 'Westminster Online'; $arrayMappingCityToWebLink["Winchester"] = 'Winchester Online'; $arrayMappingCityToWebLink["Wolverhampton"] = 'Wolverhampton'; $arrayMappingCityToWebLink["Worcester"] = 'Worcester Online'; $arrayMappingCityToWebLink["York"] = 'York Online'; // Can we link to a city guide? $linkToCSEWebsite = $arrayMappingCityToWebLink["$city"]; if($linkToCSEWebsite) { $statisticsTableContents.=" County: $county
Country: $country
Local Website:
$linkToCSEWebsite
Local Gov. Website: $linkToCityCouncil "; } //------------------------------------------------- else { $statisticsTableContents.=" County: $county
Country: $country
Local Gov. Website: $linkToCityCouncil "; } $statisticsTableColour="$mainTableColour"; $statisticsTitleText="$city At a Glance"; $statisticsTableHTML = createTable(120,$statisticsTitleText,$statisticsTableColour,$statisticsTableContents); //------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------ // Let's create the Google ads block if ($typeOfPage=="category") { // Hack for Google ads $cityCategoryContents=' '; $cityCategoryColour="$mainTableColour"; $cityCategoryTitleText="advertisements"; $cityCategoryAds= createTable(160,$cityCategoryTitleText,$cityCategoryColour,$cityCategoryContents); } // end if //------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------ // Let's create the City Directory box $directoryTableContents=" Population: 120,000
City Status Granted: 1965 "; // We need to create the categories table by looping through the categories arrays #print"2 topLevelCategory = $topLevelCategory"; foreach($arrayOfTopLevelCategories as $topLevelCategoryInOurArray) { $subcategoriesTextToDisplayUnderMainCategory=""; # print"
Dealing with $topLevelCategoryInOurArray ..."; // Let's get $topLevelCategoryInOurArray's subcats $uppercaseTopLevelCategory = ucfirst($topLevelCategoryInOurArray); $variableNameOfArrayOfSubcategories = '$arrayOf'.$uppercaseTopLevelCategory.'Subcategories'; # print"
Name of variable = $variableNameOfArrayOfSubcategories ..."; // We want to extract all the subcategories out of an array with that name eval ("\$thisCategorysSubcategories = $variableNameOfArrayOfSubcategories; "); # print"
thisCategorysSubcategories = $thisCategorysSubcategories ...
"; # print_r($thisCategorysSubcategories); // Let's grab the first 4 subcategories for ($subcategoryIndex=0; $subcategoryIndex<4; $subcategoryIndex++) { $subcategory = $thisCategorysSubcategories[$subcategoryIndex]; $subcategoryFormatted = str_replace("$topLevelCategoryInOurArray/","",$subcategory); $subcategoryFormatted = str_replace("_"," ",$subcategoryFormatted); $subcategoryFormatted = trim($subcategoryFormatted); # print"
-Adding $subcategory to the subcat list"; if ($subcategoryFormatted) { $subcategoriesTextToDisplayUnderMainCategory .= ''.$subcategoryFormatted.'   '; } } $topLevelCategoryInOurArrayFormatted = str_replace("_"," ",$topLevelCategoryInOurArray); $directoryInnerTable .= '

'.$topLevelCategoryInOurArrayFormatted.' in '.$city.'

'.$subcategoriesTextToDisplayUnderMainCategory.'

'; } #print"3 topLevelCategory = $topLevelCategory"; $directoryTableContents='
'.$directoryInnerTable.'
'; # $directoryTableHTML = $directoryTableContents; #$directoryTableColour="pastelblue"; #$directoryTitleText="$city Directory"; #$directoryTableHTML = createTable(500,$directoryTitleText,$directoryTableColour,$directoryTableContents); //------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------ if ($typeOfPage=="category") { // Let's create the array name which we need to query $uppercaseTopLevelCategory = ucfirst($topLevelCategory); $variableNameOfArrayOfSubcategories = '$arrayOf'.$uppercaseTopLevelCategory.'Subcategories'; #print""; // We want to extract all the subcategories out of an array with that name eval ("\$thisCategorysSubcategories = $variableNameOfArrayOfSubcategories; "); if ( sizeof($thisCategorysSubcategories) > 0 ) { foreach($thisCategorysSubcategories as $subcategory) { $subcategoryFormatted = str_replace("$topLevelCategory/","",$subcategory); $subcategoryFormatted = str_replace("_"," ",$subcategoryFormatted); $subcategoryFormatted = str_replace("Restaurants/","",$subcategoryFormatted); $subcategoryFormatted = str_replace("/"," - ",$subcategoryFormatted); # print"
-Adding $subcategory to the subcat list"; $subcategoriesTextForSideMenu .= '
  • '.$subcategoryFormatted.'
  • '; } // end foreach } // end if $subcategoriesTextForSideMenu=' '; $subcategoriesTableColour="$mainTableColour"; if ($isTopLevelCategory) { $subcategoriesTitleText="In this section"; } else { $subcategoriesTitleText="Related areas"; } $subcategoriesTableHTML = createTable(120,$subcategoriesTitleText,$subcategoriesTableColour,$subcategoriesTextForSideMenu); //--------------------------------------------------------------------------------------------------- // If it is a top level category, we want to include the description if ($isTopLevelCategory) { $topLevelCategoryDescriptionTitle = returnBottomLevelCategoryWithoutAnd($category); $topLevelCategoryDescriptionTextForSideMenu = $associativeArrayOfTopLevelCategoryDescriptions[$topLevelCategory]; $topLevelCategoryDescriptionTableColour="$mainTableColour"; $topLevelCategoryDescriptionTitleText="$topLevelCategoryDescriptionTitle Guide"; $topLevelCategoryDescriptionTableHTML = createTable(120,$topLevelCategoryDescriptionTitleText,$topLevelCategoryDescriptionTableColour,$topLevelCategoryDescriptionTextForSideMenu)."
    "; } // end if //--------------------------------------------------------------------------------------------------- } //------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------ // Let's create the main paragraph text FOR SUBCATEGORIES if (!$isTopLevelCategory) { // We need to import functionality from SentenceFactory.inc.php - imported at top of script $siteTitle = "UK Cities"; // NB first paramter is 0 denoting that this is NOT a topLevel category $mainParagraphBoxText = generateIntroduction(0,"$category",$arrayOfCategoryNounMappings,$siteTitle, $masterSeed, $city); // We need to make some substitutions to the text // Let's get the HTML to substitute in ready $currentUrl = "https://www.ukcities.co.uk".$_SERVER['PHP_SELF']; $parentCategoryHTML = "higher level category"; $homepageClickHereHTML =" Click Here"; $favouritiesClickHereHTML =" Click Here"; $submitClickHereHTML = "Please see the instructions on the front page."; $mainParagraphBoxText = str_replace("", $parentCategoryHTML, $mainParagraphBoxText); $mainParagraphBoxText = str_replace("", $homepageClickHereHTML, $mainParagraphBoxText); $mainParagraphBoxText = str_replace("", $favouritiesClickHereHTML, $mainParagraphBoxText); $mainParagraphBoxText = str_replace("", $submitClickHereHTML, $mainParagraphBoxText); $mainParagraphBoxTableColour="pastelblue"; // "$mainParagraphTableColour"; $mainParagraphBoxTitleText=ucwords("$city $searchTerms"); if(preg_match("/architect/", $category)) { $possibleArchitectsWarning="Note: This category contains architect listings AND RELATED FIRMS AND RESOURCES. Therefore some of the listings below may not necessarily be registered or chartered architects.
    "; $mainParagraphBoxText = $possibleArchitectsWarning.$mainParagraphBoxText; } # $mainParagraphBoxTableHTML = createTable("98%",$mainParagraphBoxTitleText,$mainParagraphBoxTableColour,$mainParagraphBoxText); $mainParagraphBoxTableHTML = "

    $mainParagraphBoxTitleText

    $mainParagraphBoxText
    "; } //------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------ elseif ($isTopLevelCategory) { // Let's create the main paragraph text FOR TOP LEVEL CATEGORIES // We need to import functionality from SentenceFactory.inc.php - imported at top of script $siteTitle = "UK Cities"; // NB first paramter is 1 denoting that this is a topLevel category $mainParagraphBoxText = generateIntroduction(1,"$category",$arrayOfCategoryNounMappings,$siteTitle, $masterSeed, $city); // Now that we have created an introductory paragraph, let's add another copy of the menu of subcategories $mainParagraphBoxText .= "\n\n".$subcategoriesTextForSideMenu; // We need to make some substitutions to the text // Let's get the HTML to substitute in ready # $mainParagraphBoxTableColour="pastelblue"; // "$mainParagraphTableColour"; $mainParagraphBoxTitleText=ucwords("$city $searchTerms"); # $mainParagraphBoxTableHTML = createTable("98%",$mainParagraphBoxTitleText,$mainParagraphBoxTableColour,$mainParagraphBoxText); $mainParagraphBoxTableHTML = "

    $mainParagraphBoxTitleText

    $mainParagraphBoxText
    "; } //------------------------------------------------------------------------------------------------------------------ if ($typeOfPage == "category") { $menu="$topLevelCategoryDescriptionTableHTML $subcategoriesTableHTML"; // searchTerms worked out at top of script # $searchTerms = "$category"; $keywords = $searchTerms; $miragoSearchTerms = $searchTerms; // Get Thomson listings # include("thomsoninclude.php"); // The following variables should now be set // $paidThomsonWebsiteListings // $freeThomsonTextListings // $freeThomsonWebsiteListings # Mirago switched off now # // Get Mirago listings # include("listings-setup.inc.php"); # # if ($DISPLAY_PAID_MIRAGO_WEBSITE_LISTINGS) # { # include($paidMiragoListingsFilename); # } # if ($DISPLAY_FREE_MIRAGO_WEBSITE_LISTINGS) # { # include($freeMiragoListingsFilename); # } // The following variables should now be set // $freeMiragoWebsiteListings // $paidMiragoWebsiteListings // Let's create the body #// JPH Edit #if( strlen($freeThomsonTextListings) <100 ) # { # $freeThomsonTextListings = "

    Error: could not connect to server to retrieve listings

    "; # } //---------------------------------------- # if($SITE_LOCATION == "Kingston upon Hull") # { # $SITE_LOCATION = "Hull"; # } # if($SITE_LOCATION == "Newcastle upon Tyne") # { # $SITE_LOCATION = "Newcastle"; # } # if($SITE_LOCATION == "City of London") # { # $SITE_LOCATION = "London"; # } # if($SITE_LOCATION == "Brighton And Hove") # { # $SITE_LOCATION = "Brighton"; # } if($city=="Kingston upon Hull") { $city="Hull"; } if($city=="St Davids") { $city="Haverfordwest"; } // Get Scoot listings ### include("scootinclude.php"); //---------------------------------------- if($paidThomsonWebsiteListings) { $paidThomsonWebsiteListings .= "
    "; } if($paidMiragoWebsiteListings) { $paidMiragoWebsiteListings .= "
    "; } $PRIMARY_COLOUR = "#ff9933"; //=================================================================================================== $cityUnderscored = str_replace(" ","_", $city); $listingTableName = strtolower($cityUnderscored."_listing"); $ukcitiesCategory = $category; $cseCategory = $arrayMappingUkcitiesCategoriesToCseCategories[$ukcitiesCategory]; $cseCategory = trim($cseCategory); // For ORDER BY RAND($seededRandomNumber) $seededRandomNumber = strlen($ukcitiesCategory.$cseCategory); # print"seededRandomNumber = $seededRandomNumber "; if(preg_match("/keyword/", $cseCategory)) { $keywordConditions=""; $keywordsComponents = explode(":", $cseCategory); $keywords=$keywordsComponents[1]; # print"
    keywords found: $keywords"; $arrayOfKeywords = explode(",",$keywords); if(sizeof($arrayOfKeywords)>1) { foreach($arrayOfKeywords as $aKeyword) { $keywordConditions .= " OR title LIKE '%$aKeyword%' OR businessType LIKE '%$aKeyword%' OR categoryPath LIKE '%$aKeyword%' "; } } else { $aKeyword = $keywords; $aKeyword = str_replace("%", "", $aKeyword); $keywordConditions .= " OR title LIKE '%$aKeyword%' OR businessType LIKE '%$aKeyword%' OR categoryPath LIKE '%$aKeyword%' "; } $Query="SELECT * FROM `$listingTableName` WHERE 1 AND ( 0 $keywordConditions ) AND (`$listingTableName`.state = 'ACTIVE' || `$listingTableName`.state = '') ORDER BY RAND($seededRandomNumber) "; } else { $Query="SELECT * FROM `$listingTableName` WHERE `$listingTableName`.categoryPath LIKE ? AND (`$listingTableName`.state = 'ACTIVE' || `$listingTableName`.state = '') ORDER BY RAND($seededRandomNumber) "; } # ORDER BY `$listingTableName`.title // $Query .= " LIMIT 0,$NUMBER_OF_CITY_GUIDE_LISTINGS" # Get listings $NUMBER_OF_CITY_GUIDE_LISTINGS="20"; $mysqli = new mysqli($sqlhost, $sqlusername, $sqlpassword, $sqldatabase); $statement = $mysqli->prepare($Query); $statement->bind_param('s', $cseCategory); $statement->execute(); $result = $statement->get_result(); if($result->num_rows === 0) { # exit('No rows'); } #$categoryUnderscored = "Building_and_Construction/Architects"; if($_GET["jason"]) { print"
    DISPLAY_TEXT_LISTINGS=$DISPLAY_TEXT_LISTINGS"; } # $listingCountQuery="SELECT * FROM $listingTableName WHERE $listingTableName.categoryPath='$categoryUnderscored' AND ($listingTableName.state = 'ACTIVE' || $listingTableName.state = '') "; # $listingCountResult = mysql_query($listingCountQuery, $Link); #### $totalNumberOfListings = mysql_num_rows($listingCountResult); # print"totalNumberOfListings = $totalNumberOfListings "; # print"----$listingCountQuery-----"; if($_GET["jason"]) { print"----$Query-----"; } // Let's now formulate the toolbar # $toolbarHTML = returnResultsPagesToolbar($offsetPageNumber, $totalNumberOfListings, "$SITE_URL/$scriptDirectory/$mainValue/", $subcategoryPrintable, $NUMBER_OF_CITY_GUIDE_LISTINGS); # print"$toolbarHTML"; //---------------------- //----------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------- // We push those who try to pull the wool over our eyes into an array $arrayContainingDishonestUrls=array(); // Instead of looping and printing the data to screen, we will loop and slot the data into a multidimensional array // We will then pull some paid listings from Mirago and mix them. Finally we will sort them by title or url $arrayContainingPaidUrls=array(); $numberOfListingsForThisCategory=0; while($Row = $result->fetch_assoc()) { # print"
    Adding $listingId"; $listingId = $Row[listingId]; $title = $Row[title]; $street = $Row[street]; $address = $Row[address]; $businessType = $Row[businessType]; $categoryPath = $Row[categoryPath]; $county = $Row[county]; $town = $Row[town]; $postcode = $Row[postcode]; $telephone = $Row[telephone]; $datetimeLastUpdated = $Row[datetimeLastUpdated]; $state = $Row[state]; if(preg_match("/The$/i", $title) ) { $title = preg_replace("/The$/i", "", $title); $title = "The ".$title; } // Remove Ltd etc from title $title = str_ireplace(" Ltd","", $title); $streetUnderscored = str_replace(" ","_", $street); # print"
    title=$title"; // Start of code to get listings //--------------------------------------------------------------------------------------------------------------- # '.$street.' //------------------------------ $townCountyPostcodeArray = array(); if($town) { $townCountyPostcodeArray[] = $town; } if($county) { $townCountyPostcodeArray[] = $county; } if($postcode) { $townCountyPostcodeArray[] = $postcode; } $townCountyPostcode = implode(", ", $townCountyPostcodeArray); //------------------------------ $textListings .= '

    '.$title.'

    '.$businessType.' serving '.$town.' area

    '.$address.', '.$townCountyPostcode.'

    Tel: '.$telephone.'

    '; $numberOfListingsForThisCategory++; // End of code to get listings } // end while if($numberOfListingsForThisCategory >= 6) { $possibleCseAd2 = ""; } else { $possibleCseAd2 = ""; } if(!$numberOfListingsForThisCategory) { $textListings = "No listings currently found in this category. Please try the related categories from the menu to the left of page."; } //=================================================================================================== # \n\n$adsenseCentralColumn\n\n $body =" $mainParagraphBoxTableHTML
    $textListings
    $possibleCseAd2 "; # $rightColumn = $paidThomsonWebsiteListings; } if ($typeOfPage == "homepage") { $menu="$statisticsTableHTML\n
    \n
    $aboutCityTableHTML"; #$partnerBoxTableHTML #

    $body =" $directoryTableHTML "; } //--------------------------- // Let's add in our links to the main articles $articlesMenuBoxText = ' '; $articlesMenuBoxTableColour="$mainTableColour"; // "$mainParagraphTableColour"; $articlesMenuBoxTitleText=ucwords("UK Cities Help"); $articlesMenuBoxTableHTML = createTable(120,$articlesMenuBoxTitleText,$articlesMenuBoxTableColour,$articlesMenuBoxText); // Append to the main menu $menu .= "
    $articlesMenuBoxTableHTML"; //--------------------------- $leftColumn = $menu; $metaDescriptionTag = generateMetaDescription(1,"$category",$arrayOfCategoryNounMappings,$siteTitle, $masterSeed, $city); include("main.template.inc.php"); exit; ?>