====== facebookevents Plugin ====== ---- plugin ---- description: This plugin allows you to display your Facebook events in DokuWiki author : Jannes Drost-Tenfelde email : info@drost-tenfelde.de type : syntax lastupdate : 2016-09-29 compatible : 2016-06-26, 2015-08-10, 2014-09-29, 2014-05-05 depends : conflicts : similar : importfacebookevents, facebookwall, facebookalbum tags : facebook, events, calendar downloadurl: https://github.com/jdtProjects/dokuwiki/raw/master/published/plugin_facebookevents_1_2.zip bugtracker : https://github.com/jdtProjects/dokuwiki/issues sourcerepo : https://github.com/jdtProjects/dokuwiki/tree/master/facebookevents donationurl: http://drost-tenfelde.de/donate screenshot_img: ---- This pluging allows you to connect to your Facebook page and display the page's events in DokuWiki. The latest Version has been updated to use Facebook's Graph API, rather than the Facebook PHP SDK. ===== Installation ===== * You must create a [[https://developers.facebook.com/apps/|Facebook App]], which allows you to connect to Facebook using * App ID, which identifies your Facebook App (you can have multiple Apps) * App Secret, which secures your Facebook App Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. ===== Examples/Usage ===== * Displays all status messages on the facebook wall{{facebookevents>appid=123456&secret=123456&fanpageid=123456}} * Displays the 3 newest status messages on the facebook wall{{facebookevents>appid=123456&secret=123456&fanpageid=123456&numberOfEntries=3&sort=DESC}} * Displays the 3 events after today{{facebookevents>appid=123456&secret=123456&fanpageid=123456&numberOfEntries=3&sort=ASC&from=today}} See the plugin in action [[http://www.drost-tenfelde.de/?id=dokuwiki:plugins:facebookevents:demo|here]] FIXME. The sample page shows all the styles available with the plugin. ===== Syntax ===== {{facebookevents>key=value&..&key=value}} ^ key | the parameter key to set | optional | ^ value | the parameter value to set | optional | Multiple key=value parameters can be set using the & as a seperator. Available parameters: ^ Key ^ Type ^ Comments ^ Requirement ^ Version ^ | appid | string | This is the mandatory App ID of your Facebook App | **mandatory** | all | | secret | string | This is the mandatory App Secret of your Facebook App | **mandatory** | all | | fanpageid | string | This is the ID of your Facebook page. You can find this ID by going to your Facebook page. Typically, the link of your page looks like %%https://www.facebook.com/#!/pages//%%. Copy the page ID from the URL and use it in the syntax. | **mandatory** | all | | showAs | string | Default: **default**. Allows you to use alternate display of the wall posts using configuration parameters. You can add more templates by editing the default.php and metadata.php files in the conf/ directory. | optional | all | | from | date | This indicates the date from which the wall posts should be displayed. Older wall posts are disregarded. Format is DD/MM/YYYY. The value 'today' is also valid. | optional | all | | to | date | This indicates the date to which the wall posts should be displayed. Newer wall posts are disregarded. Format is DD/MM/YYYY. The value 'today' is also valid. | optional | all | | numberOfEntries | number | Indicates the maximum number of entries to display. | optional | all | | sort | string | Default: **DESC**\\ Allows you to sort by the date of the wall post. Valid values are ''ASC'' and ''DESC''. | optional | all | | showEndTimes | onoff | Default: **on**\\ Allows you to display end times of the event. | optional | all | | limit | number | Default: **0**\\ Allows you to limit the maximum number of characters displayed for the message. | optional | Version 1.1 or newer | ===== Configuration and Settings ===== ^ Key ^ Type ^ Comments ^ Requirement ^ Version ^ | dformat | date | Formatting of the event date (See [[phpfn>strftime|Format]]) | required | all | | tformat | date | Formatting of the event time (See [[phpfn>strftime|Format]]) | required | all | | default | string | Default template for displaying wall posts. | required | all | ===== Display templates ===== You may add your own configuration parameters in order to display the wall posts in different formats. The appropriate configuration parameter for the template can be set via the syntax parameter **showAs**. In order to make a new template, for example one that displays all wall posts as an unsorted list, the configuration files must be changed as follows: ** conf/metadata.php ** If you wish to alter your self-created template in the administration panel, you must setup the metadata for this parameter. Example: $meta['unsortedlist'] = array(''); ** conf/default.php ** If you wish to set a default setting for the newly created parameter, you can set it up in default.php. This is optional, you can also use the administration panel to setup the configuration parameter. $conf['unsortedlist'] = ' * {datetime}: {title} {description} '; ** showAs ** Once the configuration parameter has been added, you can use it in the plugin syntax: ''%%{{facebookevents>appid=123456&secret=123456&fanpageid=123456&showAs=unsortedlist}}%%'' ===== Template tags ===== The templates, which can be configured in ''conf/default.php'', or via the administraton panel, is parsed using the following tags: ^ Tag ^ Comments ^ Version | | ''%%{date}%%'' | The date of the wall post. The date format can be configured in the conf/default.php file. | all | | ''%%{time}%%'' | The time of the wall post. The time format can be configured in the conf/default.php file. | all | | ''%%{datetime}%%'' | The date and time of the wall post. This functions as ''%%{date} {time}%%''. | all | | ''%%{title}%%'' | The title of the event. | all | | ''%%{description}%%'' | The event description. | all | | ''%%{location}%%'' | The location of the event. | all | | ''%%{image}%%'' | The original picture of the event. | all | | ''%%{image_large}%%'' | A large version of the picture of the event. | all | | ''%%{image_small}%%'' | A small version of the picture of the event. | all | | ''%%{image_square}%%'' | A squared version of the picture of the event. | all | | ''%%{url}%%'' | The unformated URL of the event. You can use this in your template to make your own links to the event. | all | | ''%%{more}%%'' | This is a fomated link to the event, using the language files to output a ''%%[[{url}|Read more...]]%%'' link. | all | | ''%%{startdatetime}%%'' | The date and time of the start of the event. | Version 1.1 | | ''%%{startdate}%%'' | The date of the start of the event. | Version 1.1 or newer | | ''%%{starttime}%%'' | The time of the start of the event. | Version 1.1 or newer | | ''%%{enddatetime}%%'' | The date and time of the end of the event. | Version 1.1 or newer | | ''%%{enddatetime}%%'' | The date of the end of the event. | Version 1.1 or newer | | ''%%{endtime}%%'' | The time of the start of the event. | Version 1.1 or newer | | ''%%{timestamp}%%'' | The unix timestamp of the event. | Version 1.1 or newer | ===== Development ===== === Change Log === * **2016-09-29** Version 1.2 released. * Updated to use Facebook Graph API 2.7 instead of the Facebook PHP SDK. * **2012-03-26** Version 1.1 released. * Fixed timezone problem, where the times would sometimes not be displayed properly. * Added 'limit' parameter that allows you to set the maximum number of characters displayed for {description}. * Added template tags {startdatetime}, {startdate}, {starttime}, {enddatetime}, {enddate}, {endtime} and {timestamp}. * **2012-02-14** Version 1.0 released. * Initial release === Known Bugs and Issues === === ToDo/Wish List === * Attachments. * Add a Facebook 'like' button. ===== FAQ ===== ===== Discussion ===== Thank you for your contributions! ==== How to create a Facebook App ==== I was wondering where I might find information on what is needed for creating the Facebook App for this plug-in. ==== Not just Pages? ==== Is it possible to modify this plugin so that it could show the events in a group or for an individual? Would it involve adding ''groupid'' and ''userid'' parameters that would cause different FQL to be executed? --- [[user>iainhallam|Iain Hallam]] //2012/10/23 23:05//