diff -r 0d9a58d2c515 -r 0d28b7c10758 web/wp-content/themes/selecta/ocmx/widgets/four-block-widget.php
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/web/wp-content/themes/selecta/ocmx/widgets/four-block-widget.php Fri Mar 12 13:29:04 2010 +0000
@@ -0,0 +1,162 @@
+ "Four block thumbnail widget for the Home Page. Place in the 'Index Header Panel'."));
+ }
+
+ /** @see WP_Widget::widget */
+ function widget($args, $instance) {
+ extract( $args );
+ $widget_title = esc_attr($instance["widget_title"]);
+
+ if(!($instance["post_category"])) :
+ $use_catId = 0;
+ $cat_query = "";
+ else :
+ $use_category = $instance["post_category"];
+ $use_catId = get_category_by_slug($use_category);
+ $cat_query = "&category_name=".$use_catId->cat_name;
+ endif;
+ //Fetch the category for the widget
+ if(!($instance["post_offset"])) :
+ $use_offset = 0;
+ else :
+ $use_offset = $instance["post_offset"];
+ endif;
+
+ //Fetch the count for the widget
+ if(!($instance["post_count"])) :
+ $post_count = 4;
+ else :
+ $post_count = $instance["post_count"];
+ endif;
+
+ $ocmx_featured = new WP_Query("showposts=$post_count&post_type=post".$cat_query);
+
+ //Set the post Aguments and Query accordingly
+ $count = 0;
+?>
+
+
+
+ have_posts()) : $ocmx_featured->the_post();
+ setup_postdata($post);
+ $count++;
+ if ($count == 5) :
+ $count = 1; ?>
+
+
+
+
+ ID);
+ $get_post_video = get_post_meta($this_post->ID, "main_video", true);
+ $get_thumbnail = get_post_meta($this_post->ID, "other_media", true);
+ $get_video_thumbnail = get_post_meta($this_post->ID, "video_thumbnail", true);
+ $link = get_permalink($this_post->ID);
+ // Set our category
+ $category = get_the_category();
+ // If we haven't used our custom image input, search for the first image in the post
+ $post_image = "";
+ if($get_thumbnail == "" && (get_option("ocmx_auto_home_images") && get_option("ocmx_auto_home_images") !== "no")) :
+ $post_image = fetch_post_image($ocmx_featured->ID, "300", "600");
+ endif;
+ ?>
+ - >
+
+
+
+
+
; ?>/functions/timthumb.php?src=<?php echo $get_video_thumbnail ?>&h=&w=300&zc=1)
+
+
; ?>/functions/timthumb.php?src=<?php echo $get_thumbnail ?>&h=&w=300&zc=1)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file