[ Index ] |
PHP Cross Reference of phpwcms V1.5.0 _r431 (28.01.12) |
[Summary view] [Print] [Text view]
1 <?php 2 /************************************************************************************* 3 Copyright notice 4 5 (c) 2002-2012 Oliver Georgi <oliver@phpwcms.de> // All rights reserved. 6 7 This script is part of PHPWCMS. The PHPWCMS web content management system is 8 free software; you can redistribute it and/or modify it under the terms of 9 the GNU General Public License as published by the Free Software Foundation; 10 either version 2 of the License, or (at your option) any later version. 11 12 The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html 13 A copy is found in the textfile GPL.txt and important notices to the license 14 from the author is found in LICENSE.txt distributed with these scripts. 15 16 This script is distributed in the hope that it will be useful, but WITHOUT ANY 17 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 18 PARTICULAR PURPOSE. See the GNU General Public License for more details. 19 20 This copyright notice MUST APPEAR in all copies of the script! 21 *************************************************************************************/ 22 23 // ---------------------------------------------------------------- 24 // obligate check for phpwcms constants 25 if (!defined('PHPWCMS_ROOT')) { 26 die("You Cannot Access This Script Directly, Have a Nice Day."); 27 } 28 // ---------------------------------------------------------------- 29 30 // image rendering functions 31 // moved away from front 32 33 function imagetable(& $phpwcms, & $image, $rand="0:0:0:0", $align=0) { 34 // creates the image tags if text w/image 35 // 0 :1 :2 :3 :4 :5 :6 :7 :8 36 // dbid:filename:hash:extension:width:height:caption:position:zoom 37 38 $cnt_image_lightbox = empty($GLOBALS['cnt_image_lightbox']) ? 0 : 1; 39 $crop = empty($image['crop']) ? 0 : 1; 40 41 $thumb_image = get_cached_image( 42 array( "target_ext" => $image[3], 43 "image_name" => $image[2] . '.' . $image[3], 44 "max_width" => $image[4], 45 "max_height" => $image[5], 46 "thumb_name" => md5($image[2].$image[4].$image[5].$phpwcms["sharpen_level"].$crop), 47 'crop_image' => $crop 48 ) 49 ); 50 51 if($image[8]) { 52 53 $zoominfo = get_cached_image( 54 array( "target_ext" => $image[3], 55 "image_name" => $image[2] . '.' . $image[3], 56 "max_width" => $phpwcms["img_prev_width"], 57 "max_height" => $phpwcms["img_prev_height"], 58 "thumb_name" => md5($image[2].$phpwcms["img_prev_width"].$phpwcms["img_prev_height"].$phpwcms["sharpen_level"]) 59 ) 60 ); 61 62 if($zoominfo == false) $image[8] = 0; 63 64 } 65 66 $table = ''; 67 68 if($thumb_image != false) { 69 70 // read content image info 71 $table_class = $GLOBALS["template_default"]["article"]["image_table_class"]; 72 $table_class = ($table_class) ? ' class="'.$table_class.'"' : ''; 73 $table_bgcolor = $GLOBALS["template_default"]["article"]["image_table_bgcolor"]; 74 $table_bgcolor = ($table_bgcolor) ? ' bgcolor="'.$table_bgcolor.'"' : ''; 75 $image_align = $GLOBALS["template_default"]["article"]["image_align"]; 76 $image_align = ($image_align) ? ' align="'.$image_align.'"' : ''; 77 $image_valign = $GLOBALS["template_default"]["article"]["image_valign"]; 78 $image_valign = ($image_valign) ? ' valign="'.$image_valign.'"' : ''; 79 $image_border = ' border="'.intval($GLOBALS["template_default"]["article"]["image_border"]).'"'; 80 $image_imgclass = $GLOBALS["template_default"]["article"]["image_imgclass"]; 81 $image_imgclass = ($image_imgclass) ? ' class="'.$image_imgclass.'"' : ''; 82 $image_class = $GLOBALS["template_default"]["article"]["image_class"]; 83 $image_class = ($image_class) ? ' class="'.$image_class.'"' : ''; 84 $image_bgcolor = $GLOBALS["template_default"]["article"]["image_bgcolor"]; 85 $image_bgcolor = ($image_bgcolor) ? ' bgcolor="'.$image_bgcolor.'"' : ''; 86 $caption_class = $GLOBALS["template_default"]["article"]["image_caption_class"]; 87 $caption_class = ($caption_class) ? ' class="'.$caption_class.'"' : ''; 88 $caption_bgcolor= $GLOBALS["template_default"]["article"]["image_caption_bgcolor"]; 89 $caption_bgcolor= ($caption_bgcolor) ? ' bgcolor="'.$caption_bgcolor.'"' : ''; 90 $caption_valign = $GLOBALS["template_default"]["article"]["image_caption_valign"]; 91 $caption_valign = ($caption_valign) ? ' valign="'.$caption_valign.'"' : ''; 92 $caption_align = $GLOBALS["template_default"]["article"]["image_caption_align"]; 93 $caption_align = ($caption_align) ? ' align="'.$caption_align.'"' : ''; 94 $capt_before = $GLOBALS["template_default"]["article"]["image_caption_before"]; 95 $capt_after = $GLOBALS["template_default"]["article"]["image_caption_after"]; 96 97 // image caption 98 //$caption = explode('|', base64_decode($image[6])); 99 $caption = getImageCaption(base64_decode($image[6])); 100 $caption[0] = html_specialchars($caption[0]); 101 $caption[3] = empty($caption[3]) ? '' : ' title="'.html_specialchars($caption[3]).'"'; //title 102 $caption[1] = empty($caption[1]) ? html_specialchars($image[1]) : html_specialchars($caption[1]); 103 104 // image source 105 $img = '<img src="'.PHPWCMS_IMAGES.$thumb_image[0].'" '.$thumb_image[3]; 106 $img .= $image_border.$image_imgclass.' alt="'.$caption[1].'"'.$caption[3].' />'; 107 108 $tablewidth = $thumb_image[1]; 109 110 // spaces around image table 111 $rand = explode(":", $rand); 112 if(is_array($rand) && count($rand)) { 113 foreach($rand as $key => $value) { 114 $rand[$key] = intval($value); 115 } 116 } else { 117 $rand = array(0,0,0,0); 118 } 119 if($rand[2] && $rand[3]) { 120 $colspan = ' colspan="3"'; 121 } else { 122 if($rand[2] || $rand[3]) { 123 $colspan = ' colspan="2"'; 124 } else { 125 $colspan = ''; 126 } 127 } 128 $tablewidth += $rand[2] + $rand[3]; 129 130 $table .= '<table width="'.$tablewidth.'" border="0" cellspacing="0" cellpadding="0" '; 131 $table .= ($align) ? 'align="'.$align.'"' : ''; 132 $table .= $table_bgcolor.$table_class.">\n"; 133 $table .= ($rand[0]) ? '<tr><td'.$colspan.'>'.spacer(1,$rand[0])."</td></tr>\n" : ''; 134 $table .= '<tr>'; 135 $table .= ($rand[2]) ? '<td>'.spacer($rand[2],1).'</td>' : ''; 136 if($image[8]) { 137 138 $open_popup_link = 'image_zoom.php?'.getClickZoomImageParameter($zoominfo[0].'?'.$zoominfo[3]); 139 $table .= '<td'.$image_align.$image_valign.$image_bgcolor.$image_class.">"; 140 if($caption[2][0]) { 141 $open_link = $caption[2][0]; 142 $return_false = ''; 143 } else { 144 $open_link = $open_popup_link; 145 $return_false = 'return false;'; 146 } 147 148 if(!$cnt_image_lightbox || $caption[2][0]) { 149 150 $table .= "<a href=\"".$open_link."\" onclick=\"checkClickZoom();clickZoom('".$open_popup_link."','previewpic','width="; 151 $table .= $zoominfo[1].",height=".$zoominfo[2]."');".$return_false."\"".$caption[2][1].">"; 152 153 } else { 154 155 $table .= '<a href="'.PHPWCMS_IMAGES.$zoominfo[0].'" rel="lightbox"'; 156 if($caption[0]) { 157 $table .= ' title="'.parseLightboxCaption($caption[0]).'"'; 158 } 159 $table .= ' target="_blank">'; 160 161 } 162 $table .= $img.'</a></td>'; 163 } else { 164 $table .= '<td'.$image_align.$image_valign.$image_bgcolor.$image_class.">"; 165 if($caption[2][0]) { 166 $table .= '<a href="'.$caption[2][0].'"'.$caption[2][1].'>'.$img.'</a>'; 167 } else { 168 $table .= $img; 169 } 170 $table .= '</td>'; 171 } 172 $table .= ($rand[3]) ? "<td>".spacer($rand[3],1)."</td>" : ""; 173 $table .= "</tr>\n"; 174 if($caption[0] && empty($image['nocaption'])) { 175 $table .= "<tr>"; 176 $table .= ($rand[2]) ? "<td>".spacer($rand[2],1)."</td>" : ""; 177 $table .= '<td'.$caption_valign.$caption_align.$caption_bgcolor.$caption_class.'>'.$capt_before.$caption[0]; 178 if($caption[4] !== '') { 179 $table .= ' <span class="copyright">'.html_specialchars($caption[4]).'</span>'; 180 } 181 $table .= $capt_after."</td>"; 182 $table .= ($rand[3]) ? "<td>".spacer($rand[3],1)."</td>" : ""; 183 $table .= "</tr>\n"; 184 } 185 $table .= ($rand[1]) ? "<tr><td".$colspan.">".spacer(1,$rand[1])."</td></tr>\n" : ""; 186 $table .= "</table>"; 187 188 } 189 190 return $table; 191 } 192 193 function imagediv(& $phpwcms, & $image, $classname='') { 194 // creates the image tags if text w/image 195 // 0 :1 :2 :3 :4 :5 :6 :7 :8 196 // dbid:filename:hash:extension:width:height:caption:position:zoom 197 198 $cnt_image_lightbox = empty($GLOBALS['cnt_image_lightbox']) ? 0 : 1; 199 $crop = empty($image['crop']) ? 0 : 1; 200 201 $classname = 'imgDIV'.$classname; 202 203 $thumb_image = get_cached_image( 204 array( "target_ext" => $image[3], 205 "image_name" => $image[2] . '.' . $image[3], 206 "max_width" => $image[4], 207 "max_height" => $image[5], 208 "thumb_name" => md5($image[2].$image[4].$image[5].$phpwcms["sharpen_level"].$crop), 209 'crop_image' => $crop 210 ) 211 ); 212 213 if($image[8]) { 214 215 $zoominfo = get_cached_image( 216 array( "target_ext" => $image[3], 217 "image_name" => $image[2] . '.' . $image[3], 218 "max_width" => $phpwcms["img_prev_width"], 219 "max_height" => $phpwcms["img_prev_height"], 220 "thumb_name" => md5($image[2].$phpwcms["img_prev_width"].$phpwcms["img_prev_height"].$phpwcms["sharpen_level"]) 221 ) 222 ); 223 224 if($zoominfo == false) $image[8] = 0; 225 226 } 227 228 $image_block = ''; 229 230 if($thumb_image != false) { 231 232 // read content image info 233 $image_border = ' border="'.intval($GLOBALS["template_default"]["article"]["image_border"]).'"'; 234 $image_imgclass = $GLOBALS["template_default"]["article"]["image_imgclass"]; 235 $image_imgclass = ($image_imgclass) ? ' class="'.$image_imgclass.'"' : ''; 236 $image_class = $GLOBALS["template_default"]["article"]["image_class"]; 237 $image_class = ($image_class) ? ' class="'.$image_class.'"' : ' class="imgClass"'; 238 $caption_class = $GLOBALS["template_default"]["article"]["image_caption_class"]; 239 $caption_class = ($caption_class) ? ' class="'.$caption_class.'"' : ' class="caption"'; 240 $capt_before = $GLOBALS["template_default"]["article"]["image_caption_before"]; 241 $capt_after = $GLOBALS["template_default"]["article"]["image_caption_after"]; 242 243 // image caption 244 $caption = getImageCaption(base64_decode($image[6])); 245 $caption[0] = html_specialchars($caption[0]); 246 $caption[3] = empty($caption[3]) ? '' : ' title="'.html_specialchars($caption[3]).'"'; //title 247 $caption[1] = empty($caption[1]) ? html_specialchars($image[1]) : html_specialchars($caption[1]); 248 249 // image source 250 $img = '<img src="'.PHPWCMS_IMAGES.$thumb_image[0].'" '.$thumb_image[3]; 251 $img .= $image_border.$image_imgclass.' alt="'.$caption[1].'"'.$caption[3].' />'; 252 253 $image_block .= '<div class="'.$classname.'">'; 254 255 if($image[8]) { 256 257 $open_popup_link = 'image_zoom.php?'.getClickZoomImageParameter($zoominfo[0].'?'.$zoominfo[3]); 258 $image_block .= '<div'.$image_class.">"; 259 if($caption[2][0]) { 260 $open_link = $caption[2][0]; 261 $return_false = ''; 262 } else { 263 $open_link = $open_popup_link; 264 $return_false = 'return false;'; 265 } 266 267 if(!$cnt_image_lightbox || $caption[2][0]) { 268 269 $image_block .= '<a href="'.$open_link."\" onclick=\"checkClickZoom();clickZoom('".$open_popup_link."','previewpic','width="; 270 $image_block .= $zoominfo[1].",height=".$zoominfo[2]."');".$return_false."\"".$caption[2][1].">"; 271 272 } else { 273 274 $image_block .= '<a href="'.PHPWCMS_IMAGES.$zoominfo[0].'" rel="lightbox"'; 275 if($caption[0]) { 276 $image_block .= ' title="'.parseLightboxCaption($caption[0]).'"'; 277 } 278 $image_block .= ' target="_blank">'; 279 280 } 281 $image_block .= $img.'</a></div>'; 282 283 } else { 284 285 $image_block .= '<div'.$image_class.">"; 286 if($caption[2][0]) { 287 288 $image_block .= '<a href="'.$caption[2][0].'"'.$caption[2][1].'>'.$img.'</a>'; 289 290 } else { 291 292 $image_block .= $img; 293 294 } 295 $image_block .= '</div>'; 296 } 297 if($caption[0] && empty($image['nocaption'])) { 298 $image_block .= '<p'.$caption_class.'>'.$capt_before.$caption[0]; 299 if($caption[4] !== '') { 300 $image_block .= ' <span class="copyright">'.html_specialchars($caption[4]).'</span>'; 301 } 302 $image_block .= $capt_after."</p>"; 303 } 304 305 $image_block .= "</div>"; 306 307 } 308 309 return $image_block; 310 } 311 312 function imagelisttable($imagelist, $rand="0:0:0:0", $align=0, $type=0) { 313 // build imagelist or ecard chooser table 314 // image: type = 0 315 // ecard: type = 1 316 $template_type = (!$type) ? 'imagelist' : 'ecard'; 317 318 if(empty($GLOBALS['cnt_image_lightbox'])) { 319 $lightbox = 0; 320 } else { 321 $lightbox = generic_string(5); 322 } 323 324 $caption_on = empty($imagelist['nocaption']) ? true : false; 325 $crop = empty($imagelist['crop']) ? 0 : 1; 326 327 $table_class = $GLOBALS["template_default"]["article"][$template_type."_table_class"]; 328 if($align) { 329 $table_class .= ' imgListTable'.ucfirst($align); 330 } 331 332 $table_class = trim($table_class); 333 if($table_class) { 334 $table_class = ' class="'.$table_class.'"'; 335 } 336 $table_bgcolor = $GLOBALS["template_default"]["article"][$template_type."_table_bgcolor"]; 337 $table_bgcolor = ($table_bgcolor) ? ' bgcolor="'.$table_bgcolor.'"' : ''; 338 $image_align = $GLOBALS["template_default"]["article"][$template_type."_align"]; 339 $image_align = ($image_align) ? ' align="'.$image_align.'"' : ''; 340 $image_valign = $GLOBALS["template_default"]["article"][$template_type."_valign"]; 341 $image_valign = ($image_valign) ? ' valign="'.$image_valign.'"' : ''; 342 $image_border = ' border="'.intval($GLOBALS["template_default"]["article"][$template_type."_border"]).'"'; 343 $image_imgclass = $GLOBALS["template_default"]["article"][$template_type."_imgclass"]; 344 $image_imgclass = ($image_imgclass) ? ' class="'.$image_imgclass.'"' : ''; 345 $image_class = $GLOBALS["template_default"]["article"][$template_type."_class"]; 346 $image_class = ($image_class) ? ' class="'.$image_class.'"' : ''; 347 $image_bgcolor = $GLOBALS["template_default"]["article"][$template_type."_bgcolor"]; 348 $image_bgcolor = ($image_bgcolor) ? ' bgcolor="'.$image_bgcolor.'"' : ''; 349 $caption_class = $GLOBALS["template_default"]["article"][$template_type."_caption_class"]; 350 $caption_class = ($caption_class) ? ' class="'.$caption_class.'"' : ''; 351 $caption_bgcolor= $GLOBALS["template_default"]["article"][$template_type."_caption_bgcolor"]; 352 $caption_bgcolor= ($caption_bgcolor) ? ' bgcolor="'.$caption_bgcolor.'"' : ''; 353 $caption_valign = $GLOBALS["template_default"]["article"][$template_type."_caption_valign"]; 354 $caption_valign = ($caption_valign) ? ' valign="'.$caption_valign.'"' : ''; 355 $caption_align = $GLOBALS["template_default"]["article"][$template_type."_caption_align"]; 356 $caption_align = ($caption_align) ? ' align="'.$caption_align.'"' : ''; 357 $capt_before = $GLOBALS["template_default"]["article"][$template_type."_caption_before"]; 358 $capt_after = $GLOBALS["template_default"]["article"][$template_type."_caption_after"]; 359 360 $align = (!$align) ? '' : ' align="'.$align.'"'; 361 $rand = explode(":", $rand); 362 if(count($rand)) { 363 foreach($rand as $key => $value) { 364 $rand[$key] = intval($value); 365 } 366 } else { 367 $rand = array(0,0,0,0); 368 } 369 $col_rand = ($rand[2] && $rand[3]) ? 2 : (($rand[2] || $rand[3]) ? 1 : 0 ); 370 371 if(($count_images = count($imagelist['images']))) { 372 373 // randomize image 374 if(!empty($imagelist['random'])) { 375 shuffle($imagelist['images']); 376 } 377 378 if(empty($imagelist['limit'])) { 379 $imagelist['limit'] = 0; 380 } 381 382 //Tabelle starten 383 $table = LF.'<table border="0" cellspacing="0" width="10%" cellpadding="0"'.$align.$table_bgcolor.$table_class.' summary="">'.LF; 384 $x=0; 385 $y=0; 386 $z=0; 387 foreach($imagelist['images'] as $key => $value) { 388 389 $y++; 390 if($z && $x==1) { 391 if($col_space) { 392 $table .= LF.'<tr>'.LF.' <td'; 393 $table .= (($col_total>1)?" colspan=\"".$col_total."\"":""); 394 if(!empty($GLOBALS["template_default"]['article']['imagelist_spacerrow_class'])) { 395 $table .= ' class="'.$GLOBALS["template_default"]['article']['imagelist_spacerrow_class'].'">'; 396 $table .= spacer(1,1).'</td>'.LF.'</tr>'.LF; 397 } else { 398 $table .= '>'.spacer(1,$col_space).'</td>'.LF.'</tr>'.LF; 399 } 400 } 401 } 402 403 if(!$x) { 404 //Some default values 405 $col_space = $imagelist['space']; //Space between images 406 $col_count = $imagelist['col']; //columns 407 $col_total = $col_count + (($col_space)?($col_count-1):(0)) + $col_rand; 408 //Wenn oberer Rand definiert 409 if($rand[0]) { 410 $table .= '<tr>'.LF.' <td'.(($col_total>1)?' colspan="'.$col_total.'"':'').'>'.spacer(1,$rand[0]).'</td>'.LF.'</tr>'.LF; 411 } 412 $x=1; 413 } 414 if($x==1) { 415 416 // if left border 417 $table_tmp = ($rand[2]) ? ' <td width="'.$rand[2].'">'.spacer($rand[2],1).'</td>'.LF : ''; 418 419 //Neue Tabellenzeile 420 $capt_tmp = ''; 421 $capt_row = '<tr>'.LF.$table_tmp; 422 423 if($caption_on) { 424 $table .= $capt_row; 425 } else { 426 $table .= '<tr>'.LF; 427 } 428 429 } 430 //Aktuelle Bildspalte ausgeben 431 $table .= ' <td'.$image_align.$image_valign.$image_bgcolor.$image_class.'>'; 432 //width="'.$imagelist[$key]["w"].'" removed because no centered image possible 433 434 435 $thumb_image = get_cached_image( 436 array( "target_ext" => $imagelist['images'][$key][3], 437 "image_name" => $imagelist['images'][$key][2] . '.' . $imagelist['images'][$key][3], 438 "max_width" => $imagelist['images'][$key][4], 439 "max_height" => $imagelist['images'][$key][5], 440 "thumb_name" => md5( $imagelist['images'][$key][2].$imagelist['images'][$key][4]. 441 $imagelist['images'][$key][5].$GLOBALS['phpwcms']["sharpen_level"].$crop), 442 'crop_image' => $crop 443 ) 444 ); 445 446 if($imagelist['zoom']) { 447 448 $zoominfo = get_cached_image( 449 array( "target_ext" => $imagelist['images'][$key][3], 450 "image_name" => $imagelist['images'][$key][2] . '.' . $imagelist['images'][$key][3], 451 "max_width" => $GLOBALS['phpwcms']["img_prev_width"], 452 "max_height" => $GLOBALS['phpwcms']["img_prev_height"], 453 "thumb_name" => md5( $imagelist['images'][$key][2].$GLOBALS['phpwcms']["img_prev_width"]. 454 $GLOBALS['phpwcms']["img_prev_height"].$GLOBALS['phpwcms']["sharpen_level"] 455 ) 456 ) 457 ); 458 } 459 460 // now try to build caption and if neccessary add alt to image or set external link for image 461 $caption = getImageCaption($imagelist['images'][$key][6]); 462 // set caption and ALT Image Text for imagelist 463 $capt_cur = !$type ? html_specialchars($caption[0]) : $caption[0]; 464 $caption[3] = empty($caption[3]) ? '' : ' title="'.html_specialchars($caption[3]).'"'; //title 465 $caption[1] = empty($caption[1]) ? html_specialchars($imagelist['images'][$key][1]) : html_specialchars($caption[1]); 466 467 $list_img_temp = '<img src="'.PHPWCMS_IMAGES.$thumb_image[0].'" '.$thumb_image[3].$image_border.$image_imgclass; 468 $list_img_temp .= ' alt="'.$caption[1].'"'.$caption[3].' />'; 469 470 if($imagelist['zoom'] && isset($zoominfo) && $zoominfo != false) { 471 // if click enlarge the image 472 $open_popup_link = 'image_zoom.php?'.getClickZoomImageParameter($zoominfo[0].'?'.$zoominfo[3]); 473 if($caption[2][0]) { 474 $open_link = $caption[2][0]; 475 $return_false = ''; 476 } else { 477 $open_link = $open_popup_link; 478 $return_false = 'return false;'; 479 } 480 481 if(!$lightbox || $caption[2][0]) { 482 483 $table .= "<a href=\"".$open_link."\" onclick=\"checkClickZoom();clickZoom('".$open_popup_link."','previewpic','width="; 484 $table .= $zoominfo[1].",height=".$zoominfo[2]."');".$return_false.'"'.$caption[2][1].'>'; 485 486 } else { 487 488 // lightbox 489 $table .= '<a href="'.PHPWCMS_IMAGES.$zoominfo[0].'" rel="lightbox['.$lightbox.']"'; 490 if($capt_cur) { 491 $table .= ' title="'.parseLightboxCaption($capt_cur).'"'; 492 } 493 $table .= ' target="_blank">'; 494 495 } 496 497 $table .= $list_img_temp."</a>"; 498 } else { 499 // if not click enlarge 500 if($caption[2][0]) { 501 $table .= '<a href="'.$caption[2][0].'"'.$caption[2][1].'>'.$list_img_temp.'</a>'; 502 } else { 503 $table .= $list_img_temp; 504 } 505 } 506 $table .= '</td>'.LF; 507 508 $capt_tmp .= $capt_cur; 509 $capt_row .= ' <td'.$caption_valign.$caption_align.$caption_bgcolor.$caption_class.'>'.$capt_before.$capt_cur.$capt_after.'</td>'.LF; 510 511 512 //Gegenchecken wieviele Tabellenspalten als Rest bleiben und ergänzen 513 if($y == $count_images && $col_count > 1) { //wenn eigentlich alle Bilder durchlaufen sind 514 if ($col_space && $x<$col_count) { 515 $xct = ' <td>'.spacer($col_space,1).'</td>'.LF; 516 $table .= $xct; 517 $capt_row .= $xct; 518 } 519 $rest_image = (ceil($count_images / $col_count) * $col_count) - $count_images; 520 for ($i=1; $i <= $rest_image; $i++) { 521 $table .= ' <td> </td>'; 522 $capt_row .= ' <td> </td>'; 523 if($i < $rest_image) { 524 if($col_space) { 525 $xct = ' <td width="'.$col_space.'">'.spacer($col_space,1).'</td>'.LF; 526 $table .= $xct; 527 $capt_row .= $xct; 528 } 529 } 530 $x++; 531 } 532 } 533 534 if($x==$col_count) { //Wenn maximale Anzahl Bildspalten erreicht 535 $xct = ($rand[3]) ? '<td width="'.$rand[3].'">'.spacer($rand[3],1).'</td>'.LF : ''; 536 $table .= $xct; 537 $capt_row .= $xct; 538 $table .= "</tr>".LF; 539 $capt_row .= "</tr>".LF; 540 if($capt_tmp) { 541 if($caption_on) { 542 $table .= $capt_row; 543 } 544 $capt_row = ''; 545 $capt_tmp = ''; 546 } 547 $x=1; $z++; 548 } else { 549 $xct = ($col_space) ? ' <td width="'.$col_space.'">'.spacer($col_space,1).'</td>'.LF : ''; 550 $table .= $xct; 551 $capt_row .= $xct; 552 $x++; 553 } 554 555 // end if max image count 556 if($imagelist['limit'] == $y) { 557 break; 558 } 559 } 560 561 if($rand[1]) { 562 $table .= '<tr>'.LF.' <td'.(($col_total>1)?" colspan=\"".$col_total."\"":"").">".spacer(1,$rand[1]).'</td>'.LF.'</tr>'.LF; 563 } 564 $table .= '</table>'.LF; 565 } 566 return $table; 567 } 568 569 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Jan 29 16:31:14 2012 | Cross-referenced by PHPXref 0.7.1 |