CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Obtaining Event Summary in EventInfo.php
Pages: [1]

Author Topic: Obtaining Event Summary in EventInfo.php  (Read 621 times)

lchauhan

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.1 Beta
  • CMS version: Drupal
  • MySQL version: Latest
  • PHP version: 5.something
Obtaining Event Summary in EventInfo.php
June 29, 2012, 01:16:12 pm
Hey Everyone,

Just creating a custom Facebook app for my charity group, but was wondering what is the easiest way to call Event Summary so I can use it for adding a customer Meta tag.

I'm a little confused with API codes Civicrm uses as I work on Wordpress for development mostly and never Drupal!

Cheers,

Lchauhan

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Obtaining Event Summary in EventInfo.php
June 29, 2012, 01:19:22 pm

Might want to check this patch:

https://github.com/kurund/civicrm-facebook

most likely this will be part of 4.2

The API is the same and its in PHP. So does not matter a lot if u r using WP or Drupal

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

lchauhan

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.1 Beta
  • CMS version: Drupal
  • MySQL version: Latest
  • PHP version: 5.something
Re: Obtaining Event Summary in EventInfo.php
June 29, 2012, 01:41:01 pm
Everything for Facebook is setup just need description. Looking at the code I am assuming I use the following:
Code: [Select]
$params = array('id' => $this->_id);
+    $values = array();
+    CRM_Event_BAO_Event::retrieve($params, $values);
+
+    $params = array('entity_id' => $this->_id, 'entity_table' => 'civicrm_event');
+    $location = CRM_Core_BAO_Location::getValues($params, TRUE);
+    $location = $location['address'][1];
+   
+    $stateProvinces = CRM_Core_Pseudoconstant::stateProvince();
+    $country        = CRM_Core_Pseudoconstant::country();
+
+    $venueInfo = array(
+      'street'    => $location['street_address'],
+      'city'      => $location['city'],
+      'state'     => $stateProvinces[$location['state_province_id']] ,
+      'zip'       => $location['postal_code'],
+      'country'   => $country[$location['country_id']],
+      'latitude'  =>  $location['geo_code_1'],
+      'longitude' =>  $location['geo_code_2']
+    );
+   
+    //crm_core_error::debug( $venueInfo );
+    //crm_core_error::debug( $values ); exit;
+    // Create an event
+    $ret_obj = $this->_facebook->api('/me/events', 'POST', array(
+      'name' => $values['title'],
+      'description' => $formValues['summary'],
+      'start_time' => $values['start_date'],
+      'end_time' => $values['end_date'],
+      'privacy_type' => $event_privacy,
+      'venue'        => $venueInfo 
+    ));

and then use $formValues['summary'] to call the summary?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Obtaining Event Summary in EventInfo.php

This forum was archived on 2017-11-26.