Пример #1
0
    function widget($args, $instance)
    {
        extract($args);
        $title = $instance['title'];
        $limit = $instance['limit'];
        $cat_id = $instance['cat_id'];
        $tag = $instance['tag'];
        $width = $instance['width'];
        $height = $instance['height'];
        if (!empty($tag)) {
            $myposts = get_posts("numberposts={$limit}&tag={$tag}");
        } else {
            $myposts = get_posts("numberposts={$limit}&cat={$cat_id}");
        }
        $post_list = '';
        $count = 0;
        $active = "active";
        $display = "";
        echo $before_widget;
        ?>
       
        <?php 
        echo $before_title . $title . $after_title;
        ?>

            <?php 
        if (isset($myposts)) {
            foreach ($myposts as $mypost) {
                $embed = woo_get_embed('embed', $width, $height, 'widget_video', $mypost->ID);
                if ($embed) {
                    $count++;
                    if ($count > 1) {
                        $active = '';
                        $display = "style='display:none'";
                    }
                    ?>
						<div class="widget-video-unit" <?php 
                    echo $display;
                    ?>
 >
						<?php 
                    echo '<h4>' . get_the_title($mypost->ID) . "</h4>\n";
                    echo $embed;
                    $post_list .= "<li class='{$active}'><a href='#'>" . get_the_title($mypost->ID) . "</a></li>\n";
                    ?>
						</div>
						<?php 
                }
            }
        }
        ?>
        <ul class="widget-video-list">
        	<?php 
        echo $post_list;
        ?>
        </ul>

        <?php 
        echo $after_widget;
    }
Пример #2
0
    function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        $instance = $this->woo_enforce_defaults($instance);
        extract($instance, EXTR_SKIP);
        if (!empty($tag)) {
            $myposts = get_posts("numberposts={$limit}&tag={$tag}");
        } else {
            $myposts = get_posts("numberposts={$limit}&cat={$cat_id}");
        }
        $post_list = '';
        $count = 0;
        $active = 'active';
        $display = '';
        echo $before_widget;
        echo $before_title . apply_filters('widget_title', $title, $instance, $this->id_base) . $after_title;
        if (isset($myposts)) {
            foreach ($myposts as $mypost) {
                $embed = woo_get_embed('embed', $width, $height, 'widget_video', $mypost->ID);
                if ($embed) {
                    $count++;
                    if ($count > 1) {
                        $active = '';
                        $display = "style='display:none'";
                    }
                    echo '<div class="widget-video-unit" ' . $display . ' >';
                    echo '<h4>' . get_the_title($mypost->ID) . "</h4>\n";
                    echo $embed;
                    $post_list .= "<li class='{$active}'><a href='#'>" . get_the_title($mypost->ID) . "</a></li>\n";
                    echo '</div>';
                }
            }
        }
        ?>

		<ul class="widget-video-list">
			<?php 
        echo $post_list;
        ?>

		</ul>
<?php 
        echo $after_widget;
    }
Пример #3
0
			<ul class="idTabs">
	
			<?php while (have_posts()) : the_post(); ?>	
		
				<li><a href="#video-<?php the_ID(); ?>"><?php the_title(); ?></a></li>
			
			<?php endwhile; ?>
			
			</ul>	
		
		<?php endif; ?>
	
		</div><!--/video-right -->

	<?php if (have_posts()) : ?>
	
		<div class="video-left">

		<?php while (have_posts()) : the_post(); ?>	
	
			<div id="video-<?php the_ID(); ?>">
				<?php echo woo_get_embed('embed','350','280'); ?> 
			</div>
		
		<?php endwhile; ?>
		
		</div><!--/video-left -->
	
	<?php endif; ?>
	
	</div><!--/video-frame -->
Пример #4
0
function videoWidget()
{
    $number = 3;
    $title = "Latest Videos";
    $settings = get_option("widget_videowidget");
    if ($settings['number']) {
        $number = $settings['number'];
    }
    if ($settings['title']) {
        $title = $settings['title'];
    }
    ?>

<div id="video" class="widget">

    <h3><?php 
    echo $title;
    ?>
</h3>
    
    <div class="inside">
		<?php 
    query_posts('showposts=' . $number . '&cat=' . $GLOBALS[video_id]);
    ?>
        <?php 
    if (have_posts()) {
        ?>
            <?php 
        while (have_posts()) {
            the_post();
            ?>
	
        
            <div id="video-<?php 
            the_ID();
            ?>
" class="latest">
                <?php 
            echo woo_get_embed('embed', '269', '225');
            ?>
 
            </div>	
            
            <?php 
        }
        ?>
   
        <?php 
    }
    ?>
	</div>
    
	<?php 
    query_posts('showposts=' . $number . '&cat=' . $GLOBALS[video_id]);
    ?>
   
    <?php 
    if (have_posts()) {
        ?>
    
    <ul class="wooTabs">
    
    <?php 
        while (have_posts()) {
            the_post();
            $count++;
            ?>
	        
        <li><a href="#video-<?php 
            the_ID();
            ?>
" title="<?php 
            the_title();
            ?>
"><?php 
            the_title();
            ?>
</a></li>            
    <?php 
        }
        ?>
            
    </ul>

    <?php 
    }
    ?>
	
</div>
<?php 
}
Пример #5
0
function woo_custom_rss_video_output($post_id)
{
    ?>
	<?php 
    woo_custom_rss_category_link($post_id);
    ?>
<p><a href="<?php 
    the_permalink();
    ?>
" rel="bookmark" title="<?php 
    the_title();
    ?>
" target="_blank"><?php 
    echo _e('View Video', 'woothemes');
    ?>
</a></p><p><?php 
    echo woo_get_embed('video-embed', '400', '');
    ?>
</p>
	<?php 
}
Пример #6
0
function videoWidget()
{
    $number = 5;
    $title = "Latest Videos";
    $settings = get_option("widget_videowidget");
    if ($settings['number']) {
        $number = $settings['number'];
    }
    if ($settings['title']) {
        $title = $settings['title'];
    }
    ?>

			<div id="video" class="box">

				<span class="heading">Featured Video</span>
				
				<div class="video_container">
					
					<?php 
    query_posts('showposts=1&tag=video');
    ?>
					
					<?php 
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            ?>
				
						<div class="player">
								 <?php 
            woo_get_embed('embed', '260', '215');
            ?>
 
						</div><!-- /player -->
					
							<h3 class="playing"><a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
"><?php 
            the_title();
            ?>
</a></h3>
					
					<?php 
        }
    }
    ?>
					
					<span>View more videos:</span>
					
					<ul>

					<?php 
    query_posts('offset=1&showposts=' . $number . '&tag=video');
    ?>
					
					<?php 
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            ?>
					
						<li><a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
"><?php 
            the_title();
            ?>
</a></li>

					<?php 
        }
    }
    ?>
		
					</ul>
				
				</div><!-- /video_containter -->
			
			</div><!-- /video -->

<?php 
}
Пример #7
0
        the_time($GLOBALS['woodate']);
        ?>
                            <span class="comments"><img src="<?php 
        bloginfo('template_directory');
        ?>
/images/ico-comment.png" alt="" /><?php 
        comments_popup_link(__('0 Comments', 'woothemes'), __('1 Comment', 'woothemes'), __('% Comments', 'woothemes'));
        ?>
</span>
                        </p>

						<?php 
        echo woo_get_embed('embed', '590', '420');
        ?>
						<?php 
        if (woo_get_embed('embed', '590', '420') && get_option('woo_ad_content') == "true") {
            include TEMPLATEPATH . '/ads/content_ad.php';
        }
        ?>
                        <div class="entry">
							<?php 
        the_content();
        ?>
							<?php 
        edit_post_link();
        ?>

                        </div>
                        <div class="fix"></div>

                        <?php 
Пример #8
0
function woo_tumblog_videos($post_id = 0, $count = 0, $pagetype = '')
{
    $service = get_option('woo_url_shorten');
    $category_link = woo_tumblog_category_link($post_id, 'video');
    ?>
	<div class="post video-post">
				
        <div class="posttype">
        	<a href="<?php 
    echo $category_link;
    ?>
" title="<?php 
    echo esc_attr(get_post_format_string(get_post_format()));
    ?>
"><img src="<?php 
    bloginfo('template_directory');
    ?>
/images/ico-video.png" alt="" /></a>
        </div><!-- /.posttype -->
                
	    <?php 
    if (is_singular()) {
        ?>
	    <h1 class="title"><a href="<?php 
        the_permalink();
        ?>
" rel="bookmark" title="<?php 
        the_title();
        ?>
"><?php 
        the_title();
        ?>
</a></h1>
	    <?php 
    } else {
        ?>
	    <h2 class="title"><a href="<?php 
        the_permalink();
        ?>
" rel="bookmark" title="<?php 
        the_title();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
	    <?php 
    }
    ?>
	    
	    <?php 
    woo_post_meta();
    ?>
        
        <div class="media">
       	    <?php 
    echo woo_get_embed('video-embed', '550', '');
    ?>
	
    	</div><!-- /.media --> 
    	    	        
        <div class="entry">
        	<?php 
    if (get_option('woo_home_content') == 'false' && is_home() || get_option('woo_archive_content') == 'false' && (is_archive() || is_search() || is_tax())) {
        the_excerpt();
    } elseif ($pagetype == 'archive' && get_option('woo_archive_content') == 'false') {
        the_excerpt();
    } elseif ($pagetype == 'home' && get_option('woo_home_content') == 'false') {
        the_excerpt();
    } else {
        the_content();
    }
    ?>
        </div>
           	       
	    <div class="post-more">      
	    		<span class="comments"><?php 
    comments_popup_link(__('0 Comments', 'woothemes'), __('1 Comments', 'woothemes'), __('% Comments', 'woothemes'));
    ?>
</span>
	    		<?php 
    if ($service != 'Off') {
        ?>
<span class="shorturl"><a href="<?php 
        echo woo_short_url(get_permalink());
        ?>
" title="<?php 
        _e('Short URL for', 'woothemes');
        ?>
 <?php 
        the_title();
        ?>
"><?php 
        _e('Short URL', 'woothemes');
        ?>
</a></span><?php 
    }
    ?>
				<?php 
    the_tags('<span class="tags">', ', ', '</span>');
    ?>
	    </div>   
	           
                                    
    </div><!-- /.post -->
	
	<?php 
}
Пример #9
0
 function widget($args, $instance)
 {
     extract($args);
     /* Our variables from the widget settings. */
     $title = apply_filters('widget_title', $instance['title']);
     $category = $instance['category'];
     $tag = $instance['tag'];
     $width = $instance['width'];
     $height = $instance['height'];
     $limit = intval($instance['limit']);
     if ($limit == 0) {
         $limit = 10;
     }
     /* Get Posts. */
     $query_args = array('post_type' => 'woo_video', 'posts_per_page' => $limit);
     /* Determine whether to look in a tag or a category. */
     if ($tag) {
         $query_args['tax_query'] = array(array('taxonomy' => 'post_tag', 'field' => 'slug', 'terms' => $tag));
     } else {
         if ($category && $category > 0) {
             $query_args['tax_query'] = array(array('taxonomy' => 'woo_video_category', 'field' => 'id', 'terms' => $category));
         }
     }
     $query = new WP_Query($query_args);
     wp_reset_query();
     $posts = array();
     /* Make sure we only have posts of the "woo_video" post type. */
     if ($query->have_posts()) {
         while ($query->have_posts()) {
             $query->the_post();
             if (get_post_type() == 'woo_video') {
                 $posts[] = $query->post;
             }
         }
     }
     /* Before widget (defined by themes). */
     echo $before_widget;
     /* Display the widget title if one was input (before and after defined by themes). */
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     // End IF Statement
     /* Widget content. */
     // Add actions for plugins/themes to hook onto.
     do_action('widget_woo_embed_top');
     $html = '';
     if ($posts) {
         $count = 0;
         $post_list = '';
         $display = '';
         $active = 'active';
         foreach ($posts as $post) {
             $embed = woo_get_embed('embed', $width, $height, 'widget_video', $post->ID);
             $title = get_the_title($post->ID);
             if ($embed) {
                 $count++;
                 if ($count > 1) {
                     $active = '';
                     $display = 'style="display:none;"';
                 }
                 $html .= '<div class="widget-video-unit" ' . $display . '>' . "\n";
                 $html .= '<h4>' . $title . '</h4>' . "\n";
                 $html .= $embed . "\n";
                 $post_list .= '<li class="' . $active . '"><a href="#">' . $title . '</a></li>' . "\n";
                 $html .= '</div><!--/.widget-video-unit-->' . "\n";
             }
             // End IF Statement
         }
     }
     if ($post_list != '') {
         $html .= '<ul class="widget-video-list">' . "\n";
         $html .= $post_list;
         $html .= '</ul><!--/.widget-video-list-->' . "\n";
     }
     echo $html;
     // Add actions for plugins/themes to hook onto.
     do_action('widget_woo_embed_bottom');
     /* After widget (defined by themes). */
     echo $after_widget;
 }