YaWK  24.1
Yet another WebKit
YAWK\WIDGETS\PINTEREST\PIN\pinterestPin Class Reference

Pinterest Pin Widget. More...

+ Inheritance diagram for YAWK\WIDGETS\PINTEREST\PIN\pinterestPin:

Public Member Functions

 __construct ($db)
 Load all widget settings from database and fill object. More...
 
 embedPinterestPin ()
 Embed Pinterest Pin. More...
 
 init ()
 Init pinterest pin widget and call embed method. 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

 $pinterestPinHeading = ''
 
 $pinterestPinHideDescription = 'data-pin-terse="true"'
 
 $pinterestPinSize ="large"
 
 $pinterestPinSubtext = ''
 
 $pinterestPinUrl ="https://www.pinterest.com/pin/99360735500167749/"
 
 $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

Pinterest Pin Widget.

Pinterest Pin - embed a single pin on your page

Use this widget to embed any single pin on your page. To get this widget to work, enter any public pin url. Description can be shown or hidden, the size of your pin can be changed and heading and subtext could be added as well.

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 pinterest_pin.php.

Constructor & Destructor Documentation

◆ __construct()

YAWK\WIDGETS\PINTEREST\PIN\pinterestPin::__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 36 of file pinterest_pin.php.

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

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

Member Function Documentation

◆ embedPinterestPin()

YAWK\WIDGETS\PINTEREST\PIN\pinterestPin::embedPinterestPin ( )

Embed Pinterest Pin.

Embed Pinterest Pin

Definition at line 60 of file pinterest_pin.php.

62  { // check if url is set
63  if (isset($this->pinterestPinUrl)
64  && (!empty($this->pinterestPinUrl)
65  && (is_string($this->pinterestPinUrl))))
66  { // embed pinterest follow button markup
67  echo '
68  <a data-pin-do="embedPin" data-pin-width="'.$this->pinterestPinSize.'" data-pin-terse="'.$this->pinterestPinHideDescription.'" href="'.$this->pinterestPinUrl.'"></a>
69  <script async defer src="//assets.pinterest.com/js/pinit.js"></script>';
70  }
71  else
72  {
73  echo "Here should be a pinterest pin, but no URL is set. Please enter your pinterest pin URL.";
74  }

Referenced by YAWK\WIDGETS\PINTEREST\PIN\pinterestPin\init().

◆ init()

YAWK\WIDGETS\PINTEREST\PIN\pinterestPin::init ( )

Init pinterest pin widget and call embed method.

Embed any public Pinterest Pin

Definition at line 50 of file pinterest_pin.php.

52  { // draw headline on screen
53  echo $this->getHeading($this->pinterestPinHeading, $this->pinterestPinSubtext);
54  $this->embedPinterestPin();
getHeading($heading, $subtext)
Get widget heading and subtext, return headline.
Definition: widget.php:669

References YAWK\WIDGETS\PINTEREST\PIN\pinterestPin\embedPinterestPin(), and YAWK\widget\getHeading().

Member Data Documentation

◆ $pinterestPinHeading

YAWK\WIDGETS\PINTEREST\PIN\pinterestPin::$pinterestPinHeading = ''
Parameters
stringTitle that will be shown above widget

Definition at line 21 of file pinterest_pin.php.

◆ $pinterestPinHideDescription

YAWK\WIDGETS\PINTEREST\PIN\pinterestPin::$pinterestPinHideDescription = 'data-pin-terse="true"'
Parameters
stringThe URL of your pinterest channel

Definition at line 29 of file pinterest_pin.php.

◆ $pinterestPinSize

YAWK\WIDGETS\PINTEREST\PIN\pinterestPin::$pinterestPinSize ="large"
Parameters
stringThe URL of your pinterest channel

Definition at line 27 of file pinterest_pin.php.

◆ $pinterestPinSubtext

YAWK\WIDGETS\PINTEREST\PIN\pinterestPin::$pinterestPinSubtext = ''
Parameters
stringSubtext will be displayed beside title

Definition at line 23 of file pinterest_pin.php.

◆ $pinterestPinUrl

YAWK\WIDGETS\PINTEREST\PIN\pinterestPin::$pinterestPinUrl ="https://www.pinterest.com/pin/99360735500167749/"
Parameters
stringThe URL of your pinterest channel

Definition at line 25 of file pinterest_pin.php.

◆ $widget

YAWK\WIDGETS\PINTEREST\PIN\pinterestPin::$widget = ''
Parameters
objectglobal widget object data

Definition at line 19 of file pinterest_pin.php.


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