YaWK  24.1
Yet another WebKit
YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate Class Reference

Embed chaturbate room (or stream) on your website. More...

Public Member Functions

 __construct ($db)
 Load all widget settings from database and fill object. More...
 
 embed ()
 Embed any chaturbate room on your website. More...
 
 init ()
 
 printObject ()
 Print all object data. More...
 
 setProperties ()
 Set widget properties from database and fill object params. More...
 

Public Attributes

 $chaturbateDisableSound = ''
 
 $chaturbateHeading = ''
 
 $chaturbateHeadline = ''
 
 $chaturbateHeight = '370'
 
 $chaturbateRoom = ''
 
 $chaturbateSubtext = ''
 
 $chaturbateVideoOnly = '0'
 
 $chaturbateVideoUrl = ''
 
 $chaturbateWidth = '100%'
 
 $widget = ''
 

Detailed Description

Embed chaturbate room (or stream) on your website.

Embed any chaturbate channel or stream on your page.

Chaturbate.com is an adult webcam streaming service. With this widget, you can embed any public channel or stream from chaturbate onto your website. All you need is any chaturbate username you wish to embed. But there are a few things to setup. If you like to, you are able to set width, height sound settings and more. By using this widget, embedding a stream from chaturbate is very easy.

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

Constructor & Destructor Documentation

◆ __construct()

YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate::__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 45 of file chaturbate.php.

47  {
48  // load this widget settings from db
49  $this->widget = new \YAWK\widget();
50  $settings = $this->widget->getWidgetSettingsArray($db);
51  foreach ($settings as $property => $value) {
52  $this->$property = $value;
53  }
if(isset($_POST['save'])) $settings
$value

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

Member Function Documentation

◆ embed()

YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate::embed ( )

Embed any chaturbate room on your website.

This method embeds the chaturbate stream

Definition at line 112 of file chaturbate.php.

114  {
115 
116 echo"<style>
117 .videoWrapper {
118  position: relative;
119  padding-bottom: 56.25%; /* 16:9 */
120  padding-top: 25px;
121  height: 0;
122 }
123 .videoWrapper iframe {
124  position: absolute;
125  top: 0;
126  left: 0;
127  width: 100%;
128  height: 100%;
129  border: none;
130  }
131 </style>";
132  // HTML output
133  echo "
134 <!-- chaturbate room stream iframe -->
135 $this->chaturbateHeadline
136 <div class=\"videoWrapper\">
137 <iframe src=\"$this->chaturbateVideoUrl\"
138  width=\"$this->chaturbateWidth\"
139  height=\"$this->chaturbateHeight\"
140  frameborder=\"0\"
141  scrolling=\"no\">
142 </iframe></div>";

Referenced by YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate\init().

◆ init()

YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate::init ( )

Definition at line 66 of file chaturbate.php.

68  {
69  $this->setProperties();
70  $this->embed();
embed()
Embed any chaturbate room on your website.
Definition: chaturbate.php:112
setProperties()
Set widget properties from database and fill object params.
Definition: chaturbate.php:76

References YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate\embed(), and YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate\setProperties().

◆ printObject()

YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate::printObject ( )

Print all object data.

(for development and testing purpose)

Definition at line 59 of file chaturbate.php.

61  {
62  echo "<pre>";
63  print_r($this);
64  echo "</pre>";

◆ setProperties()

YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate::setProperties ( )

Set widget properties from database and fill object params.

Load all widget settings.

Definition at line 76 of file chaturbate.php.

78  {
79  // if a heading is set and not empty
80  if (isset($this->chaturbateHeading) && (!empty($this->chaturbateHeading)))
81  { // add h1 tag to heading string
82  $this->chaturbateHeading = "$this->chaturbateHeading";
83 
84  // if subtext is set, add <small> subtext to string
85  if (isset($this->chaturbateSubtext) && (!empty($this->chaturbateSubtext)))
86  { // build a headline with heading and subtext
87  $this->chaturbateSubtext = "<small>$this->chaturbateSubtext</small>";
88  $this->chaturbateHeadline = "<h1>$this->chaturbateHeading&nbsp;"."$this->chaturbateSubtext</h1>";
89  }
90  else
91  { // build just a headline - without subtext
92  $this->chaturbateHeadline = "<h1>$this->chaturbateHeading</h1>"; // draw just the heading
93  }
94  }
95  else
96  { // leave empty if it's not set
97  $this->chaturbateHeadline = '';
98  }
99 
100  if (substr($this->chaturbateWidth, -1) !== "%")
101  {
102  $this->chaturbateWidth = $this->chaturbateWidth."%";
103  }
104 
105  // build video url
106  $this->chaturbateVideoUrl = "https://chaturbate.com/embed/$this->chaturbateRoom?bgcolor=transparent&disable_sound=$this->chaturbateDisableSound&fullscreen=true&embed_video_only=$this->chaturbateVideoOnly&target=_blank";

Referenced by YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate\init().

Member Data Documentation

◆ $chaturbateDisableSound

YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate::$chaturbateDisableSound = ''
Parameters
stringDisable Sound

Definition at line 30 of file chaturbate.php.

◆ $chaturbateHeading

YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate::$chaturbateHeading = ''
Parameters
stringHeading

Definition at line 34 of file chaturbate.php.

◆ $chaturbateHeadline

YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate::$chaturbateHeadline = ''
Parameters
stringHeadline HTML Markup

Definition at line 38 of file chaturbate.php.

◆ $chaturbateHeight

YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate::$chaturbateHeight = '370'
Parameters
stringHeight in px

Definition at line 28 of file chaturbate.php.

◆ $chaturbateRoom

YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate::$chaturbateRoom = ''
Parameters
stringChaturbate room name (username)

Definition at line 22 of file chaturbate.php.

◆ $chaturbateSubtext

YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate::$chaturbateSubtext = ''
Parameters
stringSubtext

Definition at line 36 of file chaturbate.php.

◆ $chaturbateVideoOnly

YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate::$chaturbateVideoOnly = '0'
Parameters
stringDisable Sound

Definition at line 32 of file chaturbate.php.

◆ $chaturbateVideoUrl

YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate::$chaturbateVideoUrl = ''
Parameters
stringURL of your chaturbate stream

Definition at line 24 of file chaturbate.php.

◆ $chaturbateWidth

YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate::$chaturbateWidth = '100%'
Parameters
stringWidth in percent

Definition at line 26 of file chaturbate.php.

◆ $widget

YAWK\WIDGETS\CHATURBATE\STREAM\chaturbate::$widget = ''
Parameters
objectglobal widget object data

Definition at line 20 of file chaturbate.php.


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