__( 'Get the latset news from aljazzera.net RSS', 'text_domain' ), ) // Args ); } function widget($args, $instance) { extract($args); // Get the variables $rss_url = esc_url(strip_tags($instance['rss_url'])); $display_logo = isset($instance['display_logo']) ? $instance['display_logo'] : false; $display_link = isset($instance['display_link']) ? $instance['display_link'] : false; $num_items = (int) $instance['num_items']; $display_news_description = isset($instance['display_news_description']) ? $instance['display_news_description'] : false; // If the url is empty, abort if (empty($rss_url)) return; // Make sure num_items is between limits if ($num_items > $this->max_items_allowed) { $num_items = $this->max_items_allowed; } elseif ($num_items < 1) { $num_items = 1; } // Add variables to the class properties as we will need them while outputting the feed $this->desc_on = $display_news_description; $this->num_items = $num_items; $logo_src = plugins_url('/aljazeera_rss/aljazeera_logo.png'); echo $before_widget; if (isset($title)) echo $before_title . $title . $after_title; echo "
"; if ($display_logo == true) { echo ""; } if ($display_link == true) { echo "aljazeera.net"; } echo "
"; // output the feed $this->output_feed($rss_url); echo "
" . $after_widget; } function update($new_instance, $old_instance) { $instance = $old_instance; $instance['display_logo'] = isset($new_instance['display_logo']) ? true : false; $instance['display_link'] = isset($new_instance['display_link']) ? true : false; $instance['display_news_description'] = isset($new_instance['display_news_description']) ? true : false; $instance['num_items'] = (int) $new_instance['num_items']; $instance['rss_url'] = $new_instance['rss_url']; return $instance; } function form($instance) { /* Setup default widget settings. */ $defaults = array( 'display_logo' => true, 'display_link' => true, 'display_news_description' => true, 'num_items' => 5, 'rss_url' => 'http://www.aljazeera.net/aljazeerarss/3c66e3fb-a5e0-4790-91be-ddb05ec17198/4e9f594a-03af-4696-ab98-880c58cd6718' ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>

>

>

>

عذرا حدثت مشكلة فى إحضار الأخبار

"; return; } // Limit the items to the number we need $num_items_available = $rss->get_item_quantity($this->num_items); // Build an array of all the items objects, starting with element 0. $rss_items = $rss->get_items(0, $num_items_available); ?>
get_id(true); if (in_array($temp_guid, $guids)) { // Skip this item continue; } else { // Add the guid $guids[] = $temp_guid; } ?>
get_title()); ?>
desc_on == true) : ?>
get_description(), ENT_QUOTES, get_option('blog_charset')); $desc = strip_tags($desc); $desc = esc_attr($desc); $desc = str_replace(array("\n", "\r"), ' ', $desc); // Append ellipsis, change existing [...] to […]. if ('[...]' == substr($desc, -5)) { $desc = substr($desc, 0, -5) . '[…]'; } elseif ('[…]' != substr($desc, -10)) { $desc .= ' […]'; } $desc = esc_html($desc); echo $desc; ?>