Wednesday, July 3, 2019
php - Customzing Eventbrite list, I get unexpected T_FUNCTION, but it works locally
Answer
I'm displaying an events list from my Eventbrite account and when run locally, it works. When I upload it to my live test site, it triggers:
Parse error: syntax error, unexpected T_FUNCTION in ... on line ...
My PHP is as follows and pretty much verbatim from https://github.com/ryanjarvinen/eventbrite.php/blob/master/examples/event-list-example.md
include "Eventbrite.php";
$authentication_tokens = array('app_key' => 'XXXXXXXX',
'user_key' => '123456789');
$eb_client = new Eventbrite( $authentication_tokens );
$events = $eb_client->user_list_events();
$custom_render_function = function($evnt){
$time = strtotime($evnt->start_date);
if( isset($evnt->venue) && isset( $evnt->venue->name )){
$venue_name = $evnt->venue->name;
}else{
$venue_name = 'online';
}
$event_html = "
" . strftime('%a, %B %e', $time) . "
".$evnt->title."
" . strftime('%l:%M %P', $time) . "
" . $venue_name . "
\n";
return $event_html;
}
?>
Can anyone help me see where I've gone wrong?
UPDATE:
It was the version of PHP on the server (5.3). Mine had to be updated by the hosting service but it took only 30secs and this issue was resolved.
Subscribe to:
Post Comments (Atom)
plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV
In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...
-
This question attempts to collect the few pearls among the dozens of bad C++ books that are published every year. Unlike many other programm...
-
I need to do the following: My current address looks like: https://www.domain.com I want to redirect with htaccess: www.domain.com TO https:...
-
using namespace std; So far in my computer science courses, this is all we have been told to do. Not only that, but it's all tha...
No comments:
Post a Comment