Venue

require_once('wp-load.php');
global $wpdb;

$id=$_GET['id'];
$name=$_GET['n'];

$sql="SELECT * FROM wp_calendar_venues WHERE ".(empty($id)?"Name='".$wpdb->prepare($name).”‘”:”ID=”.$wpdb->prepare($id));
$venue = $wpdb->get_row($sql, ARRAY_A);

if (!$venue) {
$vRet=”No Venue Found”;
} else {
$name=$venue['Name'];
$vRet=”

“.$name.”

“.$venue['Address1'].”
“.
(!empty($venue['Address2'])?$venue['Address2']:””).”
“.
$venue['City'].”, “.$venue['State'].”
“.$venue['Zip'];
}

echo $vRet;

?>

Upcoming Shows

$sql="SELECT * FROM wp_calendar WHERE event_venue='".$wpdb->prepare($name).”‘”;
$shows = $wpdb->get_results($sql, ARRAY_A);

if (!$shows) {
$sRet=”No Upcoming Shows Found”;
} else {
$on=false;
foreach ($shows as $show) {
if ($on) {
$sRet.=”


.”“.$show['event_title'].” on “.$show['event_begin'].”

.”

“;
$on=false;
} else {
$sRet.=”


.”“.$show['event_title'].” on “.$show['event_begin'].”

.”

“;
$on=true;
}
}
}

echo $sRet;

?>

About the Author