YaWK  24.1
Yet another WebKit
YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton Class Reference

Facebook Like Button - embed a like button on your page. More...

+ Inheritance diagram for YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton:

Public Member Functions

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

 $fbLikeButtonAction = "like"
 
 $fbLikeButtonAppID = ""
 
 $fbLikeButtonColorscheme = "light"
 
 $fbLikeButtonHeight = "35"
 
 $fbLikeButtonLayout = "standard"
 
 $fbLikeButtonShare = "false"
 
 $fbLikeButtonShowFaces = "false"
 
 $fbLikeButtonSize = "small"
 
 $fbLikeButtonUrl = "http%3A%2F%2Fwww.facebook.com%2Fplatform"
 
 $fbLikeButtonWidth = "450"
 
 $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

Facebook Like Button - embed a like button on your page.

Facebook Like Button - embed a like button on your page

If you want to bring attention to your facebook page, you might want to add a 'like me on facebook' button to your page. With this widget, you can do that very easily. You can configure some settings, like width, height, layout, color scheme and much more.

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

Definition at line 17 of file fb_like_button.php.

Constructor & Destructor Documentation

◆ __construct()

YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton::__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 37 of file fb_like_button.php.

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

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

Member Function Documentation

◆ embedLikeButton()

YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton::embedLikeButton ( )

Definition at line 56 of file fb_like_button.php.

58  { // check if url is set
59  if (isset($this->fbLikeButtonUrl) && (!empty($this->fbLikeButtonUrl)))
60  { // encode url string
61  $this->fbLikeButtonUrl = rawurlencode($this->fbLikeButtonUrl);
62  }
63  // embed facebook like button
64  // REMEMBER: this could be blocked by AdBlock Browser Plugins
65  echo '<iframe src="https://www.facebook.com/plugins/like.php?href='.$this->fbLikeButtonUrl.'&width='.$this->fbLikeButtonWidth.'&layout='.$this->fbLikeButtonLayout.'&action='.$this->fbLikeButtonAction.'&size='.$this->fbLikeButtonSize.'&show_faces='.$this->fbLikeButtonShowFaces.'&share='.$this->fbLikeButtonShare.'&height='.$this->fbLikeButtonHeight.'&appId='.$this->fbLikeButtonAppID.'" width="'.$this->fbLikeButtonWidth.'" height="'.$this->fbLikeButtonHeight.'" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>';

Referenced by YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton\init().

◆ init()

YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton::init ( )

Init facebook like button.

Facebook Like Button

Definition at line 51 of file fb_like_button.php.

53  { // embed like Button
54  $this->embedLikeButton();

References YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton\embedLikeButton().

Member Data Documentation

◆ $fbLikeButtonAction

YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton::$fbLikeButtonAction = "like"

Definition at line 27 of file fb_like_button.php.

◆ $fbLikeButtonAppID

YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton::$fbLikeButtonAppID = ""

Definition at line 24 of file fb_like_button.php.

◆ $fbLikeButtonColorscheme

YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton::$fbLikeButtonColorscheme = "light"

Definition at line 25 of file fb_like_button.php.

◆ $fbLikeButtonHeight

YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton::$fbLikeButtonHeight = "35"

Definition at line 22 of file fb_like_button.php.

◆ $fbLikeButtonLayout

YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton::$fbLikeButtonLayout = "standard"

Definition at line 26 of file fb_like_button.php.

◆ $fbLikeButtonShare

YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton::$fbLikeButtonShare = "false"

Definition at line 30 of file fb_like_button.php.

◆ $fbLikeButtonShowFaces

YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton::$fbLikeButtonShowFaces = "false"

Definition at line 29 of file fb_like_button.php.

◆ $fbLikeButtonSize

YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton::$fbLikeButtonSize = "small"

Definition at line 28 of file fb_like_button.php.

◆ $fbLikeButtonUrl

YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton::$fbLikeButtonUrl = "http%3A%2F%2Fwww.facebook.com%2Fplatform"

Definition at line 23 of file fb_like_button.php.

◆ $fbLikeButtonWidth

YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton::$fbLikeButtonWidth = "450"

Definition at line 21 of file fb_like_button.php.

◆ $widget

YAWK\WIDGETS\FACEBOOK\LIKEBUTTON\fbLikeButton::$widget = ''
Parameters
objectglobal widget object data

Definition at line 20 of file fb_like_button.php.


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