• Resolved jeeman

    (@jeeman)


    I am using Newsmag theme.

    I somehow got a bad value in my database that is causing an infinite loop.

    Here is a screenshot of my database:
    https://www.jeemoney.com/wp-content/uploads/2016/03/Screen-Shot-2016-03-09-at-10.59.55-AM.png

    My code is and the post->ID is 187.

    if ( function_exists( ‘uses_nelioefi’ ) && uses_nelioefi( $this->post->ID ) ) {
    error_log(print_r($this->post->ID, TRUE));
    error_log(print_r(uses_nelioefi($this->post->ID, TRUE)));
    $td_thumb_parameters = td_api_thumb::get_by_id($thumbType);
    $td_temp_image_url[1] = $td_thumb_parameters[‘width’];
    $td_temp_image_url[2] = $td_thumb_parameters[‘height’];
    error_log(print_r($td_thumb_parameters, TRUE));
    error_log(print_r(‘starting!!!!!!!’, TRUE));
    $buffy = get_the_post_thumbnail( $this->post->ID, array(intval($td_temp_image_url[1]), intval($td_temp_image_url[2])) );
    error_log(print_r(‘done!!!!!!!’, TRUE));
    }

    https://www.ads-software.com/plugins/external-featured-image/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author David Aguilera

    (@davilera)

    Hi!

    I can’t open the image you sent (nor the site it’s hosted on). If you deactivate our plugin, does the issue disappear?

    I understand you see the “starting” log message, but you never see “done!”, right?

    Plugin Author David Aguilera

    (@davilera)

    Any updates on this, Jeeman?

    Thread Starter jeeman

    (@jeeman)

    Hi David, thanks for the response. I did fix it by deleting the entry from the database that had the -1 in it. I’m not sure why you can’t see the picture…I was having a few problems with the site back a week ago.

    Once I removed the -1, it was working fine. Also, I changed the code to this in td_module.php…this prevented issue when there was a -1, with this code:

    if ( function_exists( ‘uses_nelioefi’ ) && uses_nelioefi( $this->post->ID ) ) {
    $td_thumb_parameters = td_api_thumb::get_by_id($thumbType);
    $td_temp_image_url[1] = $td_thumb_parameters[‘width’];
    $td_temp_image_url[2] = $td_thumb_parameters[‘height’];
    $img_src = nelioefi_get_thumbnail_src($this->post->ID);
    $buffy .= ‘<div style=”width: ‘. $td_temp_image_url[1] .’px;height: ‘.$td_temp_image_url[2].’px;background-position: center; background-image: url(‘.nelioefi_get_thumbnail_src($this->post->ID).’); background-repeat: no-repeat;background-size: cover;”></div>’;
    }
    else {
    $buffy .= ‘<img width=”‘ . $td_temp_image_url[1] . ‘” height=”‘ . $td_temp_image_url[2] . ‘” class=”entry-thumb” src=”‘ . $td_temp_image_url[0] . ‘” ‘ . $attachment_alt . $attachment_title . ‘/>’;

    }

    and in td_module_single_base.php:

    if (!is_null($this->post_thumb_id)) {
    if ( function_exists( ‘uses_nelioefi’ ) && uses_nelioefi( $this->post->ID ) ) {
    $td_thumb_parameters = td_api_thumb::get_by_id($thumbType);
    $width = $td_thumb_parameters[‘width’];
    $height = $td_thumb_parameters[‘height’];
    $img_src = nelioefi_get_thumbnail_src($this->post->ID);
    $alt = $alt = get_post_meta( $id, ‘_nelioefi_alt’, true );
    $full_size_src = $img_src;
    //$buffy .= ‘<div style=”width: 100%;height: 100%;background-position: center; background-image: url(‘.nelioefi_get_thumbnail_src($this->post->ID).’); background-repeat: no-repeat;background-size: cover;”></div>’;
    }
    else { …

    Plugin Author David Aguilera

    (@davilera)

    Great! I’m glad to see you solved the issue. I’ll mark this topic as resolved ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Infinite loop b/c of bad db entry’ is closed to new replies.