getArena($_GET['aid']); } else if ($_GET['akey']) { $arena = $em->getArena("WHERE url_key = '{$_GET['akey']}'"); } if ($arena) { GeneralUse::redirect($ebm->getArenaUrl($arena), 301); } else { $_SESSION['failure'] .= "Sorry, we could not find that arena. "; GeneralUse::back(); } } // exit; // header("Content-type: text/plain"); // print_r($_SERVER); // print_r($_SESSION); // print_r($_REQUEST); // exit; $title = ""; $description = ""; $keywords = ""; if ($_REQUEST['action']) { switch (strtolower($_REQUEST['action'])) { case 'guest_review': $arena = $em->getArena($_POST['aid']); $_SESSION['guest']['name'] = $_POST['guest_name']; $_SESSION['guest']['email'] = $_POST['guest_email']; if ($arena) { if (!$_SESSION['guest']['is_human']) { $_SESSION['guest']['is_human'] = $ebm->isCaptchaSuccess($_POST); } if ($_SESSION['guest']['is_human']) { $review = array( 'review_type' => 'arena' ,'review_type_id' => $arena['id'] ,'rating' => $_POST['rating'] != '' ? $_POST['rating'] : null ,'review' => $_POST['guest_review'] ,'guest_name' => $_POST['guest_name'] ,'guest_email' => $_POST['guest_email'] ,'approved' => 0 ); if ($review['id'] = $conn->insertRow('review', $review)) { $_SESSION['success'] .= "Thank you for your comments. If they're approved, you should see them on the website soon. "; $arena_url = $ebm->getArenaUrl($arena); $email_params = array( 'table_name' => 'review' ,'table_id' => $review['id'] ,'save_message' => true ); // email Free Arenas $email_subject = 'New Guest Review'; $email_to = 'reviews@freearenas.com'; $email_from = $review['guest_email'] ? $review['guest_email'] : 'no-reply@freearenas.com'; $email_message = "

" . $review['review'] . "

"; if ($_POST['rating'] !== '') { $email_message .= "

Rating: " . $review['rating'] . "

"; } if ($review['guest_name']) { // $from = "{$review['guest_name']} <{$review['guest_email']}>"; $from = "no-reply@freearenas.com"; $email_subject .= ' from ' . $review['guest_name']; $email_message .= "


{$review['guest_name']}
{$review['guest_email']}

"; } $email_message .= "

Arena:
" . $_SERVER['SITE_ROOT'] . $arena_url . "

"; $email_message .= "

Review:
" . $_SERVER['SITE_ROOT'] . "/admin/reviews/manage.php?id=" . $review['id'] . "

"; $email_message .= "

" . "Approve" . " | " . "Deny" . " | " . "Delete" . " | " . "Reply" . "

"; $emailer->send($email_to, $email_subject, $email_message, $email_from, $email_params); /* DON'T REPLY TO USER. THIS IS WHERE SPAM IS COMING FROM * // email reviewer $email_to = $review['guest_email']; $email_from = 'support@freearenas.com'; $email_subject = "Thank you for your review of {$arena['name']}"; $email_message = ""; if ($review['guest_name']) { list($guest_name) = explode(' ', $review['guest_name']); $email_message .= "

{$guest_name},

"; } $email_message .= "

Thank you for taking the time to write this review. If it's approved, you'll get another email telling you so.

"; $email_message .= "

{$review['review']}

— {$review['guest_name']}

"; $email_message .= "

To avoid this approval process in the future, just sign up for a free account at FreeArenas.com. In addition to simplifying your reviews, you'll also be able to put together collections of arenas, log your travels, create your own areans, add photos and videos. and earn reputation points.

"; $email_message .= "

Please let us know what we can do to improve your experience on our website. You can use the \"Feedback\" tab at the bottom of the site or just send us an email at feedback@freearenas.com. We do what we can to make it easy for you to

"; $email_message .= "

Find, Share, and GET OUT THERE!

"; $emailer->send($email_to, $email_subject, $email_message, $email_from, $email_params); */ GeneralUse::redirect($arena_url); } else { $failure .= "Sorry! Something went wrong and we were not able to save your comments. Please try again. If the problem continues, please leave feedback so we can get the problem fixed. Thank you. "; } } else { $failure .= "Sorry! We could not verify that you're a human. If you really are, please try again. "; } } else { $failure .= "Arena not found. "; GeneralUse::goBack(); } break; } } if ($_GET['akey']) { $arena = $ebm->getArenaByKey($_GET['akey'], true); } else if ($_REQUEST['aid']) { $arena = $em->getArena($_REQUEST['aid']); if ($arena) { GeneralUse::redirect($ebm->getArenaUrl($arena), 301); } else { $_SESSION['failure'] .= " We couldn't find that arena. "; GeneralUse::back('/'); } } if ($arena['id']) { if (!$arena['active']) { if ($ebm->isAdmin()) { $warning .= "This arena is currently marked inactive and is not viewable to the public. "; } else { $_SESSION['failure'] .= 'The listing for ' . $arena['name'] . ' is not available at this time. Check out one of these nearby locations. '; if ($arena['nearest_city']) { $redirect = $ebm->getCleanSearchUrl(['z'=>$arena['nearest_city']]); } else { $redirect = $ebm->getCleanSearchUrl(['z'=>'my location']); } GeneralUse::redirect($redirect); } } $arena_attributes = $ebm->getArenaAttributes($arena['id']); $ebm->fillArenaAttributes($arena); // $arena['routes'] = $em->getArenaRoutes("WHERE arena_id = {$arena['id']}"); // ksort($arena['routes']); $arena['routes'] = $ebm->getArenaRoutes($arena['id']); // Logging::comment($arena, 'arena'); $page_title = $arena['arena_name']; } else { // $err_msg = "That arena is no longer there."; $_SESSION['failure'] .= $err_msg; $redirect = "/"; // $err_msg .= "\n" . StringMgr::tab(print_r($_GET, true)); if ($_GET['akey']) { if (stristr($_GET['akey'], '-near-')) { list($arena_name, $nearest_city) = explode('-near-', $_GET['akey']); } else if (stristr($_GET['akey'], '-in-')) { list($arena_name, $nearest_city) = explode('-in-', $_GET['akey']); } if ($arena_name && $nearest_city) { $arena_name = strtolower(StringMgr::strAsTitle($arena_name)); $nearest_city = strtolower(StringMgr::strAsTitle($nearest_city)); $possible_matches = $em->getArenas("WHERE arena_name LIKE '" . $conn->sqlString($arena_name) . "'"); if (count($possible_matches) == 1) { $arena = array_shift($possible_matches); $_SESSION['failure'] .= " We couldn't find that arena. This is our best guess. "; $redirect = $ebm->getArenaUrl($arena); } else { $_SESSION['failure'] .= " We couldn't find that arena. Let's try searching. "; $redirect = "/?q={$arena_name}&z={$nearest_city}&s=1&rd=1"; // Logging::writeErrorLog($_SESSION['failure'] . " (Redirected to: {$redirect})"); } } } $page_error = array(); // $page_error['error_code'] = 404; $page_error['url'] = $_SERVER['REQUEST_URI']; $page_error['referer'] = $_SERVER['HTTP_REFERER']; $page_error['user_agent'] = $_SERVER['HTTP_USER_AGENT']; $page_error['ip'] = $_SERVER['REMOTE_ADDR']; $page_error['redirect'] = $redirect; $page_error['notes'] = $_SESSION['failure']; $conn->insertRow('page_error', $page_error); GeneralUse::redirect($redirect); } if ($arena["activity_ids"]) { $activities = $em->getActivities("WHERE at.activity_id IN ({$arena["activity_ids"]})"); } // $reviews = $em->getReviews("WHERE review_type = 'arena' AND review_type_id = '{$arena['arena_id']}'"); Logging::commentOff(); // Logging::commentOn(); // $images = $ebm->getImages("arena", $arena['arena_id']); // Logging::comment($images, 'images'); $media_items = $ebm->getArenaMedia($arena); Logging::comment($media_items, "\$media_items"); Logging::commentRestore(); $videos = $em->getVideos("WHERE arena_id = '{$arena['id']}'", "ORDER BY sort_order"); $activities_list = $ebm->getActivitiesList($arena['activities']); $title = $page_title; if ($activities_list) { $title .= " - " . $activities_list; } if ($arena['nearest_city']) { $title .= " near " . $arena['nearest_city']; } else if ($arena['state']) { $title .= " in " . $arena['state']; } // Logging::comment($arena, 1, 'arena'); $description_location = ""; if ($arena['nearest_city']) { $description_location = " near " . $arena['nearest_city']; } else if ($arena['state']) { $description_location = " in " . $arena['state']; } // $description = $page_title // . " is a great place to " . $activities_list . $description_location . ". " // . strip_tags($arena['description']); $description = $activities_list . ' at ' . $arena['name'] . $description_location . ". Maps, directions, and reviews. "; if ($arena['description']) { $description .= $ebm->getArenaDescriptionText($arena['description']); $fb_og['description'] = StringMgr::singleLine($ebm->getArenaDescriptionText($arena['description'].$arena['description'].$arena['description'])); } // $description = str_replace('"', """, $description); Logging::comment($description, '$description'); Logging::comment($arena['description'], '$arena[description]'); if (is_array($media_items)) { foreach ($media_items as $media_item) { $fb_og['image'][] = $media_item['url']; } } $fb_og['type'] = 'place'; $fb_og['type'] = 'article'; $fb_og['title'] = $title; /** TESTING *** if (count($images) || count($videos)) { if (is_array($images) && count($images)) { $image = array_shift($images); $img_350 = $ebm->getSizedArenaImage($arena['id'], 350, $image); Logging::comment($img_350, 0, '$img_350'); } if (is_array($images) && count($images)) { foreach ($images as $i => $image) { $img_650 = $ebm->getSizedArenaImage($arena['id'], 600, $image); $img_150 = $ebm->getSizedArenaImage($arena['id'], 150, $image); Logging::comment($img_600, 0, '$img_600'); Logging::comment($img_150, 0, '$img_150'); } } } ** TESTING ***/ $nearby_order = "ORDER BY distance ASC LIMIT 20"; $nearby_camping = $ebm->getNearArenas($arena['gps'], array('activity_id' => 177, 'order' => $nearby_order)); if ($arena['activity_ids'] != '177') { // other arenas nearby (not solely campsites) Logging::comment($arena['activity_ids'], '$arena[activity_ids]'); $nearby_activity_ids = explode(",", $arena['activity_ids']); Logging::comment($nearby_activity_ids, 'nearby_activity_ids'); if (in_array('177', $nearby_activity_ids)) { unset($nearby_activity_ids[array_search('177', $nearby_activity_ids)]); } Logging::comment($nearby_activity_ids, 'nearby activity_ids'); $nearby_similar = $ebm->getNearArenas($arena['gps'], array('activity_ids' => implode(',', $nearby_activity_ids), 'order' => $nearby_order)); } else { $nearby_other = $ebm->getNearArenas($arena['gps'], array('order' => $nearby_order)); } if ($arena['show_google_directions']) { $google_directions_url = "https://maps.google.com/maps?daddr=" . $arena['gps']; $google_directions_mobile_url = $google_directions_url; if ($_SESSION['search']['address']) { $google_directions_url .= "&saddr=" . $_SESSION['search']['address']; } } $creator = $em->getUser($arena['created_by']); // $writer = ?; $show_map = !$arena['keep_out']; // arena references $constraint_arr = array(); $constraint_arr[] = "ar.arena_id = {$arena['id']}"; // if ($ebm->isSuperAdmin()) { $constraint_arr[] = "ar.status = '200' OR status = '' OR status IS NULL"; // } // else { // $constraint_arr[] = "ar.status = '200'"; // } if (!$ebm->isEditor()) { $constraint_arr[] = "ar.reference_url NOT LIKE '%backcountrysecrets.com%'"; $constraint_arr[] = "ar.reference_url NOT LIKE '%alltrails.com%'"; $constraint_arr[] = "ar.reference_url NOT LIKE '%theoutbound.com%'"; $constraint_arr[] = "ar.reference_url NOT LIKE '%outdoorproject.com%'"; } $constraints = "WHERE (" . implode(") AND (", $constraint_arr) . ")"; // Logging::commentOn(); $arena_references = $em->getArenaReferences($constraints, "ORDER BY status DESC, title, source_data, reference_url"); // shorg if ($ebm->isEditor()) { $is_shorg = false; foreach ($arena_references as $ref) { if (stristr($ref['reference_url'], 'swimmingholes.org')) { $is_shorg = true; break; } } if ($is_shorg) { $shorg = $conn->getRow('shorg', "WHERE arena_id = {$arena['id']}"); $arena['description'] .= "\n
" . $shorg['desc'] . "
"; $arena['directions'] .= "\n
" . $shorg['directions'] . "
"; } } $SUB_CONTENT = ""; include_once($DOCUMENT_TOP); ?> " /> " /> " /> " />
' . $arena['address'] . ''; } if ($arena['nearest_city']) { $itemprop_address_arr[] = '' . trim(array_shift(explode(',', $arena['nearest_city']))) . ''; } if ($arena['state']) { $itemprop_address_arr[] = '' . $arena['state'] . ''; } echo implode(',', $itemprop_address_arr); ?>
,
' . $arena['address'] . ''; } if ($arena['nearest_city']) { $itemprop_address_arr[] = '' . trim(array_shift(explode(',', $arena['nearest_city']))) . ''; } if ($arena['state']) { $itemprop_address_arr[] = '' . $arena['state'] . ''; } echo implode(',', $itemprop_address_arr); ?>
getSizedArenaImage($arena['id'], 600, $image); ?>
,
*/?> getGoogleMapImage($arena, 1000, 250, 16); } // else { // $cover_image_src = $_SERVER['SITE_ROOT'] . "/images/cache/{$arena['id']}/hero/{$cover_image['filename']}"; // } ?>
includeBlock('arenas/social-media-small', array( 'arena' => $arena ,'full_page_url' => $full_page_url ,'meta_description' => $meta_description )); */ ?>
displayRating($arena['rating'], $arena['rating_count']) ?>

includeBlock('arenas/save_buttons', array('arena'=>$arena)); ?>
displayActivities($arena['activity_ids'], false); ?>
displayArena($arena) ?>
isArenaEditable($arena) ? '' : 'Suggest ' ?>Edit isSuperAdmin()) { ?> Source
Flag as NOT Free

setArenaNearestCity($arena); $distance_from_nearest_city = $edm->getRelativeDistanceToNearestCity($arena, 1); // Logging::comment($filter, '$filter'); // Logging::comment($_SESSION['search'], '$_SESSION[search]'); if ($_SESSION['search']['address'] && $_SESSION['search']['gps']) { if ($_SESSION['search']['address'] == $_SESSION['search']['gps']) { // TODO: Move this somewhere global // getting address from gps $_SESSION['search']['address'] = $geocoder->addressByGps($_SESSION['search']['gps']); } $user_address = $_SESSION['search']['address']; if ($_SESSION['search']['address_src'] == 'cookie_gps') { // got address from a cookie $user_address = 'Your Location'; } // Logging::comment($user_address, '$user_address'); $distance_from_search_address = $ebm->getRelativeDistance($arena['gps'], $_SESSION['search']['gps'], $user_address); } if ($distance_from_search_address || $distance_from_nearest_city) { ?>
getArenaAttributeValue($attribute); if (!$attr_val) continue; $attr_text = trim($attribute['prefix'] . ' ' . $attr_val . ' ' . $attribute['suffix']); if ($attr_text == "Yes" ) { $yes_attrs[] = $attribute['frontend_label']; } else if ($attr_text == "No") { $no_attrs[] = $attribute['frontend_label']; } else { ?>
Address:
GPS: ddToDms($arena['gps']) ?>
Maps | Directions
State:
:
Trails/Routes:

(.*?)<\/p>/"; preg_match_all($pattern, $ad_description, $matches); // Logging::comment($matches, "\$matches"); if ($matches && count($matches[0]) > 3) { $mid_description_ezoic_ads = array( array( 'id' => '613' ,'name' => 'arena_after_3rd_paragraph' ,'location' => 'mid_content' ) ,array( 'id' => '614' ,'name' => 'arena_after_6th_paragraph' ,'location' => 'mid_content' ) ,array( 'id' => '615' ,'name' => 'arena_after_9th_paragraph' ,'location' => 'mid_content' ) ); foreach ($matches[0] as $i => $p) { if (($i + 1) % 3 == 0 && ($i + 1) != count($matches[0])) { // every 3rd paragraph but not the last paragraph $ezoic_ad_data = array_shift($mid_description_ezoic_ads); $ezoic_ad = "
"; $ad_description = str_replace($p, $p . "\n" . $ezoic_ad, $ad_description); } } } ?> includeBlock("arenas/routes-summary-table", ['routes' => $arena['routes']]) ?> getArenaEditors($arena['id']); if ($editors) { ?>
displayProfilePhoto($editor); ?>
getQueryArray(" SELECT el.created_by AS user_id , MAX(creation_date) AS last_update FROM event_log_v2 el WHERE el.event_type = 'UPDATE' AND table_name = 'arena' AND event_data LIKE '%\"key\":\"desc\"%' AND pk_value = {$arena['id']} GROUP BY user_id "); foreach ($edits as $e => &$edit) { $edit['editor'] = $em->getUser($edit['user_id']); if (in_array($edit['editor']['username'], ['freearenas','endovereric'])) { unset($edits[$e]); } } if ($edits) { ?>
displayProfilePhoto($editor); ?> Written by
isSuperAdmin()) exit; if ($arena['national_park_id']) { $national_park = $em->getNationalPark($arena['national_park_id']); $np_references['np-' . $arena['national_park_id']] = array( 'title' => "{$national_park['name']} National Park Itinerary" ,'reference_url' => $ebm->getJgtsUrl($national_park) ,'description' => "This {$national_park['name']} National Park Itinerary will help you get started as you plan your vacation to {$national_park['name']} National Park." ); $arena_references = array_merge($np_references, $arena_references); } ?>

More Information

includeBlock('arenas/references', ['arena_references' => $arena_references]); ?> Add Resource

Link to another great resource

*/ ?> getBlock('arenas/ethics-guide.php', ['arena'=>$arena]) ?>

Directions

getNearestCityDirections($arena); if ($google_directions) { ?>

From ( min.) ( mi.)

Do not follow Google Directions.

or

getImageTitleText($main_media_item); ?> " title="" target="_blank"> getImageTitle($main_media_item) ?> <?= $image_title_text ?> getVideoMainImage($main_media_item, array('rel'=>'overlay')); break; } } ?>
getImageTitleText($media_item); $image_title = $ebm->getImageTitle($media_item); ?> <?= $image_title_text ?> getVideoThumbnail($media_item, array('rel'=>'overlay')); break; } } } ?>
isBot()) { if ($arena['national_park_id']) { $edm->includeBlock('national-park-itinerary', ['national_park_id'=>$arena['national_park_id']]); } include(BLOCKS . "arena-ads.php"); include(BLOCKS . "weather-widget.php"); } ?>
displayProfilePhoto($creator) ?>

Added by

&oe=utf-8&client=firefox-a&ie=UTF8&hl=en&ll=&spn=0.123752,0.205994&z=12&source=embed&t=h">View Larger Map */?>

hasAccess("/arenas/manage-route.php")) { ?> Trails

includeBlock('arenas/route-charts', ['routes'=>$arena['routes']]) ?>

Elevation differences are scaled for emphasis. While the numbers are accurate, the cut-away shown here is not to scale.

Other getActivitiesList($nearby_activity_ids, 'arena_type', 1, 1, 1) ?> Nearby

displayArenas($nearby_similar); ?>

More Similar Arenas Near :

getActivity($nearby_activity_id); if ($activity['arena_type']) { $more_url = $ebm->getCleanSearchUrl(array( 'aid' => $arena['id'] ,'atkey' => StringMgr::plural($activity['arena_type'], 2) )); ?> getCleanSearchUrl(array( 'aid' => $arena['id'] )); ?> Things to Do

Other Arenas Nearby

displayArenas($nearby_other); ?>
getCleanSearchUrl(array( 'aid' => $arena['id'] ,'atkey' => $activity['keyword'] )); ?> More Arenas

Nearby Campsites

displayArenas($nearby_camping); ?>
getCleanSearchUrl(array( 'aid' => $arena['id'] ,'atkey' => 'campsites' )); ?>

More Campsites Near :

Campsites
includeBlock('arenas/embed-arena', ['arena'=>$arena]) ?>
includeBlock('arenas/save_buttons', array( 'arena' => $arena ,'google_directions_mobile_url' => $google_directions_mobile_url )); ?>