Ejemplo n.º 1
0
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $no_of_posts = $instance['no_of_posts'];
        $posts_order = $instance['posts_order'];
        $thumb = $instance['thumb'];
        echo $before_widget;
        echo $before_title;
        echo $title;
        ?>
		<?php 
        echo $after_title;
        ?>
				<ul>
					<?php 
        if ($posts_order == 'popular') {
            tie_popular_posts($no_of_posts, $thumb);
        } elseif ($posts_order == 'views') {
            tie_most_viewed($no_of_posts, $thumb);
        } elseif ($posts_order == 'random') {
            tie_random_posts($no_of_posts, $thumb);
        } elseif ($posts_order == 'best') {
            tie_best_reviews_posts($no_of_posts, $thumb);
        } else {
            tie_last_posts($no_of_posts, $thumb);
        }
        ?>
	
				</ul>
		<div class="clear"></div>
	<?php 
        echo $after_widget;
    }
Ejemplo n.º 2
0
    function widget($args, $instance)
    {
        extract($args);
        $posts_order = $instance['posts_order'];
        if (empty($instance['posts_number']) || $instance['posts_number'] == ' ' || !is_numeric($instance['posts_number'])) {
            $posts_number = 5;
        } else {
            $posts_number = $instance['posts_number'];
        }
        ?>
	<div class="widget" id="tabbed-widget">
		<div class="widget-container">
			<div class="widget-top">
				<ul class="tabs posts-taps">
					<li class="tabs"><a href="#tab1"><?php 
        _e('Popular', 'tie');
        ?>
</a></li>
					<li class="tabs"><a href="#tab2"><?php 
        _e('Recent', 'tie');
        ?>
</a></li>
					<li class="tabs" style="margin-left:0; "><a href="#tab3"><?php 
        _e('Comments', 'tie');
        ?>
</a></li>
				</ul>
			</div>
			<div id="tab1" class="tabs-wrap">
				<ul>
					<?php 
        if ($posts_order == 'viewed') {
            tie_most_viewed_posts($posts_number);
        } else {
            tie_popular_posts($posts_number);
        }
        ?>
	
				</ul>
			</div>
			<div id="tab2" class="tabs-wrap">
				<ul>
					<?php 
        tie_last_posts($posts_number);
        ?>
	
				</ul>
			</div>
			<div id="tab3" class="tabs-wrap">
				<ul>
					<?php 
        tie_most_commented($posts_number);
        ?>
				</ul>
			</div>
		</div>
	</div><!-- .widget /-->
<?php 
    }
Ejemplo n.º 3
0
    function widget($args, $instance)
    {
        ?>
	<div class="widget" id="tabbed-widget">
		<div class="widget-container">
			<div class="widget-top">
				<ul class="tabs posts-taps">
					<li class="tabs"><a href="#tab1"><?php 
        _e('Popular', 'tie');
        ?>
</a></li>
					<li class="tabs"><a href="#tab2"><?php 
        _e('Recent', 'tie');
        ?>
</a></li>
					<li class="tabs"><a href="#tab3"><?php 
        _e('Comments', 'tie');
        ?>
</a></li>
					<li class="tabs" style="margin-left:0"><a href="#tab4"><?php 
        _e('Tags', 'tie');
        ?>
</a></li>
				</ul>
			</div>
			<div id="tab1" class="tabs-wrap">
				<ul>
					<?php 
        tie_popular_posts();
        ?>
	
				</ul>
			</div>
			<div id="tab2" class="tabs-wrap">
				<ul>
					<?php 
        tie_last_posts();
        ?>
	
				</ul>
			</div>
			<div id="tab3" class="tabs-wrap">
				<ul>
					<?php 
        tie_most_commented();
        ?>
				</ul>
			</div>
			<div id="tab4" class="tabs-wrap tagcloud">
				<?php 
        wp_tag_cloud($args = array('largest' => 8, 'number' => 25, 'orderby' => 'count', 'order' => 'DESC'));
        ?>
			</div>
		</div>
	</div><!-- .widget /-->
<?php 
    }
Ejemplo n.º 4
0
    function widget($args, $instance)
    {
        if (!empty($instance['posts_order'])) {
            $posts_order = $instance['posts_order'];
        }
        if (empty($instance['posts_number']) || $instance['posts_number'] == ' ' || !is_numeric($instance['posts_number'])) {
            $posts_number = 5;
        } else {
            $posts_number = $instance['posts_number'];
        }
        ?>
	<div class="widget" id="tabbed-widget">
		<div class="widget-container">
			<div class="widget-top">
				<ul class="tabs posts-taps">
				<?php 
        $tabs_order = 'r,p,c,t';
        if (!empty($instance['tabs_order'])) {
            $tabs_order = $instance['tabs_order'];
        }
        $tabs_order_array = explode(',', $tabs_order);
        foreach ($tabs_order_array as $tab) {
            if ($tab == 'p') {
                echo '<li class="tabs"><a href="#tab1">' . __ti('Popular') . '</a></li>';
            }
            if ($tab == 'r') {
                echo '<li class="tabs"><a href="#tab2">' . __ti('Recent') . '</a></li>';
            }
            if ($tab == 'c') {
                echo '<li class="tabs"><a href="#tab3">' . __ti('Comments') . '</a></li>';
            }
            if ($tab == 't') {
                echo '<li class="tabs"><a href="#tab4">' . __ti('Tags') . '</a></li>';
            }
        }
        ?>
				</ul>
			</div>
			
			<?php 
        foreach ($tabs_order_array as $tab) {
            if ($tab == 'p') {
                ?>
			<div id="tab1" class="tabs-wrap">
				<ul>
					<?php 
                if (!empty($posts_order) && $posts_order == 'viewed') {
                    tie_most_viewed($posts_number);
                } else {
                    tie_popular_posts($posts_number);
                }
                ?>
	
				</ul>
			</div>
			<?php 
            }
            if ($tab == 'r') {
                ?>
			<div id="tab2" class="tabs-wrap">
				<ul>
					<?php 
                tie_last_posts($posts_number);
                ?>
	
				</ul>
			</div>
			<?php 
            }
            if ($tab == 'c') {
                ?>
			<div id="tab3" class="tabs-wrap">
				<ul>
					<?php 
                tie_most_commented($posts_number);
                ?>
				</ul>
			</div>
			<?php 
            }
            if ($tab == 't') {
                ?>
			<div id="tab4" class="tabs-wrap tagcloud">
				<?php 
                wp_tag_cloud($args = array('largest' => 8, 'number' => 25, 'orderby' => 'count', 'order' => 'DESC'));
                ?>
			</div>
			<?php 
            }
        }
        ?>

		</div>
	</div><!-- .widget /-->
<?php 
    }