WordPress.org

Ready to get started?Download WordPress

Forums

TimThumb & Temple Gate (11 posts)

  1. craven222
    Member
    Posted 2 years ago #

    Hi There,

    I've been trying to solve this problem all day, TimThumb appears to be screwing up my external images. I've googled and tried all the solutions I could find (CHMOD the directory to 777, make sure external images were allowed, tried updating the script, etc)

    Could someone take a look at my site and let me know where I'm going wrong?

    http://ablemagazine.co.uk/

  2. adpawl
    Member
    Posted 2 years ago #

    Wrong use of timthumb.

    You have:

    <a href="http://ablemagazine.co.uk/the-challenge-of-inspecting-home-care/" rel="bookmark" title="Permanent Link to The challenge of inspecting home care">
    <img src="http://ablemagazine.co.uk/wp-content/themes/templegate/scripts/timthumb.php?src=<img src="http://static.guim.co.uk/sys-images/Guardian/Pix/pictures/2012/3/21/1332338624072/lady-in-care-home-003.jpg" />&w=200&h=150&zc=1&q=100"
    alt="The challenge of inspecting home care" class="image" width="200" /></a>

    You should have:

    <a href="http://ablemagazine.co.uk/the-challenge-of-inspecting-home-care/" rel="bookmark" title="Permanent Link to The challenge of inspecting home care">
    <img src="http://ablemagazine.co.uk/wp-content/themes/templegate/scripts/timthumb.php?src=http://static.guim.co.uk/sys-images/Guardian/Pix/pictures/2012/3/21/1332338624072/lady-in-care-home-003.jpg&w=200&h=150&zc=1&q=100" alt="The challenge of inspecting home care" class="image" width="200" /></a>
  3. craven222
    Member
    Posted 2 years ago #

    How would I change this? I don't see any preferences. This is how timthumb ran out of the box.

  4. adpawl
    Member
    Posted 2 years ago #

    This theme use Custom Fields.
    You must add new eg.: name: image, value: http://static.guim.co.uk/sys-images/Guardian/Pix/pictures/2012/3/21/1332338624072/lady-in-care-home-003.jpg

  5. craven222
    Member
    Posted 2 years ago #

    Thanks, that certainly does fix it.

    But why has it put all my old images inside <img src=""> inside the custom fields? Is there any sort of script I can run that'll remove all these double quotes? (I have 1000+ posts)

  6. adpawl
    Member
    Posted 2 years ago #

    by sql queries?

    update wp_postmeta set meta_value = replace(meta_value, '<img src="', '') where meta_key=image;
    update wp_postmeta set meta_value = replace(meta_value, '" />', '') where meta_key=image;

  7. craven222
    Member
    Posted 2 years ago #

    Getting the following error when trying to run those queries

    #1054 - Unknown column 'image' in 'where clause'

    Can I run

    update wp_postmeta set meta_value = replace(meta_value, '<img src="', '');
    update wp_postmeta set meta_value = replace(meta_value, '" />', '');

    ?

  8. adpawl
    Member
    Posted 2 years ago #

    sorry

    update wp_postmeta set meta_value = replace(meta_value, '<img src="', '') where meta_key='image';
    update wp_postmeta set meta_value = replace(meta_value, '" />', '') where meta_key='image';

    -it should work.

  9. craven222
    Member
    Posted 2 years ago #

    '961 row(s) affected. ( Query took 0.0206 sec )'

    Woohoo, Thanks - you just saved me a lot of work! :)

  10. adpawl
    Member
    Posted 2 years ago #

    ....but update your timthumb! last version: http://timthumb.googlecode.com/svn/trunk/timthumb.php

    ...and change allowed sites

    if(! isset($ALLOWED_SITES)){
    	$ALLOWED_SITES = array (
    		'ablemagazine.co.uk',
    		'static.guim.co.uk',
    	);
    }
  11. craven222
    Member
    Posted 2 years ago #

    This works for posts already made. But all new posts autoblogged post are corrupt the image.

    How can I change it so that the <img src=" "> isn't posted in the field in the first place?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.