public static function fromNow(\DateTime $date, $format, $momentFormat = 'MMMM Do, h:mm:ss a, YYYY') { return sprintf('<time title="%s" data-moment="true" data-moment-fromnow="true" datetime="%s" data-format="%s">%s</time>', $date->format(Date::STRING_FORMAT), $date->format(Date::FORMAT), $momentFormat, Date::getElapsedTime($date)); }
if (!empty($model->streamInfo)) { ?> <?php if (!isset($model->streamInfo['stream']) || empty($model->streamInfo['stream'])) { ?> <span class="glyphicon glyphicon-time"></span> <span>Last broadcast ended <?php echo Date::getElapsedTime(Date::getDateTime($model->streamInfo['lastbroadcast'])); ?> </span> <?php } else { ?> <span class="glyphicon glyphicon-time"></span> <span>Started <?php echo Date::getElapsedTime(Date::getDateTime($model->streamInfo['lastbroadcast'])); ?> </span> <?php if (intval($model->streamInfo['stream']['channel']['delay']) > 1) { ?> - <?php echo intval($model->streamInfo['stream']['channel']['delay']) / 60; ?> m delay <?php } ?> <?php } ?>
<div id="broadcasts" class="stream"> <h3 class="title clearfix"> <span>Broadcasts</span> <a href="http://www.twitch.tv/<?php echo Config::$a['twitch']['user']; ?> /profile/pastBroadcasts" class="twitch-title">twitch.tv</a> </h3> <ul class="thumbnails"> <?php if (isset($model->broadcasts) && !empty($model->broadcasts['videos'])) { ?> <?php foreach ($model->broadcasts['videos'] as $broadcast) { ?> <?php $time = Date::getElapsedTime(Date::getDateTime($broadcast['recorded_at'])); ?> <li> <div class="thumbnail" data-placement="bottom" data-toggle="tooltip" title="<?php echo $time; ?> "> <a href="<?php echo $broadcast['url']; ?> "> <img alt="<?php echo $time; ?> " src="<?php echo Config::cdn(); ?>
echo Tpl::out('{"height":"500","width":"420"}'); ?> ">Pop-out chat</a> <a target="_blank" href="http://www.twitch.tv/destiny/popout" class="popup btn btn-xs btn-link" data-options="<?php echo Tpl::out('{"height":"420","width":"720"}'); ?> ">Pop-out stream</a> </div> <h1>Stream currently offline</h1> <div id="live-info"> <span class="offline-status"><?php echo Tpl::out($model->streamInfo['status']); ?> </span><br /> Last broadcast ended <strong class="offline-info-lastbroadcast"><?php echo isset($model->streamInfo['lastbroadcast']) ? Date::getElapsedTime(Date::getDateTime($model->streamInfo['lastbroadcast'])) : ''; ?> </strong><br /> Was playing <strong class="offline-info-game"><?php echo isset($model->streamInfo['game']) ? Tpl::out($model->streamInfo['game']) : ''; ?> </strong><br /> </div> <a href="/bigscreen" class="btn btn-lg btn-primary">Join the chat while you wait!</a> <small> Prefer the old layout? <a href="/screen">Try this</a></small> </div> </div> </div> </div> </section>