Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>With PHP-SDK I uses the api call for <strong>automatic</strong> POSTING an Event in App page <strong>after</strong> filling a form.</p> <p>Here the automatic process after the user (You) have an valid APP access_token and manage app/page permissions. The token to use is your APP token you receive with your FBapp connection.</p> <h1>Starting creating php-sdk object</h1> <pre><code>$connectparam = array(); $connectparam['appId'] = 'YOURAPPID'; $connectparam['secret'] = 'YOURAPPSECRET'; $connectparam['fileUpload'] = 'true'; $connectparam['cookie'] = 'true'; $facebook = new Facebook($this-&gt;connectparam); </code></pre> <h1>Building the event informations</h1> <pre><code>$FBcreateAnTestEvent = array(); $nowtime = date('Y-m-d H:i:s'); $FBcreateAnTestEvent['name'] = 'Test Event in myApp from me'; $FBcreateAnTestEvent['start_time'] = $nowtime; $FBcreateAnTestEvent['privacy_type'] = 'SECRET'; $FBcreateAnTestEvent['description'] = 'This Event is created from my WebFBApp and is a testing Event creating by Qtronik from myWebApp'; </code></pre> <h1>Automaticly create event</h1> <pre><code>$resp = '&lt;a href="'.$facebook-&gt;api('/me/events','POST',$FBcreateAnTestEvent).'"&gt; Create a test event&lt;/a&gt;'; echo $resp; </code></pre> <p><strong>When is echoing the php-sdk create immediately the Event so it's better to put it in a ajax or in action linked page in a form</strong></p> <h2>For FanPage use FQL link</h2> <p>If You parse the FBuser admin_pages and filter by <strong>APPLICATION</strong> field and/or filter by your FBpage id you can get this user FBpages admin access_token's. Of Course you need the manage_pages permissions. Then you need <strong>admin_events</strong> permission to publish to FBfanPage's. I create an FanPageEvent with GraphApi link like this:</p> <pre><code>$pageAccessToken = $facebook-&gt;api('/' . $YOURPAGEID . '/?fields=access_token'); $resp = '&lt;a href="https://graph.facebook.com/'.$pageAccessToken['id'].'/events ?access_token=' . $pageAccessToken['access_token'] . ' &amp;method=POST &amp;name='.$FBcreateAnTestEvent['name'].' &amp;start_time='.$FBcreateAnTestEvent['start_time'].' &amp;location='.$FBcreateAnTestEvent['location'].')"&gt; Create a test event&lt;/a&gt;'; </code></pre> <p>Then voila I have allot of other things to do with this for handle it with Ajax but this is the two way of adding an Event's to Facebook from a website administrating way... All this it's not very intended for personal profile event create so it's more difficult to spam FBpages and or FBapp/FBwebapp.</p> <blockquote> <p>I'm French speaking so excuse my poor English... ;)</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload