[ Index ]

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

title

Body

[close]

/include/inc_front/content/ -> cnt27.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  //FAQ
  33  
  34  $crow["acontent_form"]    = unserialize($crow["acontent_form"]);
  35  $crow["acontent_image"]    = empty($crow["acontent_image"]) ? '' : explode(":", $crow["acontent_image"]);
  36  
  37  if(!empty($crow["acontent_form"]['faq_template']) && file_exists(PHPWCMS_TEMPLATE.'inc_cntpart/faq/'.$crow["acontent_form"]['faq_template'])) {
  38  
  39      $crow["acontent_form"]['faq_template'] = @file_get_contents(PHPWCMS_TEMPLATE.'inc_cntpart/faq/'.$crow["acontent_form"]['faq_template']);
  40  
  41  } else {
  42      $crow["acontent_form"]['faq_template'] = '<div class="phpwcmsFAQ">
  43      <!-- hidden title/subtitle [TITLE]
  44      <h3 id="faq_id{FAQ_ID}">{TITLE}</h3>[/TITLE][SUBTITLE]
  45      <h4>{SUBTITLE}</h4>[/SUBTITLE] 
  46      -->
  47      [FAQ_QUESTION]<h3>{FAQ_QUESTION}</h3>[/FAQ_QUESTION]
  48      [FAQ_IMAGE]<div class="faqImage">
  49      {FAQ_IMAGE}[FAQ_CAPTION]
  50      <div class="faqCaption">{FAQ_CAPTION}</div>[/FAQ_CAPTION]
  51      </div>[/FAQ_IMAGE]
  52      [FAQ_ANSWER]<p>{FAQ_ANSWER}</p>[/FAQ_ANSWER]
  53  </div>';
  54  }
  55  
  56  /*
  57  $thumb_image = get_cached_image(
  58                      array(    "target_ext"    =>    $image[3],
  59                              "image_name"    =>    $image[2] . '.' . $image[3],
  60                              "max_width"        =>    $image[4],
  61                              "max_height"    =>    $image[5],
  62                              "thumb_name"    =>    md5($image[2].$image[4].$image[5].$phpwcms["sharpen_level"])
  63                               )
  64                      );
  65                      
  66  if($image[8]) {
  67      
  68      $zoominfo = get_cached_image(
  69                      array(    "target_ext"    =>    $image[3],
  70                              "image_name"    =>    $image[2] . '.' . $image[3],
  71                              "max_width"        =>    $phpwcms["img_prev_width"],
  72                              "max_height"    =>    $phpwcms["img_prev_height"],
  73                              "thumb_name"    =>    md5($image[2].$phpwcms["img_prev_width"].$phpwcms["img_prev_height"].$phpwcms["sharpen_level"])
  74                               )
  75                      );
  76          
  77      if($zoominfo == false) $image[8] = 0;
  78  
  79  }
  80  */
  81  
  82  // 0   :1       :2   :3        :4    :5     :6      :7       :8
  83  // dbid:filename:hash:extension:width:height:caption:position:zoom
  84  
  85  //build image/image link
  86  $thumb_image    = false;
  87  $thumb_img        = '';
  88  $caption[0]        = '';
  89  if(!empty($crow["acontent_image"][2])) {
  90  
  91      $caption = getImageCaption(base64_decode($crow["acontent_image"][6]));
  92      $caption[0]    = html_specialchars($caption[0]);
  93      $caption[3] = empty($caption[3]) ? '' : ' title="'.html_specialchars($caption[3]).'"'; //title
  94      $caption[1] = empty($caption[1]) ? html_specialchars($crow["acontent_image"][1]) : html_specialchars($caption[1]);
  95  
  96      $thumb_image = get_cached_image(
  97      array(    "target_ext"    =>    $crow["acontent_image"][3],
  98              "image_name"    =>    $crow["acontent_image"][2] . '.' . $crow["acontent_image"][3],
  99              "max_width"        =>    $crow["acontent_image"][4],
 100              "max_height"    =>    $crow["acontent_image"][5],
 101              "thumb_name"    =>    md5($crow["acontent_image"][2].$crow["acontent_image"][4].$crow["acontent_image"][5].$GLOBALS['phpwcms']["sharpen_level"])
 102      ));
 103  
 104      if($thumb_image != false) {
 105      
 106          $thumb_img  = '<img src="'.PHPWCMS_IMAGES . $thumb_image[0] .'" border="0" '.$thumb_image[3];
 107          $thumb_img .= ' alt="'.$caption[1].'"'.$caption[3].' />';
 108  
 109          if($crow["acontent_image"][8]) {
 110  
 111              $zoominfo = get_cached_image(
 112              array(    "target_ext"    =>    $crow["acontent_image"][3],
 113                      "image_name"    =>    $crow["acontent_image"][2] . '.' . $crow["acontent_image"][3],
 114                      "max_width"        =>    $GLOBALS['phpwcms']["img_prev_width"],
 115                      "max_height"    =>    $GLOBALS['phpwcms']["img_prev_height"],
 116                      "thumb_name"    =>    md5($crow["acontent_image"][2].$GLOBALS['phpwcms']["img_prev_width"].$GLOBALS['phpwcms']["img_prev_height"].$GLOBALS['phpwcms']["sharpen_level"])
 117              ));
 118  
 119              if($zoominfo != false) {
 120              
 121                  $popup_img = 'image_zoom.php?'.getClickZoomImageParameter($zoominfo[0].'?'.$zoominfo[3]);
 122              
 123                  if(!empty($caption[2][0])) {
 124                      $open_link = $caption[2][0];
 125                      $return_false = '';
 126                  } else {
 127                      $open_link = $popup_img;
 128                      $return_false = 'return false;';
 129                  }
 130  
 131                  $thumb_img = '<a href="'.$popup_img.'" onclick="window.open(\''.$open_link.
 132                  "','previewpic','width=".$zoominfo[1].",height=".$zoominfo[2]."');".$return_false.
 133                  '"'.$caption[2][1].'>'.$thumb_img.'</a>';
 134                  
 135                  
 136              }
 137          } else {
 138  
 139              if($caption[2][0]) {
 140                  $thumb_img = '<a href="'.$caption[2][0].'"'.$caption[2][1].'>'.$thumb_img.'</a>';
 141              }
 142          }
 143      }
 144  }
 145  
 146  
 147  
 148  
 149  // now render whole recipe
 150  $crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'TITLE', html_specialchars($crow['acontent_title']));
 151  $crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
 152  $crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'FAQ_QUESTION', html_specialchars($crow["acontent_text"]));
 153  $crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'FAQ_ANSWER', $crow["acontent_html"]);
 154  $crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'FAQ_IMAGE', $thumb_img);
 155  $crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'FAQ_CAPTION', $caption[0]);
 156  $crow["acontent_form"]['faq_template'] = str_replace('{FAQ_ID}', $crow['acontent_id'], $crow["acontent_form"]['faq_template']);
 157  
 158  $CNT_TMP .= $crow["acontent_form"]['faq_template'];
 159  
 160  
 161  
 162  
 163  unset($image, $caption);
 164  
 165  ?>


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