Activity Stream
48,167 MEMBERS
6700 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 6 of 6
  1.     
    #1
    OH GOD!!!!!
    Website's:
    HotNewHipHop.com

    Default PHP Resize?

    Im using this code for wordpress to show external hosted images as thumbnails, it works fine but i cant find a way to change width and height.
    code is located in function.php
    Code: 
    function getImage($num) {
    global $more;
    $more = 1;
    $link = get_permalink();
    $content = get_the_content();
    $count = substr_count($content, '<img');
    $start = 0;
    for($i=1;$i<=$count;$i++) {
    $imgBeg = strpos($content, '<img', $start);
    $post = substr($content, $imgBeg);
    $imgEnd = strpos($post, '>');
    $postOutput = substr($post, 0, $imgEnd+1);
    $postOutput = preg_replace('/width="([0-9]*)" height="([0-9]*)"/', '',$postOutput);;
    $image[$i] = $postOutput;
    $start=$imgEnd+1;
    }
    if(stristr($image[$num],'<img')) { echo '<a href="'.$link.'">'.$image[$num]."</a>"; }
    $more = 0;
    }
    I tried editing this fields but doesnt work :
    width="([0-9]*)" height="([0-9]*)



    code used to call function

    Code: 
    <?php getImage('1'); ?>
    bxflow Reviewed by bxflow on . PHP Resize? Im using this code for wordpress to show external hosted images as thumbnails, it works fine but i cant find a way to change width and height. code is located in function.php function getImage($num) { global $more; $more = 1; $link = get_permalink(); $content = get_the_content(); $count = substr_count($content, '<img'); $start = 0; Rating: 5

  2.   Sponsored Links

  3.     
    #2
    OH GOD!!!!!
    Website's:
    HotNewHipHop.com
    no one damn it?

  4.     
    #3
    Banned
    Do you still looking for a solution for this?
    If yes reply I have it

  5.     
    #4
    Member
    Website's:
    LulzCovers.com LulzTroll.com
    well the width and height is either px or &#37;

    so.. you can try
    width="([\d+]px)" height="([\d+]px)"

    or best is resizing them with css
    or use any plugin for resize
    Contact me for Traffic, SEO, WCDDL, Wordpress, IPB related Services or queries.
    Template Designing, PSD to HTML, Wordpress


  6.     
    #5
    Banned
    Well the exact code for that function in WP will be:

    Code: 
    $postOutput = preg_replace('/width="([0-9]*)" height="([0-9]*)"/', '/width="100″ height="100″/',$postOutput);

  7.     
    #6
    Member
    Website's:
    maxneeds.info
    GetImageSize php function ...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Resize Image
    By cyb3r in forum Graphics Area
    Replies: 1
    Last Post: 15th Sep 2011, 02:50 PM
  2. php resize
    By Chris2k in forum Web Development Area
    Replies: 11
    Last Post: 14th Jul 2011, 02:37 PM
  3. Looking for some new Image resize mod
    By Spartan in forum phpBB
    Replies: 1
    Last Post: 27th May 2011, 08:58 AM
  4. Image resize in DLE
    By John in forum Webmaster Discussion
    Replies: 1
    Last Post: 30th Dec 2010, 01:31 AM
  5. how to resize image in DL
    By loverhaker in forum Forum and DDL Discussion
    Replies: 0
    Last Post: 28th Aug 2010, 01:48 AM

Tags for this Thread

BE SOCIAL