YaWK  24.1
Yet another WebKit
YAWK\WIDGETS\PINTEREST\PROFILE\pinterestProfile Class Reference

Pinterest Pin Widget. More...

+ Inheritance diagram for YAWK\WIDGETS\PINTEREST\PROFILE\pinterestProfile:

Public Member Functions

 __construct ($db)
 Load all widget settings from database and fill object. More...
 
 embedPinterestProfile ()
 Embed Pinterest Profile. More...
 
 init ()
 Init pinterest profile 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

 $pinterestProfileHeading = ''
 
 $pinterestProfileHeight = 500
 
 $pinterestProfileSubtext = ''
 
 $pinterestProfileUrl ="https://www.pinterest.com/pin/99360735500167749/"
 
 $pinterestProfileWidth = 900
 
 $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_profile.php.

Constructor & Destructor Documentation

◆ __construct()

YAWK\WIDGETS\PINTEREST\PROFILE\pinterestProfile::__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_profile.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

◆ embedPinterestProfile()

YAWK\WIDGETS\PINTEREST\PROFILE\pinterestProfile::embedPinterestProfile ( )

Embed Pinterest Profile.

Embed Pinterest Profile

Definition at line 60 of file pinterest_profile.php.

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

Referenced by YAWK\WIDGETS\PINTEREST\PROFILE\pinterestProfile\init().

◆ init()

YAWK\WIDGETS\PINTEREST\PROFILE\pinterestProfile::init ( )

Init pinterest profile widget and call embed method.

Embed any public Pinterest Profile

Definition at line 50 of file pinterest_profile.php.

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

References YAWK\WIDGETS\PINTEREST\PROFILE\pinterestProfile\embedPinterestProfile(), and YAWK\widget\getHeading().

Member Data Documentation

◆ $pinterestProfileHeading

YAWK\WIDGETS\PINTEREST\PROFILE\pinterestProfile::$pinterestProfileHeading = ''
Parameters
stringTitle that will be shown above widget

Definition at line 21 of file pinterest_profile.php.

◆ $pinterestProfileHeight

YAWK\WIDGETS\PINTEREST\PROFILE\pinterestProfile::$pinterestProfileHeight = 500
Parameters
intProfile Heightin pixels

Definition at line 29 of file pinterest_profile.php.

◆ $pinterestProfileSubtext

YAWK\WIDGETS\PINTEREST\PROFILE\pinterestProfile::$pinterestProfileSubtext = ''
Parameters
stringSubtext will be displayed beside title

Definition at line 23 of file pinterest_profile.php.

◆ $pinterestProfileUrl

YAWK\WIDGETS\PINTEREST\PROFILE\pinterestProfile::$pinterestProfileUrl ="https://www.pinterest.com/pin/99360735500167749/"
Parameters
stringThe URL of your pinterest channel

Definition at line 25 of file pinterest_profile.php.

◆ $pinterestProfileWidth

YAWK\WIDGETS\PINTEREST\PROFILE\pinterestProfile::$pinterestProfileWidth = 900
Parameters
intProfile Width in pixels

Definition at line 27 of file pinterest_profile.php.

◆ $widget

YAWK\WIDGETS\PINTEREST\PROFILE\pinterestProfile::$widget = ''
Parameters
objectglobal widget object data

Definition at line 19 of file pinterest_profile.php.


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