YaWK  24.1
Yet another WebKit
fbEvents.php
Go to the documentation of this file.
1 <?php
3 {
4  /**
5  * <b>Use Facebook Graph API to get Events from a Facebook Page. Require App ID and Access Token.</b>
6  *
7  * <p>With this widget, you are able to embed events from your facebook page onto your website.
8  * It helps you to keep your website up to date. Have you ever been bored of adding the same content twice?
9  * Previously it was like that: Add a event on facebook, invite your friends, add this date to your website.
10  * This plugin makes it easy for you to keep focused on your social activities. If you change your facebook
11  * event, the data on your website will be updated automatically. No matter if it's the event date, time
12  * title, cover image or something else.</p>
13  *
14  * <p>You need an APP ID, as well as an access token for the facebook page you want to embed events from.
15  * For reasons, you (respectively the app id / access token) needs administrative access rights to the facebook
16  * page you want to grab events from. Create a new fb event widget in the backend, enter app id, access token
17  * and your page id (facebook.com/YOURPAGE) and you're good to go. Experiment with the settings to fit your needs.
18  *
19  * This class only got 2 important methods: the constructor, which loads the settings for this widget,
20  * as well as the display() method. It connects to facebook, gets the data, walk through the array
21  * and manage the output of your events. This method could surely be more abstract. Code Improvement
22  * and abstraction will implemented due future updates on this class. A pragmatical approach - for now.
23  * </p>
24  *
25  * @package YAWK
26  * @author Daniel Retzl <[email protected]>
27  * @copyright 2018 Daniel Retzl
28  * @license https://opensource.org/licenses/MIT
29  * @version 1.0.0
30  * @link http://yawk.io
31  * @annotation Use Facebook Graph API to get Events from a facebook page and embed this data with your own design.
32  */
33  class fbEvents
34  {
35  /** @var object global widget object data */
36  public $widget = '';
37  /** @var string your app ID (from developers.facebook.com) */
38  public $fbEventsAppId = '';
39  /** @var string your page ID (http://facebook.com/{YOURPAGEID} */
40  public $fbEventsPageId = '';
41  /** @var string your access token (secret word from developers.facebook.com) */
42  public $fbEventsAccessToken = '';
43  /** @var string user defined layout */
44  public $fbEventsLayout = 'left';
45  /** @var string show cover image? true|false */
46  public $fbEventsShowCover = 'true';
47  /** @var string any css class for the cover image */
48  public $fbEventsCoverClass = '';
49  /** @var string which events should be shown? future|past|all */
50  public $fbEventsType = 'future';
51  /** @var string show events of this time range */
52  public $fbEventsYearRange = '1';
53  /** @var string how events should be sorted: ascending|descending */
54  public $fbEventsSortation = 'asc';
55  /** @var string user defined start date */
56  public $fbEventsStartDate = '';
57  /** @var string user defined end date */
58  public $fbEventsEndDate = '';
59  /** @var string events since this date (used for calc) */
60  public $sinceDate = '';
61  /** @var string events until this date (used for calc) */
62  public $untilDate = '';
63  /** @var string headline before the widget (heading + subtext, if set) */
64  public $headline = '';
65  /** @var string heading before widget */
66  public $fbEventsHeading = '';
67  /** @var string subtext before widget */
68  public $fbEventsSubtext = '';
69  /** @var string fields that should be selected from facebook graph */
70  public $fields = 'id,name,description,place,start_time,cover,maybe_count,attending_count,is_canceled';
71  /** @var object api result (as object) */
72  public $apiObject;
73  /** @var array all api result data (multidimensional array) */
74  public $data = array();
75  /** @var array current event (multidimensional array) */
76  public $event = array();
77  /** @var object datetime of current event */
78  public $eventDate;
79  /** @var string pretty formatted date - will be used in frontend view */
80  public $prettyDate = '';
81  /** @var string calculated date will be used in frontend view */
82  public $dateString = '';
83  /** @var string should interested people be shown? 0|1 */
84  public $fbEventsShowCounter = '1';
85  /** @var int how many people are interested or attending - used for calculations */
86  public $iPeopleCount = '';
87  /** @var string how many people are interested - will be used in frontend view */
88  public $showPeople = '';
89  /** @var string font size of the event title */
90  public $fbEventsFontEventName = 'h2';
91  /** @var string internal placeholder variable */
92  public $fontEventNameH = '';
93  /** @var string custom css of the event title */
94  public $fbEventsFontEventNameCss = '';
95  /** @var string font size of the event date */
96  public $fbEventsFontDate = 'h4';
97  /** @var string internal placeholder variable */
98  public $fontEventDateH = '';
99  /** @var string custom css of the event date */
100  public $fbEventsFontDateCss = '';
101  /** @var string dateword (dateString) as small tag? true|false */
102  public $fbEventsFontDateword = 'true';
103  /** @var string custom css of the dateword (dateString) */
104  public $fbEventsDatewordCss = '';
105  /** @var string font size of the event location */
106  public $fbEventsFontLocation = 'globaltext';
107  /** @var string custom css of the event location */
108  public $fbEventsFontLocationCss = '';
109  /** @var string internal placeholder var */
110  public $fontEventLocationH = '';
111  /** @var string font size of the event address */
112  public $fbEventsFontAddress = 'globaltext';
113  /** @var string internal placeholder var */
114  public $fontEventAddressH = '';
115  /** @var string custom css of the event address */
116  public $fbEventsFontAddressCss = '';
117  /** @var string font size of the event description */
118  public $fbEventsFontDescription = 'globaltext';
119  /** @var string internal placeholder var */
120  public $fontEventDescriptionH = '';
121  /** @var string custom css of the event description */
122  public $fbEventsFontDescriptionCss = '';
123  /** @var string font size of the event people (interested / attending) */
124  public $fbEventsFontPeople = 'globaltext';
125  /** @var string internal placeholder var */
126  public $fontEventPeopleH = '';
127  /** @var string custom css of the event people (interested / attending) */
128  public $fbEventsFontPeopleCss = 'text-muted';
129  /** @var string font size of canceled event */
130  public $fbEventsFontCanceled = 'h3';
131  /** @var string custom css of canceled event */
132  public $fbEventsFontCanceledCss = 'text-danger';
133  /** @var string font title html markup start */
134  public $fontTitleStart = '';
135  /** @var string font title html markup end */
136  public $fontTitleEnd = '';
137  /** @var string display <hr> between address and description */
138  public $fbEventsDisplaySpacer = 'true';
139  /** @var string background color of the event jumbotron box */
140  public $fbEventsBgColor = '222222';
141  /** @var string text color of the event jumbotron box */
142  public $fbEventsTextColor = 'CCCCCC';
143  /** @var string address string */
144  public $address = '';
145  /** @var string canceled events strike-trough? true|false */
146  public $fbEventsCanceledOn = 'true';
147  /** @var string css class of seperator line */
148  public $fbEventsHrClass = '';
149  /** @var string facebook link? true|false */
150  public $fbEventsFbLink = 'true';
151  /** @var string display google map? true|false */
152  public $fbEventsGoogleMap = 'true';
153  /** @var int limit event to (x) */
154  public $fbEventsLimit = 0;
155  /** @var string limit markup */
156  public $limit = '';
157  /** @var string contains error message, if any */
158  public $errorMsg = '';
159 
160  public function __construct($db)
161  {
162  // load this widget settings from db
163  $this->widget = new \YAWK\widget();
165  foreach ($settings as $property => $value)
166  {
167  $this->$property = $value;
168  }
169  }
170 
171  public function display()
172  {
173  if (isset($this->fbEventsAppId) && (!empty($this->fbEventsAppId)
174  && (isset($this->fbEventsAccessToken) && (!empty($this->fbEventsAccessToken)
175  && (isset($this->fbEventsPageId) && (!empty($this->fbEventsPageId)))))))
176  {
177  /*
178  // include facebook SDK JS
179  echo "<script>
180  window.fbAsyncInit = function() {
181  FB.init({
182  appId : '" . $this->fbEventsAppId . "',
183  xfbml : true,
184  version : 'v3.1'
185  });
186  FB.AppEvents.logPageView();
187  };
188 
189  (function(d, s, id){
190  var js, fjs = d.getElementsByTagName(s)[0];
191  if (d.getElementById(id)) {return;}
192  js = d.createElement(s); js.id = id;
193  js.src = \"https://connect.facebook.net/en_US/sdk.js\";
194  fjs.parentNode.insertBefore(js, fjs);
195  }(document, 'script', 'facebook-jssdk'));
196  </script>";
197  */
198 
199  // WHICH EVENTS TO DISPLAY?
200  // evaluation of event type select field
201  if ($this->fbEventsType === "all")
202  {
203  // ALL EVENTS (FUTURE + PAST)
204  $this->sinceDate = date('Y-01-01', strtotime('-' . $this->fbEventsYearRange . ' years'));
205  $this->untilDate = date('Y-01-01', strtotime('+' . $this->fbEventsYearRange . ' years'));
206  }
207  elseif ($this->fbEventsType == "future")
208  {
209  // UPCOMING EVENTS
210  $this->sinceDate = date('Y-m-d');
211  $this->untilDate = date('Y-12-31', strtotime('+' . $this->fbEventsYearRange . ' years'));
212  }
213  elseif ($this->fbEventsType === "past")
214  {
215  // PAST EVENTS
216  $this->sinceDate = date('Y-01-01', strtotime('-' . $this->fbEventsYearRange . ' years'));
217  $this->untilDate = date('Y-m-d');
218  }
219  else
220  { // IF NOT SET - use default:
221  // UPCOMING EVENTS
222  $this->sinceDate = date('Y-m-d');
223  $this->untilDate = date('Y-12-31', strtotime('+' . $this->fbEventsYearRange . ' years'));
224  }
225 
226  // IF START + END DATE IS SET
227  if (isset($this->fbEventsStartDate) && (!empty($this->fbEventsStartDate))
228  && (isset($this->fbEventsEndDate) && (!empty($this->fbEventsEndDate))))
229  {
230  $this->sinceDate = date($this->fbEventsStartDate);
231  $this->untilDate = date($this->fbEventsEndDate);
232  }
233 
234  // unix timestamp years
235  $since_unix_timestamp = strtotime($this->sinceDate);
236  $until_unix_timestamp = strtotime($this->untilDate);
237 
238  // prepare fields
239  // $this->fields="id,name,description,place,start_time,cover,maybe_count,attending_count,is_canceled";
240 
241  // prepare API call
242  // $json_link = "https://graph.facebook.com/v3.1/{$this->fbEventsPageId}/events/attending/?fields={$this->fields}&access_token={$this->fbEventsAccessToken}&since={$since_unix_timestamp}&until={$until_unix_timestamp}";
243  // $json_link = "https://graph.facebook.com/v2.7/{$this->fbEventsPageId}/events/attending/?fields={$this->fields}&access_token={$this->fbEventsAccessToken}&since={$since_unix_timestamp}&until={$until_unix_timestamp}";
244  // $json_link = "https://graph.facebook.com/v3.1/me/events/?fields={$this->fields}&access_token={$this->fbEventsAccessToken}&since={$since_unix_timestamp}&until={$until_unix_timestamp}";
245  // $json_link = "https://graph.facebook.com/v3.3/me/events/?fields={$this->fields}&access_token={$this->fbEventsAccessToken}&since={$since_unix_timestamp}&until={$until_unix_timestamp}";
246 
247  // $json_link = "https://graph.facebook.com/v14.0/me/events?access_token={$this->fbEventsAccessToken}&fields={$this->fields}&created_time={$since_unix_timestamp}";
248  $json_link = "https://graph.facebook.com/v14.0/me/events?access_token={$this->fbEventsAccessToken}&fields={$this->fields}&created_time={$this->since_unix_timestamp}";
249  // get json string
250  // $json = file_get_contents($json_link);
251  // convert json to object
252  // $obj = json_decode($json, true, 512, JSON_BIGINT_AS_STRING);
253 
254  $curl = curl_init();
255  curl_setopt($curl, CURLOPT_URL, $json_link);
256  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
257  // decode json and create object
258  $obj = json_decode(curl_exec($curl), true, 512, JSON_BIGINT_AS_STRING);
259  curl_close($curl);
260 
261  /*
262  echo "<pre>";
263  print_r($this);
264  echo "<hr>";
265  print_r($obj);
266  echo "</pre>";
267  exit;
268  */
269 
270  // if object is set, but array got not data...
271  if (isset($obj) && (is_array($obj) && (is_array($obj['data']) && (empty($obj['data'])))))
272  { // no upcoming data found
273  if (isset($this->fbEventsType) && (!empty($this->fbEventsType) && $this->fbEventsType == "future"))
274  {
275  // echo "Sorry, no upcoming events were found.";
276  $this->errorMsg = "Im Moment sind keine Termine geplant.";
277  }
278  // no past data found
279  else if (isset($this->fbEventsType) && (!empty($this->fbEventsType) && $this->fbEventsType == "past"))
280  {
281  // echo "Sorry, no past events were found.";
282  $this->errorMsg = "Sorry, es wurden keine vergangenen Konzerte gefunden.";
283  }
284  else
285  { // in any other empty array case
286  // echo "Sorry, no events were found.";
287  $this->errorMsg = "Im Moment gibt es keine Termine.";
288  }
289  }
290 
291  // sort data
292  if ($this->fbEventsSortation === "asc")
293  { // reverse array data to display upcoming event first
294  $obj['data'] = array_reverse($obj['data']);
295  }
296 
297  // CHECK, if a limit should be set
298  if (isset($this->fbEventsLimit) && (!empty($this->fbEventsLimit)))
299  {
300  $obj['data'] = array_slice($obj['data'], 0 -$this->fbEventsLimit);
301  }
302 
303  // $i will be used for counting elements and to help animate content
304  $i = 0;
305 
306  /* HEADING */
307  // if a heading is set and not empty
308  if (isset($this->fbEventsHeading) && (!empty($this->fbEventsHeading)))
309  { // add a h1 tag to heading string
310  $this->fbEventsHeading = "$this->fbEventsHeading";
311 
312  // if subtext is set, add <small> subtext to string
313  if (isset($this->fbEventsSubtext) && (!empty($this->fbEventsSubtext)))
314  { // build a headline with heading and subtext
315  $this->fbEventsSubtext = "<small>$this->fbEventsSubtext</small>";
316  $this->headline = "<h1>$this->fbEventsHeading&nbsp;"."$this->fbEventsSubtext</h1>";
317  }
318  else
319  { // build just a headline - without subtext
320  $this->headline = "<h1>$this->fbEventsHeading</h1>"; // draw just the heading
321  }
322  }
323  else
324  { // leave empty if it's not set
325  $this->headline = '';
326  }
327 
328  // check, if there are any errors
329  if (isset($this->errorMsg) && (!empty($this->errorMsg)))
330  {
331  // OUTPUT ERROR MSG (workaround)
332  // echo "<br>".$this->errorMsg;
333  }
334  else
335  {
336  // OUTPUT HEADING (title)
337  echo $this->headline;
338  }
339 
340 
341  // DATA PROCESSING START HERE
342  // walk through object data
343  foreach ($obj['data'] as $this->data => $this->event)
344  {
345  // the event date as obj
346  $this->eventDate = new \DateTime($this->event['start_time']);
347  // the event date formatted as pretty date
348  $this->prettyDate = $this->eventDate->format('d.m.Y H:i');
349  // current time as obj
350  $now = new \DateTime();
351 
352  // difference (object) between now and event date
353  $until = $now->diff($this->eventDate, true);
354 
355  // the event date as string in format:
356  $eventDateSimple = $this->eventDate->format('Y-m-d');
357  // current date as string in format:
358  $currentDateSimple = $now->format('Y-m-d');
359 
360  // some german stuff
361  if ($this->eventDate > $now)
362  { // future prepend text
363  $prepend = "in";
364  }
365  else
366  { // past prepend text
367  $prepend = "vor";
368  }
369 
370  // calculate how many days, weeks, months or years the event is away
371  // MONTHS: time between more than one month and under one year
372  if ($until->days >= 31 && ($until->days < 365))
373  { // less than two months
374  if ($until->m < 2)
375  { // singular
376  $duration = "Monat";
377  }
378  else
379  { // plural
380  $duration = "Monaten";
381  }
382  // set wordy date string
383  $this->dateString = "$prepend $until->m $duration";
384  }
385  // not within a year
386  else if ($until->days >= 365)
387  { // less than two years
388  if ($until->y < 2)
389  { // singular
390  $duration = "Jahr";
391  }
392  else
393  { // plural
394  $duration = "Jahren";
395  }
396  // set wordy date string
397  $this->dateString = "$prepend $until->y $duration";
398  }
399 
400  // split month into smaller bits
401  else if ($until->days === 14)
402  {
403  if ($this->eventDate > $now)
404  {
405  // in exactly two weeks
406  $this->dateString = "in zwei Wochen";
407  }
408  else
409  {
410  // two weeks ago
411  $this->dateString = "vor zwei Wochen";
412  }
413  }
414  else if ($until->days >= 8 && ($until->days <= 13))
415  { if ($this->eventDate > $now)
416  {
417  // nearly two weeks
418  $this->dateString = "in knapp zwei Wochen";
419  }
420  else
421  {
422  // nearly two weeks ago
423  $this->dateString = "vor knapp zwei Wochen";
424  }
425  }
426  else if ($until->days === 7)
427  { if ($this->eventDate > $now)
428  {
429  // in exactly one week
430  $this->dateString = "in einer Woche";
431  }
432  else
433  {
434  // exactly one week ago
435  $this->dateString = "vor einer Woche";
436  }
437  }
438  else if ($until->days === 2)
439  {
440  if ($this->eventDate > $now)
441  {
442  // in two days
443  $this->dateString = "&uuml;bermorgen";
444  }
445  else
446  {
447  // two days ago
448  $this->dateString = "vorgestern";
449  }
450  }
451  else if ($until->days === 1)
452  {
453  if ($this->eventDate > $now)
454  {
455  // tomorrow
456  $this->dateString = "<span class=\"".$this->fbEventsDatewordCss."\">morgen</span>";
457  }
458  else
459  {
460  // yesterday
461  $this->dateString = "<span class=\"".$this->fbEventsDatewordCss."\">gestern</span>";
462  }
463  }
464  // 0 days remaining, eventDate and currentDate are the same -
465  else if ($eventDateSimple == $currentDateSimple)
466  { // it must be today
467  $this->dateString = "<span class=\"".$this->fbEventsDatewordCss."\">HEUTE !</span>";
468  }
469  else
470  { if ($this->eventDate > $now)
471  {
472  // any other amount of days
473  $this->dateString = "$prepend $until->d Tagen";
474  }
475  else
476  {
477  // must be yesterday
478  if ($until->d === 0 && ($until->m === 0))
479  {
480  $this->dateString = "gestern";
481  }
482  else
483  { // x days ago
484  // less than two months
485  if ($until->m < 2)
486  { // singular
487  $duration = "Monat";
488  }
489  else
490  { // plural
491  $duration = "Monaten";
492  }
493  if ($until->m >= 1)
494  {
495  $this->dateString = "$prepend $until->m $duration";
496  }
497  else
498  {
499  $this->dateString = "$prepend $until->d Tagen";
500  }
501  }
502  }
503  }
504 
505  // check if event is canceled
506  if (isset($this->fbEventsCanceledOn) && ($this->fbEventsCanceledOn == true))
507  {
508  if (isset($this->event['is_canceled']) && $this->event['is_canceled'] === true)
509  { // set markup for canceled events
510  $canceled = "<span class=\"".$this->fbEventsFontCanceledCss."\">ACHTUNG! ABGESAGT!</span><br>";
511  $delStart = "<del>";
512  $delEnd = "</del>";
513  }
514  else
515  { // event is not canceled - no markup needed
516  $canceled = '';
517  $delStart = '';
518  $delEnd = '';
519  }
520  }
521  else
522  { // event is not canceled - no markup needed
523  $canceled = '';
524  $delStart = '';
525  $delEnd = '';
526  }
527 
528  // check if people counter is enabled or disabled
529  if (isset($this->fbEventsShowCounter) && ($this->fbEventsShowCounter == "true"))
530  { // do it only, if maybe_count and attending_count are set and valid
531  if (isset($this->event['maybe_count']) && (!empty($this->event['maybe_count']))
532  && (isset($this->event['attending_count'])))
533  { // add maybe people and attending people to get a more attractive number
534  $this->iPeopleCount = $this->event['maybe_count'] + $this->event['attending_count'];
535  }
536  // if there are more than 0 people interested
537  if (isset($this->iPeopleCount) && ($this->iPeopleCount != 0))
538  { // generate string that will be displayed in the frontend
539  if ($this->eventDate > $now)
540  { // future events
541  $this->showPeople = "<br><br><i class=\"$this->fbEventsFontPeopleCss\">" . $this->iPeopleCount . " Personen sind daran interessiert oder werden dieses Konzert besuchen.</i>";
542  }
543  else
544  { // past events
545  $this->showPeople = "<br><br><i class=\"$this->fbEventsFontPeopleCss\">" . $this->iPeopleCount . " Personen waren daran interessiert oder haben dieses Konzert besucht.</i>";
546  }
547  }
548  else
549  { // no people are interested or attending, leave string empty
550  $this->showPeople = '';
551  }
552  }
553  else
554  { // people counter is disabled, leave string empty
555  $this->showPeople = '';
556  }
557 
558  /** FONT EVENT NAME SETTINGS */
559  if (isset($this->fbEventsFontEventName) && (!empty($this->fbEventsFontEventName)))
560  {
561  $smallTagStart = '';
562  $smallTagEnd = '';
563 
564  if ($this->fbEventsFontEventName == "H1 SMALL")
565  {
566  $this->fontEventNameH = "H1";
567  $smallTagStart = "<small>";
568  $smallTagEnd = "</small>";
569  }
570  else if ($this->fbEventsFontEventName == "H2 SMALL")
571  {
572  $this->fontEventNameH = "H2";
573  $smallTagStart = "<small>";
574  $smallTagEnd = "</small>";
575  }
576  else if ($this->fbEventsFontEventName == "H3 SMALL")
577  {
578  $this->fontEventNameH = "H3";
579  $smallTagStart = "<small>";
580  $smallTagEnd = "</small>";
581  }
582  else if ($this->fbEventsFontEventName == "H4 SMALL")
583  {
584  $this->fontEventNameH = "H4";
585  $smallTagStart = "<small>";
586  $smallTagEnd = "</small>";
587  }
588  else if ($this->fbEventsFontEventName == "H5 SMALL")
589  {
590  $this->fontEventNameH = "H5";
591  $smallTagStart = "<small>";
592  $smallTagEnd = "</small>";
593  }
594  else if ($this->fbEventsFontEventName == "H6 SMALL")
595  {
596  $this->fontEventNameH = "H6";
597  $smallTagStart = "<small>";
598  $smallTagEnd = "</small>";
599  }
600  else
601  {
602  $this->fontEventNameH = $this->fbEventsFontEventName;
603  }
604 
605  if (isset($this->fbEventsFontEventNameCss) && (!empty($this->fbEventsFontEventNameCss)))
606  {
607  $fontTitleCss = " class=\"".$this->fbEventsFontEventNameCss."\"";
608  }
609  else
610  {
611  $fontTitleCss = '';
612  }
613  // check if facebook link is enabled
614  if (isset($this->fbEventsFbLink) && ($this->fbEventsFbLink === "true"))
615  { // facebook link
616  $fbLinkStart = "<a href=\"https://www.facebook.com/events/".$this->event['id']."\" title=\"auf Facebook &ouml;ffnen: ".$this->event['name']."\" target=\"_blank\">";
617  $fbLinkEnd = "</a>";
618  }
619  else
620  { // facebook link disabled
621  $fbLinkStart = '';
622  $fbLinkEnd = '';
623  }
624  $fontTitleStart = "".$fbLinkStart."<".$this->fontEventNameH."".$fontTitleCss.">".$smallTagStart."";
625  $fontTitleEnd = "".$smallTagEnd."</".$this->fontEventNameH.">".$fbLinkEnd."";
626  }
627  else
628  {
629  $fontTitleStart = "<h4>";
630  $fontTitleEnd = "</h4>";
631  }
632 
633  /** FONT EVENT DATE SETTINGS */
634  if (isset($this->fbEventsFontDate) && (!empty($this->fbEventsFontDate)))
635  {
636  $smallTagStartDate = '';
637  $smallTagEndDate = '';
638 
639  if ($this->fbEventsFontDate == "H1 SMALL")
640  {
641  $this->fontEventDateH = "H1";
642  $smallTagStartDate = "<small>";
643  $smallTagEndDate = "</small>";
644  }
645  else if ($this->fbEventsFontDate == "H2 SMALL")
646  {
647  $this->fontEventDateH = "H2";
648  $smallTagStartDate = "<small>";
649  $smallTagEndDate = "</small>";
650  }
651  else if ($this->fbEventsFontDate == "H3 SMALL")
652  {
653  $this->fontEventDateH = "H3";
654  $smallTagStartDate = "<small>";
655  $smallTagEndDate = "</small>";
656  }
657  else if ($this->fbEventsFontDate == "H4 SMALL")
658  {
659  $this->fontEventDateH = "H4";
660  $smallTagStartDate = "<small>";
661  $smallTagEndDate = "</small>";
662  }
663  else if ($this->fbEventsFontDate == "H5 SMALL")
664  {
665  $this->fontEventDateH = "H5";
666  $smallTagStartDate = "<small>";
667  $smallTagEndDate = "</small>";
668  }
669  else if ($this->fbEventsFontDate == "H6 SMALL")
670  {
671  $this->fontEventDateH = "H6";
672  $smallTagStartDate = "<small>";
673  $smallTagEndDate = "</small>";
674  }
675  else
676  {
677  $this->fontEventDateH = $this->fbEventsFontDate;
678  }
679 
680  if (isset($this->fbEventsFontDateCss) && (!empty($this->fbEventsFontDateCss)))
681  {
682  $fontDateCss = " class=\"".$this->fbEventsFontDateCss."\"";
683  }
684  else
685  {
686  $fontDateCss = '';
687  }
688  $fontDateStart = "<".$this->fontEventDateH."".$fontDateCss.">".$smallTagStartDate."";
689  $fontDateEnd = "".$smallTagEndDate."</".$this->fontEventDateH.">";
690  }
691  else
692  {
693  $fontDateStart = "<h4><small>";
694  $fontDateEnd = "</h4></small>";
695  }
696 
697  /** FONT EVENT DATEWORD SETTINGS */
698  if (isset($this->fbEventsFontDateword) && (!empty($this->fbEventsFontDateword)))
699  {
700 
701  if ($this->fbEventsFontDateword == "true")
702  {
703  $smallTagStartDateword = "<small>";
704  $smallTagEndDateword = "</small>";
705  }
706  else
707  {
708  $smallTagStartDateword = "";
709  $smallTagEndDateword = "";
710  }
711 
712  if (isset($this->fbEventsDatewordCss) && (!empty($this->fbEventsDatewordCss)))
713  {
714  $fontDatewordCssStart = "<span class=\"".$this->fbEventsDatewordCss."\">";
715  $fontDatewordCssEnd = "</span>";
716  }
717  else
718  {
719  $fontDatewordCssStart = '';
720  $fontDatewordCssEnd = '';
721  }
722  $fontDatewordStart = "$smallTagStartDateword".$fontDatewordCssStart."";
723  $fontDatewordEnd = "$fontDatewordCssEnd".$smallTagEndDateword."";
724  }
725  else
726  {
727  $fontDatewordStart = "<small>";
728  $fontDatewordEnd = "</small>";
729  }
730 
731 
732  /** FONT EVENT Location SETTINGS */
733  if (isset($this->fbEventsFontLocation) && (!empty($this->fbEventsFontLocation)))
734  {
735  $smallTagStartLocation = '';
736  $smallTagEndLocation = '';
737 
738  if ($this->fbEventsFontLocation == "H1 SMALL")
739  {
740  $this->fontEventLocationH = "H1";
741  $smallTagStartLocation = "<small>";
742  $smallTagEndLocation = "</small>";
743  }
744  else if ($this->fbEventsFontLocation == "H2 SMALL")
745  {
746  $this->fontEventLocationH = "H2";
747  $smallTagStartLocation = "<small>";
748  $smallTagEndLocation = "</small>";
749  }
750  else if ($this->fbEventsFontLocation == "H3 SMALL")
751  {
752  $this->fontEventLocationH = "H3";
753  $smallTagStartLocation = "<small>";
754  $smallTagEndLocation = "</small>";
755  }
756  else if ($this->fbEventsFontLocation == "H4 SMALL")
757  {
758  $this->fontEventLocationH = "H4";
759  $smallTagStartLocation = "<small>";
760  $smallTagEndLocation = "</small>";
761  }
762  else if ($this->fbEventsFontLocation == "H5 SMALL")
763  {
764  $this->fontEventLocationH = "H5";
765  $smallTagStartLocation = "<small>";
766  $smallTagEndLocation = "</small>";
767  }
768  else if ($this->fbEventsFontLocation == "H6 SMALL")
769  {
770  $this->fontEventLocationH = "H6";
771  $smallTagStartLocation = "<small>";
772  $smallTagEndLocation = "</small>";
773  }
774  else
775  {
776  $this->fontEventLocationH = $this->fbEventsFontLocation;
777  }
778 
779  if (isset($this->fbEventsFontLocationCss) && (!empty($this->fbEventsFontLocationCss)))
780  {
781  $fontLocationCss = " class=\"".$this->fbEventsFontLocationCss."\"";
782  }
783  else
784  {
785  $fontLocationCss = '';
786  }
787  $fontLocationStart = "<".$this->fontEventLocationH."".$fontLocationCss.">".$smallTagStartLocation."";
788  $fontLocationEnd = "".$smallTagEndLocation."</".$this->fontEventLocationH.">";
789  }
790  else
791  {
792  $fontLocationStart = "<h4><small>";
793  $fontLocationEnd = "</h4></small>";
794  }
795 
796 
797  /** FONT EVENT Address SETTINGS */
798  if (isset($this->fbEventsFontAddress) && (!empty($this->fbEventsFontAddress)))
799  {
800  $smallTagStartAddress = '';
801  $smallTagEndAddress = '';
802 
803  if ($this->fbEventsFontAddress == "H1 SMALL")
804  {
805  $this->fontEventAddressH = "H1";
806  $smallTagStartAddress = "<small>";
807  $smallTagEndAddress = "</small>";
808  }
809  else if ($this->fbEventsFontAddress == "H2 SMALL")
810  {
811  $this->fontEventAddressH = "H2";
812  $smallTagStartAddress = "<small>";
813  $smallTagEndAddress = "</small>";
814  }
815  else if ($this->fbEventsFontAddress == "H3 SMALL")
816  {
817  $this->fontEventAddressH = "H3";
818  $smallTagStartAddress = "<small>";
819  $smallTagEndAddress = "</small>";
820  }
821  else if ($this->fbEventsFontAddress == "H4 SMALL")
822  {
823  $this->fontEventAddressH = "H4";
824  $smallTagStartAddress = "<small>";
825  $smallTagEndAddress = "</small>";
826  }
827  else if ($this->fbEventsFontAddress == "H5 SMALL")
828  {
829  $this->fontEventAddressH = "H5";
830  $smallTagStartAddress = "<small>";
831  $smallTagEndAddress = "</small>";
832  }
833  else if ($this->fbEventsFontAddress == "H6 SMALL")
834  {
835  $this->fontEventAddressH = "H6";
836  $smallTagStartAddress = "<small>";
837  $smallTagEndAddress = "</small>";
838  }
839  else
840  {
841  $this->fontEventAddressH = $this->fbEventsFontAddress;
842  }
843 
844  if (isset($this->fbEventsFontAddressCss) && (!empty($this->fbEventsFontAddressCss)))
845  {
846  $fontAddressCss = " class=\"".$this->fbEventsFontAddressCss."\"";
847  }
848  else
849  {
850  $fontAddressCss = '';
851  }
852  $fontAddressStart = "<".$this->fontEventAddressH."".$fontAddressCss.">".$smallTagStartAddress."";
853  $fontAddressEnd = "".$smallTagEndAddress."</".$this->fontEventAddressH.">";
854  }
855  else
856  {
857  $fontAddressStart = "";
858  $fontAddressEnd = "";
859  }
860 
861 
862  /** FONT EVENT Description SETTINGS */
863  if (isset($this->fbEventsFontDescription) && (!empty($this->fbEventsFontDescription)))
864  {
865  $smallTagStartDescription = '';
866  $smallTagEndDescription = '';
867 
868  if ($this->fbEventsFontDescription == "H1 SMALL")
869  {
870  $this->fontEventDescriptionH = "H1";
871  $smallTagStartDescription = "<small>";
872  $smallTagEndDescription = "</small>";
873  }
874  else if ($this->fbEventsFontDescription == "H2 SMALL")
875  {
876  $this->fontEventDescriptionH = "H2";
877  $smallTagStartDescription = "<small>";
878  $smallTagEndDescription = "</small>";
879  }
880  else if ($this->fbEventsFontDescription == "H3 SMALL")
881  {
882  $this->fontEventDescriptionH = "H3";
883  $smallTagStartDescription = "<small>";
884  $smallTagEndDescription = "</small>";
885  }
886  else if ($this->fbEventsFontDescription == "H4 SMALL")
887  {
888  $this->fontEventDescriptionH = "H4";
889  $smallTagStartDescription = "<small>";
890  $smallTagEndDescription = "</small>";
891  }
892  else if ($this->fbEventsFontDescription == "H5 SMALL")
893  {
894  $this->fontEventDescriptionH = "H5";
895  $smallTagStartDescription = "<small>";
896  $smallTagEndDescription = "</small>";
897  }
898  else if ($this->fbEventsFontDescription == "H6 SMALL")
899  {
900  $this->fontEventDescriptionH = "H6";
901  $smallTagStartDescription = "<small>";
902  $smallTagEndDescription = "</small>";
903  }
904  else
905  {
906  $this->fontEventDescriptionH = $this->fbEventsFontDescription;
907  }
908 
909  if (isset($this->fbEventsFontDescriptionCss) && (!empty($this->fbEventsFontDescriptionCss)))
910  {
911  $fontDescriptionCss = " class=\"".$this->fbEventsFontDescriptionCss."\"";
912  }
913  else
914  {
915  $fontDescriptionCss = '';
916  }
917  $fontDescriptionStart = "<".$this->fontEventDescriptionH."".$fontDescriptionCss.">".$smallTagStartDescription."";
918  $fontDescriptionEnd = "".$smallTagEndDescription."</".$this->fontEventDescriptionH.">";
919  }
920  else
921  {
922  $fontDescriptionStart = "";
923  $fontDescriptionEnd = "";
924  }
925 
926 
927  /** FONT EVENT People SETTINGS */
928  if (isset($this->fbEventsFontPeople) && (!empty($this->fbEventsFontPeople)))
929  {
930  $smallTagStartPeople = '';
931  $smallTagEndPeople = '';
932 
933  if ($this->fbEventsFontPeople == "H1 SMALL")
934  {
935  $this->fontEventPeopleH = "H1";
936  $smallTagStartPeople = "<small>";
937  $smallTagEndPeople = "</small>";
938  }
939  else if ($this->fbEventsFontPeople == "H2 SMALL")
940  {
941  $this->fontEventPeopleH = "H2";
942  $smallTagStartPeople = "<small>";
943  $smallTagEndPeople = "</small>";
944  }
945  else if ($this->fbEventsFontPeople == "H3 SMALL")
946  {
947  $this->fontEventPeopleH = "H3";
948  $smallTagStartPeople = "<small>";
949  $smallTagEndPeople = "</small>";
950  }
951  else if ($this->fbEventsFontPeople == "H4 SMALL")
952  {
953  $this->fontEventPeopleH = "H4";
954  $smallTagStartPeople = "<small>";
955  $smallTagEndPeople = "</small>";
956  }
957  else if ($this->fbEventsFontPeople == "H5 SMALL")
958  {
959  $this->fontEventPeopleH = "H5";
960  $smallTagStartPeople = "<small>";
961  $smallTagEndPeople = "</small>";
962  }
963  else if ($this->fbEventsFontPeople == "H6 SMALL")
964  {
965  $this->fontEventPeopleH = "H6";
966  $smallTagStartPeople = "<small>";
967  $smallTagEndPeople = "</small>";
968  }
969  else if ($this->fbEventsFontPeople == "globaltext small")
970  {
971  $this->fontEventPeopleH = "span";
972  $smallTagStartPeople = "<small>";
973  $smallTagEndPeople = "</small>";
974  }
975  else
976  {
977  $this->fontEventPeopleH = $this->fbEventsFontPeople;
978  }
979 
980  if (isset($this->fbEventsFontPeopleCss) && (!empty($this->fbEventsFontPeopleCss)))
981  {
982  $fontPeopleCss = " class=\"".$this->fbEventsFontPeopleCss."\"";
983  }
984  else
985  {
986  $fontPeopleCss = '';
987  }
988  $fontPeopleStart = "<".$this->fontEventPeopleH."".$fontPeopleCss.">".$smallTagStartPeople."";
989  $fontPeopleEnd = "".$smallTagEndPeople."</".$this->fontEventPeopleH.">";
990  }
991  else
992  {
993  $fontPeopleStart = "<span class=\"text-muted\">";
994  $fontPeopleEnd = "</span>";
995  }
996 
997 
998  // is cover image enabled by widget settings?
999  if (isset($this->fbEventsShowCover) && ($this->fbEventsShowCover == "true"))
1000  { // if cover image source is set
1001  if (isset($this->event['cover']['source']) && (!empty($this->event['cover']['source'])))
1002  {
1003  // img html markup
1004  // check if custom cover class is set
1005  if (isset($this->fbEventsCoverClass) && (!empty($this->fbEventsCoverClass)))
1006  { // yep, display it with custom class
1007  // check if facebook link is enabled
1008 
1009  // check if facebook link is enabled
1010  if (isset($this->fbEventsFbLink) && ($this->fbEventsFbLink === "true"))
1011  { // facebook link
1012  $fbLinkStart = "<a href=\"https://www.facebook.com/events/".$this->event['id']."\" title=\"auf Facebook &ouml;ffnen: ".$this->event['name']."\" target=\"_blank\">";
1013  $fbLinkEnd = "</a>";
1014  }
1015  else
1016  { // facebook link disabled
1017  $fbLinkStart = '';
1018  $fbLinkEnd = '';
1019  }
1020  $coverImage = "<br>".$fbLinkStart."<img src=\"" . $this->event['cover']['source'] . "\" title=\"" . $this->event['name'] . "\" class=\"img-center ".$this->fbEventsCoverClass."\">".$fbLinkEnd."";
1021  }
1022  else
1023  { // default: img-thumbnail responsive
1024  $coverImage = "<br><img src=\"" . $this->event['cover']['source'] . "\" title=\"" . $this->event['name'] . "\" class=\"img-thumbnail img-fluid\">";
1025  }
1026  }
1027  else
1028  { // no image - no source, leave empty
1029  $coverImage = '';
1030  }
1031  }
1032  else
1033  { // cover image disabled by widget settings, leave empty
1034  $coverImage = '';
1035  }
1036 
1037  if ($i < 1)
1038  {
1039  $animate = " animated fadeIn";
1040  }
1041  else
1042  {
1043  $animate = " animate";
1044  }
1045 
1046  // check address street var
1047  if (isset($this->event['place']['location']['street']) && (!empty($this->event['place']['location']['street'])))
1048  {
1049  $this->address = $this->event['place']['location']['street'].", ";
1050  }
1051  else
1052  {
1053  $this->address = '';
1054  }
1055  // check address zip var
1056  if (isset($this->event['place']['location']['zip']) && (!empty($this->event['place']['location']['zip'])))
1057  {
1058  $this->address .= $this->event['place']['location']['zip'].", ";
1059  }
1060  else
1061  {
1062  $this->address = '';
1063  }
1064  // check address city var
1065  if (isset($this->event['place']['location']['city']) && (!empty($this->event['place']['location']['city'])))
1066  {
1067  $this->address .= $this->event['place']['location']['city'].", ";
1068  }
1069  else
1070  {
1071  $this->address = '';
1072  }
1073  // check address country var
1074  if (isset($this->event['place']['location']['country']) && (!empty($this->event['place']['location']['country'])))
1075  {
1076  $this->address .= $this->event['place']['location']['country'];
1077  }
1078  else
1079  {
1080  $this->address = '';
1081  }
1082 
1083  // check google map setting
1084  //$latitude = $this->event['place']['location']['latitute'];
1085  //$longitude = $this->event['place']['location']['longitute'];
1086  if (isset($this->fbEventsGoogleMap) && ($this->fbEventsGoogleMap == "true"))
1087  {
1088  $googleMapMarkup = "<a class=\"hvr-grow\" target=\"_blank\" title=\"auf Google Maps ansehen\" href=\"http://maps.google.de/maps/dir/".$this->event['place']['location']['latitude'].",".$this->event['place']['location']['longitude']."\"><i class=\"fa fa-map-marker\"></i></a>";
1090  $this->address = "".$address."&nbsp;&nbsp;".$googleMapMarkup."";
1091  }
1092 
1093  // check if hr class is set
1094  if (isset($this->fbEventsHrClass) && (!empty($this->fbEventsHrClass)))
1095  {
1096  $hrClass = " class=\"".$this->fbEventsHrClass."".$animate."\"";
1097  }
1098  else
1099  {
1100  $hrClass = '';
1101  }
1102 
1103  // search for links in event description and set html markup to link them
1104  if (isset($this->event['description']) && (!empty($this->event['description'])))
1105  {
1106  // regex filter
1107  $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
1108 
1109  // check if there is a URL in the string
1110  if(preg_match($reg_exUrl, $this->event['description'], $url))
1111  {
1112  // change urls to true hyperlinks
1113  $this->event['description'] = preg_replace($reg_exUrl, '<a href="'.$url[0].'" target="_blank">'.$url[0].'</a> ', $this->event['description']);
1114  }
1115  }
1116 
1117  if (isset($this->fbEventsCanceledOn) && ($this->fbEventsCanceledOn == true))
1118  {
1119 
1120  /* LAYOUTS */
1121  // All Events will be displayed within one of the following layouts:
1122 
1123  // MINIMAL
1124  if (isset($this->fbEventsLayout) && ($this->fbEventsLayout == "minimal"))
1125  {
1126  echo "<div class=\"container-fluid\">";
1127  echo "<div class=\"row".$animate."\">";
1128  echo "<div class=\"col-md-12\">";
1129  echo "".$fontTitleStart."".$canceled."".$delStart."".$this->event['name']."".$fontTitleEnd."";
1130  echo "".$fontDateStart."".$delStart."".$this->prettyDate." Uhr ".$fontDatewordStart."(".$this->dateString.")".$fontDatewordEnd."".$delEnd."".$fontDateEnd."<br>";
1131  echo "".$delStart."".$fontLocationStart."".$this->event['place']['name']."".$fontLocationEnd."<br>".$fontAddressStart."".$this->address."".$fontAddressEnd."".$delEnd."";
1132  echo "".$fontPeopleStart."".$this->showPeople."".$fontPeopleEnd."";
1133  echo "</div></div></div><br><br><br><br><br>";
1134  $i++;
1135  }
1136 
1137  // TABLE
1138  // draw events within a classical table view
1139  if (isset($this->fbEventsLayout) && ($this->fbEventsLayout == "table"))
1140  { // if cover should be displayed
1141  if (isset($this->fbEventsShowCover) && ($this->fbEventsShowCover === "true"))
1142  { // if cover source is found (if event got a picture)
1143  if (isset($this->event['cover']['source']))
1144  { // display facebook event picture
1145  $coverImage = " style=\"background-image:url(".$this->event['cover']['source'].");background-repeat:no-repeat;background-size:250px; width: 250px; height: 180px;\"";
1146  }
1147  else
1148  { // no source found, leave empty
1149  $coverImage = '';
1150  }
1151  }
1152  else
1153  { // cover image set to false - do not show cover image
1154  $coverImage = '';
1155  }
1156  echo "<div class=\"container-fluid\" style=\"background-color:#".$this->fbEventsBgColor."; color:#".$this->fbEventsTextColor.";\">";
1157  echo "<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" class=\"table table-responsive".$animate."\">";
1158  echo "<tr>";
1159  echo "<td width=\"14%\"".$coverImage.">";
1160  echo "</td>";
1161  echo "<td>";
1162  echo "".$fontTitleStart."".$canceled."".$delStart."" . $this->event['name'] . "</b><br>" . $this->event['place']['name'] . "<br><small>" . $this->prettyDate . " Uhr <small>(" . $this->dateString . ")</small></small><br><small>(" . $this->event['place']['location']['street'] . ", " . $this->event['place']['location']['zip'] . " " . $this->event['place']['location']['city'] . ", " . $this->event['place']['location']['country'] . ")</small>".$fontTitleEnd."" . $delEnd . "<br>".$this->event['description']."";
1163  echo "</td>";
1164  echo "</tr>";
1165  echo "</table>";
1166  echo "</div>";
1167  $i++;
1168  }
1169 
1170  if (isset($this->fbEventsLayout) && ($this->fbEventsLayout == "left"))
1171  {
1172  // jumbotron output
1173  echo "<div class=\"jumbotron".$animate."\" style=\"background-color:#".$this->fbEventsBgColor."; color:#".$this->fbEventsTextColor.";\">";
1174  echo "<div class=\"row\">";
1175  echo "<div class=\"col-md-4 text-center align-middle\">";
1176  echo "".$coverImage."";
1177  echo "<br></div>";
1178  echo "<div class=\"col-md-8\">";
1179  echo "".$fontTitleStart."".$canceled."".$delStart."".$this->event['name']."".$fontTitleEnd."";
1180  echo "".$fontDateStart."".$delStart."".$this->prettyDate." Uhr ".$fontDatewordStart."(".$this->dateString.")".$fontDatewordEnd."".$delEnd."".$fontDateEnd."<br>";
1181  echo "".$delStart."".$fontLocationStart."".$this->event['place']['name']."".$fontLocationEnd."<br>".$fontAddressStart."".$this->address."".$fontAddressEnd."".$delEnd."<hr".$hrClass.">";
1182  echo "".$fontDescriptionStart."".$this->event['description']."".$fontDescriptionEnd."";
1183  echo "".$fontPeopleStart."".$this->showPeople."".$fontPeopleEnd."";
1184  echo "</div>";
1185  echo "</div>";
1186  echo "</div><br><br><br>";
1187  $i++;
1188  }
1189 
1190  if (isset($this->fbEventsLayout) && ($this->fbEventsLayout == "top"))
1191  {
1192  // jumbotron output
1193  echo "<div class=\"jumbotron".$animate."\" style=\"background-color:#".$this->fbEventsBgColor."; color:#".$this->fbEventsTextColor.";\">";
1194  echo "<div class=\"row\">";
1195  echo "<div class=\"col-md-12 text-center align-middle\">";
1196  echo "".$coverImage."<br>";
1197  echo "".$fontTitleStart."".$canceled."".$delStart."".$this->event['name']."".$fontTitleEnd."";
1198  echo "".$fontDateStart."".$delStart."".$this->prettyDate." Uhr ".$fontDatewordStart."(".$this->dateString.")".$fontDatewordEnd."".$delEnd."".$fontDateEnd."<br>";
1199  echo "".$delStart."".$fontLocationStart."".$this->event['place']['name']."".$fontLocationEnd."<br>".$fontAddressStart."".$this->address."".$fontAddressEnd."".$delEnd."<hr".$hrClass.">";
1200  echo "".$fontDescriptionStart."".$this->event['description']."".$fontDescriptionEnd."";
1201  echo "".$fontPeopleStart."".$this->showPeople."".$fontPeopleEnd."";
1202  echo "</div>";
1203  echo "</div>";
1204  echo "</div><br><br><br>";
1205  $i++;
1206  }
1207 
1208 
1209  if (isset($this->fbEventsLayout) && ($this->fbEventsLayout == "middle"))
1210  {
1211  // jumbotron output
1212  echo "<div class=\"container-fluid\">";
1213  echo "<div class=\"".$animate."\" style=\"background-color:#".$this->fbEventsBgColor."; color:#".$this->fbEventsTextColor.";\">";
1214  echo "<div class=\"row\">";
1215  echo "<div class=\"col-md-12 text-center align-middle\"><br>";
1216  echo "".$fontTitleStart."".$canceled."".$delStart."".$this->event['name']."".$fontTitleEnd."";
1217  echo "".$coverImage."<br>";
1218  echo "".$fontDateStart."".$delStart."".$this->prettyDate." Uhr ".$fontDatewordStart."(".$this->dateString.")".$fontDatewordEnd."".$delEnd."".$fontDateEnd."<br>";
1219  echo "".$delStart."".$fontLocationStart."".$this->event['place']['name']."".$fontLocationEnd."<br>".$fontAddressStart."".$this->address."".$fontAddressEnd."".$delEnd."<hr".$hrClass.">";
1220  echo "".$fontDescriptionStart."".$this->event['description']."".$fontDescriptionEnd."";
1221  echo "".$fontPeopleStart."".$this->showPeople."".$fontPeopleEnd."<br><br><br>";
1222  echo "</div>";
1223  echo "</div>";
1224  echo "</div><br><br><br>";
1225  $i++;
1226  }
1227 
1228  if (isset($this->fbEventsLayout) && ($this->fbEventsLayout == "middle2"))
1229  {
1230  // jumbotron output
1231  echo "<div class=\"jumbotron".$animate."\" style=\"background-color:#".$this->fbEventsBgColor."; color:#".$this->fbEventsTextColor.";\">";
1232  echo "<div class=\"row\">";
1233  echo "<div class=\"col-md-12 text-center align-middle\">";
1234  echo "".$fontTitleStart."".$canceled."".$delStart."".$this->event['name']."".$fontTitleEnd."";
1235  echo "".$fontDateStart."".$delStart."".$this->prettyDate." Uhr ".$fontDatewordStart."(".$this->dateString.")".$fontDatewordEnd."".$delEnd."".$fontDateEnd."";
1236  echo "".$coverImage."<br><br>";
1237  echo "".$delStart."".$fontLocationStart."".$this->event['place']['name']."".$fontLocationEnd."<br>".$fontAddressStart."".$this->address."".$fontAddressEnd."".$delEnd."<hr".$hrClass.">";
1238  echo "".$fontDescriptionStart."".$this->event['description']."".$fontDescriptionEnd."";
1239  echo "".$fontPeopleStart."".$this->showPeople."".$fontPeopleEnd."<br>";
1240  echo "</div>";
1241  echo "</div>";
1242  echo "</div><br><br><br>";
1243  $i++;
1244  }
1245 
1246  if (isset($this->fbEventsLayout) && ($this->fbEventsLayout == "middle3"))
1247  {
1248  // jumbotron output
1249  echo "<div class=\"jumbotron".$animate."\" style=\"background-color:#".$this->fbEventsBgColor."; color:#".$this->fbEventsTextColor.";\">";
1250  echo "<div class=\"row\">";
1251  echo "<div class=\"col-md-12 text-center align-middle\">";
1252  echo "".$fontTitleStart."".$canceled."".$delStart."".$this->event['name']."".$fontTitleEnd."";
1253  echo "".$fontDateStart."".$delStart."".$this->prettyDate." Uhr ".$fontDatewordStart."(".$this->dateString.")".$fontDatewordEnd."".$delEnd."".$fontDateEnd."";
1254  echo "".$delStart."".$fontLocationStart."".$this->event['place']['name']."".$fontLocationEnd."<br>".$fontAddressStart."".$this->address."".$fontAddressEnd."".$delEnd."";
1255  echo "<br>".$coverImage."<br><hr".$hrClass.">";
1256  echo "".$fontDescriptionStart."".$this->event['description']."".$fontDescriptionEnd."";
1257  echo "".$fontPeopleStart."".$this->showPeople."".$fontPeopleEnd."<br>";
1258  echo "</div>";
1259  echo "</div>";
1260  echo "</div><br><br><br>";
1261  $i++;
1262  }
1263 
1264  if (isset($this->fbEventsLayout) && ($this->fbEventsLayout == "right"))
1265  {
1266  // jumbotron output
1267  echo "<div class=\"jumbotron".$animate."\" style=\"background-color:#".$this->fbEventsBgColor."; color:#".$this->fbEventsTextColor.";\">";
1268  echo "<div class=\"row\">";
1269  echo "<div class=\"col-md-8\">";
1270  echo "".$fontTitleStart."".$canceled."".$delStart."".$this->event['name']."".$fontTitleEnd."";
1271  echo "".$fontDateStart."".$delStart."".$this->prettyDate." Uhr ".$fontDatewordStart."(".$this->dateString.")".$fontDatewordEnd."".$delEnd."".$fontDateEnd."<br>";
1272  echo "".$delStart."".$fontLocationStart."".$this->event['place']['name']."".$fontLocationEnd."<br>".$fontAddressStart."".$this->address."".$fontAddressEnd."".$delEnd."<hr".$hrClass.">";
1273  echo "".$fontDescriptionStart."".$this->event['description']."".$fontDescriptionEnd."";
1274  echo "".$fontPeopleStart."".$this->showPeople."".$fontPeopleEnd."";
1275  echo "</div>";
1276  echo "<div class=\"col-md-4 text-center align-middle\">";
1277  echo "".$coverImage."";
1278  echo "<br></div>";
1279  echo "</div>";
1280  echo "</div><br><br><br>";
1281  $i++;
1282  }
1283 
1284  if (isset($this->fbEventsLayout) && ($this->fbEventsLayout == "bottom"))
1285  {
1286  // jumbotron output
1287  echo "<div class=\"jumbotron".$animate."\" style=\"background-color:#".$this->fbEventsBgColor."; color:#".$this->fbEventsTextColor.";\">";
1288  echo "<div class=\"row\">";
1289  echo "<div class=\"col-md-12 text-center align-middle\">";
1290  echo "".$fontTitleStart."".$canceled."".$delStart."".$this->event['name']."".$fontTitleEnd."";
1291  echo "".$fontDateStart."".$delStart."".$this->prettyDate." Uhr ".$fontDatewordStart."(".$this->dateString.")".$fontDatewordEnd."".$delEnd."".$fontDateEnd."<br>";
1292  echo "".$delStart."".$fontLocationStart."".$this->event['place']['name']."".$fontLocationEnd."<br>".$fontAddressStart."".$this->address."".$fontAddressEnd."".$delEnd."<hr".$hrClass.">";
1293  echo "".$fontDescriptionStart."".$this->event['description']."".$fontDescriptionEnd."";
1294  echo "".$fontPeopleStart."".$this->showPeople."".$fontPeopleEnd."<br>";
1295  echo "".$coverImage."<br>";
1296  echo "</div>";
1297  echo "</div>";
1298  echo "</div><br><br><br>";
1299  $i++;
1300  }
1301  }
1302  }
1303  }
1304  else
1305  {
1306  die ("Unable to load data. AppID, Access Token or PageID is not set! Don't know what to do? Visit: <a href=\"http://developers.facebook.com\" target=\"_blank\">http://developers.facebook.com</a>");
1307  }
1308  } // end function display()
1309  } // end class events
1310 } // end namespace
$now
die
Definition: block-user.php:27
Widgets are small, useful tools that you can include everywhere in your website.
Definition: widget.php:22
getWidgetSettingsArray($db)
Get widget settings and return it as array.
Definition: widget.php:69
c jPlayer errorMsg
c jPlayer event
if(isset($_POST['save'])) $settings
print $tourdates date
$url
Definition: user-new.php:101
$value
$i