[ Index ]

PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09)

title

Body

[close]

/include/inc_front/content/ -> cnt1.article.inc.php (source)

   1  <?php
   2  /*************************************************************************************
   3     Copyright notice
   4     
   5     (c) 2002-2009 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  
  31  
  32  
  33  //image with text
  34  
  35  // read template
  36  if(empty($crow["acontent_template"]) && is_file(PHPWCMS_TEMPLATE.'inc_default/imagetext.tmpl')) {
  37  
  38      $crow["acontent_template"]    = @file_get_contents(PHPWCMS_TEMPLATE.'inc_default/imagetext.tmpl');
  39      
  40  } elseif(is_file(PHPWCMS_TEMPLATE.'inc_cntpart/imagetext/'.$crow["acontent_template"])) {
  41  
  42      $crow["acontent_template"]    = @file_get_contents(PHPWCMS_TEMPLATE.'inc_cntpart/imagetext/'.$crow["acontent_template"]);
  43  
  44  } else {
  45  
  46      $crow["acontent_template"]    = '[IMAGETEXT]<div class="image-with-text">{IMAGETEXT}</div>[/IMAGETEXT]';
  47  
  48  }
  49  
  50  // 0   :1       :2   :3        :4    :5     :6      :7       :8
  51  // dbid:filename:hash:extension:width:height:caption:position:zoom
  52  $image        = ($crow["acontent_image"]) ? explode(":", $crow["acontent_image"]) : false ;
  53  $image_text    = '';
  54  
  55  //zoom click = $image[8];
  56  if($image) {
  57  
  58      // load special functions
  59      require_once (PHPWCMS_ROOT.'/include/inc_front/img.func.inc.php');
  60  
  61  
  62      $image['div'] = empty($template_default["article"]["image_div"]) ? false : true;
  63      
  64      $cnt_image    = @unserialize($crow["acontent_form"]);
  65      if(!isset($cnt_image['cimage_lightbox'])) {
  66      
  67          $GLOBALS['cnt_image_lightbox'] = 0;
  68          $cnt_image_lightbox = 0;
  69      
  70      } elseif($cnt_image['cimage_lightbox']) {
  71      
  72          $GLOBALS['cnt_image_lightbox'] = 1;
  73          $cnt_image_lightbox = 1;
  74          initializeLightbox();
  75      
  76      }
  77      $image['nocaption'] = empty($cnt_image['cimage_nocaption']) ? 0 : 1;
  78      $image['crop']        = empty($cnt_image['cimage_crop']) ? 0 : 1;
  79      
  80      switch($image[7]) {
  81  
  82          //oben links
  83          case 0: 
  84          $image_text .= $image['div'] ? imagediv($phpwcms, $image, 'topLeft') : imagetable($phpwcms, $image, "0:5:0:0", "");
  85          $image_text .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
  86          $image_text .= ($crow["acontent_text"]) ? div_class($crow["acontent_text"], $template_default["article"]["text_class"]) : "";
  87          break;
  88          //oben mitte
  89          case 1:
  90          $image_text .= $image['div'] ? imagediv($phpwcms, $image, 'topCenter" align="center') : imagetable($phpwcms, $image, "0:5:0:0", "center");
  91          $image_text .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
  92          $image_text .= ($crow["acontent_text"]) ? div_class($crow["acontent_text"], $template_default["article"]["text_class"]) : "";
  93          break;
  94          //oben rechts
  95          case 2:    
  96          if($image['div']) {
  97              $image_text .= imagediv($phpwcms, $image, 'topRight" align="right');
  98          } else {
  99              $image_text .= '<div align="right" style="text-align:right;margin:0;padding:0;">'.imagetable($phpwcms, $image, "0:5:0:0", "").'</div>';
 100          }
 101          $image_text .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
 102          $image_text .= ($crow["acontent_text"]) ? div_class($crow["acontent_text"], $template_default["article"]["text_class"]) : "";
 103          break;
 104          //unten links
 105          case 3: 
 106          $image_text .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
 107          $image_text.= ($crow["acontent_text"]) ? div_class($crow["acontent_text"], $template_default["article"]["text_class"]) : "";
 108          $image_text .= $image['div'] ? imagediv($phpwcms, $image, 'bottomLeft') : imagetable($phpwcms, $image, "5:0:0:0", "");
 109          break;
 110          //unten mitte
 111          case 4: 
 112          $image_text .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
 113          $image_text .= ($crow["acontent_text"]) ? div_class($crow["acontent_text"],$template_default["article"]["text_class"]) : "";
 114          $image_text .= $image['div'] ? imagediv($phpwcms, $image, 'bottomCenter" align="center') : imagetable($phpwcms, $image, "5:0:0:0", "center");
 115          break;
 116          //unten rechts
 117          case 5: 
 118          $image_text .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
 119          $image_text .= ($crow["acontent_text"]) ? div_class($crow["acontent_text"],$template_default["article"]["text_class"]) : "";
 120          if($image['div']) {
 121              $image_text .= imagediv($phpwcms, $image, 'bottomRight" align="right');
 122          } else {
 123              $image_text .= '<div align="right" style="text-align:right;margin:0;padding:0;">'.imagetable($phpwcms, $image, "5:0:0:0", "").'</div>';
 124          }
 125          break;
 126          //im Text links
 127          case 6: 
 128          $image_text .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
 129          $icontent = ($crow["acontent_text"]) ? "###image_replace###".div_class($crow["acontent_text"], $template_default["article"]["text_class"]) : "###image_replace###";
 130          if($image['div']) {
 131              $iconimg = imagediv($phpwcms, $image, 'inTextLeft" align="left');
 132          } else {
 133              $iconimg = imagetable($phpwcms, $image, "0:0:0:8", "left");
 134          }
 135          $image_text .= str_replace("###image_replace###", $iconimg, $icontent);
 136          break;
 137          //im Text rechts
 138          case 7: 
 139          $image_text .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
 140          $icontent = ($crow["acontent_text"]) ? "###image_replace###".div_class($crow["acontent_text"], $template_default["article"]["text_class"]) : "###image_replace###";
 141          if($image['div']) {
 142              $iconimg = imagediv($phpwcms, $image, 'inTextRight" align="right');
 143          } else {
 144              $iconimg = imagetable($phpwcms, $image, "0:0:10:0", "right");
 145          }
 146          $image_text .= str_replace("###image_replace###", $iconimg, $icontent);
 147          break;
 148          
 149          case 9: 
 150          // Tabelle, links
 151          $image_text  .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
 152          $icontent  = '<table width="100%" cellpadding="0" cellspacing="0" border="0" class="imgTextLeft">';
 153          $icontent .= "\n<tr>\n";
 154          if($crow["acontent_text"]) {
 155              $icontent .= '<td valign="top" class="'.$template_default["article"]["text_class"].'">';
 156              $icontent .= $crow["acontent_text"];
 157              $icontent .= "</td>\n";
 158          }
 159          if($image['div']) {
 160              $iconimg = imagediv($phpwcms, $image, 'blockImgRight');
 161          } else {
 162              $iconimg = div_class(imagetable($phpwcms, $image, "0:0:0:0"), '');
 163          }
 164          if($iconimg) {
 165              $icontent .= '<td valign="top" width="10%" class="'.$template_default["article"]["image_class"].'">';
 166              $icontent .= $iconimg."</td>\n";
 167          }
 168          $icontent .= "</tr>\n</table>";
 169          $image_text  .= $icontent;
 170          break;
 171          
 172          case 8: 
 173          // Tabelle, rechts
 174          $image_text  .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
 175          $icontent  = '<table width="100%" cellpadding="0" cellspacing="0" border="0" class="imgTextRight">';
 176          $icontent .= "\n<tr>\n";
 177          if($image['div']) {
 178              $iconimg = imagediv($phpwcms, $image, 'blockImgLeft');
 179          } else {
 180              $iconimg = div_class(imagetable($phpwcms, $image, "0:0:0:0"), '');
 181          }
 182          if($iconimg) {
 183              $icontent .= '<td valign="top" width="10%" class="'.$template_default["article"]["image_class"].'">';
 184              $icontent .= $iconimg."</td>\n";
 185          }
 186          if($crow["acontent_text"]) {
 187              $icontent .= '<td valign="top" class="'.$template_default["article"]["text_class"].'">';
 188              $icontent .= $crow["acontent_text"];
 189              $icontent .= "</td>\n";
 190          }
 191          $icontent .= "</tr>\n</table>";
 192          $image_text  .= $icontent;
 193          break;
 194          
 195      }
 196      
 197      unset($cnt_image);
 198      $GLOBALS['cnt_image_lightbox'] = 0;
 199      $cnt_image_lightbox = 0;
 200      
 201  } else {
 202      $image_text .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
 203      if($crow["acontent_text"]) {
 204          $image_text .= div_class($crow["acontent_text"], $template_default["article"]["text_class"]);
 205      }
 206  }
 207  unset($image);
 208  
 209  $CNT_TMP .= LF . trim( render_cnt_template($crow["acontent_template"], 'IMAGETEXT', trim($image_text) ) ) . LF;
 210  
 211  
 212  ?>


Generated: Wed Dec 30 05:55:15 2009 Cross-referenced by PHPXref 0.7