[Plugin: Popularity Contest] popularity contest throwing up "blank image" in RSS Reader (4 posts)

  1. tlobf
    Posted 5 years ago #

    wondering if anyone can help...

    popularity contest is throwing up a weird "non" image in my RSS Reader... i've checked on other browsers, iPhone, different machines etc and it's a constant.

    the "non image" looks like this:


    when i inspect the code, the API code = popularity contest

    see: http://twitpic.com/1c89uu

    can anyone suggest a fix?

    my site: http://www.thelineofbestfit.com



  2. godrox
    Posted 5 years ago #

    Yeah, I have this same problem.

    The URL for the image is:


    The id= number changes for each post. Any idea how to fix this?

  3. jncarter
    Posted 5 years ago #

    Here is what I did to fix it.

    1.) Upload a blank 1x1 gif.
    2.) Edit popularity-contest/popularity-contest.php
    3.) Search for function akpc_api_record_view
    4.) Comment out the following line.
    header('Content-type: image/jpeg');
    5.) Just below that line add the following.
    header("Location: /blank_image.gif");

    Just adjust the location to wherever you uploaded the blank gif in step #1.

  4. jyee
    Posted 4 years ago #

    Here's a fix that's all in code:


    header('Content-type: image/jpeg');


    header('Content-type: image/png'); // set the content type
    $blankimg = imagecreatetruecolor(1,1); // create an image
    imagesavealpha($blankimg, TRUE); // enable transparency saving
    $trans_color = imagecolorallocatealpha($blankimg, 0, 0, 0, 127); // set the transparent "color"
    imagefill($blankimg, 0, 0, $trans_color); // fill the image
    imagepng($blankimg); // output the image
    imagedestroy($blankimg); // clear memory

    The problem is that the php is sending a content type header, telling the browser that the subsequent data is an image... but then it doesn't send any data, so the browser interprets that as a missing image. The code above simply creates a transparent 1px png and sends the data. That way you don't need to perform a redirect as in the solution above.

Topic Closed

This topic has been closed to new replies.

About this Topic