首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Eventbrite.php错误

Eventbrite.php错误
EN

Stack Overflow用户
提问于 2014-05-22 13:30:21
回答 1查看 265关注 0票数 0

我正在为Eventbrite https://github.com/ryanjarvinen/eventbrite.php使用这个api。

它在ok中提取事件,但当有已知事件发布时,它会给我一个错误:

致命错误:没有异常‘异常’与消息‘找不到此用户事件’。在/home/davidhender/glasgowcitymission.davidhendersondesign.com/news-events/Eventbrite.php:109堆栈跟踪中:#0 /home/davidhender/glasgowcitymission.davidhendersondesign.com/news-events/events/eventbrite.php(17):Eventbrite->_/home/davidhender/glasgowcitymission.davidhendersondesign.com/news-events/events/eventbrite.php(17):_call(‘user_list_event.’),数组) #1 /home/davidhender/glasgowcitymission.davidhendersondesign.com/news-events/events/eventbrite.php(17):Eventbrite->user_list_events() #2 {main}在第109行的/home/davidhender/glasgowcitymission.davidhendersondesign.com/news-events/Eventbrite.php中抛出

代码语言:javascript
复制
    <?php
// load the API Client library
include "../Eventbrite.php"; 

// Initialize the API client
//  Eventbrite API / Application key (REQUIRED)
//   http://www.eventbrite.com/api/key/
//  Eventbrite user_key (OPTIONAL, only needed for reading/writing private user data)
//   http://www.eventbrite.com/userkeyapi
$authentication_tokens = array('app_key'  => 'UHH2XQAMZXTTZM526G',
                               'user_key' => '139627418395393246769');
$eb_client = new Eventbrite( $authentication_tokens );

// For more information about the features that are available through the Eventbrite API, see http://developer.eventbrite.com/doc/
$events = $eb_client->user_list_events();

//mark-up the list of events that were requested 
// render in html - ?>
<style type="text/css">
.eb_event_list_item{
  padding-top: 20px;
}
.eb_event_list_title{
  position: absolute;
  left: 220px;
  width: 300px;
  overflow: hidden;
}
.eb_event_list_date{
  padding-left: 20px;
}
.eb_event_list_time{
  position: absolute;
  left: 150px;
}
.eb_event_list_location{
  position: absolute;
  left: 520px;
}
</style>

<h1>My Event List:</h1>
<?= Eventbrite::eventList( $events, 'eventListRow'); ?>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-05-22 14:01:52

尝尝这个

代码语言:javascript
复制
<?php 
try {
    $events = $eb_client->user_list_events();
} catch ( Exception $e ) {
    // Be sure to plan for potential error cases 
    // so that your application can respond appropriately
    $events = array();
}
?>

回显事件列表

代码语言:javascript
复制
<?= Eventbrite::eventList( $events, 'eventListRow'); ?>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23808352

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档