YaWK  24.1
Yet another WebKit
YAWK\WIDGETS\PINTEREST\FOLLOW\pinterestFollow Class Reference

Pinterest Follow Widget. More...

+ Inheritance diagram for YAWK\WIDGETS\PINTEREST\FOLLOW\pinterestFollow:

Public Member Functions

 __construct ($db)
 Load all widget settings from database and fill object. More...
 
 embedPinterestFollow ()
 Embed Pinterest Follow Button. More...
 
 init ()
 Init example widget and call a function for demo purpose. 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

 $pinterestFollowHeading = ''
 
 $pinterestFollowSubtext = ''
 
 $pinterestFollowUrl = ''
 
 $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 Follow Widget.

Pinterest Follow Widget - add a follow me on pinterest button to your page.

If you want to pay attention to your pinterest channel, embed this widget. All you need to enter is any pinterest url to follow. Like any other widget, you can add a heading and a subtext that will be displayed above this widget.

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

Constructor & Destructor Documentation

◆ __construct()

YAWK\WIDGETS\PINTEREST\FOLLOW\pinterestFollow::__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 32 of file pinterest_follow.php.

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

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

Member Function Documentation

◆ embedPinterestFollow()

YAWK\WIDGETS\PINTEREST\FOLLOW\pinterestFollow::embedPinterestFollow ( )

Embed Pinterest Follow Button.

Embed Pinterest Follow Button

Definition at line 56 of file pinterest_follow.php.

58  { // check if url is set
59  if (isset($this->pinterestFollowUrl)
60  && (!empty($this->pinterestFollowUrl)
61  && (is_string($this->pinterestFollowUrl))))
62  { // embed pinterest follow button markup
63  echo '
64  <a data-pin-do="buttonFollow" href="'.$this->pinterestFollowUrl.'">Pinterest</a>
65  <script async defer src="//assets.pinterest.com/js/pinit.js"></script>';
66  }
67  else
68  {
69  echo "Here should be a pinterest follow button, but no URL is set. Please add your pinterest url.";
70  }

Referenced by YAWK\WIDGETS\PINTEREST\FOLLOW\pinterestFollow\init().

◆ init()

YAWK\WIDGETS\PINTEREST\FOLLOW\pinterestFollow::init ( )

Init example widget and call a function for demo purpose.

Example Widget Init

Definition at line 46 of file pinterest_follow.php.

48  { // draw headline on screen
49  echo $this->getHeading($this->pinterestFollowHeading, $this->pinterestFollowSubtext);
50  $this->embedPinterestFollow();
embedPinterestFollow()
Embed Pinterest Follow Button.
getHeading($heading, $subtext)
Get widget heading and subtext, return headline.
Definition: widget.php:669

References YAWK\WIDGETS\PINTEREST\FOLLOW\pinterestFollow\embedPinterestFollow(), and YAWK\widget\getHeading().

Member Data Documentation

◆ $pinterestFollowHeading

YAWK\WIDGETS\PINTEREST\FOLLOW\pinterestFollow::$pinterestFollowHeading = ''
Parameters
stringTitle that will be shown above widget

Definition at line 21 of file pinterest_follow.php.

◆ $pinterestFollowSubtext

YAWK\WIDGETS\PINTEREST\FOLLOW\pinterestFollow::$pinterestFollowSubtext = ''
Parameters
stringSubtext will be displayed beside title

Definition at line 23 of file pinterest_follow.php.

◆ $pinterestFollowUrl

YAWK\WIDGETS\PINTEREST\FOLLOW\pinterestFollow::$pinterestFollowUrl = ''
Parameters
stringThe URL of your pinterest channel

Definition at line 25 of file pinterest_follow.php.

◆ $widget

YAWK\WIDGETS\PINTEREST\FOLLOW\pinterestFollow::$widget = ''
Parameters
objectglobal widget object data

Definition at line 19 of file pinterest_follow.php.


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