2017-08-08 19:38:42 +01:00
< ? php
2021-12-07 22:14:12 -08:00
2017-08-08 19:38:42 +01:00
/*
2022-05-27 11:54:24 +03:00
* Made by Samerton
2017-08-08 19:38:42 +01:00
* https :// github . com / NamelessMC / Nameless /
2025-02-24 18:44:29 +00:00
* NamelessMC version 2.2 . 0
2017-08-08 19:38:42 +01:00
*
2025-02-24 18:44:29 +00:00
* Licence : MIT
2017-08-08 19:38:42 +01:00
*
* Twitter Widget
*/
2021-12-07 22:14:12 -08:00
2017-08-08 19:38:42 +01:00
class TwitterWidget extends WidgetBase {
2020-12-19 19:25:59 +01:00
2023-06-21 10:19:46 -07:00
private string $_twitter_url ;
private string $_theme ;
2018-08-28 16:15:25 +01:00
2025-02-24 18:44:29 +00:00
public function __construct ( TemplateEngine $engine , ? string $twitter = '' , ? string $theme = '' ) {
2017-10-06 20:22:17 +01:00
$this -> _module = 'Core' ;
2017-08-08 19:38:42 +01:00
$this -> _name = 'Twitter' ;
2020-12-14 20:44:25 -08:00
$this -> _description = 'Display your Twitter feed on your site. Make sure you have entered your Twitter URL in the StaffCP -> Core -> Social Media tab first!' ;
2025-02-24 18:44:29 +00:00
$this -> _engine = $engine ;
2020-12-19 19:25:59 +01:00
2023-06-21 10:19:46 -07:00
$this -> _twitter_url = $twitter ;
$this -> _theme = $theme ;
2017-08-08 19:38:42 +01:00
}
2018-09-10 01:14:58 +01:00
2021-10-30 16:44:05 -07:00
public function initialise () : void {
2023-06-21 10:19:46 -07:00
$this -> _content = '
< a class = " twitter-timeline " ' . (($this->_theme == ' dark ') ? ' data - theme = " dark " ' : ' ') . ' data - height = " 600 " href = " ' . Output::getClean( $this->_twitter_url ) . ' " >
Tweets
</ a >
< script async src = " //platform.twitter.com/widgets.js " charset = " utf-8 " ></ script >
< br >
' ;
2018-09-10 01:14:58 +01:00
}
2018-06-20 21:57:59 +03:00
}