<?php /**
 * Jthoor free theme v 1.0
 *
 * this site use free theme ffrom jthoor,com.
 *
 * @package 	Jthoor free theme 
 * @copyright	Copyright (c) 2013-2014, Jthoor 
 * @license		http://www.jthoor.com
 *
 * @since 		1.0
 */
 ?>
<?php $up_options = upfw_get_options(); ?>
<?php
class widget_seadd extends WP_Widget {
    // Create Widget
    function widget_seadd() {
        parent::WP_Widget(false, $name = 'البـحث المتطور', array('description' => ''));
    }
    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        ?>        
<div class="search">
<?php include TEMPLATEPATH . '/searchform.php';?>       
        		</div><!--End Search-->                   
        <?php
     }
    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        ?>
                                     
        <?php       
    }

}
register_widget('widget_seadd');
/*  search   */








$up_options = upfw_get_options(); ?>
<?php
class widget_imgs extends WP_Widget {
    // Create Widget
    function widget_imgs() {
        parent::WP_Widget(false, $name = 'معرض الصور ( كبير )', array('description' => ''));
    }
    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        ?>  
        

      
         <?php $true = get_option('nt_gallery_true') ;
               $catt = get_option('nt_gallery_cat') ;
               $num = get_option('nt_gallery_num') ;
               if($true == 'category'){$loop6 = new WP_Query( array( 'post_type' => 'post','offset'                 => '0', 'category_name'  => $catt ,'posts_per_page' => $num ) );}
               else{$loop6 = new WP_Query( array( 'post_type' => 'post','posts_per_page' => $num));}
               

 ?>
 <br />
 <div class="side-title"><?php echo get_option('nt_gallery_title') ; ?></div>
	<ul class="pgwSlider"><?php while ( $loop6->have_posts() ) : $loop6->the_post(); ?>
        		
        		
        		
    <li>
        <a href="<?php the_permalink() ?>" >
            <img src="<?php $image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id,'large', true);
echo $image_url[0];  ?>">
	    <span><?php echo wp_trim_words( get_the_title(), 7 ); ?></span>
        </a>
    </li>

        		
        		
        	<?php endwhile; ?></ul>	
        		
        <?php
     }
    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        ?>
                                     
        <?php       
    }

}
register_widget('widget_imgs');
/*  search   */








class widget_navv extends WP_Widget {
    // Create Widget
    function widget_navv() {
        parent::WP_Widget(false, $name = 'التاريخ والتواصل', array('description' => ''));
    }
    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        ?>        
<div id="nav">
<ul class="date"><li><script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/date.js"></script></li>
<li><?php echo date("d-m-Y h:i:s"); ?></li>
</ul>
<div class="socialmedia"><?php include('socials.php'); ?></div><div class="clear"></div>
</div>
               
        <?php
     }
    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        ?>
                                     
        <?php       
    }

}
register_widget('widget_navv');










class widget_logo  extends WP_Widget {
    // Create Widget
    function widget_logo() {
        parent::WP_Widget(false, $name = 'اللوجو والاعلانات ', array('description' => ''));
    }
    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        ?>        


<div id="header">
<?php $up_options = upfw_get_options(); ?>
	<?php $logo2 = $up_options->image;
    if ( $logo2 == '' ):
	$logo2 = 'http://jthoor.com/inc/logo-dark.png';
	else:
	 $logo2 = $logo2 ;
	endif;
	?>
<div class="logo"><a class="vtip" title="الرئيسية" href="index.php"><img src="<?php echo $logo2 ?>" /></a></div>
<?php include('h-ads.php'); ?>
<div class="clear"></div>
</div>


               
        <?php
     }
    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        ?>
                                     
        <?php       
    }

}
register_widget('widget_logo');














class widget_grid extends WP_Widget {
    // Create Widget
    function widget_grid() {
        parent::WP_Widget(false, $name = 'عرض المربعات ', array('description' => ''));
    }
    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        ?>        


	<?php $up_options = upfw_get_options(); ?>



	<?php
	include('grid.php');
	?>


               
        <?php
     }
    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        ?>
                                     
        <?php       
    }

}
register_widget('widget_grid');















class widget_shreet  extends WP_Widget {
    // Create Widget
    function widget_shreet() {
        parent::WP_Widget(false, $name = 'شريط آخر الاخبار ', array('description' => ''));
    }
    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        ?>        


	<?php $up_options = upfw_get_options(); ?>



	<?php $last_cc = $up_options->theme_last;
    if ( $last_cc == 'nd_th' ):
	include('ticker2.php');
	else:
	include('ticker.php');
	endif;
	?>


               
        <?php
     }
    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        ?>
                                     
        <?php       
    }

}
register_widget('widget_shreet');










class widget_menu1 extends WP_Widget {
    // Create Widget
    function widget_menu1() {
        parent::WP_Widget(false, $name = 'قائمة الهيدر', array('description' => ''));
    }
    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        ?>        


<div class="nav-m">

<?php wp_nav_menu( array( 'theme_location' => 'hm' ) ); ?>

</div>

               
        <?php
     }
    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        ?>
                                     
        <?php       
    }

}
register_widget('widget_menu1');









class widget_sslider extends WP_Widget {
    // Create Widget
    function widget_sslider() {
        parent::WP_Widget(false, $name = 'سلايدر الاخبار', array('description' => 'سلايدر الاخبار الرئيسي '));
    }
    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        ?>        
<?php include TEMPLATEPATH . '/inc/slider1.php';?>       
        <?php
     }
    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        ?>
                                     
        <?php       
    }

}
register_widget('widget_sslider');
/*  slider   */








class widget_last_news extends WP_Widget {
    // Create Widget
    function widget_last_news() {
        parent::WP_Widget(false, $name = 'اخر الاخبار للرئيسية', array('description' => 'الجزئ الاساسى الذى يعرض اخر الاخبار '));
    }
    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        ?>        
<?php include TEMPLATEPATH . '/inc/right.php';?>       
        <?php
     }
    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        ?>
                                     
        <?php       
    }

}
register_widget('widget_last_news');
/*  right   */















class widget_soci extends WP_Widget {

    // Create Widget
    function widget_soci() {
        parent::WP_Widget(false, $name = 'شبكات التواصل', array('description' => ''));
    }

    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        $skype_url = strip_tags($instance['skype_url']);
        $youtube_url = strip_tags($instance['youtube_url']);
        $rss_url = strip_tags($instance['rss_url']);
        $twiter_url = strip_tags($instance['twiter_url']);
        $facebook_url = strip_tags($instance['facebook_url']);
        ?>        
	    		<div class="sidebar">
                	<div class="side-title">تابعنا على</div>
	    			<ul id="iner" class="s-ul" >
        				<li>
            				<a  href="<?php echo $skype_url; ?>">
            					<i class="wed-social fa fa-skype"></i>
                    		</a>
            			</li>
        				<li>
            				<a  href="<?php echo $youtube_url; ?>">
            					<i class="wed-social fa fa-youtube"></i>
                    		</a>
            			</li> 
        				<li>
            				<a  href="<?php echo $rss_url; ?>">
            					<i class="wed-social fa fa-rss"></i>
                    		</a>
            			</li>
        				<li>
            				<a href="<?php echo $twiter_url; ?>">
            					<i class="wed-social fa fa-twitter"></i>
                    		</a>
            			</li>
        				<li>
            				<a  href="<?php echo $facebook_url; ?>">
            					<i class="wed-social fa fa-facebook"></i>
                    		</a>
            			</li>                
        			</ul>
    			</div><!--End Socail-->        	                   
        <?php
     }

    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        $skype_url = strip_tags($instance['skype_url']);
        $youtube_url = strip_tags($instance['youtube_url']);
        $rss_url = strip_tags($instance['rss_url']);
        $twiter_url = strip_tags($instance['twiter_url']);
        $facebook_url = strip_tags($instance['facebook_url']);		
        ?>
      		          
      			<p>
                <label for="<?php echo $this->get_field_id('skype_url'); ?>">
				رابط الاسكايب: </label>
                <input class="widefat" id="<?php echo $this->get_field_id('skype_url'); ?>" name="<?php echo $this->get_field_name('skype_url'); ?>" type="text" value="<?php echo esc_attr($skype_url); ?>" />
            </p>                   		 
      			<p>
                <label for="<?php echo $this->get_field_id('youtube_url'); ?>">
				رابط اليوتيوب: </label>
                <input class="widefat" id="<?php echo $this->get_field_id('youtube_url'); ?>" name="<?php echo $this->get_field_name('youtube_url'); ?>" type="text" value="<?php echo esc_attr($youtube_url); ?>" />
            </p> 
      			<p>
                <label for="<?php echo $this->get_field_id('rss_url'); ?>">
				رابط التغذية: </label>
                <input class="widefat" id="<?php echo $this->get_field_id('rss_url'); ?>" name="<?php echo $this->get_field_name('rss_url'); ?>" type="text" value="<?php echo esc_attr($rss_url); ?>" />
            </p> 
      			<p>
                <label for="<?php echo $this->get_field_id('twiter_url'); ?>">
				رابط تويتر: </label>
                <input class="widefat" id="<?php echo $this->get_field_id('twiter_url'); ?>" name="<?php echo $this->get_field_name('twiter_url'); ?>" type="text" value="<?php echo esc_attr($twiter_url); ?>" />
            </p> 
      			<p>
                <label for="<?php echo $this->get_field_id('facebook_url'); ?>">
				رابط الفيس : </label>بوك
                <input class="widefat" id="<?php echo $this->get_field_id('facebook_url'); ?>" name="<?php echo $this->get_field_name('facebook_url'); ?>" type="text" value="<?php echo esc_attr($facebook_url); ?>" />
            </p>                                           		                                               
        <?php       
    }

}

register_widget('widget_soci');










class widget_mk extends WP_Widget {

    // Create Widget
    function widget_mk() {
        parent::WP_Widget(false, $name = 'مقالات متطورة', array('description' => ''));
    }

    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        $mkal_title = strip_tags($instance['mkal_title']);
        ?>        
                <div class="sidebar">
                	<div class="side-title">
                    	<?php echo $mkal_title; ?>
                    </div>
                    <div class="side-cc">
						<ul class="mqalat">
						
						
						         <?php $true = get_option('nt_mq_true') ;
               $catt = get_option('nt_mq_cat') ;
               $num = get_option('nt_mq_num') ;
               if($true == 'category'){$loop4 = new WP_Query( array( 'post_type' => 'post','offset'                 => '0', 'category_name'  => $catt ,'posts_per_page' => $num ) );}
               else{$loop4 = new WP_Query( array( 'post_type' => 'post','posts_per_page' => $num));}
               

 ?>
<?php while ( $loop4->have_posts() ) : $loop4->the_post(); ?>


				


              	<li>
                            	<a href="<?php the_permalink() ?>">
                            	<img src="<?php $image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id,'large', true);
echo $image_url[0];  ?>" alt="" />
                                </a>
                                <a class="maqal-title" href="<?php the_permalink() ?>"><?php echo wp_trim_words( get_the_title(), 10 ); ?></a>
                                <span class="maqal-cco"><i class="fa fa-comment"></i>
                                بقلم : <?php echo wpshed_get_custom_field( 'wpshed_textfield' ); ?></span>
                                <div class="clear"></div>
                            </li>
                            <?php endwhile; ?>
                            </ul>
                    </div>
                </div><!--End Class-sidebar-->	    		        	                   
        <?php
     }

    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        $mkal_title = strip_tags($instance['mkal_title']);
        ?>
      		          
      			<p>
                <label for="<?php echo $this->get_field_id('mkal_title'); ?>"> 
				العنوان: </label>
                <input class="widefat" id="<?php echo $this->get_field_id('mkal_title'); ?>" name="<?php echo $this->get_field_name('mkal_title'); ?>" type="text" value="<?php echo esc_attr($mkal_title); ?>" />
            </p>                   		 
      			                       
        <?php       
    }

}
register_widget('widget_mk');








class widget_video extends WP_Widget {

    // Create Widget
    function widget_video() {
        parent::WP_Widget(false, $name = 'الفيديو واليوتيوب', array('description' => 'http://www.youtube.com/watch?v=اي دى الفيديو'));
    }

    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        $video_title = strip_tags($instance['video_title']);
        $video_url = strip_tags($instance['video_url']);
        ?>        
                <div class="sidebar">
                	<div class="side-title">
                    	<?php echo $video_title; ?>
                    </div>
                    <div class="side-text">
<iframe width="98%" height="315"  style="margin:2px auto;"
src="http://www.youtube.com/embed/<?php echo $video_url; ?>" frameborder="0" allowfullscreen></iframe>
                    </div>
                </div><!--End Class-sidebar-->	    		        	                   
        <?php
     }

    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        $video_title = strip_tags($instance['video_title']);
        $video_url = strip_tags($instance['video_url']);
        ?>
      		          
      			<p>
                <label for="<?php echo $this->get_field_id('video_title'); ?>"> 
				العنوان: </label>
                <input class="widefat" id="<?php echo $this->get_field_id('video_title'); ?>" name="<?php echo $this->get_field_name('video_title'); ?>" type="text" value="<?php echo esc_attr($video_title); ?>" />
            </p>                   		 
      			      			<p>
                <label for="<?php echo $this->get_field_id('video_url'); ?>"> 
								رقم اى دى فيديو اليوتيوب: </label>
                <input class="widefat" id="<?php echo $this->get_field_id('video_url'); ?>" name="<?php echo $this->get_field_name('video_url'); ?>" type="text" value="<?php echo esc_attr($video_url); ?>" />
            </p>                       
        <?php       
    }

}

register_widget('widget_video');










class widget_tab extends WP_Widget {

    // Create Widget
    function widget_tab() {
        parent::WP_Widget(false, $name = 'الأكثر مشاركة وتعليقا', array('description' => ''));
    }

    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        ?>        
        <div class="sidebar">
			<div class="tabs-title">
				<ul class="tabs">
				<li class="active"><a  href="#tab1">الاكثر 
				قراءه</a></li>
				<li><a  href="#tab2">الاكثر تعليقا</a></li>
				<li><a  href="#tab3">مختارات</a></li>
				</ul>
			</div>        	

            <div class="side-text">
				<div id="tab1">
				
<div class="sidebar">
                    <div class="side-cc">
						<ul class="mqalat">
    			                <?php $loop = new WP_Query( array( 'post_type' => array('post', 'randnews', 'random', 'people', 'slider','newslone','static','star','hdaf','dawry','tdmatchs','rka','econ','sportworld','brazil','news','news','sport') ,
'orderby'      => 'meta_value', 
'meta_key'     => 'post_views_count',
'posts_per_page' => 6 ) ); ?>               
				<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

                        	<li>
                            	<a href="<?php the_permalink() ?>">
                            	<img src="<?php $image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id,'large', true);
echo $image_url[0];  ?>" alt="" />
                                </a>
                                <a class="maqal-title" href="<?php the_permalink() ?>"><?php echo wp_trim_words( get_the_title(), 10 ); ?></a>
                                <span class="maqal-cco"><i class="fa fa-comment"></i>
                                بقلم : <?php echo wpshed_get_custom_field( 'wpshed_textfield' ); ?></span>
                                <div class="clear"></div>
                            </li>
                            <?php endwhile; ?>
                            </ul>
                    </div>
                </div>

                    
                                    
                    
             
                </div><!--End Loop-->
				<div id="tab2">
               


<div class="sidebar">
                    <div class="side-cc">
						<ul class="mqalat">
    			 <?php $loop = new WP_Query( array( 'post_type' => array('post', 'randnews', 'random', 'people', 'slider','newslone','static','star','hdaf','dawry','tdmatchs','rka','econ','sportworld','brazil','news','news','sport') ,
'orderby'                => 'comment_count','posts_per_page' => 6 ) ); ?>               
				<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>                        	<li>
                            	<a href="<?php the_permalink() ?>">
                            	<img src="<?php $image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id,'large', true);
echo $image_url[0];  ?>" alt="" />
                                </a>
                                <a class="maqal-title" href="<?php the_permalink() ?>"><?php echo wp_trim_words( get_the_title(), 10 ); ?></a>
                                <span class="maqal-cco"><i class="fa fa-comment"></i>
                                بقلم : <?php echo wpshed_get_custom_field( 'wpshed_textfield' ); ?></span>
                                <div class="clear"></div>
                            </li>
                            <?php endwhile; ?>
                            </ul>
                    </div>
                </div>



                </div><!--End Loop-->    

<div id="tab3">
                



<div class="sidebar">
                    <div class="side-cc">
						<ul class="mqalat">
    			<?php $loop = new WP_Query( array( 'post_type' => array('post', 'randnews', 'random', 'people', 'slider','newslone','static','star','hdaf','dawry','tdmatchs','rka','econ','sportworld','brazil','news','news','sport') ,
'order'                  => 'DESC',
	'orderby'                => 'rand','posts_per_page' => 6 ) ); ?>               
				<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
				
                        	<li>
                            	<a href="<?php the_permalink() ?>">
                            	<img src="<?php $image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id,'large', true);
echo $image_url[0];  ?>" alt="" />
                                </a>
                                <a class="maqal-title" href="<?php the_permalink() ?>"><?php echo wp_trim_words( get_the_title(), 10 ); ?></a>
                                <span class="maqal-cco"><i class="fa fa-comment"></i>
                                بقلم : <?php echo wpshed_get_custom_field( 'wpshed_textfield' ); ?></span>
                                <div class="clear"></div>
                            </li>
                            <?php endwhile; ?>
                            </ul>
                    </div>
                </div>






                </div> 
                
                           
            </div>
        </div><!--End Sidebar-class-->                    		        	                   
        <?php
     }

    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        ?>
      		          
      			              		 
      			                       
        <?php       
    }

}

register_widget('widget_tab');














class widget_visite extends WP_Widget {

    // Create Widget
    function widget_visite() {
        parent::WP_Widget(false, $name = 'التوقيت', array('description' => ''));
    }

    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        $visit_title = strip_tags($instance['visit_title']);
        ?>        
                <div class="sidebar">
                	<div class="side-title">
                    	<?php echo $visit_title; ?>
                    </div>
                    <div class="side-text">
						<center>
<iframe src="http://free.timeanddate.com/clock/i40pcndn/n214/szw110/szh110/cf100/hnce1ead6" frameborder="0" width="112" height="112"></iframe>


                    </center> 
                    </div>
                </div><!--End Class-sidebar-->	    		        	                   
        <?php
     }

    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        $visit_title = strip_tags($instance['visit_title']);
        ?>
      		          
      			<p>
                <label for="<?php echo $this->get_field_id('visit_title'); ?>"> 
				العنوان: </label>
                <input class="widefat" id="<?php echo $this->get_field_id('visit_title'); ?>" name="<?php echo $this->get_field_name('visit_title'); ?>" type="text" value="<?php echo esc_attr($visit_title); ?>" />
            </p>                   		 
      			                       
        <?php       
    }

}
register_widget('widget_visite');














class widget_weather extends WP_Widget {

    // Create Widget
    function widget_weather() {
        parent::WP_Widget(false, $name = 'الطقس', array('description' => ''));
    }

    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        $weather_title = strip_tags($instance['weather_title']);
        ?>        
                <div class="sidebar">
                	<div class="side-title">
                    	<?php echo $weather_title; ?>
                    </div>
                    <div class="side-text">
						<center>
<a href="http://www.accuweather.com/ar/ye/al-madinah/355832/weather-forecast/355832" class="aw-widget-legal">
<!--
By accessing and/or using this code snippet, you agree to AccuWeather’s terms and conditions (in English) which can be found at http://www.accuweather.com/en/free-weather-widgets/terms and AccuWeather’s Privacy Statement (in English) which can be found at http://www.accuweather.com/en/privacy.
-->
</a><div id="awcc1410386749074" class="aw-widget-current"  data-locationkey="" data-unit="c" data-language="ar" data-useip="true" data-uid="awcc1410386749074"></div><script type="text/javascript" src="http://oap.accuweather.com/launch.js"></script>

                    </center> 
                    </div>
                </div><!--End Class-sidebar-->	    		        	                   
        <?php
     }

    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        $weather_title = strip_tags($instance['weather_title']);
        ?>
      		          
      			<p>
                <label for="<?php echo $this->get_field_id('weather_title'); ?>"> 
				العنوان: </label>
                <input class="widefat" id="<?php echo $this->get_field_id('weather_title'); ?>" name="<?php echo $this->get_field_name('weather_title'); ?>" type="text" value="<?php echo esc_attr($weather_title); ?>" />
            </p>                   		 
      			                       
        <?php       
    }

}
register_widget('widget_weather');















class widget_bdate extends WP_Widget {

    // Create Widget
    function widget_bdate() {
        parent::WP_Widget(false, $name = 'التقويم', array('description' => ''));
    }

    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        $widget_bdate_title = strip_tags($instance['widget_bdate_title']);
        ?>        
        <style>
        .scc {
  background: none repeat scroll 0 0 #FFFFFF;
  border: medium none;
  width: 100%;
}
.scc tr{}
.scc td {
  border: 1px solid #ccc;
  text-align: center;
  font-size:11pt;
}
.sd td {
  border: 1px solid #CCCCCC;
  color: #FFFFFF;
  padding: 0;
}
.cd td {
  border: 1px solid #CCCCCC;
  background-color:#CCCCCC;
  color: #fff;
  padding: 6px;
  color:#000;
}
        </style>
                        <div class="sidebar">
                    <div class="side-text">
						<center>
  <html dir="rtl">
<script>

//للمزيد من الجافا سكريبت .. نرجو زيارة مجمع البرامج http://www.vip4soft.com/
monthnames = new Array(
"يناير",
"فبراير",
"مارس",
"ابريل",
"مايو",
"يونيو",
"يوليو",
"اغسطس",
"سبتمبر",
"اكتوبر",
"نوفمبر",
"ديسمبر");
var linkcount=0;
function addlink(month, day, href) {
var entry = new Array(3);
entry[0] = month;
entry[1] = day;
entry[2] = href;
this[linkcount++] = entry;
}
Array.prototype.addlink = addlink;
linkdays = new Array();
monthdays = new Array(12);
monthdays[0]=31;
monthdays[1]=28;
monthdays[2]=31;
monthdays[3]=30;
monthdays[4]=31;
monthdays[5]=30;
monthdays[6]=31;
monthdays[7]=31;
monthdays[8]=30;
monthdays[9]=31;
monthdays[10]=30;
monthdays[11]=31;
todayDate=new Date();
thisday=todayDate.getDay();
thismonth=todayDate.getMonth();
thisdate=todayDate.getDate();
thisyear=todayDate.getYear();
thisyear = thisyear % 100;
thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear));
if (((thisyear % 4 == 0) 
&& !(thisyear % 100 == 0))
||(thisyear % 400 == 0)) monthdays[1]++;
startspaces=thisdate;
while (startspaces > 7) startspaces-=7;
startspaces = thisday - startspaces + 1;
if (startspaces < 0) startspaces+=7;
document.write("<table class='scc' border=2 bgcolor=white ");
document.write("bordercolor=black><font color=black>");
document.write("<tr class='cd'><td colspan=7><center><strong>" 
+ monthnames[thismonth] + " " + thisyear 
+ "</strong></center></font></td></tr>");
document.write("<tr class='sd'>");
document.write("<td align=center>الاحد</td>");
document.write("<td align=center>الاثنين</td>");
document.write("<td align=center>الثلاثاء</td>");
document.write("<td align=center>الاربعاء</td>");
document.write("<td align=center>الخميس</td>");
document.write("<td align=center>الجمعة</td>");
document.write("<td align=center>السبت</td>"); 
document.write("</tr>");
document.write("<tr>");
for (s=0;s<startspaces;s++) {
document.write("<td> </td>");
}
count=1;
while (count <= monthdays[thismonth]) {
for (b = startspaces;b<7;b++) {
linktrue=false;
document.write("<td>");
for (c=0;c<linkdays.length;c++) {
if (linkdays[c] != null) {
if ((linkdays[c][0]==thismonth + 1) && (linkdays[c][1]==count)) {
document.write("<a href=\"" + linkdays[c][2] + "\">");
linktrue=true;
      }
   }
}
if (count==thisdate) {
document.write("<font color='FF0000'><strong>");
}
if (count <= monthdays[thismonth]) {
document.write(count);
}
else {
document.write(" ");
}
if (count==thisdate) {
document.write("</strong></font>");
}
if (linktrue)
document.write("</a>");
document.write("</td>");
count++;
}
document.write("</tr>");
document.write("<tr>");
startspaces=0;
}
document.write("</table></p>");
    </script>						
                    </center> 
                    </div>
                </div><!--End Class-sidebar-->
                	       
        	                   
        <?php
     }

    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        $widget_bdate_title = strip_tags($instance['widget_bdate_title']);
        ?>

      			<p>
                <label for="<?php echo $this->get_field_id('widget_bdate_title'); ?>"> 
				أضف عنوان : </label>
                <input class="widefat" id="<?php echo $this->get_field_id('widget_bdate_title'); ?>" name="<?php echo $this->get_field_name('widget_bdate_title'); ?>" type="text" value="<?php echo esc_attr($widget_bdate_title); ?>" />
            </p>       		                             		 
      		                                               
        <?php       
    }

}

register_widget('widget_bdate');

















class widget_tags extends WP_Widget {

    // Create Widget
    function widget_tags() {
        parent::WP_Widget(false, $name = 'سحابة الكلمات الدلالية', array('description' => ''));
    }

    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        $tags_title = strip_tags($instance['tags_title']);
        ?>        
                <div class="sidebar">
                	<div class="side-title">
                    	<?php echo $tags_title; ?>
                    </div>
                    <div class="side-cc">


<?php wp_tag_cloud( array( 'taxonomy' => 'category' ) ); ?>



                    </div>
                </div><!--End Class-sidebar-->	    		        	                   
        <?php
     }

    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        $tags_title = strip_tags($instance['tags_title']);
        ?>
      		          
      			<p>
                <label for="<?php echo $this->get_field_id('tags_title'); ?>"> 
				العنوان: </label>
                <input class="widefat" id="<?php echo $this->get_field_id('tags_title'); ?>" name="<?php echo $this->get_field_name('tags_title'); ?>" type="text" value="<?php echo esc_attr($tags_title); ?>" />
            </p>                   		 
      			                       
        <?php       
    }

}
register_widget('widget_tags');


































































class widget_adss extends WP_Widget {

    // Create Widget
    function widget_adss () {
        parent::WP_Widget(false, $name = 'منطقة اعلانية', array('description' => 'اسحب المنطقة الاعلانية للمكان المرا تفعيلها به وقم بتحديد الرابط والصورة وسيتم ظهور الاعلان '));
    }

    // Widget Content
    function widget($args, $instance) { 
        extract( $args );
        $link_url = strip_tags($instance['link_url']);
        $img_url = strip_tags($instance['img_url']);
        ?>        
	    		<a href="<?php echo $link_url; ?>"><img class="addss" src="<?php echo $img_url; ?>" /></a>        	                   
        <?php
     }

    // Update and save the widget
    function update($new_instance, $old_instance) {
        return $new_instance;
    }

    // If widget content needs a form
    function form($instance) {
        //widgetform in backend
        $link_url = strip_tags($instance['link_url']);
        $img_url = strip_tags($instance['img_url']);
        ?>
      		          
      		<p>
                <label for="<?php echo $this->get_field_id('link_url'); ?>">
				رابط الاعلان </label>
                <input class="widefat" id="<?php echo $this->get_field_id('link_url'); ?>" name="<?php echo $this->get_field_name('link_url'); ?>" type="text" value="<?php echo esc_attr($link_url); ?>" />
            </p>                   		 
      			<p>
                <label for="<?php echo $this->get_field_id('img_url'); ?>">
				رابط صورة الاعلان</label>
                <input class="widefat" id="<?php echo $this->get_field_id('img_url'); ?>" name="<?php echo $this->get_field_name('img_url'); ?>" type="text" value="<?php echo esc_attr($img_url); ?>" />
            </p> 
      			                                           		                                               
        <?php       
    }

}

register_widget('widget_adss');








?>