Using Graph API to create an event with map - facebook

I am adding a new event via the graph API.
Is there a secret to making the map appear or does it has to be an official FB place?
This is what i am sending. Everything seems to work (kindof)
A couple of things.
When i view the event, no zip or map are displayed.
Any help/suggestions would be greatly appreciated
BTW all the fields are populated and correct
$fb = new Facebook(array(
'appId' => FB_APP_ID,
'secret' => FB_APP_SECRET,
'cookie' => true,
'fileUpload' => true
));
$fb->setAccessToken($_SESSION[ $eid.'_FB_USER_ACCESSCODE' ]);
$data = array( 'access_token' => $_SESSION[ $eid.'_FB_USER_ACCESSCODE' ],
'owner' => $_SESSION[ $eid.'_FB_USER_ACCESSCODE' ],
'latitude' => $event->getLat(),
'longitude' => $event->getLong(),
'name' => $event->getTitle(),
'description' => $description,
'start_time' => date('c', $event->getStart()),
'end_time' => date('c', $event->getEnd()),
'street' => $event->getAddress(),
'city' => $event->getCity(),
'state' => $event->getState(),
'zip' => $event->getZip(),
'location' => $event->getLocation(),
'privacy' => 'OPEN'
, basename($fileName) => '#'.$fileName
) ;

I'm not sure, but the map what you see isn't just an image?
The event documentation says: https://developers.facebook.com/docs/reference/api/event/ you able to submit the event's profil picture.

Related

Prestashop fields_options in AdminMaintenanceController

In my override file AdminMaintenanceController, I try to add an input file to add an image(dynamically) on maintenance.tpl when the maintenance mode in active. The field form appear correctly in my backoffice below maintenance ip and switch but nothing is uploaded.
Do you have tips or informations about this issue ?
I'm on 1.6
My controller:
class AdminMaintenanceController extends AdminMaintenanceControllerCore
{
public function __construct()
{
$this->bootstrap = true;
$this->className = 'Configuration';
$this->table = 'configuration';
parent::__construct();
$this->fields_options = array(
'general' => array(
'title' => $this->l('General'),
'fields' => array(
'PS_SHOP_ENABLE' => array(
'title' => $this->l('Enable Shop'),
'desc' => $this->l('Activate or deactivate your shop (It is a good idea to deactivate your shop while you perform maintenance. Please note that the webservice will not be disabled).'),
'validation' => 'isBool',
'cast' => 'intval',
'type' => 'bool'
),
'PS_MAINTENANCE_IP' => array(
'title' => $this->l('Maintenance IP'),
'hint' => $this->l('IP addresses allowed to access the front office even if the shop is disabled. Please use a comma to separate them (e.g. 42.24.4.2,127.0.0.1,99.98.97.96)'),
'validation' => 'isGenericName',
'type' => 'maintenance_ip',
'default' => ''
),
),
'submit' => array('title' => $this->l('Save'))
),
'image' => array(
'title' => $this->l('Images parameters'),
'fields' => array(
'PS_IMG1' => array(
'title' => $this->l('Left side image'),
'type' => 'file',
'name' => 'PS_IMG1',
'thumb' => _PS_IMG_.'PS_IMG1.jpg',
'hint' => $this->l('Choose the photo for this side'),
),
),
'submit' => array('title' => $this->l('Save'))
),
It seems that you have implemented only a form fields display but not file(image) upload process. You need to instantiate a process of an image uploading after form confirmation

How to use required argument in Redux Framework based on checkbox sortable?

Good evening,
I have the following option in Redux Framework (version 3.1.9):
array(
'id' => 'social-networks',
'type' => 'sortable',
'mode' => 'checkbox',
'title' => __('Order Social Icons', 'options'),
'subtitle' => __('Order and activate/deactivate social icons', 'options'),
'options' => array(
'fb' => 'Facebook',
'tw' => 'Twitter',
'lin' => 'LinkedIn',
)
),
And the output (if all three options are checked) is:
[fb] => 1
[tw] => 1
[lin] => 1
After this option I want to display a text field for every checked social network in this list and I have the example text input:
array(
'id' => 'facebook-url',
'type' => 'text',
'required' => array('social-networks["fb"]','equals','1'),
'title' => __('Facebook URL', 'options'),
'subtitle' => __('Enter your Facebook URL.', 'options'),
),
Of course the "required" argument doesn't work.
Is there a way to use this argument by using an option from a field and not only the ID.
Thanks
According to http://docs.reduxframework.com/redux-framework/arguments/required/, your conditional option should look like this:
array(
'id' => 'facebook-url',
'type' => 'text',
'required' => array('social-networks','equals','fb'),
'title' => __('Facebook URL', 'options'),
'subtitle' => __('Enter your Facebook URL.', 'options'),
),
Next option:
array(
'id' => 'twitter-url',
'type' => 'text',
'required' => array('social-networks','equals','tw'),
'title' => __('Twitter URL', 'options'),
'subtitle' => __('Enter your twitter URL.', 'options'),
),
and so on.

a link pass multiple parameter in zend framework

hi i am new in zend framework 2.2.0. i want to create the a link that go to delete page right now i am passing only id in the url so i want to pass another id in it.
Add to Trash
right now in this link message id is passing i also want to pass one more id named "did" in this link
Add to Trash
how can i get this ?
thanks in advance
You should use url view helper's third argument ($options) to pass your variables in the query string. Example:
$route = 'message';
$param = array('action' => 'delete');
$opts = array(
'query' => array(
'id' => $message->message_id,
'did' => $message->deliver_id
)
);
$this->url($route, $params, $opts);
You have to add "did" to your message route like this:
'router' => array(
'routes' => array(
'message' => array(
'type' => 'segment',
'options' => array(
'route' => '/:action/:id[/:did]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]+',
'id' => '[0-9]+',
'did' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Application\Controller\Index',
),
),
),
),
),
echo $this->url('message',array('action'=>'delete', 'id' => $message->message_id,'did'=>$message->deliver_id);
// output: /delete/1/2

Insert email when creating account with rest api

I am faced with a Sugar 6.3 CE installation, trying to create new accounts through rest api.
I am still on the learning curve for a lot of the innards of the CRM, and cannot figure out how to have the email inserted whith the rest of the account info upon creation with a REST call.
I have tried many different field values, and after catching that $email1 was used in some snippet examples I saw on the sugarCRM site. I have not found other mentions in the forums or in the docs yet.
The $parameters array used to configure the usual rest call to create an account in php with REST api looks like this and works fine, except for the $email1:
$parameters = array(
'session' => $session,
'module' => 'Contacts',
'name_value_list' => array(
array('name' => 'first_name', 'value' =>
utf8_encode($contacts["Name"])),
array('name' => 'last_name', 'value' =>
utf8_encode($contacts["GivenName"])),
array('name' => 'phone_work', 'value' =>
utf8_encode($row->PrimaryPhoneAreaCode . ' ' . $row->PrimaryPhone)),
array('name' => 'phone_fax', 'value' =>
utf8_encode($row->PrimaryFaxAreaCode . ' ' . $row->PrimaryFaxNumber)),
array('name' => 'title', 'value' =>
utf8_encode($contacts["Title"])),
/*
* PROBLEM HERE!
*/
array('name' => 'email1', 'value' =>
utf8_encode($row->PrimaryEmail)),
array('name' => 'primary_address_street', 'value' =>
utf8_encode($row->Address1) . ' ' .
utf8_encode($row->Address2)),
array('name' => 'language', 'value' =>
utf8_encode($row->Language)),
array('name' => 'assigned_user_id', 'value' =>
get_rep_id($row->Salesperson1Name, $sugarlink)),
)
);
I would be curious, if someone has the trick. I tried to find to field for emails but it seems to be in separate tables. Any help / tips appreciated.
If you are using REST API the email1 will work for both set en get methods (just tested it).
Did not used the SOAP API as in your example, and suggest to migrate all to REST according to SugarCRM recommendations.
You must add the email into emailadress database first, create contact and set a relationship between both ;-)
$set_entry_parametersEADDR = array(
"session" => $session_id,
//The name of the module from which to retrieve records.
"module_name" => "EmailAddresses",
//Record attributes
"name_value_list" => array(
array('name' => 'email_address', 'value' => $email),
array('name' => 'email_address_caps', 'value' => strtoupper($email)),
array('name' => 'invalid_email' , 'value' => 0),
array('name' => 'opt_out', 'value' => 0),
array('name' => 'date_created' , 'value' => date('Y-m-d H:i:s')),
array('name' => 'date_modified', 'value' => date('Y-m-d H:i:s')),
array('name' => 'deleted' , 'value' => 0),
),
);
$set_entry_resultEmailsAdd = call("set_entry", $set_entry_parametersEADDR, $url);
print_r($set_entry_resultEmailsAdd);
$Email_id = $set_entry_resultEmailsAdd->id;
$set_entry_parameters_contact = array(
//session id
"session" => $session_id,
//The name of the module from which to retrieve records.
"module_name" => "Contacts",
//Record attributes
"name_value_list" => array(
//to update a record, you will nee to pass in a record id as commented below
//array("name" => "id", "value" => "9b170af9-3080-e22b-fbc1-4fea74def88f"),
array("name" => "first_name", "value" => $prof["Prenom"]),
array("name" => "last_name", "value" => $prof["Nom"]),
array("name" => "login_c", "value" => $prof["Login"]),
//array("name" => "email1", "value" => $email),
array("name" => "fonction_c", "value" => "prof")
),
);
$set_entry_result_contact = call("set_entry", $set_entry_parameters_contact, $url);
print_r($set_entry_result_contact);
$contact_id = $set_entry_result_contact->id;
$set_relationship_parameters_email = array(
'session' => $session_id,
'module_name' => 'Contacts',
'module_id' => $contact_id,
'link_field_name' => 'email_addresses',
'related_ids' => $Email_id,
);
$set_relationship_result_email = call("set_relationship", $set_relationship_parameters_email, $url);
print_r($set_relationship_result_email);
Currently I think that not works with REST api but works with SOAP API. Could you try to use email1_set_in_workflow key instead of email1?
It's not a very good solution but perhaps that could unlock you pending a better way to do that in future release

Zend_Feed_Reader Not supported Schema

I'm using Zend FW and wanted to make a feed reader. I did the following:
$feed = Zend_Feed_Reader::import('feed://blog.lookup.cl/?feed=rss2');
$data = array(
'title' => $feed->getTitle(),
'link' => $feed->getLink(),
'dateModified' => $feed->getDateModified(),
'description' => $feed->getDescription(),
'language' => $feed->getLanguage(),
'entries' => array(),
);
foreach ($feed as $entry) {
$edata = array(
'title' => $entry->getTitle(),
'description' => $entry->getDescription(),
'dateModified' => $entry->getDateModified(),
'authors' => $entry->getAuthors(),
'link' => $entry->getLink(),
'content' => $entry->getContent()
);
$data['entries'][] = $edata;
}
And it throws the following exception: Scheme "feed" is not supported
The blog was made using Wordpress.
What's wrong? If "feed it's not supported", how can I change the type of feed that Wordpress does?
Thanks in advance,
Take care,
Solved.
I had to put http instead of feed.