YaWK  24.1
Yet another WebKit
YAWK\WIDGETS\TWITTER\GRID\twitterGrid Class Reference

Embed Twitter Timeline as grid. More...

+ Inheritance diagram for YAWK\WIDGETS\TWITTER\GRID\twitterGrid:

Public Member Functions

 __construct ($db)
 Load all widget settings from database and fill object. More...
 
 init ()
 Init Twitter 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

 $twitterGridHeading = ''
 
 $twitterGridSubtext = ''
 
 $twitterGridTweetLimit = "5"
 
 $twitterGridUrl = "https://twitter.com/TwitterDev/timelines/539487832448843776"
 
 $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 as grid.

Twitter Widget - embed Twitter Timeline as grid

Twitter Timelines can be embeded as grid view. 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 twitterGrid.php.

Constructor & Destructor Documentation

◆ __construct()

YAWK\WIDGETS\TWITTER\GRID\twitterGrid::__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 twitterGrid.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\GRID\twitterGrid::init ( )

Init Twitter widget.

Twitter Widget Init

Definition at line 48 of file twitterGrid.php.

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

References YAWK\widget\getHeading().

Member Data Documentation

◆ $twitterGridHeading

YAWK\WIDGETS\TWITTER\GRID\twitterGrid::$twitterGridHeading = ''
Parameters
stringTitle that will be shown above widget

Definition at line 21 of file twitterGrid.php.

◆ $twitterGridSubtext

YAWK\WIDGETS\TWITTER\GRID\twitterGrid::$twitterGridSubtext = ''
Parameters
stringSubtext will be displayed beside title

Definition at line 23 of file twitterGrid.php.

◆ $twitterGridTweetLimit

YAWK\WIDGETS\TWITTER\GRID\twitterGrid::$twitterGridTweetLimit = "5"
Parameters
stringHow many tweets (latest n)

Definition at line 27 of file twitterGrid.php.

◆ $twitterGridUrl

YAWK\WIDGETS\TWITTER\GRID\twitterGrid::$twitterGridUrl = "https://twitter.com/TwitterDev/timelines/539487832448843776"
Parameters
stringURL of your twitter timeline

Definition at line 25 of file twitterGrid.php.

◆ $widget

YAWK\WIDGETS\TWITTER\GRID\twitterGrid::$widget = ''
Parameters
objectglobal widget object data

Definition at line 19 of file twitterGrid.php.


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