Results 1 to 6 of 6
-
2nd Aug 2010, 06:28 AM #1OPOH GOD!!!!!Website's:
HotNewHipHop.comPHP 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; }
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
-
4th Aug 2010, 10:03 AM #2OPOH GOD!!!!!Website's:
HotNewHipHop.comno one damn it?
-
7th Sep 2010, 11:12 AM #3Banned
Do you still looking for a solution for this?
If yes reply I have it
-
7th Sep 2010, 11:54 AM #4MemberWebsite's:
LulzCovers.com LulzTroll.comwell the width and height is either px or %
so.. you can try
width="([\d+]px)" height="([\d+]px)"
or best is resizing them with css
or use any plugin for resizeContact me for Traffic, SEO, WCDDL, Wordpress, IPB related Services or queries.
Template Designing, PSD to HTML, Wordpress
-
7th Sep 2010, 11:56 AM #5Banned
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);
-
7th Sep 2010, 03:36 PM #6MemberWebsite's:
maxneeds.infoGetImageSize php function ...
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Resize Image
By cyb3r in forum Graphics AreaReplies: 1Last Post: 15th Sep 2011, 02:50 PM -
php resize
By Chris2k in forum Web Development AreaReplies: 11Last Post: 14th Jul 2011, 02:37 PM -
Looking for some new Image resize mod
By Spartan in forum phpBBReplies: 1Last Post: 27th May 2011, 08:58 AM -
Image resize in DLE
By John in forum Webmaster DiscussionReplies: 1Last Post: 30th Dec 2010, 01:31 AM -
how to resize image in DL
By loverhaker in forum Forum and DDL DiscussionReplies: 0Last Post: 28th Aug 2010, 01:48 AM
themaLeecher - leech and manage...
Version 5.03 released. Open older version (or...