Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author jamesdbruner

    (@jamesdbruner)

    What versions of the plugin and also what version of php are you running?

    Thread Starter Cicero83

    (@cicero83)

    I’m running version 1.3 of the plugin on WP 3.5.1
    And PHP Version 5.3.22

    Hope you can help.

    Plugin Author jamesdbruner

    (@jamesdbruner)

    This one is still baffling me. Sorry for the slow reply, I’ve been crazy busy. Can you give me a link to your site?

    Plugin Author jamesdbruner

    (@jamesdbruner)

    Question for you… Is it giving you a “Cheatin uh?” error when you try to save or just refreshes the page and all the settings are empty?

    I have the same Issue…

    I´m running the version 1.3 of the plugin on WP 3.5.1 and PHP Version 5.3.1.

    I don´t get any error when saving..

    Plugin Author jamesdbruner

    (@jamesdbruner)

    Okay, see I’m new to the Settings API so it’s probably something I did wrong. I’ll look into it… Until then, the settings aren’t necessary to use the plugin. You can use the shortcode and if you need it on every page you can do that to with do_shortcode.

    Thread Starter Cicero83

    (@cicero83)

    I followed your advice, but it’s makes it a lot easier for our customer that the settings can be saved 🙂
    I hope you can find a solution, but take your time. You created a nice plugin though!

    your checking process is a bit different me and a mate have hacked around the coding to make it work …. quite simple but my advice to you is to go back to basics and check your _keys … particularly lines 82-86 in index.php and then the functions in options any of the check_ functions need a revamp for a quick hack around to those that want to use it now (although you can just modify the shortcode yourself) you can use this code (changing it for each function thats already there)where id is replace them with the name of function at present…. ie fade delay overlay etc etc ….

    if(get_option('id_key') === false){
    		add_option('id_key',  $input['ID']);
    	    }
    	return $input['ID'];

    good luck !

    Plugin Author jamesdbruner

    (@jamesdbruner)

    So you’re saying instead of

    $fade = get_option('fade');

    I should use

    if(get_option('fade') === false){
        $fade = get_option('fade');
    }
        return $input['Fade'];

    Correct?

    Plugin Author jamesdbruner

    (@jamesdbruner)

    One more question… How would you go about doing the checkboxes? Or am I overthinking it..

    $arrows = get_option('arrows');
      if($arrows == 0){
       $arrows = 'no';
      }
      if($arrows == 1){
       $arrows = 'yes';
      }

    Should be

    if(get_option('arrows') === false){
    $arrows = get_option('arrows');
      if($arrows == 0){
       $arrows = 'no';
      }
      if($arrows == 1){
       $arrows = 'yes';
      }
    }
    return $input['Arrows'];

    Is that right..?

    no the check boxes work fine. just the inputs that a text boxes werent getting passed properly .
    I’ll post the code we did below 🙂
    Index.php Lines 83 to 87

    $fade = get_option('fade_key');
    $delay = get_option('delay_key');
    $title = get_option('title_key');
    $overlay = get_option('overlay_key');
    $arrows = get_option('arrows');

    Options.php lines 107 to 194

    <?php
        }
    
        public function check_fade($input){
    
            if(get_option('fade_key') === false){
    		add_option('fade_key',  $input['Fade']);
    	    }
    	return $input['Fade'];
        }
    
      public function check_delay($input){
    
         if(get_option('delay_key') === false){
    		add_option('delay_key',  $input['Delay']);
    	    }
    	return $input['Delay'];	  }
    
    public function check_overlay($input){ 
    
     if(get_option('overlay_key') === false){
    		add_option('overlay_key',  $input['Overlay']);
    	    }
    	return $input['Overlay'];	 }
    
      public function check_title($input){ 
    
    	    if(get_option('title_key') === false){
    		add_option('title_key',  $input['Title']);
    	    }
    	return $input['Title'];
    	  }
    
       public function check_arrows($input){
    
       if( isset($input['Arrows'])){$Arrows = $input['Arrows']; 	}
    
       if ( !isset( $Arrows['arrows'] ) ) {
         $Arrows = 0;
         add_option('arrows', $Arrows);
       } 
    
        if ( $input['Arrows'] == 1 ) {
            $Arrows = 1;
          update_option('arrows', $Arrows);
        } else {
            $Arrows = 0;
          update_option('arrows', $Arrows);
        }
       return $Arrows;
    }
    
       public function check_autoplay($input){
    
        if( isset($input['Autoplay'])){$Autoplay = $input['Autoplay']; 	}
    
        if ( $input['Autoplay'] == 1 ) {
            $Autoplay = 1;
          update_option('autoplay', $Autoplay);
        } else {
            $Autoplay = 0;
          update_option('autoplay', $Autoplay);
        }
       return $Autoplay;
    }
    
       public function check_global($input){
    
        if( isset($input['Global'])){$Global = $input['Global']; 	}
    
        if ( $input['Global'] == 1 ) {
            $Global = 1;
          update_option('global', $Global);
        } else {
            $Global = 0;
          update_option('global', $Global);
        }
       return $Global;
    }
    
        public function check_id($input){
    
         if(get_option('id_key') === false){
    		add_option('id_key',  $input['ID']);
    	    }
    	return $input['ID'];
        }

    This is a temporary work around that will work, i’ll try and find out a way for you to check the strings before theyre submitted (probably a isnumeric()tag for the numbers) the overlay url doesnt need to be checked because if it isnt correct it wont work anyway

    Plugin Author jamesdbruner

    (@jamesdbruner)

    If anyone’s still having trouble saving settings after updating to version 1.4 would you let me know by creating a new topic. I’m marking this one as resolved since it’s a couple months old and since I’ve addressed the issue in version 1.4 so you should only need to update to resolve the issue.

    Thanks, James

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Settings doesn't save’ is closed to new replies.