Plugin Directory

Changeset 2019461


Ignore:
Timestamp:
01/26/2019 07:24:35 AM (7 years ago)
Author:
sksni
Message:

Added ability to display Live status of a singular stream

Location:
livetwitch/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • livetwitch/trunk/includes/class-twitch.php

    r2015816 r2019461  
    220220        return $this->version;
    221221    }
    222 
     222   
    223223    /**
    224224     * Create shortcode that takes 2 variables (count and singular).
     
    237237                'orderby' => 'viewers',
    238238                'order' => 'DESC',
     239                'singletext' => '',
    239240            ),
    240241            $atts,
     
    242243        );
    243244
    244        
     245        // return
    245246        if(!empty($atts['singular']) || strlen($atts['singular']) > 0 ){
     247
     248            $singletext = false;
     249
     250            if(!empty($atts['singletext'])){
     251                $singletext = true;
     252            }
    246253
    247254            $viewers = $game = $link = $image = $stream_title = "";
     
    294301               
    295302            }
     303        }elseif ($singletext) {
     304            echo '<span class="livetwitch is-live">Live</span>';
    296305        }else {
    297306            $stream = array_map(array('LiveTwitchWidget','LiveTwitch_DisplayString'), $stream);
     
    305314    }
    306315
     316    /**
     317     * Add filter for Twitch game name.
     318     *
     319     * @since    0.0.3
     320     * @access   public
     321     * @var      string    $game    Game name.
     322     */
     323    public static function display_singlelive($game) {
     324        livetwitch_get_template('single-live.php');
     325    }
    307326   
    308327    /**
  • livetwitch/trunk/live-twitch.php

    r2015816 r2019461  
    2525}
    2626
    27 define( 'LiveTwitch', '0.0.3' );
     27define( 'LiveTwitch', '0.0.4' );
    2828/**
    2929 * The core plugin class that is used to define internationalization,
Note: See TracChangeset for help on using the changeset viewer.