[wp-hackers] Conditional text replacement

McGonegal Robert robert37 at gmail.com
Thu Jan 17 06:51:05 GMT 2008


I'd like a super simple way to have phpthumbs.php use ImageMagick to  
resize images. I tried using a plugin filter to translate, say,  
[[image.jpg]] to:

<img src="../phpThumb.php?src=http://domain.com/path/to/ 
image.jpg&amp;w=400" alt="" />

That works fine but what is needed is for image width (w=400 in the  
example above) to be a set value depending upon the CSS id of an  
element it is contained within (eg. <body id="sales">). That way one  
image tag automatically gets resized to fit the column width of  
whatever template it's used in.

I understand how to create an array but not how to apply it  
conditionally. What would be the most efficient way to do this?

Robert





More information about the wp-hackers mailing list