Changeset 942368
- Timestamp:
- 07/02/2014 06:57:50 PM (12 years ago)
- Location:
- image-formatr/trunk
- Files:
-
- 2 edited
-
image-formatr.php (modified) (1 diff)
-
src/class.formatr.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
image-formatr/trunk/image-formatr.php
r941673 r942368 4 4 * Plugin URI: http://warriorself.com/blog/about/image-formatr/ 5 5 * Description: Formats all content images on a page / post giving them captions and popups. 6 * Version: 1.2.4 6 * Version: 1.2.4.1 7 7 * License: GPLv3 8 8 * Author: Steven Almeroth -
image-formatr/trunk/src/class.formatr.php
r941673 r942368 155 155 $image_atts = $this->get_attributes($image_tag); 156 156 157 // return the untouched markup if we can't find any attributes 157 // return the untouched markup if we can't find any attributes: no src? 158 158 if (!count($image_atts)) return $orig_markup; 159 159 … … 194 194 195 195 // return nothing if we're not on the right page 196 // in effect this image gets deleted 196 // in effect this image gets deleted, why are we doing this? 197 197 if ( ($image_atts['page'] == 'front' and !is_front_page()) 198 198 or ($image_atts['page'] == 'single' and !is_single() ) … … 228 228 $image_atts['class'] = str_replace($class, "", $image_atts['class']); 229 229 230 return $this->format($image_atts );230 return $this->format($image_atts, $image_tag); 231 231 } 232 232 … … 234 234 * Format the html output 235 235 * 236 * @param array $param The image attributes/parameters as an associative array 236 237 * [alt] => IMG_4308 237 238 * [asis] => … … 255 256 * [none] => 256 257 * 257 * @param array $param The image attributes/parameters as an associative array 258 * @param string $image The image tag markup, with closing slash 259 * <img src="..." .../> 260 * 258 261 * @return string The screen markup 259 262 */ 260 function format ( $param )263 function format ( $param, $image ) 261 264 { 262 265 // setup dimensions width & height ///////////////////////////////// … … 313 316 $height = $img_height ? "max-height: {$img_height}px;" : ""; 314 317 } 315 if ($this->get_option('stdthumb')) {316 $image_style = "style=\"$width $height\"";317 $container_style = "style=\"width:{$img_width}px\"";318 } else {319 $image_style = "";320 $container_style = "";321 }322 318 323 319 // setup source & id print variables /////////////////////// … … 374 370 375 371 $class = trim("{$this->add_class} {$param['class']}"); 372 $container_style = ''; 373 374 if ($this->get_option('stdthumb')) { 375 $container_style = 'style="width:{$img_width}px"'; 376 $image = <<< IMAGE 377 <img src="$src" alt="{$param['alt']}" style="$width $height" $title/> 378 IMAGE; 379 } 376 380 377 381 return <<< DIV_A_IMG 378 382 <div $id class="$class" $container_style> 379 $anchor <img src="$src" alt="{$param['alt']}" $image_style $title/>$anchor_close383 $anchor$image$anchor_close 380 384 $caption 381 385 </div>
Note: See TracChangeset
for help on using the changeset viewer.