Event Attend Button – External Link

“How do you change the url that is linked on the “Attend” button to be external one?”

Please follow these instructions:

1. open includes/plugins/meta.php
2. find these lines:

$meta_boxes[] = array(
	'id' => 'event_details',
	'title' => 'Event Details',
	'pages' => array('event'),
	'fields' => array(
		array(
			'name'		=> 'Location',
			'id'		=> $prefix . 'location',
			'desc'		=> '',
			'type'		=> 'text',
			'std'		=> ''
		),
		array(
			'name'		=> 'Venue',
			'id'		=> $prefix . 'venue',
			'desc'		=> '',
			'type'		=> 'text',
			'std'		=> ''
		),
		array(
			'name'		=> 'Start Date',
			'id'		=> $prefix . 'start_date',
			'desc'		=> '',
			'type'		=> 'date',
			'std'		=> ''
		),
		array(
			'name'		=> 'End Date',
			'id'		=> $prefix . 'end_date',
			'desc'		=> '',
			'type'		=> 'date',
			'std'		=> ''
		),
		array(
			'name'		=> 'Time',
			'id'		=> $prefix . 'time',
			'desc'		=> '',
			'type'		=> 'time',
			'std'		=> ''
		),
		array(
			'name'		=> 'Photos',
			'id'		=> $prefix . 'event_photos',
			'desc'		=> 'Add event photos, please.',
			'type'		=> $imageType,
			'std'		=> ''
		)
	)
);

and change them to read:

$meta_boxes[] = array(
	'id' => 'event_details',
	'title' => 'Event Details',
	'pages' => array('event'),
	'fields' => array(
		array(
			'name'		=> 'Location',
			'id'		=> $prefix . 'location',
			'desc'		=> '',
			'type'		=> 'text',
			'std'		=> ''
		),
		array(
			'name'		=> 'Venue',
			'id'		=> $prefix . 'venue',
			'desc'		=> '',
			'type'		=> 'text',
			'std'		=> ''
		),
		array(
			'name'		=> 'Start Date',
			'id'		=> $prefix . 'start_date',
			'desc'		=> '',
			'type'		=> 'date',
			'std'		=> ''
		),
		array(
			'name'		=> 'End Date',
			'id'		=> $prefix . 'end_date',
			'desc'		=> '',
			'type'		=> 'date',
			'std'		=> ''
		),
		array(
			'name'		=> 'Time',
			'id'		=> $prefix . 'time',
			'desc'		=> '',
			'type'		=> 'time',
			'std'		=> ''
		),
		array(
			'name'		=> 'Photos',
			'id'		=> $prefix . 'event_photos',
			'desc'		=> 'Add event photos, please.',
			'type'		=> $imageType,
			'std'		=> ''
		),
		array(
			'name'		=> 'Attend URL',
			'id'		=> $prefix . 'event_attend_url',
			'desc'		=> 'Insert attend URL, please.',
			'type'		=> 'text',
			'std'		=> ''
		),
		array(
			'name'		=> 'Attend URL button',
			'id'		=> $prefix . 'event_attend_url_button',
			'desc'		=> 'Insert attend button text, please.',
			'type'		=> 'text',
			'std'		=> 'Attend'
		)
	)
);

3. open sidebar-event.php
4. find these lines:

		$postMeta = $_SESSION['postMeta'];
		$location = $postMeta['_location'][0];
		$venue = $postMeta['_venue'][0];
		$startDate = $postMeta['_start_date'][0];
		$endDate = $postMeta['_end_date'][0];
		$time = $postMeta['_time'][0];
		$eventPhotos = $postMeta['_event_photos'];

and change them to read:

		$postMeta = $_SESSION['postMeta'];
		$location = $postMeta['_location'][0];
		$venue = $postMeta['_venue'][0];
		$startDate = $postMeta['_start_date'][0];
		$endDate = $postMeta['_end_date'][0];
		$time = $postMeta['_time'][0];
		$eventPhotos = $postMeta['_event_photos'];
		$attendURL = $postMeta['_event_attend_url'][0];
		$attendButton = $postMeta['_event_attend_url_button'][0];

5. find this line

		<p><a href="<?php tb_write_link('tb_page_contact') ?>?msgSubject=<?php echo $post->ID; ?>">Attend...</a></p>

and change it to read:

		<?php if (!$attendButton) $attendButton = 'Attend'; ?>

		<?php if ($attendURL) { ?>
			<p><a href="<?php echo esc_url($attendURL); ?>"><?php echo $attendButton; ?></a></p>
		<?php } else { ?>
			<p><a href="<?php tb_write_link('tb_page_contact') ?>?msgSubject=<?php echo $post->ID; ?>"><?php echo $attendButton; ?></a></p>
		<?php } ?>

6. open includes/widgets/tbUpcomingEvents.php
7. find these lines:

		$location = $postCustom['_location'][0];
		$startDate = $postCustom['_start_date'][0];
		$time = $postCustom['_time'][0];

and change them to read:

		$location = $postCustom['_location'][0];
		$startDate = $postCustom['_start_date'][0];
		$time = $postCustom['_time'][0];
		$attendURL = $postCustom['_event_attend_url'][0];
		$attendButton = $postCustom['_event_attend_url_button'][0];

8. find this line

<a href="<?php echo $postPermalink; ?>" title="<?php echo $postTitle; ?>">Details</a> <a href="<?php tb_write_link('tb_page_contact') ?>?msgSubject=<?php echo $postID; ?>">Atte

and change it to read:

				<a href="<?php echo $postPermalink; ?>" title="<?php echo $postTitle; ?>">Details</a>

				<?php if (!$attendButton) $attendButton = 'Attend'; ?>				
				<?php if ($attendURL) { ?>
					<a href="<?php echo esc_url($attendURL); ?>"><?php echo $attendButton; ?></a>
				<?php } else { ?>
					<a href="<?php tb_write_link('tb_page_contact') ?>?msgSubject=<?php echo $postID; ?>"><?php echo $attendButton; ?></a>
				<?php } ?>

.

0