[ Index ]

PHP Cross Reference of phpwcms V1.4.7 _r403 (01.11.10)

title

Body

[close]

/include/inc_front/ -> img.func.inc.php (source)

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


Generated: Tue Nov 16 22:51:00 2010 Cross-referenced by PHPXref 0.7