<?php 
global $redux_demo, $nolazy;
$text = get_post_meta($post->ID, '_quote_text', true);
$author = get_post_meta($post->ID, '_quote_author', true);
$source = get_post_meta($post->ID, '_quote_source', true);
$image = get_post_meta($post->ID, '_quote_image', true);
$nsfw = get_post_meta($post->ID, '_quote_nsfw', true);
if(is_user_logged_in() ) {
    $userid = wp_get_current_user();
    if(get_user_meta($userid->ID, '_nsfw', true) != 1) {
        $nsfw = 2;
    }
}
$class = 'main-post';
if(is_single() ) {
    $class .= ' post-page';
}
?>
<article <?php post_class($class);?>>
    <?php get_template_part('content', 'header');?>
    <div class="article-content">
        <?php get_template_part('content', 'infobar');?>
        <div class="quote-wrap">
            <h2><?php _e('Quote', 'Aruna');?></h2>
                <div class="quote">
                    <?php 
                    if($text != '') { ?>
                        <p>&ldquo; <?php echo $text; ?> &rdquo;</p>
                    <?php } 
                    if($author != '') { ?>
                        <p class="author-quote">
                            <strong><?php _e('Quote author:', 'Aruna');?></strong>
                            <?php echo ' ' . $author;?>
                        </p>
                    <?php }
                    if($source != '') { ?>
                        <p class="source-quote">
                            <strong><?php _e('Quote source:', 'Aruna');?></strong>
                            <?php echo $source;?>
                        </p>
                    <?php } ?>
                </div>
        </div>
        <?php if($image != '') { ?>
            <figure <?php if($nsfw == 1) echo 'class="nsfw"';?>>
                <?php if($nolazy == 1) { ?>
                    <a href="<?php the_permalink();?>"><img src="<?php echo aq_resize($image, 635, null, true); ?>" alt="<?php the_title();?> "/></a>
                <?php } else { ?>
                    <a href="<?php the_permalink();?>"><img class="lazy" data-original="<?php echo aq_resize($image, 635, null, true); ?>" alt="<?php the_title();?> "/></a>
                <?php } ?>
            <div class="nsfw_text"><?php _e('Not safe for work', 'Aruna');?></div>
            <div class="nsfw_textreveal"><?php _e('Click here to reveal', 'Aruna');?></div>
            </figure>
        <?php } ?>
    </div>
</article>