public function index() { $twitch = Twitch::find_all('', 'twitch.position ASC'); $this->assign('twitch', $twitch); $this->title = 'Twitch Channels'; $this->render('twitch/index.tpl'); }
public function coverage($permalink = null) { $event = self::load_event($permalink); $this->assign('event', $event); $this->assignLayout('cEvent', $event); $slideshow = Slideshow::find(null, "slideshows.created_at DESC", true, 5); $this->assign("slideshow", $slideshow); $news = News::find_published('', "news.publish_at DESC", true, 5); $this->assign('news', $news); $matches = EventContent::find_by_permalink($event, 'matchfeed', false); $this->assign('matches', $matches); $twitch = Twitch::find_all('twitch.public = 1', 'twitch.position ASC'); $activeTwitch = Twitch::getActive(); $this->assignLayout('twitch', $twitch); $this->assignLayout('activetwitch', $activeTwitch); $this->layout = 'coverage2'; $this->title = "{$event->name} :: Coverage"; $this->render('event/coverage2.tpl'); }
public static function process($script) { $twitch = Twitch::find_all(); foreach ($twitch as $stream) { echo "Updating [{$stream}] {$stream->channel}"; $stream->update(); } }
<?php if (!defined("MAIN_ROOT")) { exit; } global $pluginObj; $twitchObj = new Twitch($mysqli); $pluginInfo = $pluginObj->get_info_filtered(); ?> <div class='streamPageContainer'> <?php $totalTwitchUsers = $twitchObj->displayAllMemberCards(); if ($totalTwitchUsers == 0) { echo "\n\t\t\t\n\t\t\t<div class='shadedBox' style='margin: 20px auto; width: 45%'>\n\t\t\t\n\t\t\t\t<p align='center' class='main'>\n\t\t\t\t\t<i>There are currently no Twitch users!</i> \n\t\t\t\t</p>\n\t\t\t\n\t\t\t</div>\n\t\t\n\t\t"; } ?> </div>
<?php require "init.php"; $script = Script::find_by_code('twitch'); $script->start(); ob_start(); $time = date("H:i:s"); echo "[{$time}] Updating Twitch Streams\r\n\r\n"; Twitch::process($script); $script = Script::find_by_code('twitch'); $output = ob_get_clean(); $script->finish($output);
<?php if (!defined("MAIN_ROOT")) { exit; } $member = new Member($mysqli); $twitchObj = new Twitch($mysqli); $pluginObj = new btPlugin($mysqli); $pluginObj->selectByName("Twitch"); if (!$member->select($_GET['user']) || !$twitchObj->hasTwitch($_GET['user'])) { echo "\n\t\t\t<script type='text/javascript'>window.location='" . MAIN_ROOT . "plugins/twitch'</script>\n\t\t"; exit; } $twitchName = $twitchObj->getTwitchName($twitchObj->data['memberID']); $autoPlay = $pluginObj->getConfigInfo("autoplay") == "1" ? "true" : "false"; ?> <div class='twitchPlayerContainer'> <object class='twitchPlayer' type='application/x-shockwave-flash' id='live_embed_player_flash' data='http://www.twitch.tv/widgets/live_embed_player.swf?channel=<?php echo $twitchName; ?> ' bgcolor='#000000'> <param name='allowFullScreen' value='true' /><param name='wmode' value='opaque' /> <param name='allowScriptAccess' value='always' /><param name='allowNetworking' value='all' /> <param name='movie' value='http://www.twitch.tv/widgets/live_embed_player.swf' /> <param name='flashvars' value='hostname=www.twitch.tv&channel=<?php echo $twitchName; ?> &auto_play=<?php echo $autoPlay;