I need to adjust the image size on certain pages only. If my client uses an image with a width of 600px on their post it should show properly on the single.php file but only 450px wide on any kind of list page.
I'm planning on using timthumb.php to do this. I've read all the forum posts on this but I cant seem to splice the blog.dir/'.$blog_id.' into my images src so this works with WPMU. Here is my regular expression.
$pattern = "/<img(.*?)src=('|\"){0,1}(https?\:)\/\/([A-Za-z0-9_\.\~\:-]*?)([A-Za-z0-9\/_\.\~\:-]*?)(\.bmp|\.gif|\.jpg|\.jpeg|\.png)('|\"){0,1}([^\>]*?)>/i";
$replacement = '<img src="'.get_bloginfo('url').'/wp-content/plugins/psir/timthumb.php?src=$3//$4/blog.dir/'.$blog_id.'$5$6&w=150&h=200&zc=0">';
$content = preg_replace($pattern, $replacement, $content);
outputs the following:
<img src="http://oregon.cyclingaction.com/wp-content/plugins/psir/timthumb.php?src=http:///blog.dir/3oregon.cyclingaction.com/files/2009/10/P3080045-1024x768.jpg&w=150&h=200&zc=0">
So the piece I want to splice in is following the "http://" not the ".com"
Any suggestion would be helpful