• panic42

    (@panic42)


    Hi,

    i don’t know if somebody has done this already. Here is a little patch so a nicer html code is outputted when wordpress creates thumbnails.

    And a fix for the alt tag not filled in, if register_globals is off.


    --- wordpress/wp-admin/upload.php Wed Dec 15 20:41:49 2004
    +++ upload.php Wed Feb 9 14:30:02 2005
    @@ -2,6 +2,7 @@
    require_once('../wp-includes/wp-l10n.php');

    $title = 'Upload Image or File';
    +$imgdesc = $_POST['imgdesc'];

    require_once('admin-header.php');

    @@ -195,16 +196,20 @@
    $max_side = intval($_POST['imgthumbsizecustom']);
    }

    - $result = wp_create_thumbnail($pathtofile, $max_side, NULL);
    - if($result != 1) {
    - print $result;
    + $thumb_result = wp_create_thumbnail($pathtofile, $max_side, NULL);
    + if($thumb_result != 1) {
    + print $thumb_result;
    }
    }

    if ( ereg('image/',$img1_type)) {
    - $piece_of_code = "<img src="". get_settings('fileupload_url') ."/$im
    g1_name" alt="$imgdesc" />";
    + if ($thumb_result == 1) {
    + $piece_of_code = "<a href="". get_settings('fileupload_url') ."/$im
    g1_name"><img src="". get_settings('fileupload_url') ."/thumb-$im
    g1_name" alt="$imgdesc" />";
    + } else {
    + $piece_of_code = "<img src="". get_settings('fileupload_url') ."/$i
    mg1_name" alt="$imgdesc" />";
    + }
    } else {
    $piece_of_code = "<a href="". get_settings('fileupload_url') . "/$im
    g1_name" title="$imgdesc" />$imgdesc";
    };

Viewing 2 replies - 1 through 2 (of 2 total)
  • earcos

    (@earcos)

    patch: **** malformed patch at line 4: require_once(‘../wp-includes/wp-l10n.php’);

    morgs

    (@morgs)

    Hello,

    I think this might be what I am looking for but not sure how to implement it.

    Can you tell me?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Thumbnail html code with Upload’ is closed to new replies.