WordPress.org

Ready to get started?Download WordPress

Forums

Hide empty img tags in IE (9 posts)

  1. Beel
    Member
    Posted 9 years ago #

    I don't think there is a way to stop IE from doing that as it is user dependent (I can stop it by de-selecting "Show image download placeholders", you can't). If you don't want to write the code to check for an image, why don't you just make a small transparent gif to use for each category for which you do not want/have an image?

  2. Jack
    Member
    Posted 9 years ago #

    Good suggestion:) So I tried it with the if(file_exists), but somehow I'm making a mistake in the code, because now no image at all is displayed. If it's not too much asked, here's the textfile of that php-file.

  3. Beel
    Member
    Posted 9 years ago #

    It is late and if you haven't gotten it by tomorrow, I will take a look at it when I get home, but I would first suggest testing the string you are trying to generate - maybe it is incorrect (and thus actually doesn't exist).
    $file = blah-blah;
    if (file_exists($file)) { echo "the file $file exists" } else { echo "The file $filename does not exist"}

  4. Jack
    Member
    Posted 9 years ago #

    OK and thanks. But it's not that late!? It's just 08.27 in the morning where I live :) I will try it later this day or perhaps tomorrow. Not enough time today I'm afraid...

  5. Jack
    Member
    Posted 9 years ago #

    I can't get this to work properly. I inserted this code:
    $file = get_settings('home').'/plaatjes/'.$category->cat_name.'.gif';
    if (file_exists($file)) {
    in the php-file (http://www.spoenk.nl/public/catimage.txt) and now no images show up at all. When I leave out the if(file_exists... part I do get to see the proper image in Mozilla and at the same the time the echo-message that that file doesn't exist!?
    So I get the message 'http://www.spoenk.nl/weblog/plaatjes/groot.gif' doesn't exist, while the image is actually loaded and visible???
    Care to have a look at it?

  6. Beel
    Member
    Posted 9 years ago #

    I have heard scientists have actually created a situation where something exists simultaneously in two places, but haven't heard about both existing and not existing. Send me the code you were using and where you are putting it and I will play around with it on my site. boulderbill "at" comcast "dot" net

  7. Jack
    Member
    Posted 9 years ago #

    Send you the code. Reply here if you didn't get it somehow.
    Thanks for helping :)

  8. Beel
    Member
    Posted 9 years ago #

    Glad you got it to work :-)

  9. Jack
    Member
    Posted 9 years ago #

    And just when this works 'they' made some corrections in the templates to the_categoryID() so that it functions again...
    So I guess I'll be going back to the category_ID(). No extra code needed...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.