Placing a a “Buy Tickets” button on your website is simple. It involves cutting and pasting a small snipped of code onto your website. Here’s how to do it
Welcome to the HoldMyTicket Blog
We have collected valuable resources that will help you get the most out of our platform.
Home
› Category Archives › Code
Hide/Show Long Event Descriptions
September 1st
If you have a long description for your event you can automatically truncate it on the event page by doing the following:

(more…)
TaosSkiValley.com – Event Calendar Integration
December 2nd
Here’s one of the latest integrations into a website with Hold My Ticket. The Taos Ski Valley Chamber of Commerce. http://taosskivalley.com
Building this feed utilized the API and a month view widget. We will update this blog with some code that can be used to create similar embeddable calendar functions.
Hold My Ticket API Library
October 26th
Here is a simple php class file that communicates with our API. If you have any contributions, you can add them to gist on github.com
<?php
class hmt {
# just configure the api key to use
# you can aquire an API key in the holdmyticket control panel under account settings
var $apikey = '';
function getEvents($opts=array()){
$venues = '';
if(isset($opts['venues'])):
$venues = $opts['venues'];
endif;
$url = "http://holdmyticket.com/api/events/getList/api_key/".$this->apikey;
if(!empty($venues)):
$url .= "/venues/".$venues;
endif;
$xml_response = $this->stream_remote_file($url);
$res = new SimpleXMLElement($xml_response);
return $res->event;
}
function getEvent($event_id){
$url = "http://holdmyticket.com/api/events/getInfo/api_key/".$this->apikey."/event/".$event_id;
$x = $this->simplexml_load_file($url);
return $x['event'];
}
function getEventHTML($event_id){
$url = "http://holdmyticket.com/api/events/getHTML/api_key/".$this->apikey."/event/".$event_id;
return $this->stream_remote_file($url);
}
function stream_remote_file($url){
$handle = fopen($url, "rb");
return stream_get_contents($handle);
}
function formatDateRange($start,$end,$hideTime=false){
list($s['date'],$s['time']) = explode(" ",$start);
list($s['year'],$s['mon'],$s['day']) = explode("-",$s['date']);
list($s['hour'],$s['min'],$s['sec']) = explode(":",$s['time']);
list($e['date'],$e['time']) = explode(" ",$end);
list($e['year'],$e['mon'],$e['day']) = explode("-",$e['date']);
list($e['hour'],$e['min'],$e['sec']) = explode(":",$e['time']);
$startTime = mktime($s['hour'],$s['min'],$s['sec'],$s['mon'],$s['day'],$s['year']);
$endTime = mktime($e['hour'],$e['min'],$e['sec'],$e['mon'],$e['day'],$e['year']);
if($end == '0000-00-00 00:00:00'){
# just return the start date
if($hideTime == true){
return date("F j, Y",$startTime);
}else{
return date("F j, Y, g:i A",$startTime);
}
}elseif($s['day'] == $e['day'] && $s['mon'] == $e['mon'] && $s['year'] == $e['year']){
# okay this is the same start and end date.. so just give them the day and start and end times..
if($hideTime == true){
return date("F j, Y",$startTime);
}else{
return date("F j, Y g:i A",$startTime)." - ".date("g:i a",$endTime);
}
}elseif($s['day'] != $e['day'] && $s['mon'] == $e['mon']){
# different day in same month.. so show something like August 23rd - 29th 2008
return date("F j",$startTime)." - ".date("j, Y",$endTime);
}elseif($s['mon'] != $e['mon']){
# different day and month so show, August 23rd - September 5th 2008
return date("F j",$startTime)." - ".date("F j, Y",$endTime);
}
}
}
?>






Our Facebook app creates a dynamic event page on your business’s Facebook page. This page automatically updates as you manage events in your HoldMyTicket account. ‘BUY TICKETS’ buttons allow patrons to buy tickets directly from your Facebook page. You’ll never have to add events on Facebook again. We do the work for you!


