• 09-06-2014, 12:09:34
    #1
    <?php
    
    /*-----------------------------------------------------------------------------------
    
    	Plugin Name: BYT Home Feature
    
    -----------------------------------------------------------------------------------*/
    
    
    // Add function to widgets_init that'll load our widget.
    add_action( 'widgets_init', 'byt_home_feature_widgets' );
    
    // Register widget.
    function byt_home_feature_widgets() {
    	register_widget( 'byt_Home_Feature_Widget' );
    }
    
    // Widget class.
    class byt_Home_Feature_Widget extends WP_Widget {
    
    
    /*-----------------------------------------------------------------------------------*/
    /*	Widget Setup
    /*-----------------------------------------------------------------------------------*/
    	
    	function byt_Home_Feature_Widget() {
    	
    		/* Widget settings. */
    		$widget_ops = array( 'classname' => 'byt_home_feature_widget', 'description' => __('BookYourTravel: Home Feature Widget', 'bookyourtravel') );
    
    		/* Widget control settings. */
    		$control_ops = array( 'width' => 300, 'height' => 550, 'id_base' => 'byt_home_feature_widget' );
    
    		/* Create the widget. */
    		$this->WP_Widget( 'byt_home_feature_widget', __('BookYourTravel: Home Feature Widget', 'bookyourtravel'), $widget_ops, $control_ops );
    	}
    
    
    /*-----------------------------------------------------------------------------------*/
    /*	Display Widget
    /*-----------------------------------------------------------------------------------*/
    	
    	function widget( $args, $instance ) {
    		extract( $args );
    
    		/* Our variables from the widget settings. */
    		$title = apply_filters('widget_title', $instance['title'] );
    		$home_feature_text = $instance['home_feature_text'];
    
    		/* Before widget (defined by themes). */
    		echo $before_widget;
    
    		/* Display Widget */
    		?>
    			<article class="home_features clearfix">
    				<h2><?php echo $title; ?></h2>
    				<p><?php echo $home_feature_text; ?></p>
    			</article>
    		<?php
    
    		/* After widget (defined by themes). */
    		echo $after_widget;
    	}
    
    
    /*-----------------------------------------------------------------------------------*/
    /*	Update Widget
    /*-----------------------------------------------------------------------------------*/
    	
    	function update( $new_instance, $old_instance ) {
    		$instance = $old_instance;
    
    		/* Strip tags to remove HTML (important for text inputs). */
    		$instance['title'] = strip_tags( $new_instance['title'] );
    		$instance['home_feature_text'] = strip_tags( $new_instance['home_feature_text']);
    
    		return $instance;
    	}
    	
    
    /*-----------------------------------------------------------------------------------*/
    /*	Widget Settings
    /*-----------------------------------------------------------------------------------*/
    	 
    	function form( $instance ) {
    
    		/* Set up some default widget settings. */
    		$defaults = array(
    		'title' => 'Handpicked Accommodations',
    		'home_feature_text' => 'All Book Your Travel Accommodations fulfil strict selection criteria. Each accommodation is chosen individually and inclusion cannot be bought.',
    		);
    		$instance = wp_parse_args( (array) $instance, $defaults ); ?>
    
    		<!-- Widget Title: Text Input -->
    		<p>
    			<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'bookyourtravel') ?></label>
    			<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />
    		</p>
    
    		<p>
    			<label for="<?php echo $this->get_field_id( 'home_feature_text' ); ?>"><?php _e('Feature text:', 'bookyourtravel') ?></label>
    			<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'home_feature_text' ); ?>" name="<?php echo $this->get_field_name( 'home_feature_text' ); ?>" value="<?php echo $instance['home_feature_text']; ?>" />
    		</p>
    		
    	<?php
    	}
    }
    ?>
    wp-content/plugins/widgets/widget-home-feature.php on line 16


    nasıl sorunu çözebiliriz
  • 09-06-2014, 12:40:29
    #2
    biletci adlı üyeden alıntı: mesajı görüntüle
    <?php
    
    /*-----------------------------------------------------------------------------------
    
    	Plugin Name: BYT Home Feature
    
    -----------------------------------------------------------------------------------*/
    
    
    // Add function to widgets_init that'll load our widget.
    add_action( 'widgets_init', 'byt_home_feature_widgets' );
    
    // Register widget.
    function byt_home_feature_widgets() {
    	register_widget( 'byt_Home_Feature_Widget' );
    }
    
    // Widget class.
    class byt_Home_Feature_Widget extends WP_Widget {
    
    
    /*-----------------------------------------------------------------------------------*/
    /*	Widget Setup
    /*-----------------------------------------------------------------------------------*/
    	
    	function byt_Home_Feature_Widget() {
    	
    		/* Widget settings. */
    		$widget_ops = array( 'classname' => 'byt_home_feature_widget', 'description' => __('BookYourTravel: Home Feature Widget', 'bookyourtravel') );
    
    		/* Widget control settings. */
    		$control_ops = array( 'width' => 300, 'height' => 550, 'id_base' => 'byt_home_feature_widget' );
    
    		/* Create the widget. */
    		$this->WP_Widget( 'byt_home_feature_widget', __('BookYourTravel: Home Feature Widget', 'bookyourtravel'), $widget_ops, $control_ops );
    	}
    
    
    /*-----------------------------------------------------------------------------------*/
    /*	Display Widget
    /*-----------------------------------------------------------------------------------*/
    	
    	function widget( $args, $instance ) {
    		extract( $args );
    
    		/* Our variables from the widget settings. */
    		$title = apply_filters('widget_title', $instance['title'] );
    		$home_feature_text = $instance['home_feature_text'];
    
    		/* Before widget (defined by themes). */
    		echo $before_widget;
    
    		/* Display Widget */
    		?>
    			<article class="home_features clearfix">
    				<h2><?php echo $title; ?></h2>
    				<p><?php echo $home_feature_text; ?></p>
    			</article>
    		<?php
    
    		/* After widget (defined by themes). */
    		echo $after_widget;
    	}
    
    
    /*-----------------------------------------------------------------------------------*/
    /*	Update Widget
    /*-----------------------------------------------------------------------------------*/
    	
    	function update( $new_instance, $old_instance ) {
    		$instance = $old_instance;
    
    		/* Strip tags to remove HTML (important for text inputs). */
    		$instance['title'] = strip_tags( $new_instance['title'] );
    		$instance['home_feature_text'] = strip_tags( $new_instance['home_feature_text']);
    
    		return $instance;
    	}
    	
    
    /*-----------------------------------------------------------------------------------*/
    /*	Widget Settings
    /*-----------------------------------------------------------------------------------*/
    	 
    	function form( $instance ) {
    
    		/* Set up some default widget settings. */
    		$defaults = array(
    		'title' => 'Handpicked Accommodations',
    		'home_feature_text' => 'All Book Your Travel Accommodations fulfil strict selection criteria. Each accommodation is chosen individually and inclusion cannot be bought.',
    		);
    		$instance = wp_parse_args( (array) $instance, $defaults ); ?>
    
    		<!-- Widget Title: Text Input -->
    		<p>
    			<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'bookyourtravel') ?></label>
    			<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />
    		</p>
    
    		<p>
    			<label for="<?php echo $this->get_field_id( 'home_feature_text' ); ?>"><?php _e('Feature text:', 'bookyourtravel') ?></label>
    			<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'home_feature_text' ); ?>" name="<?php echo $this->get_field_name( 'home_feature_text' ); ?>" value="<?php echo $instance['home_feature_text']; ?>" />
    		</p>
    		
    	<?php
    	}
    }
    ?>
    wp-content/plugins/widgets/widget-home-feature.php on line 16


    nasıl sorunu çözebiliriz
    Bende bi sorun gözükmüyor binary(ikilli) olarak yüklermisin.
  • 09-06-2014, 12:45:25
    #3
    kingofseo adlı üyeden alıntı: mesajı görüntüle
    Bende bi sorun gözükmüyor binary(ikilli) olarak yüklermisin.
    halen aynı
  • 09-06-2014, 12:47:04
    #4
    biletci adlı üyeden alıntı: mesajı görüntüle
    halen aynı
    Ne sorunu aliyorsun ? Tüm sorunu yazarmisin.
  • 09-06-2014, 12:48:23
    #5
    kingofseo adlı üyeden alıntı: mesajı görüntüle
    Ne sorunu aliyorsun ? Tüm sorunu yazarmisin.

    Eklenti etkinleştirilemedi, çünkü önlenemeyen bir hataya sebep oldu.


    Fatal error: Cannot redeclare byt_home_feature_widgets() (previously declared in /home/.../public_html/tur/wp-content/themes/..../plugins/widgets/widget-home-feature.php:15) in /home/.../public_html/tur/wp-content/plugins/widgets/widget-home-feature.php on line 16
  • 09-06-2014, 12:51:19
    #6
    biletci adlı üyeden alıntı: mesajı görüntüle
    Eklenti etkinleştirilemedi, çünkü önlenemeyen bir hataya sebep oldu.


    Fatal error: Cannot redeclare byt_home_feature_widgets() (previously declared in /home/.../public_html/tur/wp-content/themes/..../plugins/widgets/widget-home-feature.php:15) in /home/.../public_html/tur/wp-content/plugins/widgets/widget-home-feature.php on line 16
    Denermisin :

    <?php
     
    /*-----------------------------------------------------------------------------------
     
       Plugin Name: BYT Home Feature
     
    -----------------------------------------------------------------------------------*/
     
     
    // Add function to widgets_init that'll load our widget.
    add_action( 'widgets_init', 'home_register_widgetsdo' );
     
    // Register widget.
    function home_register_widgetsdo() {
       register_widget( 'byt_Home_Feature_Widget' );
    }
     
    // Widget class.
    class byt_Home_Feature_Widget extends WP_Widget {
     
     
    /*-----------------------------------------------------------------------------------*/
    /* Widget Setup
    /*-----------------------------------------------------------------------------------*/
        
       function byt_Home_Feature_Widget() {
        
          /* Widget settings. */
          $widget_ops = array( 'classname' => 'byt_home_feature_widget', 'description' => __('BookYourTravel: Home Feature Widget', 'bookyourtravel') );
     
          /* Widget control settings. */
          $control_ops = array( 'width' => 300, 'height' => 550, 'id_base' => 'byt_home_feature_widget' );
     
          /* Create the widget. */
          $this->WP_Widget( 'byt_home_feature_widget', __('BookYourTravel: Home Feature Widget', 'bookyourtravel'), $widget_ops, $control_ops );
       }
     
     
    /*-----------------------------------------------------------------------------------*/
    /* Display Widget
    /*-----------------------------------------------------------------------------------*/
        
       function widget( $args, $instance ) {
          extract( $args );
     
          /* Our variables from the widget settings. */
          $title = apply_filters('widget_title', $instance['title'] );
          $home_feature_text = $instance['home_feature_text'];
     
          /* Before widget (defined by themes). */
          echo $before_widget;
     
          /* Display Widget */
          ?>
             <article class="home_features clearfix">
                <h2><?php echo $title; ?></h2>
                <p><?php echo $home_feature_text; ?></p>
             </article>
          <?php
     
          /* After widget (defined by themes). */
          echo $after_widget;
       }
     
     
    /*-----------------------------------------------------------------------------------*/
    /* Update Widget
    /*-----------------------------------------------------------------------------------*/
        
       function update( $new_instance, $old_instance ) {
          $instance = $old_instance;
     
          /* Strip tags to remove HTML (important for text inputs). */
          $instance['title'] = strip_tags( $new_instance['title'] );
          $instance['home_feature_text'] = strip_tags( $new_instance['home_feature_text']);
     
          return $instance;
       }
        
     
    /*-----------------------------------------------------------------------------------*/
    /* Widget Settings
    /*-----------------------------------------------------------------------------------*/
         
       function form( $instance ) {
     
          /* Set up some default widget settings. */
          $defaults = array(
          'title' => 'Handpicked Accommodations',
          'home_feature_text' => 'All Book Your Travel Accommodations fulfil strict selection criteria. Each accommodation is chosen individually and inclusion cannot be bought.',
          );
          $instance = wp_parse_args( (array) $instance, $defaults ); ?>
     
          <!-- Widget Title: Text Input -->
          <p>
             <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'bookyourtravel') ?></label>
             <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />
          </p>
     
          <p>
             <label for="<?php echo $this->get_field_id( 'home_feature_text' ); ?>"><?php _e('Feature text:', 'bookyourtravel') ?></label>
             <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'home_feature_text' ); ?>" name="<?php echo $this->get_field_name( 'home_feature_text' ); ?>" value="<?php echo $instance['home_feature_text']; ?>" />
          </p>
           
       <?php
       }
    }
    ?>
  • 09-06-2014, 12:52:48
    #7
    bu eklenti içinde include edilen bir dosya var mı? Muhtemelen fonksiyonların tutulduğu dosyayı birden fazla çağırıyor. include edilen fonksiyon dosyasını include yerine include_once şeklinde değiştirirseniz hatayı almazsınız.
  • 09-06-2014, 13:16:54
    #8
    kingofseo adlı üyeden alıntı: mesajı görüntüle
    Denermisin :

    <?php
     
    /*-----------------------------------------------------------------------------------
     
       Plugin Name: BYT Home Feature
     
    -----------------------------------------------------------------------------------*/
     
     
    // Add function to widgets_init that'll load our widget.
    add_action( 'widgets_init', 'home_register_widgetsdo' );
     
    // Register widget.
    function home_register_widgetsdo() {
       register_widget( 'byt_Home_Feature_Widget' );
    }
     
    // Widget class.
    class byt_Home_Feature_Widget extends WP_Widget {
     
     
    /*-----------------------------------------------------------------------------------*/
    /* Widget Setup
    /*-----------------------------------------------------------------------------------*/
        
       function byt_Home_Feature_Widget() {
        
          /* Widget settings. */
          $widget_ops = array( 'classname' => 'byt_home_feature_widget', 'description' => __('BookYourTravel: Home Feature Widget', 'bookyourtravel') );
     
          /* Widget control settings. */
          $control_ops = array( 'width' => 300, 'height' => 550, 'id_base' => 'byt_home_feature_widget' );
     
          /* Create the widget. */
          $this->WP_Widget( 'byt_home_feature_widget', __('BookYourTravel: Home Feature Widget', 'bookyourtravel'), $widget_ops, $control_ops );
       }
     
     
    /*-----------------------------------------------------------------------------------*/
    /* Display Widget
    /*-----------------------------------------------------------------------------------*/
        
       function widget( $args, $instance ) {
          extract( $args );
     
          /* Our variables from the widget settings. */
          $title = apply_filters('widget_title', $instance['title'] );
          $home_feature_text = $instance['home_feature_text'];
     
          /* Before widget (defined by themes). */
          echo $before_widget;
     
          /* Display Widget */
          ?>
             <article class="home_features clearfix">
                <h2><?php echo $title; ?></h2>
                <p><?php echo $home_feature_text; ?></p>
             </article>
          <?php
     
          /* After widget (defined by themes). */
          echo $after_widget;
       }
     
     
    /*-----------------------------------------------------------------------------------*/
    /* Update Widget
    /*-----------------------------------------------------------------------------------*/
        
       function update( $new_instance, $old_instance ) {
          $instance = $old_instance;
     
          /* Strip tags to remove HTML (important for text inputs). */
          $instance['title'] = strip_tags( $new_instance['title'] );
          $instance['home_feature_text'] = strip_tags( $new_instance['home_feature_text']);
     
          return $instance;
       }
        
     
    /*-----------------------------------------------------------------------------------*/
    /* Widget Settings
    /*-----------------------------------------------------------------------------------*/
         
       function form( $instance ) {
     
          /* Set up some default widget settings. */
          $defaults = array(
          'title' => 'Handpicked Accommodations',
          'home_feature_text' => 'All Book Your Travel Accommodations fulfil strict selection criteria. Each accommodation is chosen individually and inclusion cannot be bought.',
          );
          $instance = wp_parse_args( (array) $instance, $defaults ); ?>
     
          <!-- Widget Title: Text Input -->
          <p>
             <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'bookyourtravel') ?></label>
             <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />
          </p>
     
          <p>
             <label for="<?php echo $this->get_field_id( 'home_feature_text' ); ?>"><?php _e('Feature text:', 'bookyourtravel') ?></label>
             <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'home_feature_text' ); ?>" name="<?php echo $this->get_field_name( 'home_feature_text' ); ?>" value="<?php echo $instance['home_feature_text']; ?>" />
          </p>
           
       <?php
       }
    }
    ?>
    maalesef tam bozuldu busefer

    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 13:16:54 -->-> Daha önceki mesaj 13:16:16 --

    loc adlı üyeden alıntı: mesajı görüntüle
    bu eklenti içinde include edilen bir dosya var mı? Muhtemelen fonksiyonların tutulduğu dosyayı birden fazla çağırıyor. include edilen fonksiyon dosyasını include yerine include_once şeklinde değiştirirseniz hatayı almazsınız.
    herhangi bir include goremiyorum
  • 09-06-2014, 13:28:13
    #9
    <?php
      
    /*-----------------------------------------------------------------------------------
      
       Plugin Name: BYT Home Feature
      
    -----------------------------------------------------------------------------------*/
      
    // Widget class.
    class byt_Home_Feature_Widget extends WP_Widget {
    
    public function __construct(){
    parent::__construct();
    }
      
      
    /*-----------------------------------------------------------------------------------*/
    /* Widget Setup
    /*-----------------------------------------------------------------------------------*/
         
       function byt_Home_Feature_Widget() {
         
          /* Widget settings. */
          $widget_ops = array( 'classname' => 'byt_home_feature_widget', 'description' => __('BookYourTravel: Home Feature Widget', 'bookyourtravel') );
      
          /* Widget control settings. */
          $control_ops = array( 'width' => 300, 'height' => 550, 'id_base' => 'byt_home_feature_widget' );
      
          /* Create the widget. */
          $this->WP_Widget( 'byt_home_feature_widget', __('BookYourTravel: Home Feature Widget', 'bookyourtravel'), $widget_ops, $control_ops );
       }
      
      
    /*-----------------------------------------------------------------------------------*/
    /* Display Widget
    /*-----------------------------------------------------------------------------------*/
         
       function widget( $args, $instance ) {
          extract( $args );
      
          /* Our variables from the widget settings. */
          $title = apply_filters('widget_title', $instance['title'] );
          $home_feature_text = $instance['home_feature_text'];
      
          /* Before widget (defined by themes). */
          echo $before_widget;
      
          /* Display Widget */
          ?>
             <article class="home_features clearfix">
                <h2><?php echo $title; ?></h2>
                <p><?php echo $home_feature_text; ?></p>
             </article>
          <?php
      
          /* After widget (defined by themes). */
          echo $after_widget;
       }
      
      
    /*-----------------------------------------------------------------------------------*/
    /* Update Widget
    /*-----------------------------------------------------------------------------------*/
         
       function update( $new_instance, $old_instance ) {
          $instance = $old_instance;
      
          /* Strip tags to remove HTML (important for text inputs). */
          $instance['title'] = strip_tags( $new_instance['title'] );
          $instance['home_feature_text'] = strip_tags( $new_instance['home_feature_text']);
      
          return $instance;
       }
         
      
    /*-----------------------------------------------------------------------------------*/
    /* Widget Settings
    /*-----------------------------------------------------------------------------------*/
          
       function form( $instance ) {
      
          /* Set up some default widget settings. */
          $defaults = array(
          'title' => 'Handpicked Accommodations',
          'home_feature_text' => 'All Book Your Travel Accommodations fulfil strict selection criteria. Each accommodation is chosen individually and inclusion cannot be bought.',
          );
          $instance = wp_parse_args( (array) $instance, $defaults ); ?>
      
          <!-- Widget Title: Text Input -->
          <p>
             <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'bookyourtravel') ?></label>
             <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />
          </p>
      
          <p>
             <label for="<?php echo $this->get_field_id( 'home_feature_text' ); ?>"><?php _e('Feature text:', 'bookyourtravel') ?></label>
             <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'home_feature_text' ); ?>" name="<?php echo $this->get_field_name( 'home_feature_text' ); ?>" value="<?php echo $instance['home_feature_text']; ?>" />
          </p>
            
       <?php
       }
       // Add function to widgets_init that'll load our widget.
    add_action( 'widgets_init', 'home_register_widgetsdo' );
      
    // Register widget.
    function home_register_widgetsdo() {
       $widget=$this->byt_Home_Feature_Widget();
       register_widget( $widget );
    }
    }
    ?>