$url = $HTTP_SERVER_VARS['HTTP_HOST'];
$page = $_SERVER['REQUEST_URI'];
if ($url != "www.angelsandurchins.co.uk") {
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.angelsandurchins.co.uk".$page);
}
include_once("../admin/func/db_func.php");
include_once("../admin/global.php");
global $img_small, $img_medium, $img_large, $img_xlarge;
$page = get_pages_info("2");
$replacethis = array(" ", "'");
$withthis = array("-", "");
$replacethis_cat_drop = array(' ','class="select-field"');
$withthis_cat_drop = array('all categories ','class="select-field2"');
$replacethis_area_drop = array('Choose Area... All ','class="select-field"');
$withthis_area_drop = array('all London ','class="select-field2"');
$replacethis_area_drop2 = array('Choose Area... All ','class="select-field"');
$withthis_area_drop2 = array('all London ',' class="select-field3" onchange="this.form.submit();"');
//echo 'this = '.$_GET['pid'];
if (isset($_GET['uid'])) {
if ($_GET['mode'] =="event") {
$currenttid = get_whatson_info($_GET['uid']);
$tid = $currenttid['cid'];
$titleevent = ' - '.stripslashes($currenttid['name']);
} else {
$tid = $_GET['uid'];
}
buildTitles_whatson($tid); //here we call our function - pass your ID variable for the current category here
//reverse sort the arrays (sorting on the key not the value)
krsort($titles_arr, SORT_NUMERIC);
krsort($titles_arr, SORT_NUMERIC);
//cycle through arrays - we only need to cycle through one as the keys will be identical on both arrays
foreach($titles_arr as $key => $value) {
//$crumb .= ' - '.stripslashes(htmlspecialchars(str_replace($replacethis,$withthis,$value)));
//we are pulling data from MySQL so we must clean slashes
//and protect against HTML code in the category names
//using stripslashes and htmlspecialchars
$title_name .= ' - '.stripslashes(htmlspecialchars($value)) . ' ';
}
//our crumb will have a trailing > character with a space either side -
//let’s chop that off
$title_name = substr($title_name, 0, strlen($titles) - 1);
//echo $title_name;
//$title_name = ' - '.get_dcategory_name_by_uid($_GET['pid']);
}
?>
if (($_GET['mode'] =="search") || ($_GET['mode'] =="search_a") || ($_GET['mode'] =="search_d") || ($_GET['mode'] =="search_r") || ($_GET['mode'] =="search_f")) {
?>
if (isset($_GET['area'])) {
$areatext = "in
".$_GET['area']." ";
}
//search results
if (($_GET['sstring'] == "venue, show, activity, etc...") || ($_GET['sstring'] == "")){
$sstring = "";
echo '
Your search produced the following results
';
} else {
$sstring = $_GET['sstring'];
echo '
Your search for "'.$sstring.'" '.$areatext.'produced the following results
';
}
$cat = $_GET['pid'];
$area = $_GET['area'];
$date = $_GET['dates'];
if (strlen($sstring) > 0) {
$hiddensearch = '
';
}
if (strlen($cat) > 0) {
$hiddencat = '
';
}
if (strlen($area) > 0) {
$hiddenarea = '
';
}
if (strlen($date) > 0) {
$hiddendate = '
';
}
if ($_GET['mode'] == "search") {
$searchorder = "search";
} elseif ($_GET['mode'] == "search_a") {
$searchorder = "search_a";
} elseif ($_GET['mode'] == "search_d") {
$searchorder = "search_d";
} elseif ($_GET['mode'] == "search_r") {
$searchorder = "search_r";
} elseif ($_GET['mode'] == "search_f") {
$searchorder = "search_f";
}
//echo $searchorder;
?>
$paging = search_whatson_fe($sstring,$cat,$area,$date,$searchorder);
$isResults = $paging->isResult();
if(!$isResults == 0)
{
while($current=$paging->result_assoc())
{
$imagefile = $_SERVER['DOCUMENT_ROOT'].'/whatson/images/'.$current['uid'].'.jpg';
if( file_exists($imagefile) ) {
$r_image = '
';
}
/*if (strlen(get_dates($current['uid'])) > 5) {
$dates = str_replace('Dates,','
Dates: ',get_dates($current['uid'])).'
';
} else {
$dates = "";
}*/
if ($current['dates']) {
$dates = stripslashes($current['dates']).'
';
}
if ($current['free']) {
$f_flag = ' '.make_flag("f");
}
if ($current['last_chance']) {
$lc_flag = ' '.make_flag("lc");
}
if ($current['book_ahead']) {
$ba_flag = ' '.make_flag("ba");
}
if ($current['recommended']) {
$r_flag = ' '.make_flag("r");
}
if (strlen(stripslashes(strip_tags($current['details']))) > 50) {
$rdescrip = stripslashes(substr(strip_tags($current['details']),0,50)).' ...';
} else {
$rdescrip = stripslashes(strip_tags($current['details']));
}
$venue = get_venue_info($current['vid']);
echo '
';
$r_image = '';
$f_flag = '';
$lc_flag = '';
$ba_flag = '';
$r_flag = '';
}
echo $paging->print_link2();
} else {
echo '
No events found! Please check your spelling. Alternatively, you may wish to broaden your search criteria.
';
}
?>
Not found what you're looking for?
} elseif (($_GET['mode'] =="browse") || ($_GET['mode'] =="browse_d") || ($_GET['mode'] =="browse_r") || ($_GET['mode'] =="browse_f")) {
?>
if ($_GET['uid'] != 0) {
$get_sub_categories = get_wcategory($_GET['uid']);
$count_categories = count_sub_wcategory($_GET['uid']);
$categories_count = mysql_fetch_array($count_categories);
if ($categories_count['acount'] != 0) {
echo '
Narrow your search ';
$rows = 0;
while($currentsubcat = mysql_fetch_array($get_sub_categories))
{
$rows++;
echo '
'.stripslashes($currentsubcat['name']).' ('.get_uids_whatson($currentsubcat['uid']).') ';
$num_items = 0;
$count = 0;
//echo $rows;
if ($rows == 3) {
echo '
';
$rows = 0;
}
}
echo '
';
}
echo '
'.stripslashes(get_wcategory_name_by_uid($_GET['uid'])).' currently has '.get_uids_whatson($_GET['uid']).' Events
';
$num_items = 0;
$count = 0;
?>
if ($_GET['mode'] == "browse") {
$searchorder = "browse";
} elseif ($_GET['mode'] == "browse_d") {
$searchorder = "browse_d";
} elseif ($_GET['mode'] == "browse_r") {
$searchorder = "browse_r";
} elseif ($_GET['mode'] == "browse_f") {
$searchorder = "browse_f";
}
//echo $searchorder;
$paging = browse_whatson_fe($_GET['uid'],$searchorder);
$isResults = $paging->isResult();
if(!$isResults == 0)
{
while($current=$paging->result_assoc())
{
$imagefile = $_SERVER['DOCUMENT_ROOT'].'/whatson/images/'.$current['uid'].'.jpg';
if( file_exists($imagefile) ) {
$r_image = '
';
}
/*if (strlen(get_dates($current['uid'])) > 5) {
$dates = str_replace('Dates,','
Dates: ',get_dates($current['uid'])).'
';
} else {
$dates = "";
}*/
if ($current['dates']) {
$dates = stripslashes($current['dates']).'
';
}
if ($current['free']) {
$f_flag = ' '.make_flag("f");
}
if ($current['last_chance']) {
$lc_flag = ' '.make_flag("lc");
}
if ($current['book_ahead']) {
$ba_flag = ' '.make_flag("ba");
}
if ($current['recommended']) {
$r_flag = ' '.make_flag("r");
}
if (strlen(stripslashes(strip_tags($current['details']))) > 50) {
$rdescrip = stripslashes(substr(strip_tags($current['details']),0,50)).' ...';
} else {
$rdescrip = stripslashes(strip_tags($current['details']));
}
$venue = get_venue_info($current['vid']);
echo '
';
$r_image = '';
$f_flag = '';
$lc_flag = '';
$ba_flag = '';
$r_flag = '';
}
echo $paging->print_link_browse();
} else {
echo '
No events found!
';
}
} else {
echo '
What\'s On currently has '.get_uids_whatson($_GET['uid']).' Events
';
$num_items = 0;
$count = 0;
$get_categories = get_wcategory($_GET['uid']);
while($currentcat = mysql_fetch_array($get_categories))
{
echo '
'.stripslashes($currentcat['name']).' ('.get_uids_whatson($currentcat['uid']).') ';
$num_items = 0;
$count = 0;
$get_sub_categories = get_wcategory($currentcat['uid']);
$count_categories = count_sub_wcategory($currentcat['uid']);
$categories_count = mysql_fetch_array($count_categories);
if ($categories_count['acount'] != 0) {
echo '
';
$rows = 0;
while($currentsubcat = mysql_fetch_array($get_sub_categories))
{
$rows++;
echo '
';
if ($rows == 2) {
echo '
';
$rows = 0;
}
}
echo '
';
}
echo '
';
}
}
?>
} elseif ($_GET['mode'] =="event") {
$current = get_whatson_info($_GET['uid']);
$updateviews = update_views_whatson($current['uid']);
?>
$imagefile = $_SERVER['DOCUMENT_ROOT'].'/whatson/images/'.$current['uid'].'.jpg';
if( file_exists($imagefile) ) {
$image = '
';
}
if ($current['free']) {
$f_flag = ' '.make_flag("f");
}
if ($current['last_chance']) {
$lc_flag = ' '.make_flag("lc");
}
if ($current['book_ahead']) {
$ba_flag = ' '.make_flag("ba");
}
if ($current['recommended']) {
$r_flag = ' '.make_flag("r");
}
?>
echo $image; ?>
echo stripslashes($current['name']); ?>
/*if (strlen(get_dates($current['uid'])) > 5) {
echo '
'.str_replace('Dates,','
Dates: ',get_dates2($current['uid']));
}*/
?>
if (strlen($current['dates']) > 0) {
echo '
Dates: '.stripslashes($current['dates']);
}
?>
if (strlen($current['times']) > 0) {
echo '
Times: '.stripslashes($current['times']);
}
?>
if (strlen($current['ages']) > 0) {
echo '
Ages: '.$current['ages'];
}
?>
if (strlen($current['price']) > 0) {
echo '
Price: '.$current['price'];
}
?>
echo stripslashes($current['details']); ?>
$venue = get_venue_info($current['vid']); ?>
Venue Details:
echo stripslashes($venue['name']); ?>
if (strlen($venue['address']) > 0)
echo '
'.stripslashes(str_replace("\n", " ",$venue['address']));
?>
if (strlen($venue['postcode']) > 0)
echo stripslashes($venue['postcode']);
?>
if (strlen($venue['phone']) > 0)
echo '
Tel: '.stripslashes($venue['phone']);
?>
if (strlen($venue['email']) > 0)
echo '
Email: '.$venue['email'].' ';
?>
if (strlen($venue['link']) > 0)
echo '
Website: '.stripslashes($venue['link']).' ';
?>
General Information:
echo stripslashes($venue['details']); ?>
Map:
}
?>
} else {
?>
#### ROOT PAGE ####
?>
echo stripslashes($page['name']); ?>
Browse What's On
//$get_categories = get_wcategory($pid);
$getcats = get_pages_whatson_cats();
$cats = explode(",", $getcats);
echo '
';
echo '
';
$total = 0;
$rows = 0;
//while($current = mysql_fetch_array($get_categories))
foreach($cats as $cat_item)
{
if (strlen($cat_item) != 0) {
$total++;
if ($total <= 12) {
$current = get_wcategory_info($cat_item);
$rows++;
echo '
';
//echo $rows;
if ($rows == 2) {
echo '
';
$rows = 0;
}
}
}
}
echo '
';
echo '
';
?>
Search What's On for kids in London
What's On for kids: recommended
$getrec = get_pages_whatson_recommended();
//echo $getrec;
$rec = explode(",", $getrec);
$rec_count = 0;
foreach($rec as $rec_item) {
//echo $rec_item;
if ($rec_count < 3) {
if (strlen($rec_item) != 0) {
$unique_rec = get_whatson_info($rec_item);
if ( ($unique_rec['expires'] >= mktime(0, 0, 0, date("m") , date("d"), date("Y"))) || ($unique_rec['expires'] == "") ) {
?>
if (strlen(stripslashes(strip_tags($unique_rec['details']))) > 20) {
$rdescrip = stripslashes(substr(strip_tags($unique_rec['details']),0,20)).' ...';
} else {
$rdescrip = stripslashes(strip_tags($unique_rec['details']));
}
?>
$imagefile_r = $_SERVER['DOCUMENT_ROOT'].'/whatson/images/'.$unique_rec['uid'].'.jpg';
if( file_exists($imagefile_r) ) {
$r_image = '
';
$tmpName_r = 'http://'.$_SERVER['HTTP_HOST'].'/image.jpg?uid='.$unique_rec['uid'].'&wo=1&w='.$img_small;
list($width_r, $height_r, $type_r, $attr_r) = getimagesize($tmpName_r);
$addheight_r = ' style="height:'.$height_r.'px "';
}
echo '
';
$r_image = '';
?>
}
$rec_count++;
}
}
}
?>
Features
$features = explode(",", $page['features']);
$features_count = 0;
foreach($features as $feature) {
if ($features_count < 3) {
if (strlen($feature) != 0) {
$unique_feature = get_news_info($feature);
?>
if (strlen(stripslashes(strip_tags($unique_feature['descrip']))) > 100) {
$fdescrip = stripslashes(substr(strip_tags($unique_feature['descrip']),0,100)).' ...';
} else {
$fdescrip = stripslashes(strip_tags($unique_feature['descrip']));
}
?>
$imagefile_f = $_SERVER['DOCUMENT_ROOT'].'/news/images/'.$unique_feature['uid'].'.jpg';
if( file_exists($imagefile_f) ) {
$f_image = '
';
$tmpName_f = 'http://'.$_SERVER['HTTP_HOST'].'/image.jpg?uid='.$unique_feature['uid'].'&n=1&w='.$img_small;
list($width_f, $height_f, $type_f, $attr_f) = getimagesize($tmpName_f);
$addheight_f = ' style="height:'.$height_f.'px "';
}
echo '
';
$f_image = '';
?>
}
$features_count++;
}
}
?>
include_once("../includes/banner2.php");
?>
include_once("../includes/sponsoredlinks.php");
?>
Competitions
$competitions = get_competitions_fe_homepages();
while($competition = mysql_fetch_array($competitions))
{
echo '
';
}
?>
}
?>
include_once("../includes/bookmarks.php");
?>
if (isset($_GET['mode'])) {
include_once("../includes/right_wide.php");
} else {
include_once("../includes/right_narrow.php");
}
?>
include_once("../includes/footer.php");
?>