<?php

class Intense_Guests extends Intense_Shortcode {

	function __construct() {
        parent::__construct();

		global $intense_visions_options;
		global $post;

		$this->title = __( 'Guests', 'intense' );
		$this->description = __( 'Show special content for your guests in WordPress. The guests shortcode content will only be shown to non-registered users. This is useful for special call-to-actions or messages you only want to show to guest users.', 'intense' );
		$this->category = __( 'Elements', 'intense' );
		$this->preview_content = __( "Guest Only Content", 'intense' );
		$this->show_preview = false;
		$this->is_container = true;		
	}

	function shortcode( $atts, $content = null ) {
		global $intense_visions_options;
		extract( shortcode_atts( $this->get_shortcode_defaults( null, $atts ), $atts ) );

		if ( is_feed() ) return;
        $id = ( !empty ( $id ) ) ? ' id="' . $id . '"' : '';

		if ( !is_user_logged_in() ) {
			return '<div' . $id . ' class="intense guests' . ( !empty( $class ) ? ' ' . $class : '' ) . '">' . do_shortcode( $content ) . '</div>';
		} else {
			return;
		}		
	}
}
