YaWK  24.1
Yet another WebKit
YAWK\WIDGETS\TWITTER\TIMELINE\twitterTimeline Class Reference

Embed Twitter Timeline. More...

+ Inheritance diagram for YAWK\WIDGETS\TWITTER\TIMELINE\twitterTimeline:

Public Member Functions

 __construct ($db)
 Load all widget settings from database and fill object. More...
 
 init ()
 Init Twitter Timeline Widget. More...
 
- Public Member Functions inherited from YAWK\widget
 getHeading ($heading, $subtext)
 Get widget heading and subtext, return headline. More...
 
 getWidgetSettingsArray ($db)
 Get widget settings and return it as array. More...
 
 printObject ()
 Print all object data. More...
 

Public Attributes

 $twitterTimelineHeading = ''
 
 $twitterTimelineSubtext = ''
 
 $twitterTimelineTweetLimit = "5"
 
 $twitterTimelineUrl = "https://twitter.com/danielretzl"
 
 $widget = ''
 
- Public Attributes inherited from YAWK\widget
 $data
 
 $date_publish
 
 $date_unpublish
 
 $folder
 
 $id
 
 $marginBottom
 
 $marginTop
 
 $name
 
 $pageID
 
 $position
 
 $published
 
 $sort
 
 $widgetTitle
 
 $widgetType
 

Additional Inherited Members

- Static Public Member Functions inherited from YAWK\widget
static getAllSettingsIntoArray ($db, $widgetID)
 Returns an array with all widget settings data. More...
 
static getAllWidgetTypes ($db)
 Return all widget types as associative array. More...
 
static getCurrentWidgetPath ($db)
 return current widget path More...
 
static getFacebookLikeBox ()
 return the facebook likebox widget More...
 
static getLoginBox ()
 return the user login box widget More...
 
static loadWidgetsOfPage ($db, $page)
 Returns an array of all widgets that are linked with given page->id. More...
 

Detailed Description

Embed Twitter Timeline.

Twitter Timeline Widget - embed Twitter Timeline

Embed Twitter Timeline. All you need is the URL of your twitter timeline and the amount of items you wish to embed. You will get the latest tweets.

Author
Daniel Retzl danie.nosp@m.lret.nosp@m.zl@gm.nosp@m.ail..nosp@m.com
Version
1.0.0

Definition at line 16 of file twitterTimeline.php.

Constructor & Destructor Documentation

◆ __construct()

YAWK\WIDGETS\TWITTER\TIMELINE\twitterTimeline::__construct (   $db)

Load all widget settings from database and fill object.

Parameters
object$dbDatabase Object

Load all widget settings on object init.

Definition at line 34 of file twitterTimeline.php.

36  {
37  // load this widget settings from db
38  $this->widget = new \YAWK\widget();
39  $settings = $this->widget->getWidgetSettingsArray($db);
40  foreach ($settings as $property => $value) {
41  $this->$property = $value;
42  }
if(isset($_POST['save'])) $settings
$value

References $db, $settings, $value, and YAWK\widget\getWidgetSettingsArray().

Member Function Documentation

◆ init()

YAWK\WIDGETS\TWITTER\TIMELINE\twitterTimeline::init ( )

Init Twitter Timeline Widget.

Twitter Timeline Widget Init

Definition at line 48 of file twitterTimeline.php.

50  { // display heading
51  echo $this->getHeading($this->twitterTimelineHeading, $this->twitterTimelineSubtext);
52 
53  // remove trailing slash from url
54  $this->twitterTimelineUrl = rtrim($this->twitterTimelineUrl,"/");
55  // explode user from URL
56  $twitterUserArray = explode("/", $this->twitterTimelineUrl);
57  $twitterUser = $twitterUserArray['3'];
58 
59 echo "<a class=\"twitter-timeline\" data-tweet-limit=\"$this->twitterTimelineTweetLimit\" href=\"$this->twitterTimelineUrl\">Tweets by $twitterUser</a>
60 <script async src=\"//platform.twitter.com/widgets.js\" charset=\"utf-8\"></script>";
getHeading($heading, $subtext)
Get widget heading and subtext, return headline.
Definition: widget.php:669

References YAWK\widget\getHeading().

Member Data Documentation

◆ $twitterTimelineHeading

YAWK\WIDGETS\TWITTER\TIMELINE\twitterTimeline::$twitterTimelineHeading = ''
Parameters
stringTitle that will be shown above widget

Definition at line 21 of file twitterTimeline.php.

◆ $twitterTimelineSubtext

YAWK\WIDGETS\TWITTER\TIMELINE\twitterTimeline::$twitterTimelineSubtext = ''
Parameters
stringSubtext will be displayed beside title

Definition at line 23 of file twitterTimeline.php.

◆ $twitterTimelineTweetLimit

YAWK\WIDGETS\TWITTER\TIMELINE\twitterTimeline::$twitterTimelineTweetLimit = "5"
Parameters
stringHow many tweets (latest n)

Definition at line 27 of file twitterTimeline.php.

◆ $twitterTimelineUrl

YAWK\WIDGETS\TWITTER\TIMELINE\twitterTimeline::$twitterTimelineUrl = "https://twitter.com/danielretzl"
Parameters
stringURL of your twitter timeline

Definition at line 25 of file twitterTimeline.php.

◆ $widget

YAWK\WIDGETS\TWITTER\TIMELINE\twitterTimeline::$widget = ''
Parameters
objectglobal widget object data

Definition at line 19 of file twitterTimeline.php.


The documentation for this class was generated from the following file: