Forum Replies Created

Viewing 15 replies - 556 through 570 (of 598 total)
  • Hey @fabiobarbi,

    I think that only one issue can be fixed here, and that’s RFC-822 dates.

    They have been fixed in 2.1.3, so, can you please test it out and report if the feed validates now?

    But, regarding other issues, here are my thoughts:
    “Undefined itunes_summary element” – You should not worry about this one, the element is valid, but W3C feed validation service does not recognize it. Here’s another user who had the same error: https://discussions.apple.com/message/13050808#13050808 You should just ignore that error.

    “url must be a full URL” – As far as I can see, the URL is already a full one. Maybe the non-English letters in the URL are throwing it off? Can you try to remove those characters and check again?

    “Use commas to separate keywords” – This is just a low-importance warning and it should not stop your feed from working.

    Hey @daniel1009.

    Well, the thing is that previous developers decided to store the sermon date in a textual format (e.g. 08/02/2017), that wasn’t a good decision, but that’s how it was done for a while, and it worked.

    But, the problem appeared when those developers switched to Unix date format without making backwards compatible changes in the code. (By the way, change to Unix time was a smart move, it was just not done in a proper way.)

    So, some parts of the code expect textual date, but some parts expect Unix time and there’s where problems appeared.

    Our solution was to provide an UI that users could easily use and convert textual dates to Unix time with couple clicks.

    So, when you click on “Fix Dates”, the script will just convert old sermon dates to new format (Unix time).

    Hey @willjohnston-1, 2.1.1 won’t allow you to use Sermon Manager with PHP 5.5, while 2.1.2 will.

    We realized that it was not a smartest move to completely disallow usage on anything below PHP 5.6

    Hey @lbcweb and @chubbs1900, what PHP version are you using?

    It seems like that both of you using PHP less than 5.6. Can you upgrade to 5.6 and check again?

    Hey @cseevinck, can you test it out and see if the issue still persists?

    We have done some modifications to the functions, it might be fixed in 2.1.2.

    Hey, dev here.

    Sorry about the inconvenience.

    2.1.1 has been released with the fix. All you need to do is to download the latest version and upload it via FTP if you can’t access the backend area.

    No sermon data will be lost if you delete the plugin folder and replace it with the new one. (located in ~/wp-content/plugins)

    Hey @dschaller, thanks for your patience.

    You could upload the image somewhere else and send us a link (https://imgur.com for example) or send us the website URL or send the screenshot to [email protected].

    It should be a quick fix.

    Glad to hear that it’s working, @germankiwi ??

    Here you go, completely rewritten and untested:

    /**
     * Filters the output of <code>get_the_time</code> when it's used for sermons.
     * Because <code>get_the_time</code> returns post time instead of sermon time.
     *
     * @param string|int  $the_time Already filtered time. This will be returned if post type is not <code>wpfc_sermon</code>
     * @param string      $d        Format to use for retrieving the time the post was written.
     * @param int|WP_Post $post     WP_Post object or ID
     *
     * @return string|int|false
     */
    function wpfc_sermon_time_filter( $the_time, $d, $post ) {
    	if ( 'wpfc_sermon' == get_post_type() ) {
    		// get the post
    		$post = get_post( $post );
    
    		// this check is maybe not needed, post will be validated on first call of <code>get_the_time</code>
    		if ( ! $post ) {
    			return false;
    		}
    
    		// use specified format, or get default one if not specified
    		$format = $d === '' ? get_option( 'time_format' ) : $d;
    
    		// get sermon date
    		$date = get_post_meta( $post->ID, 'sermon_date', true );
    
    		// if the date is not represented as Unix timestamp, convert it
    		if ( ! is_numeric( $date ) ) {
    			$date = strtotime( $date );
    		}
    
    		// get post hour, minute and second, in seconds
    		$his = explode( ':', date( 'H:i:s', strtotime( $post->post_date ) ) );
    
    		// add hour, minute and second
    		$date += ( $his[0] * 60 * 60 + $his[1] * 60 + $his[2] );
    
    		// set date to expected format for <code>mysql2date</code>
    		$date = date( 'Y-m-d H:i:s', $date );
    
    		// convert it
    		$the_time = mysql2date( $format, $date, true );
    	}
    
    	return $the_time;
    }
    
    add_filter( 'get_the_time', 'wpfc_sermon_time_filter', 10, 3 );

    And for the date:

    /**
     * Filters the output of <code>get_the_date</code> when it's used for sermons.
     * Because <code>get_the_date</code> returns post time instead of sermon time.
     *
     * @param string|int  $the_date Already filtered time. This will be returned if post type is not <code>wpfc_sermon</code>
     * @param string      $d        Format to use for retrieving the time the post was written.
     * @param int|WP_Post $post     WP_Post object or ID
     *
     * @return string|int|false
     */
    function wpfc_sermon_date_filter( $the_date, $d, $post ) {
    	if ( 'wpfc_sermon' == get_post_type() ) {
    		// get the post
    		$post = get_post( $post );
    
    		// this check is maybe not needed, post will be validated on first call of <code>get_the_time</code>
    		if ( ! $post ) {
    			return false;
    		}
    
    		// use specified format, or get default one if not specified
    		$format = $d === '' ? get_option( 'date_format' ) : $d;
    
    		// get sermon date
    		$date = get_post_meta( $post->ID, 'sermon_date', true );
    
    		// if the date is not represented as Unix timestamp, convert it
    		if ( ! is_numeric( $date ) ) {
    			$date = strtotime( $date );
    		}
    
    		// get post hour, minute and second, in seconds
    		$his = explode( ':', date( 'H:i:s', strtotime( $post->post_date ) ) );
    
    		// add hour, minute and second
    		$date += ( $his[0] * 60 * 60 + $his[1] * 60 + $his[2] );
    
    		// set date to expected format for <code>mysql2date</code>
    		$date = date( 'Y-m-d H:i:s', $date );
    
    		// convert it
    		$the_date = mysql2date( $format, $date, true );
    	}
    
    	return $the_date;
    }
    
    add_filter( 'get_the_date', 'wpfc_sermon_date_filter', 10, 3 );

    I’m in a hurry now, so I couldn’t test it.

    Hey @andrewteg,

    I have checked this right now and I can’t seem to reproduce it.

    Could you send a database dump of an affected site to [email protected]?

    Hey @jonpbradley, we’ve jut got time to check this and it seems like 404 error has disappeared. Can you confirm that?

    Hey @christiehawkso,

    We will consider it, but we have one question: what service do you use for livestreaming?

    Hey @germankiwi, thanks for the reply!

    My thinking was that get_the_date expects a string, e.g. “April 4th, 2017”, while get_the_time expects Unix time, e.g. “1491264000”, so by omitting that line, the function would return the Unix time.

    But, that wasn’t the case. I can now see that Genesis expects ISO 8601 formatted date, and this code should work in that case:

    function wpfc_sermon_time_filter() {
    	global $post;
    	if ( 'wpfc_sermon' == get_post_type() ) {
    		$ugly_date = get_post_meta( $post->ID, 'sermon_date', 'true' );
    
    		// seems like it was stored as a text in the db sometime in the past
    		if ( ! is_numeric( $ugly_date ) ) {
    			$ugly_date = strtotime( $ugly_date );
    		}
    		$date      = date( 'c', $ugly_date );
    		return $date;
    	}
    }
    add_filter('get_the_time', 'wpfc_sermon_time_filter');

    Hey @germankiwi,

    Try this code:

    function wpfc_sermon_time_filter() {
    	global $post;
    	if ( 'wpfc_sermon' == get_post_type() ) {
    		$ugly_date = get_post_meta( $post->ID, 'sermon_date', 'true' );
    
    		// seems like it was stored as a text in the db sometime in the past
    		if ( ! is_numeric( $ugly_date ) ) {
    			$ugly_date = strtotime( $ugly_date );
    		}
    		return $date;
    	}
    }
    add_filter('get_the_time', 'wpfc_sermon_time_filter');

    It’s untested, but it should work.
    If it doesn’t, tell us the exact problem, error message if there is any; or actual output vs desired.

    It was a problem in code. Fix will be released in the next version.

    Thanks!

Viewing 15 replies - 556 through 570 (of 598 total)