__( 'Get the latset news from aljazzera.net RSS', 'text_domain' ), ) ); } 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_description = isset( $instance['display_description']) ? $instance['display_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 $this->desc_on = $display_description; $this->num_items = $num_items; $logo_src = plugins_url( '/aljazeera-logo.png', __FILE__ ); 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 : alse; $instance['display_description'] = isset($new_instance['display_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_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 ) ) { continue; } else { $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 ); // change existing [...] to […]. if ( '[...]' === substr( $desc, -5 )) { $desc = substr( $desc, 0, -5 ) . '[…]'; } elseif ('[…]' !== substr($desc, -10)) { $desc .= ' […]'; } $desc = esc_html( $desc ); echo $desc; ?>