“. $title . $after_title;
/* Get RSS Feed(s) */
include_once(ABSPATH . WPINC . ‘/feed.php’);
/* Get a SimplePie feed object from the specified feed source. */
//$rss = fetch_feed(get_site_url().’/comunidad/pg/groups/world/?filter=pop&view=rss’);
// diego.ramirez dramirez #1120 - Changed to internal cache management
$rss = self::get_feed(get_site_url().’/comunidad/pg/groups/world/?filter=pop&view=rss’);
// Checks that the object is created correctly
if (!is_wp_error( $rss ) ){
// Figure out how many total items there are, but limit it to 5.
$maxitems = $rss->get_item_quantity(10);
// Build an array of all the items, starting with element 0 (first element).
$rss_items = $rss->get_items(0, $maxitems);
}
// diego.ramirez dramirez #1002 Changing communities display layout
$widget_content = ““;
if ($maxitems == 0) {
$widget_content .= “No items to display. “;
} else {
$i=1;
$j=0;
foreach ( $rss_items as $item ) {
$item_permalink = $item->get_permalink();
$item_title = $item->get_title();
$item_date = date_i18n( ‘j F Y’, $item->get_date(‘U’), false );
$tag_icon = $item->get_item_tags(”, ‘cfkn_icon_url’);
if($tag_icon){
$item_icon = $tag_icon[0][‘data’];
}
// diego.ramirez dramirez #1002 Changing communities display layout using just divs
$widget_content .= ”
“;
if( $i % 4 == 0){
$widget_content.=” “;
$j++;
}
$i++;
}
}
if($j % 3 != 0 ){
$widget_content.=” “;
}
$widget_content .= ““;
/* view all link */
// $view_all = $rss->get_link();
$view_all = get_site_url().”/comunidad/pg/groups/world”;
$widget_content .= ““;
$widget_content .= ““;
//$widget_content = self::dummy_widget();
echo $widget_content;
/* After widget (defined by themes). */
echo $after_widget;
}
/**
* Update the widget settings.
*/
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
/* Strip tags for title and name to remove HTML (important for text inputs). */
$instance[‘title’] = strip_tags( $new_instance[‘title’] );
return $instance;
}
/**
* Displays the widget settings controls on the widget panel.
* Make use of the get_field_id() and get_field_name() function
* when creating your form elements. This handles the confusing stuff.
*/
function form( $instance ) {
/* Set up some default widget settings. */
$defaults = array( ‘title’ => __(‘Comunidades’, ‘example’), ‘name’ => __(‘John Doe’, ‘example’), ‘sex’ => ‘male’, ‘show_sex’ => true );
$instance = wp_parse_args( (array) $instance, $defaults ); ?>
“;
if ($maxitems == 0) {
$widget_content .= “No items to display. “;
} else {
$i=1;
$j=0;
foreach ( $rss_items as $item ) {
$item_permalink = $item->get_permalink();
$item_title = $item->get_title();
$item_date = date_i18n( ‘j F Y’, $item->get_date(‘U’), false );
$tag_icon = $item->get_item_tags(”, ‘cfkn_icon_url’);
if($tag_icon){
$item_icon = $tag_icon[0][‘data’];
}
// diego.ramirez dramirez #1002 Changing communities display layout using just divs
$widget_content .= ”
“;
if( $i % 4 == 0){
$widget_content.=” “;
$j++;
}
$i++;
}
}
if($j % 3 != 0 ){
$widget_content.=” “;
}
$widget_content .= “
“;
/* view all link */
// $view_all = $rss->get_link();
$view_all = get_site_url().”/comunidad/pg/groups/world”;
$widget_content .= ““;
$widget_content .= “