[ Index ]

PHP Cross Reference of phpwcms V1.5.0 _r431 (28.01.12)

title

Body

[close]

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

   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  
  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'] = render_device( @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  // 0   :1       :2   :3        :4    :5     :6      :7       :8
  57  // dbid:filename:hash:extension:width:height:caption:position:zoom
  58  
  59  //build image/image link
  60  $thumb_image    = false;
  61  $thumb_img        = '';
  62  $caption[0]        = '';
  63  if(!empty($crow["acontent_image"][2])) {
  64  
  65      $caption = getImageCaption(base64_decode($crow["acontent_image"][6]));
  66      $caption[0]    = html_specialchars($caption[0]);
  67      $caption[3] = empty($caption[3]) ? '' : ' title="'.html_specialchars($caption[3]).'"'; //title
  68      $caption[1] = empty($caption[1]) ? html_specialchars($crow["acontent_image"][1]) : html_specialchars($caption[1]);
  69  
  70      $thumb_image = get_cached_image(
  71      array(    "target_ext"    =>    $crow["acontent_image"][3],
  72              "image_name"    =>    $crow["acontent_image"][2] . '.' . $crow["acontent_image"][3],
  73              "max_width"        =>    $crow["acontent_image"][4],
  74              "max_height"    =>    $crow["acontent_image"][5],
  75              "thumb_name"    =>    md5($crow["acontent_image"][2].$crow["acontent_image"][4].$crow["acontent_image"][5].$GLOBALS['phpwcms']["sharpen_level"])
  76      ));
  77  
  78      if($thumb_image != false) {
  79      
  80          $thumb_img  = '<img src="'.PHPWCMS_IMAGES . $thumb_image[0] .'" border="0" '.$thumb_image[3];
  81          $thumb_img .= ' alt="'.$caption[1].'"'.$caption[3].' />';
  82  
  83          if($crow["acontent_image"][8]) {
  84  
  85              $zoominfo = get_cached_image(
  86              array(    "target_ext"    =>    $crow["acontent_image"][3],
  87                      "image_name"    =>    $crow["acontent_image"][2] . '.' . $crow["acontent_image"][3],
  88                      "max_width"        =>    $GLOBALS['phpwcms']["img_prev_width"],
  89                      "max_height"    =>    $GLOBALS['phpwcms']["img_prev_height"],
  90                      "thumb_name"    =>    md5($crow["acontent_image"][2].$GLOBALS['phpwcms']["img_prev_width"].$GLOBALS['phpwcms']["img_prev_height"].$GLOBALS['phpwcms']["sharpen_level"])
  91              ));
  92  
  93              if($zoominfo != false) {
  94              
  95                  $popup_img = 'image_zoom.php?'.getClickZoomImageParameter($zoominfo[0].'?'.$zoominfo[3]);
  96              
  97                  if(!empty($caption[2][0])) {
  98                      $open_link = $caption[2][0];
  99                      $return_false = '';
 100                  } else {
 101                      $open_link = $popup_img;
 102                      $return_false = 'return false;';
 103                  }
 104  
 105                  $thumb_img = '<a href="'.$popup_img.'" onclick="window.open(\''.$open_link.
 106                  "','previewpic','width=".$zoominfo[1].",height=".$zoominfo[2]."');".$return_false.
 107                  '"'.$caption[2][1].'>'.$thumb_img.'</a>';
 108                  
 109                  
 110              }
 111          } else {
 112  
 113              if($caption[2][0]) {
 114                  $thumb_img = '<a href="'.$caption[2][0].'"'.$caption[2][1].'>'.$thumb_img.'</a>';
 115              }
 116          }
 117      }
 118  }
 119  
 120  
 121  
 122  
 123  // now render whole recipe
 124  $crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'TITLE', html_specialchars($crow['acontent_title']));
 125  $crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
 126  $crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'FAQ_QUESTION', html_specialchars($crow["acontent_text"]));
 127  $crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'FAQ_ANSWER', $crow["acontent_html"]);
 128  $crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'FAQ_IMAGE', $thumb_img);
 129  $crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'FAQ_CAPTION', $caption[0]);
 130  $crow["acontent_form"]['faq_template'] = str_replace('{FAQ_ID}', $crow['acontent_id'], $crow["acontent_form"]['faq_template']);
 131  
 132  $CNT_TMP .= $crow["acontent_form"]['faq_template'];
 133  
 134  
 135  
 136  
 137  unset($image, $caption);
 138  
 139  ?>


Generated: Sun Jan 29 16:31:14 2012 Cross-referenced by PHPXref 0.7.1