// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
    die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
//bullet list
// read template
if (empty($crow["acontent_template"]) && is_file(PHPWCMS_TEMPLATE . 'inc_default/bulletlist.tmpl')) {
    $crow["acontent_template"] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_default/bulletlist.tmpl'));
} elseif (is_file(PHPWCMS_TEMPLATE . 'inc_cntpart/bulletlist/' . $crow["acontent_template"])) {
    $crow["acontent_template"] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_cntpart/bulletlist/' . $crow["acontent_template"]));
} else {
    $crow["acontent_template"] = '[TITLE]<h4>{TITLE}</h4>' . LF . '[/TITLE][SUBTITLE]<h5>{SUBTITLE}</h5>' . LF . '[/SUBTITLE]';
    $crow["acontent_template"] .= '[BULLETLIST]<ul class="bulletlist">{BULLETLIST}<!--BULLETLIST_ITEM_START//--><li>{BULLETLIST_ITEM}</li><!--BULLETLIST_ITEM_END//--></ul>[/BULLETLIST]';
}
$crow['bulletlist_item_template'] = get_tmpl_section('BULLETLIST_ITEM', $crow["acontent_template"]);
$crow["acontent_template"] = replace_tmpl_section('BULLETLIST_ITEM', $crow["acontent_template"]);
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'TITLE', html_specialchars($crow['acontent_title']));
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
$crow['bullets'] = convertStringToArray($crow["acontent_text"], LF);
if (count($crow['bullets'])) {
    $crow['bulletlist_items'] = array();
    foreach ($crow['bullets'] as $item) {
        $crow['bulletlist_items'][] = str_replace('{BULLETLIST_ITEM}', html($item), $crow['bulletlist_item_template']);
    }
    $crow['bulletlist_items'] = implode(LF, $crow['bulletlist_items']);
} else {
    $crow['bulletlist_items'] = '';
}
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'BULLETLIST', $crow['bulletlist_items']);
$CNT_TMP .= $crow["acontent_template"];
Example #2
0
        $crow['image_tag'] = '<img src="img/cmsimage.php/' . $crow["settings"]['width'] . 'x' . $crow["settings"]['height'] . 'x' . $crow["settings"]['crop'] . '/';
        $crow['image_tag'] .= $image[2] . '.' . $image[3] . '" alt="';
        if ($crow["settings"]['nocaption']) {
            $crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'CAPTION', '');
            $crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'ALT', '');
            $crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'IMAGE_TITLE', '');
            $crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'COPYRIGHT', '');
        } else {
            $caption = getImageCaption(base64_decode($image[6]));
            $crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'CAPTION', html($caption[0]));
            $caption[1] = html(empty($caption[1]) ? $image[1] : $caption[1]);
            $crow['image_tag'] .= $caption[1];
            $crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'ALT', $caption[1]);
            if (empty($caption[3])) {
                $crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'IMAGE_TITLE', '');
            } else {
                $caption[3] = html($caption[3]);
                $crow['image_tag'] .= '" title="' . $caption[3];
                $crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'IMAGE_TITLE', $caption[3]);
            }
            $crow['image_tag'] .= '" />';
            $crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'COPYRIGHT', empty($caption[4]) ? '' : html($caption[4]));
        }
        $crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'IMAGE', $crow['image_tag']);
    }
    $crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'CLASS', $crow['imagetext_class']);
    $crow["acontent_template"] = str_replace('{IMAGE_WIDTH}', $crow["settings"]['width'], $crow["acontent_template"]);
    $crow["acontent_template"] = str_replace('{IMAGE_HEIGHT}', $crow["settings"]['width'], $crow["acontent_template"]);
    $CNT_TMP .= render_cnt_template($crow["acontent_template"], 'TEXT', $crow["acontent_text"]);
}
unset($image);
Example #3
0
                        $cart_items[$x] .= 'VAT:   {PRODUCT_VAT} %' . LF;
                        $cart_items[$x] .= 'Gross: {PRODUCT_GROSS_PRICE} {CURRENCY_SYMBOL}';
                    }
                    break;
            }
            $cart_items[$x] = str_replace('{PRODUCT_DETAIL_LINK}', rel_url(array('shop_detail' => $prod_id), array('shop_cart'), $_tmpl['config']['shop_url']), $cart_items[$x]);
            $cart_items[$x] = render_cnt_template($cart_items[$x], 'PRODUCT_TITLE', html_specialchars($row['shopprod_name1']));
            $cart_items[$x] = render_cnt_template($cart_items[$x], 'PRODUCT_SHORT', $row['shopprod_description0']);
            $cart_items[$x] = render_cnt_template($cart_items[$x], 'PRODUCT_NET_PRICE', $row['net']);
            $cart_items[$x] = render_cnt_template($cart_items[$x], 'PRODUCT_GROSS_PRICE', $row['gross']);
            $cart_items[$x] = render_cnt_template($cart_items[$x], 'PRODUCT_WEIGHT', $row['weight']);
            $cart_items[$x] = render_cnt_template($cart_items[$x], 'PRODUCT_VAT', $row['vat']);
            $cart_items[$x] = render_cnt_template($cart_items[$x], 'ORDER_NUM', html_specialchars($row['shopprod_ordernumber']));
            $cart_items[$x] = render_cnt_template($cart_items[$x], 'MODEL', html_specialchars($row['shopprod_model']));
            $cart_items[$x] = render_cnt_template($cart_items[$x], 'PRODUCT_OPT1', $opt1_txt);
            $cart_items[$x] = render_cnt_template($cart_items[$x], 'PRODUCT_OPT2', $opt2_txt);
            if ($cart_mode === 'cart') {
                $cart_items[$x] = str_replace('{COUNT}', '<input type="text" name="shop_prod_amount[' . $prod_id . '][' . $opt1_id . '][' . $opt2_id . ']" value="' . $total[$prod_id]['quantity'] . '" size="3" />', $cart_items[$x]);
            } else {
                $cart_items[$x] = str_replace('{COUNT}', $total[$prod_id]['quantity'], $cart_items[$x]);
            }
            $x++;
        }
    }
}
// set shipping fees
$subtotal['shipping_net'] = 0;
$subtotal['shipping_vat'] = 0;
$subtotal['shipping_gross'] = 0;
$subtotal['shipping_calc'] = false;
$subtotal['shipping_calc_type'] = _getConfig('shop_pref_shipping_calc', '_shopPref');
Example #4
0
                if (!empty($content['CpTitleParams'][3])) {
                    continue;
                }
                if (!empty($content['CpTitleParams'][2])) {
                    $content['CpItem'] .= ' class="' . $content['CpTitleParams'][2] . '"';
                }
            }
            $content['CpItem'] .= '>' . html_specialchars($value) . '</a>';
            $content['CpTitleMenu'][] = $content['CpTitleParams'][0] . $content['CpItem'] . $content['CpTitleParams'][1];
        }
        // cp menu prefix/suffix
        if (count($content['CpTitleMenu'])) {
            $content['CpTitleMenu'][] = $content['CpTitleParams'][5];
            array_unshift($content['CpTitleMenu'], $content['CpTitleParams'][4]);
        }
        $content['all'] = render_cnt_template($content['all'], 'CP_PAGINATE_MENU', implode(LF, $content['CpTitleMenu']));
    }
} elseif (strpos($content['all'], 'CP_PAGINATE')) {
    // remove CP_paginate block
    $content['all'] = replace_tmpl_section('CP_PAGINATE', $content['all']);
}
// check if print mode - then try to replace "no-print" sections from source
if (strpos($content['all'], '--NO_PRINT')) {
    if ($aktion[2] == 1) {
        $content['all'] = replace_tmpl_section('NO_PRINT', $content['all']);
        $block['css'] = array('print_layout.css');
    } else {
        $content['all'] = str_replace(array('<!--NO_PRINT_START//-->', '<!--NO_PRINT_END//-->'), '', $content['all']);
    }
}
// now clean up special sections in case user is logged in OR not
Example #5
0
$subtotal['total_discount_vat'] = number_format($subtotal['float_discount_vat'], $_tmpl['config']['price_decimals'], $_tmpl['config']['dec_point'], $_tmpl['config']['thousands_sep']);
$subtotal['total_discount_gross'] = number_format($subtotal['float_discount_gross'], $_tmpl['config']['price_decimals'], $_tmpl['config']['dec_point'], $_tmpl['config']['thousands_sep']);
$subtotal['total_loworder_net'] = number_format($subtotal['float_loworder_net'], $_tmpl['config']['price_decimals'], $_tmpl['config']['dec_point'], $_tmpl['config']['thousands_sep']);
$subtotal['total_loworder_vat'] = number_format($subtotal['float_loworder_vat'], $_tmpl['config']['price_decimals'], $_tmpl['config']['dec_point'], $_tmpl['config']['thousands_sep']);
$subtotal['total_loworder_gross'] = number_format($subtotal['float_loworder_gross'], $_tmpl['config']['price_decimals'], $_tmpl['config']['dec_point'], $_tmpl['config']['thousands_sep']);
$subtotal['total_net'] = number_format($subtotal['float_total_net'], $_tmpl['config']['price_decimals'], $_tmpl['config']['dec_point'], $_tmpl['config']['thousands_sep']);
$subtotal['total_vat'] = number_format($subtotal['float_total_vat'], $_tmpl['config']['price_decimals'], $_tmpl['config']['dec_point'], $_tmpl['config']['thousands_sep']);
$subtotal['total_gross'] = number_format($subtotal['float_total_gross'], $_tmpl['config']['price_decimals'], $_tmpl['config']['dec_point'], $_tmpl['config']['thousands_sep']);
// Replace
$order_process = str_replace('{CURRENCY_SYMBOL}', html_specialchars($_shopPref['shop_pref_currency']), $order_process);
$order_process = str_replace('{WEIGHT_UNIT}', html_specialchars($_shopPref['shop_pref_unit_weight']), $order_process);
$order_process = str_replace('{SUBTOTAL_WEIGHT}', $subtotal['weight'], $order_process);
$order_process = str_replace('{SUBTOTAL_NET}', $subtotal['net'], $order_process);
$order_process = str_replace('{SUBTOTAL_VAT}', $subtotal['vat'], $order_process);
$order_process = str_replace('{SUBTOTAL_GROSS}', $subtotal['gross'], $order_process);
$order_process = str_replace('{SHIPPING_NET}', $subtotal['shipping_net'], $order_process);
$order_process = str_replace('{SHIPPING_VAT}', $subtotal['shipping_vat'], $order_process);
$order_process = str_replace('{SHIPPING_GROSS}', $subtotal['shipping_gross'], $order_process);
$order_process = str_replace('{DISCOUNT_NET}', $subtotal['total_discount_net'], $order_process);
$order_process = str_replace('{DISCOUNT_VAT}', $subtotal['total_discount_vat'], $order_process);
$order_process = str_replace('{DISCOUNT_GROSS}', $subtotal['total_discount_gross'], $order_process);
$order_process = str_replace('{LOWORDER_NET}', $subtotal['total_loworder_net'], $order_process);
$order_process = str_replace('{LOWORDER_VAT}', $subtotal['total_loworder_vat'], $order_process);
$order_process = str_replace('{LOWORDER_GROSS}', $subtotal['total_loworder_gross'], $order_process);
$order_process = str_replace('{TOTAL_NET}', $subtotal['total_net'], $order_process);
$order_process = str_replace('{TOTAL_VAT}', $subtotal['total_vat'], $order_process);
$order_process = str_replace('{TOTAL_GROSS}', $subtotal['total_gross'], $order_process);
$order_process = render_cnt_template($order_process, 'LOWORDER', $subtotal['float_loworder_net'] != 0 ? 1 : '');
$order_process = render_cnt_template($order_process, 'DISCOUNT', $subtotal['float_discount_net'] != 0 ? $subtotal['discount_percent'] : '');
$order_process = render_cnt_template($order_process, 'SHIPPING', $subtotal['float_shipping_net'] > 0 ? 1 : '');
        } else {
            $fmp_data['video_tag']['fallback'] = $fmp_data['fallback'];
            $fmp_data['video_tag']['footer'] = '</' . $fmp_data['fmp_set_audio'] . '>';
            if (empty($phpwcms['js_in_body'])) {
                $fmp_data['video_tag']['footer'] .= $fmp_data['init_videojs'];
            } else {
                $block['custom_htmlhead']['videojs_' . $fmp_data['id']] = '  ' . $fmp_data['init_videojs'];
            }
        }
        $fmp_data['fallback'] = '	' . implode(LF . '	', $fmp_data['video_tag']);
        unset($fmp_data['video'], $fmp_data['video_tag']);
        // Flash Video Fallback
    } elseif ($fmp_data['fallback']) {
        // Load SwfObject 2.1
        initSwfObject();
        // build SwfObject Script Block
        $block['custom_htmlhead'][$fmp_data['id']] = '  <script' . SCRIPT_ATTRIBUTE_TYPE . '>' . LF . SCRIPT_CDATA_START . LF;
        $block['custom_htmlhead'][$fmp_data['id']] .= $fmp_data['jw_license_info'];
        $block['custom_htmlhead'][$fmp_data['id']] .= '	var flashvars_' . $fmp_data['id'] . '	= {' . implode(', ', $fmp_data['flashvars']) . '};' . LF;
        $block['custom_htmlhead'][$fmp_data['id']] .= '	var params_' . $fmp_data['id'] . '	= {' . implode(', ', $fmp_data['params']) . '};' . LF;
        $block['custom_htmlhead'][$fmp_data['id']] .= '	var attributes_' . $fmp_data['id'] . '	= {' . implode(', ', $fmp_data['attributes']) . '};' . LF;
        $block['custom_htmlhead'][$fmp_data['id']] .= '	swfobject.embedSWF("' . $fmp_data['player_swf'] . '", "' . $fmp_data['id'] . '", "' . $fmp_data['fmp_width'] . '", "' . $fmp_data['fmp_height'] . '", "' . $fmp_data['fmp_set_flashversion'] . '", false, flashvars_' . $fmp_data['id'] . ', params_' . $fmp_data['id'] . ', attributes_' . $fmp_data['id'] . ');';
        $block['custom_htmlhead'][$fmp_data['id']] .= LF . SCRIPT_CDATA_END . LF . '  </script>';
        $fmp_data['fmp_set_skin_html5'] = '';
    }
    // add rendering result to current listing
    $fmp_data['fmp_template'] = render_cnt_template($fmp_data['fmp_template'], 'TITLE', html_specialchars($crow['acontent_title']));
    $fmp_data['fmp_template'] = render_cnt_template($fmp_data['fmp_template'], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
    $fmp_data['fmp_template'] = render_cnt_template($fmp_data['fmp_template'], 'PLAYER', $fmp_data['fallback']);
    $CNT_TMP .= str_replace('{ID}', $fmp_data['id'], $fmp_data['fmp_template']);
}
Example #7
0
} elseif (is_file(PHPWCMS_TEMPLATE . 'inc_cntpart/tabs/' . $crow["acontent_template"])) {
    $tabs['template'] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_cntpart/tabs/' . $crow["acontent_template"]));
} else {
    $tabs['template'] = '';
}
if ($tabs['template']) {
    $tabs['entries'] = array();
    $tabs['tmpl_entry'] = get_tmpl_section('TABS_ENTRY', $tabs['template']);
    $tabs['template'] = get_tmpl_section('TABS', $tabs['template']);
    foreach ($tabs['tabs'] as $key => $entry) {
        $tabs['entries'][$key] = render_cnt_template($tabs['tmpl_entry'], 'TABTITLE', $entry['tabtitle'] == '-' ? '' : html_specialchars($entry['tabtitle']));
        $tabs['entries'][$key] = render_cnt_template($tabs['entries'][$key], 'TABCONTENT', trim($entry['tabheadline'] . $entry['tabtext']) == '' ? '' : LF);
        $tabs['entries'][$key] = render_cnt_template($tabs['entries'][$key], 'TABHEADLINE', html_specialchars($entry['tabheadline']));
        $tabs['entries'][$key] = render_cnt_template($tabs['entries'][$key], 'TABTEXT', $entry['tabtext']);
        if (empty($entry['tablink'])) {
            $tabs['entries'][$key] = render_cnt_template($tabs['entries'][$key], 'TABLINK', '');
        } else {
            $entry['tablink'] = get_redirect_link($entry['tablink'], ' ', '');
            $tabs['entries'][$key] = render_cnt_template($tabs['entries'][$key], 'TABLINK', $entry['tablink']['link']);
            $tabs['entries'][$key] = str_replace('{TARGET}', $entry['tablink']['target'], $tabs['entries'][$key]);
        }
    }
    $tabs['template'] = render_cnt_template($tabs['template'], 'TITLE', html_specialchars($crow['acontent_title']));
    $tabs['template'] = render_cnt_template($tabs['template'], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
    $tabs['template'] = render_cnt_template($tabs['template'], 'TABS_ENTRIES', count($tabs['entries']) ? implode('', $tabs['entries']) : '');
    $CNT_TMP .= str_replace('{ID}', $crow['acontent_id'], $tabs['template']);
} else {
    $CNT_TMP .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
    $CNT_TMP .= LF . $crow["acontent_html"];
}
unset($tabs);
Example #8
0
        $map["location"] = '';
        $map['loc']['map_zip'] = trim($map['loc']['map_zip'] . ' ' . $map['loc']['map_city']);
        if ($map['loc']['map_zip']) {
            $map["location"] .= '<strong>' . html_specialchars($map['loc']['map_zip']) . "</strong>\n";
        }
        if ($map['loc']['map_entry']) {
            $map["location"] .= $map['loc']['map_entry'];
            //html_specialchars($map['loc']['map_entry'])
        }
        $map["location"] = trim($map["location"]);
        if ($map["location"]) {
            $CNT_TMP .= nl2br(div_class($map["location"], $template_default["article"]["text_class"]));
        }
    }
} else {
    if ($map['loc']) {
        // build location entry
        $map['tmpl_location'] = render_cnt_template($map['tmpl_location'], 'TITLE', html_specialchars($map['loc']['map_title']));
        $map['tmpl_location'] = render_cnt_template($map['tmpl_location'], 'ZIP', html_specialchars($map['loc']['map_zip']));
        $map['tmpl_location'] = render_cnt_template($map['tmpl_location'], 'CITY', html_specialchars($map['loc']['map_city']));
        $map['tmpl_location'] = render_cnt_template($map['tmpl_location'], 'ENTRY', $map['loc']['map_entry']);
    } else {
        $map['tmpl_location'] = '';
    }
    $map['tmpl_content'] = render_cnt_template($map['tmpl_content'], 'MAP', $map['map_img']);
    $map['tmpl_content'] = render_cnt_template($map['tmpl_content'], 'TEXT', nl2br(html_specialchars($map['text'])));
    $map['tmpl_content'] = render_cnt_template($map['tmpl_content'], 'LOCATION', $map['tmpl_location']);
    $CNT_TMP .= $map['tmpl_content'];
}
// delete map array
unset($map);
Example #9
0
/**
 * Return menu or menu elements based on article menu title information
 * starting at given structure level ID, limited to single level (non-nested)
 *
 * @return mixed (array/string)
 * @param array
 **/
function getArticleMenu($data = array())
{
    global $content;
    global $aktion;
    $defaults = array('level_id' => 0, 'class_active' => array(0 => 'active', 1 => ''), 'wrap_title_prefix' => '', 'wrap_title_suffix' => '', 'item_prefix' => "\t", 'item_suffix' => '', 'sort' => 'level', 'item_tag' => 'li', 'wrap_tag' => 'ul', 'attribute_wrap_tag' => '', 'class_item_tag' => '', 'class_first_item_tag' => '', 'class_last_item_tag' => '', 'return_format' => 'string', 'articlemenu_options' => array('enable' => false, 'image' => false, 'text' => false, 'width' => 0, 'height' => 0, 'crop' => 0, 'textlength' => 0, 'position' => 'inside', 'template' => '<span class="amenu-extended">[IMAGE]<img src="{IMAGE}" alt="{IMAGE_NAME}" />[/IMAGE][TEXT]<span class="p">{TEXT}</span>[/TEXT]</span>'));
    $data = is_array($data) && count($data) ? array_merge($defaults, $data) : $defaults;
    $li = array();
    $articles = get_actcat_articles_data($data['level_id']);
    $key = 0;
    $total = count($articles) - 1;
    foreach ($articles as $item) {
        $class = '';
        $class_a = '';
        if ($data['class_item_tag']) {
            $class .= $data['class_item_tag'] . ' ';
        }
        if ($key === 0 && $data['class_first_item_tag']) {
            $class .= $data['class_first_item_tag'] . ' ';
        } elseif ($key === $total && $data['class_last_item_tag']) {
            $class .= $data['class_last_item_tag'] . ' ';
        }
        if ($item['article_id'] == $aktion[1]) {
            if (!empty($data['class_active'][0])) {
                $class .= $data['class_active'][0] . ' ';
            }
            if (!empty($data['class_active'][1])) {
                $class_a = ' class="' . $data['class_active'][1] . '"';
                // set active link class
            }
        }
        $class = trim($class);
        $item['outside'] = '';
        $item['inside'] = '';
        if ($data['articlemenu_options']['enable']) {
            $item['img_src'] = '';
            $item['img_name'] = '';
            $item['amenu_text'] = '';
            if ($data['articlemenu_options']['image'] && (!empty($item['article_image']['list_id']) || !empty($item['article_image']['id']))) {
                if (!empty($item['article_image']['list_usesummary']) && !empty($item['article_image']['id'])) {
                    $item['img_src'] = $item['article_image']['hash'] . '.' . $item['article_image']['ext'];
                    $item['img_name'] = html($item['article_image']['name']);
                } elseif (!empty($item['article_image']['list_id'])) {
                    $item['img_src'] = $item['article_image']['list_hash'] . '.' . $item['article_image']['list_ext'];
                    $item['img_name'] = html($item['article_image']['list_name']);
                }
                if ($item['img_src']) {
                    $item['img_src'] = 'x' . $data['articlemenu_options']['height'] . 'x' . $data['articlemenu_options']['crop'] . '/' . $item['img_src'];
                    $item['img_src'] = 'img/cmsimage.php/' . $data['articlemenu_options']['width'] . $item['img_src'];
                }
            }
            if ($data['articlemenu_options']['text']) {
                switch ($data['articlemenu_options']['text']) {
                    case 'description':
                        $item['amenu_text'] = html(getCleanSubString($item['article_description'], abs($data['articlemenu_options']['textlength']), $GLOBALS['template_default']['ellipse_sign'], $data['articlemenu_options']['textlength'] < 0 ? 'char' : 'word'));
                        break;
                    case 'menutitle':
                        $item['amenu_text'] = html(getCleanSubString($item['article_menutitle'], abs($data['articlemenu_options']['textlength']), $GLOBALS['template_default']['ellipse_sign'], $data['articlemenu_options']['textlength'] < 0 ? 'char' : 'word'));
                        break;
                    case 'teaser':
                        if ($data['articlemenu_options']['textlength'] === 'HTML') {
                            $item['amenu_text'] = $item['article_summary'];
                        } else {
                            $item['amenu_text'] = trim(strip_tags($item['article_summary']));
                            $item['amenu_text'] = getCleanSubString($item['amenu_text'], abs($data['articlemenu_options']['textlength']), $GLOBALS['template_default']['ellipse_sign'], $data['articlemenu_options']['textlength'] < 0 ? 'char' : 'word');
                        }
                        break;
                }
            }
            $item[$data['articlemenu_options']['position']] = $data['articlemenu_options']['template'];
            $item[$data['articlemenu_options']['position']] = str_replace('{IMAGE_NAME}', $item['img_name'], $item[$data['articlemenu_options']['position']]);
            $item[$data['articlemenu_options']['position']] = render_cnt_template($item[$data['articlemenu_options']['position']], 'IMAGE', $item['img_src']);
            $item[$data['articlemenu_options']['position']] = render_cnt_template($item[$data['articlemenu_options']['position']], 'TEXT', $item['amenu_text']);
        }
        $li[$key] = $data['item_prefix'] . '<' . $data['item_tag'] . ($class != '' ? ' class="' . $class . '"' : '') . '>';
        $li[$key] .= '<a href="' . rel_url(array(), array('newsdetail'), setGetArticleAid($item)) . '"' . $class_a . '>';
        $li[$key] .= $data['wrap_title_prefix'];
        $li[$key] .= html(getArticleMenuTitle($item));
        $li[$key] .= $data['wrap_title_suffix'];
        $li[$key] .= $item['inside'];
        $li[$key] .= '</a>';
        $li[$key] .= $item['outside'];
        $li[$key] .= '</' . $data['item_tag'] . '>' . $data['item_suffix'];
        $key++;
    }
    if ($data['wrap_tag'] && count($li)) {
        array_unshift($li, '<' . trim($data['wrap_tag'] . ' ' . trim($data['attribute_wrap_tag'])) . '>');
        array_push($li, '</' . $data['wrap_tag'] . '>');
    }
    return $data['return_format'] == 'string' ? implode(LF, $li) : $li;
}
            if ($image['col'] == $col || $image['count'] == $total) {
                $img_a = render_cnt_template($img_a, 'LAST', $col);
                $xx = $x;
                $x++;
                $col = 0;
            } else {
                $img_a = render_cnt_template($img_a, 'LAST', '');
                $xx = $x;
            }
            // Get the entry data
            $image['tmpl_data'][] = get_tmpl_section('ENTRY_DATA', $img_a);
            $img_a = replace_tmpl_section('ENTRY_DATA', $img_a, '');
            $image['tmpl_images'][$xx] .= $img_a;
        }
        $image['template'] .= implode($image['tmpl_row_space'], $image['tmpl_images']);
    }
    $image['template'] .= $image['tmpl_footer'];
    $image['tmpl_data'] = implode('', $image['tmpl_data']);
    // now do main replacements
    $image['template'] = render_cnt_template($image['template'], 'DATA', $image['tmpl_data']);
    $image['template'] = str_replace('{ID}', $crow['acontent_id'], $image['template']);
    $image['template'] = str_replace('{SPACE}', $image['space'], $image['template']);
    $image['template'] = str_replace('{THUMB_WIDTH_MAX}', $image['tmpl_thumb_width_max'], $image['template']);
    $image['template'] = str_replace('{THUMB_HEIGHT_MAX}', $image['tmpl_thumb_height_max'], $image['template']);
    $image['template'] = str_replace('{THUMB_COLUMNS}', $image['col'], $image['template']);
    $image['template'] = render_cnt_template($image['template'], 'TITLE', html_specialchars($crow['acontent_title']));
    $image['template'] = render_cnt_template($image['template'], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
    $image['template'] = render_cnt_template($image['template'], 'TEXT', $crow['acontent_text']);
    $CNT_TMP .= $image['template'];
}
unset($image);
 *
 * @author Oliver Georgi <*****@*****.**>
 * @copyright Copyright (c) 2002-2015, Oliver Georgi
 * @license http://opensource.org/licenses/GPL-2.0 GNU GPL-2
 * @link http://www.phpwcms.de
 *
 **/
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
    die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
//code
// read template
if (empty($crow["acontent_template"]) && is_file(PHPWCMS_TEMPLATE . 'inc_default/code.tmpl')) {
    $crow["acontent_template"] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_default/code.tmpl'));
} elseif (is_file(PHPWCMS_TEMPLATE . 'inc_cntpart/code/' . $crow["acontent_template"])) {
    $crow["acontent_template"] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_cntpart/code/' . $crow["acontent_template"]));
} else {
    $crow["acontent_template"] = '[TITLE]<h3>{TITLE}</h3>[/TITLE][SUBTITLE]<h4>{SUBTITLE}</h4>[/SUBTITLE][CODE]<pre>{CODE}</pre>[/CODE]';
}
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'TITLE', html_specialchars($crow['acontent_title']));
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
if (strpos($crow["acontent_template"], '<pre') !== false) {
    $crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'CODE', html_specialchars($crow["acontent_text"]));
} else {
    $crow["acontent_text"] = str_replace(array(' ', "\t"), array('&nbsp;', '&nbsp;&nbsp;&nbsp;&nbsp;'), html_specialchars($crow["acontent_text"]));
    $crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'CODE', nl2br($crow["acontent_text"]));
}
$CNT_TMP .= $crow["acontent_template"];
Example #12
0
<?php

if (strpos($content['all'], '[LOGGED_IN')) {
    $content['all'] = render_cnt_template($content['all'], 'LOGGED_IN', _getFeUserLoginStatus() ? '<!-- //-->' : '');
}
Example #13
0
<?php

/**
 * phpwcms content management system
 *
 * @author Oliver Georgi <*****@*****.**>
 * @copyright Copyright (c) 2002-2015, Oliver Georgi
 * @license http://opensource.org/licenses/GPL-2.0 GNU GPL-2
 * @link http://www.phpwcms.de
 *
 **/
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
    die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
//HTML
// read template
if (empty($crow["acontent_template"]) && is_file(PHPWCMS_TEMPLATE . 'inc_default/html.tmpl')) {
    $crow["acontent_template"] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_default/html.tmpl'));
} elseif (is_file(PHPWCMS_TEMPLATE . 'inc_cntpart/html/' . $crow["acontent_template"])) {
    $crow["acontent_template"] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_cntpart/html/' . $crow["acontent_template"]));
} else {
    $crow["acontent_template"] = '[TITLE]<h3>{TITLE}</h3>' . LF . '[/TITLE][SUBTITLE]<h4>{SUBTITLE}</h4>' . LF . '[/SUBTITLE][HTML]{HTML}[/HTML]';
}
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'TITLE', html_specialchars($crow['acontent_title']));
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'HTML', $crow['acontent_html']);
$CNT_TMP .= LF . $crow["acontent_template"] . LF;
Example #14
0
        $ACCESS['error'] = true;
    } else {
        setcookie('phpwcmsAgree', '1', 0, '/');
        $_SESSION['phpwcmsAgree'] = true;
    }
}
if (!empty($_SESSION['phpwcmsAgree']) || isset($_COOKIE['phpwcmsAgree']) && $_COOKIE['phpwcmsAgree'] == 1) {
    $content['all'] = str_replace($ACCESS['prefix'], '', $content['all']);
    $content['all'] = str_replace($ACCESS['suffix'], '', $content['all']);
} elseif (strpos($content['all'], $ACCESS['prefix']) !== FALSE && strpos($content['all'], $ACCESS['suffix']) !== FALSE) {
    $block['custom_htmlhead']['mootools.js'] = '  <script src="' . TEMPLATE_PATH . 'lib/mootools/mootools-1.1-yc.js" type="text/javascript"></script>';
    $block['custom_htmlhead']['access.js'] = '  <script src="' . TEMPLATE_PATH . 'inc_script/access/access.js" type="text/javascript"></script>';
    $block['custom_htmlhead']['set_vars'] = '  <script type="text/javascript">' . LF . '  <!--' . LF;
    $block['custom_htmlhead']['set_vars'] .= '  var redirect="' . $redirect . '";' . LF;
    $block['custom_htmlhead']['set_vars'] .= '  var erroralert="' . $ACCESS['error_js'] . '";';
    $block['custom_htmlhead']['set_vars'] .= LF . '  //-->' . LF . '  </script>';
    $block['custom_htmlhead']['access.css'] = '  <link rel="stylesheet" type="text/css" href="' . TEMPLATE_PATH . 'inc_script/access/access.css" />';
    $ACCESS['source_data'] = @file_get_contents(PHPWCMS_TEMPLATE . 'inc_script/access/' . $ACCESS['source_data']);
    if ($ACCESS['source_data']) {
        $ACCESS['source_data'] = render_cnt_template($ACCESS['source_data'], 'ERROR', $ACCESS['error'] ? '-' : '');
        $ACCESS['source_data'] = str_replace('{CURRENT_URL}', FE_CURRENT_URL, $ACCESS['source_data']);
        $ACCESS['source_data'] = str_replace('{REDIRECT}', html_specialchars($redirect), $ACCESS['source_data']);
        $ACCESS['dialog'] = '<div id="access_dialog">' . LF . $ACCESS['source_data'] . LF . '</div>' . LF;
        $ACCESS['dialog'] .= '<div id="access_save" style="display:none">';
        $content['all'] = str_replace($ACCESS['prefix'], $ACCESS['dialog'], $content['all']);
        $content['all'] = str_replace($ACCESS['suffix'], LF . '</div>', $content['all']);
    }
} else {
    $content['all'] = str_replace($ACCESS['prefix'], '', $content['all']);
    $content['all'] = str_replace($ACCESS['suffix'], '', $content['all']);
}
Example #15
0
        $thumb_img .= ' alt="' . $caption[1] . '"' . $caption[3] . ' />';
        if ($crow["acontent_image"][8]) {
            $zoominfo = get_cached_image(array("target_ext" => $crow["acontent_image"][3], "image_name" => $crow["acontent_image"][2] . '.' . $crow["acontent_image"][3], "max_width" => $phpwcms["img_prev_width"], "max_height" => $phpwcms["img_prev_height"], "thumb_name" => md5($crow["acontent_image"][2] . $phpwcms["img_prev_width"] . $phpwcms["img_prev_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
            if ($zoominfo != false) {
                $popup_img = 'image_zoom.php?' . getClickZoomImageParameter($zoominfo[0] . '?' . $zoominfo[3]);
                if (!empty($caption[2][0])) {
                    $open_link = $caption[2][0];
                    $return_false = '';
                } else {
                    $open_link = $popup_img;
                    $return_false = 'return false;';
                }
                $thumb_img = '<a href="' . $popup_img . '" onclick="window.open(\'' . $open_link . "','previewpic','width=" . $zoominfo[1] . ",height=" . $zoominfo[2] . "');" . $return_false . '"' . $caption[2][1] . '>' . $thumb_img . '</a>';
            }
        } else {
            if ($caption[2][0]) {
                $thumb_img = '<a href="' . $caption[2][0] . '"' . $caption[2][1] . '>' . $thumb_img . '</a>';
            }
        }
    }
}
// now render whole recipe
$crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'TITLE', html_specialchars($crow['acontent_title']));
$crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
$crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'FAQ_QUESTION', html_specialchars($crow["acontent_text"]));
$crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'FAQ_ANSWER', $crow["acontent_html"]);
$crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'FAQ_IMAGE', $thumb_img);
$crow["acontent_form"]['faq_template'] = render_cnt_template($crow["acontent_form"]['faq_template'], 'FAQ_CAPTION', $caption[0]);
$crow["acontent_form"]['faq_template'] = str_replace('{FAQ_ID}', $crow['acontent_id'], $crow["acontent_form"]['faq_template']);
$CNT_TMP .= $crow["acontent_form"]['faq_template'];
unset($image, $caption);
Example #16
0
        $order_process = preg_replace('/\\[DELETE\\](.*?)\\[\\/DELETE\\]/s', $_cart_button, $order_process);
        include $phpwcms['modules']['shop']['path'] . 'inc/shipping.parse.inc.php';
        $order_process = '<form action="' . rel_url(array('shop_cart' => 'show'), array('shop_detail'), $_tmpl['config']['cart_url']) . '" class="' . $_tmpl['config']['class_form_cart'] . '" method="post">' . LF . trim($order_process) . LF . '</form>';
    }
    $order_process = str_replace('{SHOP_LINK}', rel_url(array(), array('shop_cart', 'shop_detail'), $_tmpl['config']['shop_url']), $order_process);
    $content['all'] = str_replace('{SHOP_ORDER_PROCESS}', $_tmpl['config']['shop_wrap']['prefix'] . $order_process . $_tmpl['config']['shop_wrap']['suffix'], $content['all']);
}
// small cart
if ($_shop_load_cart_small !== false) {
    if (empty($_SESSION[CART_KEY]['total']) || !is_array($_SESSION[CART_KEY]['total']) || ($_cart_count = array_sum($_SESSION[CART_KEY]['total'])) === 0) {
        $_cart_count = '';
    }
    if (strpos($_tmpl['cart_small'], '{CART_LINK}')) {
        $shop_cat_selected = isset($GLOBALS['_getVar']['shop_cat']) ? $GLOBALS['_getVar']['shop_cat'] : 0;
        $shop_detail_id = isset($GLOBALS['_getVar']['shop_detail']) ? intval($GLOBALS['_getVar']['shop_detail']) : 0;
        unset($GLOBALS['_getVar']['shop_cat'], $GLOBALS['_getVar']['shop_detail']);
        $_tmpl['cart_small'] = str_replace('{CART_LINK}', rel_url(array('shop_cart' => 'show'), array(), $_tmpl['config']['cart_url']), $_tmpl['cart_small']);
        if ($shop_cat_selected) {
            $GLOBALS['_getVar']['shop_cat'] = $shop_cat_selected;
        }
        if ($shop_detail_id) {
            $GLOBALS['_getVar']['shop_detail'] = $shop_detail_id;
        }
    }
    $_tmpl['cart_small'] = render_cnt_template($_tmpl['cart_small'], 'COUNT', $_cart_count);
    $content['all'] = str_replace('{CART_SMALL}', $_tmpl['cart_small'], $content['all']);
}
// global shop replacer, faster doing this only once
if ($_shop_parsed) {
    $content['all'] = str_replace(array('{CURRENCY_SYMBOL}', '{$}'), html($_shopPref['shop_pref_currency']), $content['all']);
}
 function listGalleryImages($folder, $sort = NULL)
 {
     if ($sort !== NULL) {
         $temp_sort = $this->image_sort;
         $this->image_sort = $sort;
     }
     $this->getImages($folder);
     if ($sort !== NULL) {
         $this->image_sort = $temp_sort;
     }
     $images = array();
     $lang = $GLOBALS['phpwcms']['default_lang'];
     foreach ($this->images as $image) {
         if ($image['f_vars'] && count($GLOBALS['phpwcms']['allowed_lang']) > 1) {
             $image['f_vars'] = @unserialize($image['f_vars']);
             if (!empty($image['f_vars'][$lang]['longinfo'])) {
                 $image['f_longinfo'] = $image['f_vars'][$lang]['longinfo'];
             }
             if (!empty($image['f_vars'][$lang]['copyright'])) {
                 $image['f_copyright'] = $image['f_vars'][$lang]['copyright'];
             }
             $image['f_vars'] = '';
         }
         $name = html($image['f_name']);
         $image['f_longinfo'] = trim($image['f_longinfo']);
         $img = '<img src="';
         $img .= $this->image_src . $this->thumb_width . 'x' . $this->thumb_height;
         if ($this->detail_thumbnail_crop == 1) {
             $img .= 'x1';
         }
         $img .= '/' . $image['f_hash'] . '.' . $image['f_ext'];
         $img .= '" alt="' . $name . '" border="0" />';
         // create zoom
         if ($this->zoom === true || $this->lightbox === true) {
             $a = '<a href="' . $this->image_src . $this->width . 'x' . $this->height;
             if ($this->detail_zoom_crop == 1) {
                 $a .= 'x1';
             }
             $a .= '/' . $image['f_hash'] . '.' . $image['f_ext'] . '" target="_blank"';
             if ($this->lightbox === true) {
                 $a .= ' rel="lightbox[gallery' . $folder . ']"';
             }
             if ($image['f_longinfo'] != '') {
                 $a .= ' title="' . parseLightboxCaption($image['f_longinfo']) . '"';
             }
             $a .= '>';
             $img = $a . $img . '</a>';
         }
         if ($this->detail_thumbnail_caption === true && $image['f_longinfo'] != '') {
             $img .= $this->line_break;
             $img .= $this->detail_caption_prefix . plaintext_htmlencode($image['f_longinfo']) . $this->detail_caption_suffix;
         }
         $img = $this->detail_thumbnail_prefix . $img . $this->detail_thumbnail_suffix;
         // prepare item download
         if ($this->download) {
             if (!isset($phpwcms)) {
                 global $phpwcms;
             }
             $IS_NEWS_CP = true;
             $crow = array();
             $value = array();
             $value['cnt_object'] = array();
             $value['cnt_object']['cnt_files'] = array('id' => array($image['f_id']), 'caption' => $image['f_copyright']);
             $value['files_direct_download'] = $this->download_direct ? 1 : 0;
             $value['files_template'] = $this->item_download_template == 'default' ? '' : $this->item_download_template;
             $news = array('files_result' => '');
             $content = array();
             $content['file_static_result'][0] = $image;
             // include content part files renderer
             include PHPWCMS_ROOT . '/include/inc_front/content/cnt7.article.inc.php';
             $img = render_cnt_template($img, 'DOWNLOAD', $news['files_result']);
             unset($IS_NEWS_CP);
         } else {
             $img = render_cnt_template($img, 'DOWNLOAD', '');
         }
         $images[] = $img;
     }
     if ($this->lightbox === true) {
         initSlimbox();
     }
     return implode($this->line_break, $images);
 }
Example #18
0
            $media["result"] .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
            $media["result"] .= "<div align=\"center\">" . $media["code"] . "</div>";
            break;
        case 2:
            $media["result"] .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
            $media["result"] .= "<div align=\"right\">" . $media["code"] . "</div>";
            break;
        case 3:
            $media["result"] .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\">\n";
            $media["result"] .= "<tr><td colspan=\"2\">" . spacer(1, 3) . "</td></tr>\n";
            $media["result"] .= $crow["acontent_title"] ? "<tr><td class=\"tableHead\">" . html_specialchars($crow["acontent_title"]) . "</td><td>" . spacer(5, 1) . "</td></tr>\n<tr><td colspan=\"2\">" . spacer(1, 3) . "</td></tr>\n" : "";
            $media["result"] .= $crow["acontent_subtitle"] ? "<tr><td class=\"tableSubHead\">" . html_specialchars($crow["acontent_subtitle"]) . "</td><td>" . spacer(5, 1) . "</td></tr>\n<tr><td colspan=\"2\">" . spacer(1, 3) . "</td></tr>\n" : "";
            $media["result"] .= "<tr><td>" . $media["code"] . "</td><td>" . spacer(5, 1) . "</td></tr>\n";
            $media["result"] .= "<tr><td colspan=\"2\">" . spacer(1, 3) . "</td></tr>\n";
            $media["result"] .= "</table>\n";
            break;
        case 4:
            $media["result"] .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"right\">\n";
            $media["result"] .= "<tr><td colspan=\"2\">" . spacer(1, 3) . "</td></tr>\n";
            $media["result"] .= $crow["acontent_title"] ? "<tr><td>" . spacer(5, 1) . "</td><td class=\"tableHead\">" . html_specialchars($crow["acontent_title"]) . "</td></tr>\n<tr><td colspan=\"2\">" . spacer(1, 3) . "</td></tr>\n" : "";
            $media["result"] .= $crow["acontent_subtitle"] ? "<tr><td>" . spacer(5, 1) . "</td><td class=\"tableSubHead\">" . html_specialchars($crow["acontent_subtitle"]) . "</td></tr>\n<tr><td colspan=\"2\">" . spacer(1, 3) . "</td></tr>\n" : "";
            $media["result"] .= "<tr><td>" . spacer(5, 1) . "</td><td>" . $media["code"] . "</td></tr>\n";
            $media["result"] .= "<tr><td colspan=\"2\">" . spacer(1, 3) . "</td></tr>\n";
            $media["result"] .= "</table>\n";
            break;
    }
} else {
    $media["result"] = headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
}
$CNT_TMP .= LF . trim(render_cnt_template($crow["acontent_template"], 'MULTIMEDIA', trim($media["result"]))) . LF;
unset($media);
                 $thumb_image = get_cached_image(array("target_ext" => which_ext($guestbook['row']['guestbook_image']), "image_name" => $guestbook['row']['guestbook_image'], "image_dir" => $guestbook['image_dir'] . '/', "max_width" => $guestbook['imgdata'][0], "max_height" => $guestbook['imgdata'][1], "thumb_name" => md5($guestbook['row']['guestbook_image'] . $guestbook['imgdata'][0] . $guestbook['imgdata'][1] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
                 if ($thumb_image != false) {
                     $guestbook['entry_image'] = '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" ' . $thumb_image[3];
                     $guestbook['entry_image'] .= ' alt="' . html_specialchars($guestbook['row']['guestbook_imagename']) . '" />';
                     //zoom
                     if ($guestbook['imgdata'][2]) {
                         $zoominfo = get_cached_image(array("target_ext" => which_ext($guestbook['row']['guestbook_image']), "image_name" => $guestbook['row']['guestbook_image'], "image_dir" => $guestbook['image_dir'] . '/', "max_width" => $phpwcms["img_prev_width"], "max_height" => $phpwcms["img_prev_height"], "thumb_name" => md5($guestbook['row']['guestbook_image'] . $phpwcms["img_prev_width"] . $phpwcms["img_prev_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
                         if ($zoominfo != false) {
                             $popup_img = 'image_zoom.php?' . getClickZoomImageParameter($zoominfo[0] . '?' . $zoominfo[3]);
                             $guestbook['entry_image'] = '<a href="' . $popup_img . '" onclick="window.open(\'' . $popup_img . "','previewpic','width=" . $zoominfo[1] . ",height=" . $zoominfo[2] . "');return false;" . '">' . $guestbook['entry_image'] . '</a>';
                         }
                     }
                 }
             }
         }
         $guestbook['c'] = render_cnt_template($guestbook['c'], 'IMAGE', $guestbook['entry_image']);
         $guestbook['entry_list'] .= $guestbook['c'];
         $guestbook['counter']++;
     }
     mysql_free_result($guestbook['result']);
     // initialize lightbox
     if ($thumb_image != false) {
         initSlimbox();
     }
     // comments
     $guestbook['entry_list'] = preg_replace('/\\[c\\](.*?)\\[\\/c\\]/is', $guestbook['comment'][0] . "\$1" . $guestbook['comment'][1], $guestbook['entry_list']);
 }
 $guestbook['list'] = str_replace('{NAV}', $guestbook['nav'], $guestbook['list']);
 $guestbook['list'] = str_replace('{FORM}', $guestbook['form'], $guestbook['list']);
 $guestbook['list'] = replace_tmpl_section('GUESTBOOK_ENTRY', $guestbook['list'], $guestbook['entry_list']);
 $CNT_TMP .= $guestbook['list'];
Example #20
0
<?php

/**
 * phpwcms content management system
 *
 * @author Oliver Georgi <*****@*****.**>
 * @copyright Copyright (c) 2002-2015, Oliver Georgi
 * @license http://opensource.org/licenses/GPL-2.0 GNU GPL-2
 * @link http://www.phpwcms.de
 *
 **/
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
    die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
// WYSIWYG
// read template
if (empty($crow["acontent_template"]) && is_file(PHPWCMS_TEMPLATE . 'inc_default/wysiwyg.tmpl')) {
    $crow["acontent_template"] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_default/wysiwyg.tmpl'));
} elseif (is_file(PHPWCMS_TEMPLATE . 'inc_cntpart/wysiwyg/' . $crow["acontent_template"])) {
    $crow["acontent_template"] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_cntpart/wysiwyg/' . $crow["acontent_template"]));
} else {
    $crow["acontent_template"] = '[TITLE]<h3>{TITLE}</h3>' . LF . '[/TITLE][SUBTITLE]<h4>{SUBTITLE}</h4>' . LF . '[/SUBTITLE][TEXT]{TEXT}[/TEXT]';
}
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'TITLE', html_specialchars($crow['acontent_title']));
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
$CNT_TMP .= render_cnt_template($crow["acontent_template"], 'TEXT', $crow['acontent_html']);
Example #21
0
     // replace tags in email form
     $cnt_form['template'] = str_replace('{' . $POST_key . '}', $POST_keyval, $cnt_form['template']);
     // replace tags in the success form
     if ($cnt_form["onsuccess_redirect"] === 1) {
         $cnt_form["onsuccess"] = str_replace('{' . $POST_key . '}', rawurlencode($POST_keyval), $cnt_form["onsuccess"]);
     } else {
         $cnt_form["onsuccess"] = str_replace('{' . $POST_key . '}', !$cnt_form['is_html_entity'] && $cnt_form["onsuccess_redirect"] === 2 ? html_specialchars($POST_keyval) : $POST_keyval, $cnt_form["onsuccess"]);
     }
 }
 $phpwcms['callback'] = now();
 $cnt_form["onsuccess"] = str_replace('{REMOTE_IP}', getRemoteIP(), $cnt_form["onsuccess"]);
 if (strpos($cnt_form["onsuccess"], 'EMAIL_COPY') !== false) {
     if ($cnt_form["onsuccess_redirect"] === 1) {
         $cnt_form["onsuccess"] = render_cnt_template($cnt_form["onsuccess"], 'EMAIL_COPY', empty($cnt_form['sendcopy']) || $cnt_form['option_email_copy'] === false ? '' : rawurlencode($cnt_form["copyto"]));
     } else {
         $cnt_form["onsuccess"] = render_cnt_template($cnt_form["onsuccess"], 'EMAIL_COPY', empty($cnt_form['sendcopy']) || $cnt_form['option_email_copy'] === false ? '' : html_specialchars($cnt_form["copyto"]));
     }
 }
 $cnt_form['onsuccess'] = preg_replace('/\\{(.*?)\\}/', '', $cnt_form['onsuccess']);
 $cnt_form['fe_current_url'] = abs_url(array(), array(), '', 'rawurlencode');
 $cnt_form['template'] = str_replace('{FORM_URL}', $cnt_form['fe_current_url'], $cnt_form['template']);
 $cnt_form['template'] = str_replace('{REMOTE_IP}', getRemoteIP(), $cnt_form['template']);
 $cnt_form['template'] = preg_replace_callback('/\\{DATE:(.*?)\\}/', 'date_callback', $cnt_form['template']);
 if (!$cnt_form['template_equal']) {
     $cnt_form['template_copy'] = str_replace('{FORM_URL}', $cnt_form['fe_current_url'], $cnt_form['template_copy']);
     $cnt_form['template_copy'] = str_replace('{REMOTE_IP}', getRemoteIP(), $cnt_form['template_copy']);
     $cnt_form['template_copy'] = preg_replace_callback('/\\{DATE:(.*?)\\}/', 'date_callback', $cnt_form['template_copy']);
     $cnt_form['template_copy'] = preg_replace('/\\{(.*?)\\}/', '', $cnt_form['template_copy']);
 }
 $cnt_form['template'] = preg_replace('/\\{(.*?)\\}/', '', $cnt_form['template']);
 // check if "copy to" email template is equal recipient
    if (count($crow["acontent_form"]['temp'])) {
        foreach ($crow["acontent_form"]['temp'] as $temp_val) {
            if (isset($temp_val['h'])) {
                //alternative headline
                $crow["acontent_form"]['ingredients'] .= '<h5>' . $temp_val['h'] . '</h5>' . LF;
                $crow["acontent_form"]['i_table'] .= '<h5>' . $temp_val['h'] . '</h5>' . LF;
            }
            if (isset($temp_val['li'])) {
                $crow["acontent_form"]['ingredients'] .= '<ul>' . LF . implode(LF, $temp_val['li']) . LF . '</ul>' . LF;
                $crow["acontent_form"]['i_table'] .= '<table cellpadding="0" cellspacing="0" border="0">' . LF . implode(LF, $temp_val['tr']) . LF . '</table>' . LF;
            }
        }
    }
} else {
    $crow["acontent_form"]['ingredients'] = '';
    $crow["acontent_form"]['i_table'] = '';
}
// now render whole recipe
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'TITLE', html_specialchars($crow['acontent_title']));
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'INGREDIENTS', $crow["acontent_form"]['ingredients']);
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'INGREDIENTSTABLE', $crow["acontent_form"]['i_table']);
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'CALORIES', $crow["acontent_form"]['calorificvalue']);
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'KCAL', $crow["acontent_form"]['kcal']);
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'CALORIESADD', html_specialchars($crow["acontent_form"]['calorificvalue_add']));
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'PREPARATION', $crow["acontent_form"]['preparation']);
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'TIME', html_specialchars($crow["acontent_form"]['time']));
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'TIMEADD', html_specialchars($crow["acontent_form"]['time_add']));
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'SEVERITY', $crow["acontent_form"]['severity']);
$crow["acontent_form"]['template'] = render_cnt_template($crow["acontent_form"]['template'], 'CAT', html_specialchars($crow["acontent_form"]['category']));
$CNT_TMP .= $crow["acontent_form"]['template'];
Example #23
0
        $_filter_link[$_filter_c] .= ' title="' . $_filter_entities . '">';
        $_filter_link[$_filter_c] .= $_filter_entities . '</a>';
        $_filter_c++;
    }
    $_filter_link = implode(' ', $_filter_link);
    $CNT_TMP .= render_cnt_template($content['glossary']['list_head'], 'FILTER', $_filter_link);
    if (!count($content['glossary']['entries'])) {
        $content['glossary']['entries'][0]['glossary_title'] = '';
        $content['glossary']['entries'][0]['glossary_text'] = $content['glossary']['glossary_noentry'];
        $content['glossary']['entries'][0]['glossary_id'] = 0;
        $_no_entry = true;
    } else {
        $_no_entry = false;
    }
    foreach ($content['glossary']['entries'] as $_entry_key => $_entry_value) {
        $content['glossary']['entries'][$_entry_key] = str_replace('{GLOSSARY_ID}', $_entry_value['glossary_id'], $content['glossary']['list_entry']);
        $content['glossary']['entries'][$_entry_key] = str_replace('{LINK}', $_no_entry ? '#' : rel_url(array('glossaryid' => $_entry_value['glossary_id'], 'glossarytitle' => $_entry_value['glossary_title'])), $content['glossary']['entries'][$_entry_key]);
        $content['glossary']['entries'][$_entry_key] = render_cnt_template($content['glossary']['entries'][$_entry_key], 'TITLE', html_specialchars($_entry_value['glossary_title']));
        if (!empty($content['glossary']['glossary_maxwords']) && !$_no_entry) {
            $_entry_value['glossary_text'] = getCleanSubString(strip_tags($_entry_value['glossary_text']), $content['glossary']['glossary_maxwords'], $template_default['ellipse_sign'], 'word');
        }
        $content['glossary']['entries'][$_entry_key] = render_cnt_template($content['glossary']['entries'][$_entry_key], 'TEXT', $_entry_value['glossary_text']);
    }
    $CNT_TMP .= implode($content['glossary']['list_spacer'], $content['glossary']['entries']);
    $CNT_TMP .= render_cnt_template($content['glossary']['list_footer'], 'FILTER', $_filter_link);
    unset($GLOBALS['_getVar']['glossary']);
}
// render content part title/subtitle
$CNT_TMP = render_cnt_template($CNT_TMP, 'CP_TITLE', html_specialchars($crow['acontent_title']));
$CNT_TMP = render_cnt_template($CNT_TMP, 'CP_SUBTITLE', html_specialchars($crow['acontent_subtitle']));
Example #24
0
                $x++;
                $col = 0;
            } else {
                $img_a = render_cnt_template($img_a, 'LAST', '');
                $xx = $x;
            }
            // Get the entry data
            $image['tmpl_data'][] = get_tmpl_section('ENTRY_DATA', $img_a);
            $img_a = replace_tmpl_section('ENTRY_DATA', $img_a, '');
            $image['tmpl_images'][$xx] .= $img_a;
        }
        $image['template'] .= implode($image['tmpl_row_space'], $image['tmpl_images']);
    }
    $image['template'] .= $image['tmpl_footer'];
    $image['tmpl_data'] = implode('', $image['tmpl_data']);
    // now do main replacements
    $image['template'] = render_cnt_template($image['template'], 'DATA', $image['tmpl_data']);
    $image['template'] = str_replace('{ID}', $crow['acontent_id'], $image['template']);
    $image['template'] = str_replace('{SPACE}', $image['space'], $image['template']);
    $image['template'] = str_replace('{THUMB_WIDTH_MAX}', $image['tmpl_thumb_width_max'], $image['template']);
    $image['template'] = str_replace('{THUMB_HEIGHT_MAX}', $image['tmpl_thumb_height_max'], $image['template']);
    $image['template'] = str_replace('{THUMB_COLUMNS}', $image['col'], $image['template']);
    $image['template'] = render_cnt_template($image['template'], 'TITLE', html_specialchars($crow['acontent_title']));
    $image['template'] = render_cnt_template($image['template'], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
    $image['template'] = render_cnt_template($image['template'], 'TEXT', $crow['acontent_html']);
    $image['template'] = render_cnt_template($image['template'], 'EFFECT_1', $image['fx1'] ? '<!-- FX 1 -->' : '');
    $image['template'] = render_cnt_template($image['template'], 'EFFECT_2', $image['fx2'] ? '<!-- FX 2 -->' : '');
    $image['template'] = render_cnt_template($image['template'], 'EFFECT_3', $image['fx3'] ? '<!-- FX 3 -->' : '');
    $CNT_TMP .= $image['template'];
}
unset($image);
Example #25
0
        $crow['template']['form'] .= "</tr></table></form></div>";
    } else {
        $crow['template']['result'] = render_cnt_template($crow['template']['result'], 'SEARCH_INPUT_LABEL', $content["search"]["label_input"]);
        $crow['template']['result'] = str_replace(array('{SEARCH_INPUT}', '{SEARCH_ACTION}', '{SEARCH_BUTTON}', '{SEARCH_VALUE}'), array('search_input_field', rel_url(), $content["search"]["label_button"], $content["search_word"]), $crow['template']['result']);
    }
}
$crow['template']['result'] = render_cnt_template($crow['template']['result'], 'TITLE', html($crow["acontent_title"]));
$crow['template']['result'] = render_cnt_template($crow['template']['result'], 'SUBTITLE', html($crow["acontent_subtitle"]));
$crow['template']['result'] = render_cnt_template($crow['template']['result'], 'TEXT', $crow['template']['text']);
$crow['template']['result'] = render_cnt_template($crow['template']['result'], 'FORM', $crow['template']['form']);
if (count($s_result_list)) {
    if ($content["search"]["show_top"] && ($_search_max_pages > 1 || $content["search"]["show_always"])) {
        //$s_result_listing .= $crow['template']['pagination'];
        $crow['template']['result'] = render_cnt_template($crow['template']['result'], 'PAGINATE_TOP', $crow['template']['pagination']);
    } else {
        $crow['template']['result'] = render_cnt_template($crow['template']['result'], 'PAGINATE_TOP', '');
    }
    if ($content["search"]["show_bottom"] && ($_search_max_pages > 1 || $content["search"]["show_always"])) {
        //$s_result_listing .= $crow['template']['pagination'];
        $crow['template']['result'] = render_cnt_template($crow['template']['result'], 'PAGINATE_BOTTOM', $crow['template']['pagination']);
    } else {
        $crow['template']['result'] = render_cnt_template($crow['template']['result'], 'PAGINATE_BOTTOM', '');
    }
    $crow['template']['result'] = render_cnt_template($crow['template']['result'], 'RESULTS', implode($crow['template']['item_space'], $s_result_list));
} else {
    $crow['template']['result'] = render_cnt_template($crow['template']['result'], 'RESULTS', '');
    $crow['template']['result'] = render_cnt_template($crow['template']['result'], 'PAGINATE_TOP', '');
    $crow['template']['result'] = render_cnt_template($crow['template']['result'], 'PAGINATE_BOTTOM', '');
}
$CNT_TMP .= $crow['template']['result'];
unset($crow['template']);
                }
                $news['row_count'] = 1;
            } else {
                if ($news['total_count'] < $news['entry_count']) {
                    $news['entries']['entry' . $key] = $news['tmpl_entry_space'];
                }
                $news['row_count']++;
            }
            $news['total_count']++;
        }
    }
    $news['tmpl_news'] = render_cnt_template($news['tmpl_news'], 'NEWS_ENTRIES', implode('', $news['entries']));
    $news['tmpl_news'] = render_cnt_template($news['tmpl_news'], 'TITLE', html_specialchars($crow['acontent_title']));
    $news['tmpl_news'] = render_cnt_template($news['tmpl_news'], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
    // render news pagination
    if ($news['list_mode']) {
        if ($news['news_paginate'] == 1) {
            $news['tmpl_news'] = render_cnt_template($news['tmpl_news'], 'PAGINATE', true);
            $news['tmpl_news'] = render_cnt_template($news['tmpl_news'], 'PAGE_PREV', $news['page_prev']);
            $news['tmpl_news'] = render_cnt_template($news['tmpl_news'], 'PAGE_NEXT', $news['page_next']);
            $news['tmpl_news'] = str_replace('{PAGE_CURRENT}', $news['current_page'], $news['tmpl_news']);
            $news['tmpl_news'] = str_replace('{PAGE_TOTAL}', $news['total_pages'], $news['tmpl_news']);
        } else {
            $news['tmpl_news'] = render_cnt_template($news['tmpl_news'], 'PAGINATE', '');
        }
    } else {
        $news['tmpl_news'] = replace_cnt_template($news['tmpl_news'], 'PAGINATE', '');
        $news['tmpl_news'] = replace_cnt_template($news['tmpl_news'], 'PAGINATE_ELSE', '');
    }
    $CNT_TMP .= $news['tmpl_news'];
}
Example #27
0
                    $content['alink']['tr'][$key] = render_cnt_template($content['alink']['tr'][$key], 'CATEGORY', html_specialchars($content['struct'][$row['article_cid']]['acat_name']));
                    // Image Caption, Alt, Title
                    $content['alink']['tr'][$key] = render_cnt_template($content['alink']['tr'][$key], 'CAPTION', $row['article_image']['list_caption']);
                    $content['alink']['tr'][$key] = render_cnt_template($content['alink']['tr'][$key], 'CAPTION_ALT', $content['alink']['caption'][1]);
                    $content['alink']['tr'][$key] = render_cnt_template($content['alink']['tr'][$key], 'CAPTION_TITLE', $content['alink']['caption'][3]);
                    // article class based on keyword *CSS-classname*
                    $row['article_class'] = get_css_keywords($row['article_keyword']);
                    $row['article_class'] = count($row['article_class']) ? implode(' ', $row['article_class']) : '';
                    $content['alink']['tr'][$key] = render_cnt_template($content['alink']['tr'][$key], 'CLASS', $row['article_class']);
                    break;
                }
            }
        }
    }
    // combine all teaser items
    if (count($content['alink']['tr'])) {
        $content['alink']['tr'] = implode(LF, $content['alink']['tr']);
        $content['alink']['teaser'] = ' ';
    } else {
        $content['alink']['tr'] = '';
        $content['alink']['teaser'] = '';
    }
    // put all template and content into one
    $content['alink']['alink_template'] = LF . $content['alink']['alink_template_head'] . $content['alink']['tr'] . $content['alink']['alink_template_footer'] . LF;
    // render teaser elements - throw everything between [TEASER]...[/TEASER]
    $content['alink'] = render_cnt_template($content['alink']['alink_template'], 'TEASER', $content['alink']['teaser']);
    // render title
    $content['alink'] = render_cnt_template($content['alink'], 'TITLE', html_specialchars($crow['acontent_title']));
    $content['alink'] = render_cnt_template($content['alink'], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
    $CNT_TMP .= $content['alink'];
}
Example #28
0
} else {
    $crow["acontent_template"] = '[TITLE]<h4>{TITLE}</h4>' . LF . '[/TITLE][SUBTITLE]<h5>{SUBTITLE}</h5>' . LF . '[/SUBTITLE][TEXT]<p>{TEXT}</p>[/TEXT]';
}
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'TITLE', html_specialchars($crow['acontent_title']));
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
$crow["acontent_form"] = @unserialize($crow["acontent_form"]);
$crow["acontent_form"] = isset($crow["acontent_form"]['ctext_format']) ? $crow["acontent_form"]['ctext_format'] : 'plain';
switch ($crow["acontent_form"]) {
    case 'markdown':
        // Load ParseDown class
        if (!isset($phpwcms['parsedown_class'])) {
            require_once PHPWCMS_ROOT . '/include/inc_ext/parsedown/Parsedown.php';
            require_once PHPWCMS_ROOT . '/include/inc_ext/parsedown-extra/ParsedownExtra.php';
            $phpwcms['parsedown_class'] = new ParsedownExtra();
        }
        $crow['acontent_text'] = $phpwcms['parsedown_class']->text($crow['acontent_text']);
        break;
    case 'textile':
        // Load Textile function and class
        if (!isset($phpwcms['textile_class'])) {
            require_once PHPWCMS_ROOT . '/include/inc_ext/classTextile.php';
            $phpwcms['textile_class'] = new Textile();
        }
        $crow['acontent_text'] = $phpwcms['textile_class']->TextileThis($crow['acontent_text']);
        break;
    case 'plain':
        $crow['acontent_text'] = plaintext_htmlencode($crow['acontent_text']);
        break;
}
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'TEXT', $crow['acontent_text']);
$CNT_TMP .= LF . trim($crow["acontent_template"]) . LF;
Example #29
0
         $sql_cnt = 'SELECT * FROM ' . DB_PREPEND . 'phpwcms_articlecontent WHERE acontent_aid=' . $content["article_id"] . ' ';
         $sql_cnt .= "AND acontent_visible=1 AND acontent_trash=0 AND acontent_block='SYSTEM' AND acontent_tid IN (2, 3) ";
         // 2 = article detail, 3 = article detail OR list
         if (!FEUSER_LOGIN_STATUS) {
             $sql_cnt .= 'AND acontent_granted=0 ';
         }
         $sql_cnt .= "ORDER BY acontent_sorting, acontent_id";
         $row["article_image"]['tmplfull'] = render_cnt_template($row["article_image"]['tmplfull'], 'SYSTEM', showSelectedContent('CPC', $sql_cnt));
     } else {
         $row["article_image"]['tmplfull'] = render_cnt_template($row["article_image"]['tmplfull'], 'SYSTEM', '');
     }
     $row["article_image"]['tmplfull'] = render_cnt_template($row["article_image"]['tmplfull'], 'IMAGE', $thumb_img);
     $row["article_image"]['tmplfull'] = render_cnt_template($row["article_image"]['tmplfull'], 'CAPTION', nl2br(html_specialchars($row["article_image"]["caption"])));
     $row["article_image"]['tmplfull'] = render_cnt_template($row["article_image"]['tmplfull'], 'COPYRIGHT', html_specialchars($row["article_image"]["copyright"]));
     $row["article_image"]['tmplfull'] = render_cnt_date($row["article_image"]['tmplfull'], $content["article_date"], $row['article_livedate'], $row['article_killdate']);
     $row["article_image"]['tmplfull'] = render_cnt_template($row["article_image"]['tmplfull'], 'ZOOMIMAGE', $popup_img);
     $content["summary"] .= $row["article_image"]['tmplfull'];
     $row["article_image"]['tmplfull'] = 1;
 } else {
     $row["article_image"]['tmplfull'] = 0;
 }
 if ($content["summary"]) {
     $content["main"] .= $content["summary"];
     $content["main"] .= $template_default["article"]["head_after"];
 }
 // render content parts
 $sql_cnt = "SELECT * FROM " . DB_PREPEND . "phpwcms_articlecontent WHERE acontent_aid=" . $row["article_id"] . " ";
 $sql_cnt .= "AND acontent_visible=1 AND acontent_trash=0 ";
 if (!FEUSER_LOGIN_STATUS) {
     $sql_cnt .= 'AND acontent_granted=0 ';
 }
Example #30
0
 function render()
 {
     $items = array('top' => array(), 'default' => array(), 'bottom' => array(), 'hide' => array());
     $now = now();
     foreach ($this->dates as $key => $date) {
         $url = '';
         $target = '';
         $href = $this->href ? $this->href . '&amp;show_date=' . date('Y-m-d', $date['calendar_start_date']) . '_' . $date['calendar_id'] : '';
         $itemgroup = 'default';
         if ($date['calendar_range']) {
             $date['calendar_range_start_date'] = strtotime($date['calendar_range_start'] . ' ' . date('H:i', $date['calendar_start_date']));
             $date['calendar_range_end_date'] = strtotime($date['calendar_range_end']);
             $expired_date = $this->expired === 'START' ? 'calendar_range_start_date' : 'calendar_range_end_date';
         } else {
             $expired_date = $this->expired === 'START' ? 'calendar_start_date' : 'calendar_end_date';
         }
         if ($this->expired !== '' && $date[$expired_date] < $now) {
             if ($this->expired === 'bottom' || $this->expired === 'top') {
                 $itemgroup = $this->expired;
             } elseif ($this->expired === 'hide') {
                 unset($this->dates[$key]);
                 continue;
             }
         }
         if (!empty($date['calendar_refid'])) {
             $date['calendar_refid'] = get_redirect_link($date['calendar_refid'], ' ', '');
             $date['calendar_refid']['link'] = trim($date['calendar_refid']['link']);
             $date['calendar_refid']['link'] = trim($date['calendar_refid']['link'], '#');
             $target = $date['calendar_refid']['target'];
             if (is_intval($date['calendar_refid']['link'])) {
                 $url = rel_url(array(), array(), 'aid=' . $date['calendar_refid']['link']);
                 //'index.php?aid='.$date['calendar_refid']['link'];
             } elseif (strpos($date['calendar_refid']['link'], '://') || strpos($date['calendar_refid']['link'], '?') || strpos($date['calendar_refid']['link'], '.')) {
                 $url = $date['calendar_refid']['link'];
             } elseif (!empty($date['calendar_refid']['link'])) {
                 $url = rel_url(array(), array(), $date['calendar_refid']['link']);
             }
         }
         // Split title/type
         if ($this->gettype !== '') {
             $date['calendar_title'] = explode($this->gettype, $date['calendar_title'], 2);
             $date['calendar_type'] = empty($date['calendar_title'][1]) ? '' : trim($date['calendar_title'][1]);
             $date['calendar_title'] = trim($date['calendar_title'][0]);
         } else {
             $date['calendar_type'] = '';
         }
         if ($date['calendar_teaser']) {
             if ($this->teaserwords) {
                 $date['calendar_teaser'] = getCleanSubString($date['calendar_teaser'], $this->teaserwords, $GLOBALS['template_default']['ellipse_sign'], 'word');
             }
             $date['calendar_teaser'] = plaintext_htmlencode($date['calendar_teaser']);
         }
         $items[$itemgroup][$key] = $this->template;
         $items[$itemgroup][$key] = render_cnt_template($items[$itemgroup][$key], 'HREF', $href);
         $items[$itemgroup][$key] = render_cnt_template($items[$itemgroup][$key], 'URL', $url);
         $items[$itemgroup][$key] = render_cnt_template($items[$itemgroup][$key], 'TARGET', $target);
         $items[$itemgroup][$key] = render_cnt_template($items[$itemgroup][$key], 'TITLE', html_specialchars($date['calendar_title']));
         $items[$itemgroup][$key] = render_cnt_template($items[$itemgroup][$key], 'TYPE', $date['calendar_type'] ? html_specialchars($date['calendar_type']) : '');
         $items[$itemgroup][$key] = render_cnt_template($items[$itemgroup][$key], 'TEASER', $date['calendar_teaser']);
         $items[$itemgroup][$key] = render_cnt_template($items[$itemgroup][$key], 'TEXT', $date['calendar_text']);
         $items[$itemgroup][$key] = render_cnt_template($items[$itemgroup][$key], 'PLACE', html_specialchars($date['calendar_where']));
         $items[$itemgroup][$key] = render_cnt_template($items[$itemgroup][$key], 'ALLDAY', $date['calendar_allday'] ? ' ' : '');
         // Detect if range date
         if ($date['calendar_range']) {
             $items[$itemgroup][$key] = render_cnt_template($items[$itemgroup][$key], 'RANGEDATE', ' ');
             $items[$itemgroup][$key] = render_cnt_date($items[$itemgroup][$key], $date['calendar_range_start_date'], $date['calendar_range_start_date'], $date['calendar_range_end_date']);
         } else {
             $items[$itemgroup][$key] = render_cnt_template($items[$itemgroup][$key], 'RANGEDATE', '');
         }
         $items[$itemgroup][$key] = render_cnt_date($items[$itemgroup][$key], $date['calendar_start_date'], $date['calendar_start_date'], $date['calendar_end_date']);
     }
     if (!count($items['default']) && !count($items['top']) && !count($items['bottom'])) {
         $items['default'][] = str_replace('{CALENDAR_RESET}', $this->resetCalendarLink(), $this->no_calendar_item_found);
     } elseif ($this->expired && count($items[$this->expired])) {
         array_unshift($items[$this->expired], $this->expired_prefix);
         $items[$this->expired][] = $this->expired_suffix;
         if ($this->expired === 'top') {
             $items = implode(LF, $items['top']) . LF . implode(LF, $items['default']);
         } else {
             $items = implode(LF, $items['default']) . LF . implode(LF, $items['bottom']);
         }
     } else {
         $items = implode(LF, $items['default']);
     }
     return $items;
 }