<?php

/*
 * Template Name: Social Streams Full Screen
 * Description: template autogenerated by Social Streams plugin.
 * Author: Social Streams
 * Author URI: https://socialstreams.com/
 *
 */

?>
<?php
/**
 * The Header template for our theme
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *
 * @package WordPress
 * @subpackage Twenty_Thirteen
 * @since Twenty Thirteen 1.0
 */
?><!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) & !(IE 8)]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
  <meta charset="<?php bloginfo( 'charset' ); ?>">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="HandheldFriendly" content="true" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />

  <title><?php wp_title( '|', true, 'right' ); ?></title>

  <!--[if lt IE 9]>
  <script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  <script src="//oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/es5-shim/2.0.8/es5-shim.min.js"></script>
  <![endif]-->
  <?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>

  <?php $searches = \SocialStreams\Utils::getMetaSearchesFromSettings(); ?>

  <div class="ss-full-screen-header">

    <a href="https://socialstreams.com" class="ss-logo" target="_blank">
      <span class="ss-inner">Social Streams</span>
    </a>

    <?php if ( !empty( $searches ) ): ?>
    <div class="ss-search-tags">
      <?php foreach ( $searches as $search ):
        switch ( $search['search_type'] )
        {
          case 'instagram_global':
          case 'twitter_global':

            $service = str_replace( '_global', '', $search['search_type'] );

            $tagPrefix = '';
            if ( $service == 'instagram' )
              $tagPrefix = '#';

            if ( !empty( $search['search_query'] ) ) :
              foreach ( explode( ' ', $search['search_query'] ) as $tag ): ?>
                <?php if ( $tag != 'OR' ): ?>
                <span class="ss-search-tag"><i class="ss-icon-<?php echo $service ?>"></i><?php echo $tagPrefix . $tag ?></span>
                <?php endif ?>
              <?php endforeach;
            endif;

            break;

          case 'instagram_user':
          case 'twitter_user':

            $service = str_replace( '_user', '', $search['search_type'] );
            $serviceData = get_option('socialstreams_' . $service);

            if ( isset( $serviceData['service_username'] ) && !empty( $serviceData['service_username'] ) ) : ?>
            <span class="ss-search-tag"><i class="ss-icon-<?php echo $service ?>"></i>@<?php echo $serviceData['service_username'] ?></span>
            <?php endif;

            break;

          default:
            break;
        }
      endforeach ?>
    </div>
    <?php endif ?>

  </div><!-- .ss-full-screen-header -->

  <div class="ss-full-width-container">

    <?php while ( have_posts() ) : the_post(); ?>

      <?php the_content(); ?>

    <?php endwhile; ?>

  </div>

  <?php wp_footer(); ?>
</body>
</html>
