// tabs
$tabs = array();
$tabs['tabs'] = @unserialize($crow["acontent_form"]);
unset($tabs['tabs']['tabwysiwygoff']);
// read template
if (empty($crow["acontent_template"]) && is_file(PHPWCMS_TEMPLATE . 'inc_default/tabs.tmpl')) {
    $tabs['template'] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_default/tabs.tmpl'));
} 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']));
Beispiel #2
0
            if ($pagelayout['additional_wrap_div']) {
                $content["all"] .= "</div>";
            }
            $content["all"] .= "</div>\n";
            break;
        case 2:
            //create the page layout based only on the content of main block
            $content["all"] = $block["maintext"];
            break;
    }
} elseif ($aktion[2] == 1) {
    //if print layout should be shown
    $_print_tmpl = PRINT_PDF ? 'pdf' : 'print';
    $content['all'] = is_file(PHPWCMS_TEMPLATE . 'inc_default/' . $_print_tmpl . '.tmpl') ? @file_get_contents(PHPWCMS_TEMPLATE . 'inc_default/' . $_print_tmpl . '.tmpl') : '{CONTENT}<hr />{CURRENT_URL}';
    if (PRINT_PDF) {
        $_print_settings = get_tmpl_section('PDF_SETTINGS', $content['all']);
        $content['all'] = replace_tmpl_section('PDF_SETTINGS', $content['all']);
        $_print_settings = parse_ini_str($_print_settings, false);
    }
    if ($content['all']) {
        $content["all"] = str_replace('{CURRENT_URL}', abs_url(), $content["all"]);
        $content["all"] = str_replace('{CONTENT}', $block["maintext"], $content["all"]);
    } else {
        $content['all'] = $block["maintext"];
    }
}
// Render possible PHP Values in category or article keyword field
$content["struct"][$aktion[0]]["acat_info"] = render_PHPcode($content["struct"][$aktion[0]]["acat_info"]);
if (!empty($content["articles"][$aktion[1]]["article_keyword"]) && strpos($content["articles"][$aktion[1]]["article_keyword"], 'PHP') !== FALSE) {
    $content["articles"][$aktion[1]]["article_keyword"] = render_PHPcode($content["articles"][$aktion[1]]["article_keyword"]);
}
     $sql .= 'ON ' . DB_PREPEND . 'phpwcms_address.address_id = ' . DB_PREPEND . 'phpwcms_newsletterqueue.queue_rid ';
     $sql .= 'WHERE ' . DB_PREPEND . 'phpwcms_newsletterqueue.queue_status=0 AND ';
     $sql .= DB_PREPEND . 'phpwcms_newsletterqueue.queue_pid=' . $newsletter["newsletter_id"];
     if ($loop) {
         $sql .= ' LIMIT ' . $loop;
     }
     $recipient = _dbQuery($sql);
 } else {
     // do nothing
 }
 if (count($recipient)) {
     echo '<p><strong>' . $BL['be_newsletter_to'] . ': </strong><p>';
     // check for newsletter template
     if (!empty($newsletter['newsletter_vars']['template']) && ($template = @file_get_contents(PHPWCMS_TEMPLATE . 'inc_newsletter/' . $newsletter['newsletter_vars']['template'] . '/newsletter.tmpl'))) {
         $template_html = trim(get_tmpl_section('HTML', $template));
         $template_text = trim(get_tmpl_section('TEXT', $template));
         if ($template_html) {
             $newsletter['newsletter_vars']['html'] = str_replace('{CONTENT}', $newsletter['newsletter_vars']['html'], $template_html);
             $newsletter['newsletter_vars']['html'] = preg_replace('/( src=["\'](?!http:|https:|mailto:))(.*?)/i', '$1' . PHPWCMS_URL . '$2', $newsletter['newsletter_vars']['html']);
         }
         if ($template_text) {
             $newsletter['newsletter_vars']['text'] = str_replace('{CONTENT}', $newsletter['newsletter_vars']['text'], $template_text);
         }
     }
     $mail = new PHPMailer();
     $mail->Mailer = $phpwcms['SMTP_MAILER'];
     $mail->Host = $phpwcms['SMTP_HOST'];
     $mail->Port = $phpwcms['SMTP_PORT'];
     $mail->CharSet = $phpwcms["charset"];
     if ($phpwcms['SMTP_AUTH']) {
         $mail->SMTPAuth = 1;
         $guestbook['readform'] = 1;
         $guestbook['post']['email'] = $guestbook['new_entry'][0]['guestbook_email'];
         $guestbook['post']['name'] = $guestbook['new_entry'][0]['guestbook_name'];
         $guestbook['post']['url'] = $guestbook['new_entry'][0]['guestbook_url'];
         $guestbook['post']['msg'] = $guestbook['new_entry'][0]['guestbook_msg'];
     }
     unset($GLOBALS['_getVar']['guestbookentry']);
 }
 // start guestbook form
 if (empty($guestbook['gb_login_post'])) {
     $guestbook['show_postform'] = true;
 } elseif (_getFeUserLoginStatus()) {
     $guestbook['show_postform'] = true;
 } else {
     $guestbook['show_postform'] = false;
     $guestbook['form'] = get_tmpl_section('LOGIN_INFO', $guestbook['template']);
 }
 if ($guestbook['show_postform']) {
     if (!$guestbook['readform']) {
         if (!count($guestbook['error'])) {
             // remove post form error part
             $guestbook['form'] = replace_tmpl_section('FORM_ERROR', $guestbook['form'], '');
         }
         //try to replace all error messages first
         $guestbook['form'] = render_cnt_template($guestbook['form'], 'ERROR_EMAIL', empty($guestbook['error']['email']) ? '' : $guestbook['error']['email']);
         $guestbook['form'] = render_cnt_template($guestbook['form'], 'ERROR_NAME', empty($guestbook['error']['name']) ? '' : $guestbook['error']['name']);
         $guestbook['form'] = render_cnt_template($guestbook['form'], 'ERROR_IMGSIZE', empty($guestbook['error']['size']) ? '' : $guestbook['error']['size']);
         $guestbook['form'] = render_cnt_template($guestbook['form'], 'ERROR_IMGSAVE', empty($guestbook['error']['move']) ? '' : $guestbook['error']['move']);
         $guestbook['form'] = render_cnt_template($guestbook['form'], 'ERROR_IMGWRITE', empty($guestbook['error']['writable']) ? '' : $guestbook['error']['writable']);
         $guestbook['form'] = render_cnt_template($guestbook['form'], 'ERROR_IMGFORMAT', empty($guestbook['error']['format']) ? '' : $guestbook['error']['format']);
         $guestbook['form'] = render_cnt_template($guestbook['form'], 'ERROR_IMGUPLOAD', empty($guestbook['error']['system']) ? '' : $guestbook['error']['system']);
Beispiel #5
0
} else {
    $crow["acontent_template"] = '<!--LINKLIST_START//-->
[TITLE]<h4>{TITLE}</h4>
[/TITLE][SUBTITLE]<h5>{SUBTITLE}</h5>
[/SUBTITLE][LINKLIST]
<ul class="linklist">
{LINKLIST}
</ul>
[/LINKLIST]<!--LINKLIST_END//-->
<!--LINKLIST_ENTRY_START//-->[LINK]	<li><a href="{LINK}"{TARGET}>{LINKNAME}</a></li>[/LINK]<!--LINKLIST_ENTRY_END//-->
<!--LINKLIST_SPACE_START//-->
<!--LINKLIST_SPACE_END//-->';
}
$content['linklist'] = get_tmpl_section('LINKLIST', $crow["acontent_template"]);
$content['linklist_entry'] = get_tmpl_section('LINKLIST_ENTRY', $crow["acontent_template"]);
$content['linklist_space'] = get_tmpl_section('LINKLIST_SPACE', $crow["acontent_template"]);
$content['linklist'] = str_replace('{ID}', $crow['acontent_id'], $content['linklist']);
$content['linklist'] = render_cnt_template($content['linklist'], 'TITLE', html_specialchars($crow['acontent_title']));
$content['linklist'] = render_cnt_template($content['linklist'], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
$link = explode(LF, $crow["acontent_text"]);
if (count($link)) {
    $tmp = array();
    foreach ($link as $key => $value) {
        $link = explode("|", $value);
        $link["name"] = trim($link[0]);
        if (empty($link[1])) {
            $link["link"] = '#';
            $link["target"] = '';
        } else {
            $link["link"] = explode(' ', trim($link[1]));
            $link["target"] = empty($link["link"][1]) ? '' : ' target="' . trim($link["link"][1]) . '"';
     $news['base_href'] = rel_url($news['listing_page'], array('newsdetail'));
 } else {
     if (is_intval($news['news_detail_link'])) {
         $news['news_detail_link'] = 'aid=' . $news['news_detail_link'];
     }
     $news['base_href'] = rel_url($news['listing_page'], array('newsdetail'), $news['news_detail_link']);
 }
 foreach ($news['result'] as $key => $value) {
     $value['cnt_object'] = @unserialize($value['cnt_object']);
     $news['entries'][$key] = getFrontendEditLink('news', $value['cnt_id']);
     if (empty($value['cnt_object']['cnt_files']['gallery'])) {
         $news['tmpl_gallery_item'] = '';
         $news['entries'][$key] .= $news['tmpl_entry'];
     } else {
         if (empty($news['tmpl_gallery_item'])) {
             $news['tmpl_gallery_item'] = get_tmpl_section('GALLERY_ITEM', $news['tmpl_entry']);
         }
         $news['entries'][$key] .= replace_tmpl_section('GALLERY_ITEM', $news['tmpl_entry']);
     }
     if ($value['cnt_teasertext']) {
         $value['cnt_opengraph_teasertext'] = $value['cnt_teasertext'];
         if ($news['config']['news_teaser_limit_chars']) {
             $value['cnt_teasertext'] = getCleanSubString($value['cnt_teasertext'], $news['config']['news_teaser_limit_chars'], $news['config']['news_teaser_limit_ellipse'], 'char');
         } elseif ($news['config']['news_teaser_limit_words']) {
             $value['cnt_teasertext'] = getCleanSubString($value['cnt_teasertext'], $news['config']['news_teaser_limit_words'], $news['config']['news_teaser_limit_ellipse'], 'word');
         }
         if (empty($value['cnt_object']['cnt_textformat']) || $value['cnt_object']['cnt_textformat'] == 'plain') {
             $value['cnt_teasertext'] = plaintext_htmlencode($value['cnt_teasertext']);
         } elseif ($value['cnt_object']['cnt_textformat'] == 'br') {
             $value['cnt_teasertext'] = br_htmlencode($value['cnt_teasertext']);
         } elseif ($value['cnt_object']['cnt_textformat'] == 'markdown') {
     }
     if ($_shop_load_order) {
         $_tmpl['cart_header'] = get_tmpl_section('CART_HEADER', $_tmpl['source']);
         $_tmpl['cart_entry'] = get_tmpl_section('CART_ENTRY', $_tmpl['source']);
         $_tmpl['cart_space'] = get_tmpl_section('CART_SPACE', $_tmpl['source']);
         $_tmpl['cart_footer'] = get_tmpl_section('CART_FOOTER', $_tmpl['source']);
         $_tmpl['cart_none'] = get_tmpl_section('CART_NONE', $_tmpl['source']);
         $_tmpl['inv_address'] = get_tmpl_section('ORDER_INV_ADDRESS', $_tmpl['source']);
         $_tmpl['order_terms'] = get_tmpl_section('ORDER_TERMS', $_tmpl['source']);
         $_tmpl['term_entry'] = get_tmpl_section('ORDER_TERMS_ITEM', $_tmpl['source']);
         $_tmpl['term_space'] = get_tmpl_section('ORDER_TERMS_ITEMSPACE', $_tmpl['source']);
         $_tmpl['mail_customer'] = get_tmpl_section('MAIL_CUSTOMER', $_tmpl['source']);
         $_tmpl['mail_neworder'] = get_tmpl_section('MAIL_NEWORDER', $_tmpl['source']);
         $_tmpl['order_success'] = get_tmpl_section('ORDER_DONE', $_tmpl['source']);
         $_tmpl['order_failed'] = get_tmpl_section('ORDER_NOT_DONE', $_tmpl['source']);
         $_tmpl['mail_item'] = get_tmpl_section('MAIL_ITEM', $_tmpl['source']);
     }
 }
 // merge config settings like translations and so on
 $_tmpl['config'] = array_merge(array('cat_all' => '@@All products@@', 'cat_all_pos' => 'bottom', 'cat_list_products' => false, 'cat_subcat_spacer' => ' / ', 'price_decimals' => 2, 'vat_decimals' => 1, 'weight_decimals' => 1, 'dec_point' => '.', 'thousands_sep' => ',', 'price_option_null' => false, 'price_option_prefix' => ' ', 'price_option_suffix' => ' {$}', 'image_list_width' => 200, 'image_list_height' => 200, 'image_detail_width' => 200, 'image_detail_height' => 200, 'image_zoom_width' => 750, 'image_zoom_height' => 500, 'image_list_lightbox' => false, 'image_detail_lightbox' => true, 'image_detail_crop' => false, 'image_list_crop' => false, 'mail_customer_subject' => "[#{ORDER}] Your order at MyShop", 'mail_neworder_subject' => "[#{ORDER}] New order", 'label_payby_prepay' => "@@Cash with order@@", 'label_payby_pod' => "@@Cash on delivery@@", 'label_payby_onbill' => "@@On account@@", 'order_number_style' => 'RANDOM', 'cat_list_sort_by' => 'shopprod_name1 ASC', 'shop_css' => '', 'shop_wrap' => '', 'image_detail_more_width' => 50, 'image_detail_more_height' => 50, 'image_detail_more_crop' => false, 'image_detail_more_start' => 1, 'image_detail_more_lightbox' => false, 'files_direct_download' => false, 'files_template' => '', 'on_request_trigger' => -999, 'pagetitle_productname' => '%s', 'pagetitle_model' => ', Model: %s', 'pagetitle_add' => '%S- %s', 'pagetitle_ordernumber' => '%S(Order No. %s)', 'pagetitle' => '%1$s%2$s%3$s%4$s'), $_tmpl['config']);
 foreach (array('shop_pref_currency', 'shop_pref_unit_weight', 'shop_pref_vat', 'shop_pref_email_to', 'shop_pref_email_from', 'shop_pref_email_paypal', 'shop_pref_shipping', 'shop_pref_shipping_calc', 'shop_pref_payment', 'shop_pref_discount', 'shop_pref_loworder') as $value) {
     _getConfig($value, '_shopPref');
 }
 if (!isset($_tmpl['config']['shop_url'])) {
     $_tmpl['config']['shop_url'] = _getConfig('shop_pref_id_shop', '_shopPref');
 }
 if (!isset($_tmpl['config']['cart_url'])) {
     $_tmpl['config']['cart_url'] = _getConfig('shop_pref_id_cart', '_shopPref');
 }
 if (!is_intval($_tmpl['config']['shop_url']) && is_string($_tmpl['config']['shop_url'])) {
     $_tmpl['config']['shop_url'] = trim($_tmpl['config']['shop_url']);
Beispiel #8
0
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
    die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
//image with text
// read template
if (empty($crow["acontent_template"]) && is_file(PHPWCMS_TEMPLATE . 'inc_default/imagetext.tmpl')) {
    $crow["acontent_template"] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_default/imagetext.tmpl'));
} elseif (is_file(PHPWCMS_TEMPLATE . 'inc_cntpart/imagetext/' . $crow["acontent_template"])) {
    $crow["acontent_template"] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_cntpart/imagetext/' . $crow["acontent_template"]));
} else {
    $crow["acontent_template"] = '[IMAGETEXT]<div class="image-with-text">{IMAGETEXT}</div>[/IMAGETEXT]';
}
$crow["settings"] = get_tmpl_section('IMAGETEXT_SETTINGS', $crow["acontent_template"]);
$crow["settings"] = parse_ini_str($crow["settings"], false);
$crow["acontent_template"] = replace_tmpl_section('IMAGETEXT_SETTINGS', $crow["acontent_template"]);
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'TITLE', html($crow['acontent_title']));
$crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'SUBTITLE', html($crow['acontent_subtitle']));
$crow["acontent_template"] = str_replace('{ID}', $crow["acontent_id"], $crow["acontent_template"]);
$crow['is_imagetext'] = strpos($crow["acontent_template"], '{IMAGETEXT}') !== false ? true : false;
$crow['has_image'] = false;
// 0   :1       :2   :3        :4    :5     :6      :7       :8
// dbid:filename:hash:extension:width:height:caption:position:zoom
$image = $crow["acontent_image"] ? explode(":", $crow["acontent_image"]) : false;
$crow["default_settings"] = array('class_top_left' => $template_default['classes']['imgtxt-top-left'], 'class_top_center' => $template_default['classes']['imgtxt-top-center'], 'class_top_right' => $template_default['classes']['imgtxt-top-right'], 'class_bottom_left' => $template_default['classes']['imgtxt-bottom-left'], 'class_bottom_center' => $template_default['classes']['imgtxt-bottom-center'], 'class_bottom_right' => $template_default['classes']['imgtxt-bottom-right'], 'class_float_left' => $template_default['classes']['imgtxt-left'], 'class_float_right' => $template_default['classes']['imgtxt-right'], 'class_column_left' => $template_default['classes']['imgtxt-column-left'], 'class_column_right' => $template_default['classes']['imgtxt-column-right'], 'class_column_left_image' => $template_default['classes']['imgtxt-column-left-image'], 'class_column_right_image' => $template_default['classes']['imgtxt-column-right-image'], 'class_column_left_text' => $template_default['classes']['imgtxt-column-left-text'], 'class_column_right_text' => $template_default['classes']['imgtxt-column-right-text'], 'width' => $image[4], 'height' => $image[5], 'zoom' => $image[8], 'crop' => 0, 'lightbox' => 0, 'nocaption' => 0);
$image_text = '';
$crow["settings"] = array_merge($crow["default_settings"], $crow["settings"]);
//zoom click = $image[8];
if ($image) {
// 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"];
Beispiel #10
0
        $map['map'] .= '<area shape="rect" coords="' . ($map['row']['map_x'] - 4) . ',' . ($map['row']['map_y'] - 4);
        $map['map'] .= ',' . ($map['row']['map_x'] + 4) . ',' . ($map['row']['map_y'] + 4) . '" href="index.php?id=';
        $map['map'] .= implode(',', $aktion) . '&amp;loc=' . $map['row']['map_id'] . '" title="';
        $map['map'] .= html_specialchars($map['row']['map_title']) . '" alt="';
        $map['map'] .= html_specialchars($map['row']['map_title']) . '" />';
        $map['p'][] = $map['row']['map_x'] . 'x' . $map['row']['map_y'];
        if ($map['show'] == $map['row']['map_id']) {
            $map['loc'] = $map['row'];
        }
    }
    mysql_free_result($map['result']);
}
$map['template'] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_cntpart/map/' . $map['template']));
$map['tmpl_var'] = get_tmpl_section('VAR', $map['template']);
$map['tmpl_content'] = get_tmpl_section('CONTENT', $map['template']);
$map['tmpl_location'] = get_tmpl_section('LOCATION', $map['template']);
$map['map_img'] = '';
if (file_exists(PHPWCMS_TEMPLATE . 'inc_cntpart/map/map_img/' . $map['image'])) {
    $map['map_img'] .= '<img src="img/mapimage.php?';
    $map['map_img'] .= 'i=' . rawurlencode($map['image']) . '&amp;xy=' . rawurlencode(implode(',', $map['p']));
    $map['map_img'] .= '&amp;v=' . rawurlencode($map['tmpl_var'] ? $map['tmpl_var'] : '1,7,7,FFFFFF,FF4000');
    $map['map_img'] .= '" hspace="0" vspace="0" alt="" usemap="#locations" />';
    if ($map['map']) {
        $map['map_img'] .= '<map name="locations">' . $map['map'] . '</map>';
    }
}
if (!$map['tmpl_content']) {
    $CNT_TMP .= '<div style="float:right;">' . $map['map_img'] . '</div>';
    if (!empty($map['text'])) {
        $CNT_TMP .= nl2br(div_class($map['text'], $template_default["article"]["text_class"]));
    }
Beispiel #11
0
     $crow["acontent_template"] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_default/filelist.tmpl'));
 } elseif ($crow["acontent_template"] == 'download-inline') {
     $crow["acontent_template"] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_default/filelist_inline.tmpl'));
 } elseif (is_file(PHPWCMS_TEMPLATE . 'inc_cntpart/filelist/' . $crow["acontent_template"])) {
     $crow["acontent_template"] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_cntpart/filelist/' . $crow["acontent_template"]));
 } else {
     $crow["acontent_template"] = '[TITLE]<h4>{TITLE}</h4>[/TITLE][SUBTITLE]<h5>{SUBTITLE}</h5>[/SUBTITLE][TEXT]{TEXT}[/TEXT]' . LF;
     $crow["acontent_template"] .= '<ul class="fileDownload">' . LF . '<!--FILE_ENTRY_START//-->' . LF;
     $crow["acontent_template"] .= '	<li><a href="{FILE_LINK}"{FILE_TARGET}>{FILE_NAME}</a></li>' . LF;
     $crow["acontent_template"] .= '<!--FILE_ENTRY_END//-->' . LF . '</ul>' . LF;
 }
 $_files_settings = get_tmpl_section('FILE_SETTINGS', $crow["acontent_template"]);
 $_files_settings = parse_ini_str($_files_settings, false);
 $_files_settings = array_merge(array('icon_path' => 'img/icons/', 'icon_name' => 'small_icon_{FILE_EXT}.gif', 'thumbnail' => 0, 'thumbnail_width' => 50, 'thumbnail_height' => 50, 'thumbnail_crop' => 1, 'lightbox_init' => 0, 'file_size_round' => 3, 'file_size_space' => ' ', 'date_format' => "%m/%d/%y", 'set_locale' => ''), $_files_settings);
 $crow["acontent_template"] = replace_tmpl_section('FILE_SETTINGS', $crow["acontent_template"]);
 $content['template_file'] = get_tmpl_section('FILE_ENTRY', $crow["acontent_template"]);
 if ($_files_settings['set_locale']) {
     $_files_old_locale = setlocale(LC_ALL, "0");
     setlocale(LC_ALL, $_files_settings['set_locale']);
 }
 if (!empty($_files_settings['lightbox_init'])) {
     initSlimbox();
 }
 $_files_count = count($content['files_result']);
 $_files_entries = array();
 $_files_get_imagesize = strpos($content['template_file'], '{FILE_IMAGE_') === FALSE ? false : true;
 // check if necessary to check for image type and sizes
 foreach ($content['files'] as $fkey => $value) {
     for ($_files_x = 0; $_files_x < $_files_count; $_files_x++) {
         $_file_current = PHPWCMS_ROOT . $phpwcms["file_path"] . $content['files_result'][$_files_x]['f_hash'];
         if ($content['files_result'][$_files_x]['f_ext']) {
     $newsletter["newsletter_vars"]['template'] = '';
 }
 $i = 0;
 foreach ($tmpllist as $value) {
     $value1 = html($value);
     $tmpldata['options'][$i] = '<option value="' . $value1 . '"';
     if ($value == $newsletter["newsletter_vars"]['template']) {
         $tmpldata['options'][$i] .= ' selected="selected"';
         $value3 = $value;
     }
     $tmpldata['options'][$i] .= '>' . $value1 . '</option>' . LF;
     $tmpldata['files'][$i] = returnFileListAsArray(PHPWCMS_TEMPLATE . 'inc_newsletter/' . $value);
     // chech against tmpl file
     if (isset($tmpldata['files'][$i]['newsletter.tmpl'])) {
         $value2 = @file_get_contents(PHPWCMS_TEMPLATE . 'inc_newsletter/' . $value . '/newsletter.tmpl');
         $value2 = get_tmpl_section('NEWSLETTER_SETTINGS', $value2);
         $value2 = parse_ini_str($value2, false);
         if (empty($value2['title'])) {
             $value2['title'] = '';
         }
         if (empty($value2['description'])) {
             $value2['description'] = '';
         }
     } else {
         $value2 = array('title' => '', 'description' => '');
     }
     $tmpldata['js'][] = '  nltemplate["' . $value . '"] = new Array();';
     $tmpldata['js'][] = '  nltemplate["' . $value . '"]["title"] = "' . js_singlequote($value2['title']) . '";';
     $tmpldata['js'][] = '  nltemplate["' . $value . '"]["description"] = "' . js_singlequote($value2['description']) . '";';
     $value2 = '';
     // set preview image
Beispiel #13
0
    if (empty($rssfeed['template']) || !is_file(PHPWCMS_TEMPLATE . 'inc_cntpart/rssfeed/' . $rssfeed['template'])) {
        $rssfeed['template'] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_default/rssfeed.tmpl'));
    } else {
        $rssfeed['template'] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_cntpart/rssfeed/' . $rssfeed['template']));
    }
    if (!$rssfeed['template']) {
        $rssfeed['template'] = '<!--ITEM_START//--><li><a href="{LINK}" target="_blank">{TITLE}</a></li><!--ITEM_END//-->
<!--DIVIDER_START//--><hr /><!--DIVIDER_END//-->
<!--FEEDINFO_START//--><p>{IMAGE}</p><!--FEEDINFO_END//-->
<!--RSSFEED_START//-->[TITLE]<h3>{TITLE}</h3>[/TITLE][SUBTITLE]<h4>{SUBTITLE}</h4>[/SUBTITLE]<div class="rss-feed">{FEEDINFO}<ul>{ITEMS}</ul></div><!--RSSFEED_END//-->';
    }
    // Get Template
    $rss['template_ITEM'] = get_tmpl_section('ITEM', $rssfeed['template']);
    $rss['template_DIVIDER'] = get_tmpl_section('DIVIDER', $rssfeed['template']);
    $rss['template_FEEDINFO'] = get_tmpl_section('FEEDINFO', $rssfeed['template']);
    $rss['template_RSSFEED'] = get_tmpl_section('RSSFEED', $rssfeed['template']);
    // Load SimplePie
    require_once PHPWCMS_ROOT . '/include/inc_ext/simplepie.inc.php';
    $rss_obj = new SimplePie();
    // Feed URL
    $rss_obj->set_feed_url($rssfeed['rssurl']);
    // Output Encoding Charset
    $rss_obj->set_output_encoding(PHPWCMS_CHARSET);
    // Input Encoding Charset
    if (!empty($rssfeed['content_type'])) {
        $rss_obj->set_input_encoding($rssfeed['content_type']);
    }
    // Feed Cache Timeout
    if (!$rssfeed["timeout"]) {
        // set to default value = 3600 seconds = 1 hour
        $rssfeed["timeout"] = 3600;
Beispiel #14
0
    unset($GLOBALS['_getVar']['glossaryid']);
    unset($GLOBALS['_getVar']['glossarytitle']);
    $content['glossary']['detail_entry'] = get_tmpl_section('GLOSSARY_DETAIL_ENTRY', $content['glossary']['glossary_template']);
    $content['glossary']['detail_entry'] = render_cnt_template($content['glossary']['detail_entry'], 'TEXT', $content['glossary']['entry']['glossary_text']);
    $content['glossary']['detail_entry'] = render_cnt_template($content['glossary']['detail_entry'], 'TITLE', html_specialchars($content['glossary']['entry']['glossary_title']));
    $content['glossary']['item'] = $content['glossary']['detail_head'] . $content['glossary']['detail_entry'] . $content['glossary']['detail_footer'];
    $content['glossary']['item'] = str_replace('{GLOSSARY_ID}', $content['glossary']['entry']['glossary_id'], $content['glossary']['item']);
    $content['glossary']['item'] = str_replace('{BACKLINK}', rel_url(), $content['glossary']['item']);
    // fine we will display given glossary ID
    $CNT_TMP .= $content['glossary']['item'];
} else {
    // get list entries template sections
    $content['glossary']['list_head'] = get_tmpl_section('GLOSSARY_LIST_HEAD', $content['glossary']['glossary_template']);
    $content['glossary']['list_footer'] = get_tmpl_section('GLOSSARY_LIST_FOOTER', $content['glossary']['glossary_template']);
    $content['glossary']['list_entry'] = get_tmpl_section('GLOSSARY_LIST_ENTRY', $content['glossary']['glossary_template']);
    $content['glossary']['list_spacer'] = get_tmpl_section('GLOSSARY_LIST_SPACER', $content['glossary']['glossary_template']);
    // OK we build filter
    $content['glossary']['glossary_alphabet'] = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $content['glossary']['glossary_filter'] = convertStringToArray(strtoupper($content['glossary']['glossary_filter']), ' ');
    $content['glossary']['glossary_filter_active'] = empty($GLOBALS['_getVar']['glossary']) ? '' : strtoupper(clean_slweg($GLOBALS['_getVar']['glossary']));
    if (in_array($content['glossary']['glossary_filter_active'], $content['glossary']['glossary_filter'])) {
        // build SQL query
        if (strpos($content['glossary']['glossary_filter_active'], '-')) {
            $content['glossary']['filter'] = explode('-', $content['glossary']['glossary_filter_active']);
            $content['glossary']['filter'][0] = substr($content['glossary']['filter'][0], 0, 1);
            $content['glossary']['filter'][1] = empty($content['glossary']['filter'][1]) ? '?' : substr($content['glossary']['filter'][1], 0, 1);
            // is there start and end
            if (strpos($content['glossary']['glossary_alphabet'], $content['glossary']['filter'][0]) !== false && strpos($content['glossary']['glossary_alphabet'], $content['glossary']['filter'][1]) !== false) {
                $content['glossary']['glossary_alphabet'] = preg_split('//', $content['glossary']['glossary_alphabet'], -1, PREG_SPLIT_NO_EMPTY);
                $content['glossary']['filters'] = array();
                $content['glossary']['filter_run'] = false;
Beispiel #15
0
    header('Pragma: public');
}
// write phpwcms release information in a custom HTTP header
header('X-phpwcms-Release: ' . PHPWCMS_VERSION);
// retrieve complete processing time
list($usec, $sec) = explode(' ', microtime());
header('X-phpwcms-Page-Processed-In: ' . number_format(1000 * ($usec + $sec - $phpwcms_rendering_start), 3) . ' ms');
// print PDF
if ($aktion[2] === 1 && defined('PRINT_PDF') && PRINT_PDF) {
    require_once PHPWCMS_ROOT . '/include/inc_front/pdf.inc.php';
    // handle output action and section
} elseif ($phpwcms['output_action']) {
    if (empty($phpwcms['output_function_filter']) || !is_array($phpwcms['output_function_filter'])) {
        $phpwcms['output_function_filter'] = array('trim', 'strip_tags');
    }
    $phpwcms['output_function'] = array_intersect($phpwcms['output_function_filter'], $phpwcms['output_function']);
    $content = ob_get_clean();
    $sections = '';
    foreach ($phpwcms['output_section'] as $section) {
        $section = get_tmpl_section($section, $content);
        foreach ($phpwcms['output_function'] as $function) {
            $section = $function($section);
        }
        $sections .= $section;
    }
    // Return sections content ONLY
    echo $sections;
    exit;
}
// send buffer to browser
ob_end_flush();
Beispiel #16
0
$content['search']['search_filename'] = empty($content['search']["no_filenames"]) ? true : false;
// search/list for file/imagenames
$content['search']['search_username'] = empty($content['search']["no_username"]) ? true : false;
$content['search']['search_caption'] = empty($content['search']["no_caption"]) ? true : false;
$content['search']['search_keyword'] = empty($content['search']["no_keyword"]) ? true : false;
$content['search']['show_summary'] = empty($content['search']["hide_summary"]) ? true : false;
// show search tester text
// read template
if (empty($crow["acontent_template"]) && is_file(PHPWCMS_TEMPLATE . 'inc_default/search.tmpl')) {
    $crow["acontent_template"] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_default/search.tmpl'));
} elseif (is_file(PHPWCMS_TEMPLATE . 'inc_cntpart/search/' . $crow["acontent_template"])) {
    $crow["acontent_template"] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_cntpart/search/' . $crow["acontent_template"]));
} else {
    $crow["acontent_template"] = '';
}
$crow['template'] = array('header' => get_tmpl_section('SEARCH_HEADER', $crow["acontent_template"]), 'footer' => get_tmpl_section('SEARCH_FOOTER', $crow["acontent_template"]), 'item_space' => get_tmpl_section('SEARCH_ITEM_SPACER', $crow["acontent_template"]), 'item' => get_tmpl_section('SEARCH_ITEM', $crow["acontent_template"]), 'pagination' => trim(get_tmpl_section('SEARCH_PAGINATE', $crow["acontent_template"])), 'text' => '', 'form' => '', 'image_render' => false);
if (!empty($_POST["search_input_field"]) || !empty($_GET['searchwords'])) {
    $s_run = 0;
    // check search
    // remove unsecure replacement tags
    $content["search_word"] = empty($_POST["search_input_field"]) ? rawurldecode($_GET['searchwords']) : $_POST["search_input_field"];
    $content["search_word"] = clean_slweg($content["search_word"]);
    $content["search_word"] = clean_replacement_tags($content["search_word"]);
    $content["search_word"] = cleanUpSpecialHtmlEntities($content["search_word"]);
    // split all search words
    $content["search_word"] = explode(' ', $content["search_word"]);
    $content["search_word"] = array_unique($content["search_word"]);
    $content['search']['highlight_result'] = empty($content["search"]['highlight_result']) ? false : true;
    $content['search']['wordlimit'] = isset($content["search"]['wordlimit']) && is_intval($content["search"]['wordlimit']) ? intval($content["search"]['wordlimit']) : 35;
    $content["search"]["result_per_page"] = empty($content["search"]['result_per_page']) ? 15 : $content["search"]['result_per_page'];
    if ($content["search"]["result_per_page"] == -1) {
Beispiel #17
0
         }
         $img_a = render_cnt_template($img_a, 'TITLE', $caption[3]);
         $img_a = render_cnt_template($img_a, 'ALT', $caption[1]);
         $img_a = render_cnt_template($img_a, 'LINK', $img_thumb_link);
         // check if this is the last image in row
         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']));
Beispiel #18
0
         $alink_sql .= " LIMIT " . intval($content['alink']['alink_max']);
     }
     if ($sql_union != '') {
         $alink_sql = '(' . $alink_sql . ') UNION DISTINCT (' . $alink_sql . ')' . $sql_union;
         if (!empty($content['alink']['alink_max']) && intval($content['alink']['alink_max'])) {
             $alink_sql .= " LIMIT " . intval($content['alink']['alink_max']);
         }
     }
 }
 $content['alink']['tr'] = array();
 $content['alink']['alink_template_head'] = get_tmpl_section('TEASER_HEAD', $content['alink']['alink_template']);
 $content['alink']['alink_template_footer'] = get_tmpl_section('TEASER_FOOTER', $content['alink']['alink_template']);
 $content['alink']['alink_template_entry'] = get_tmpl_section('TEASER_ENTRY', $content['alink']['alink_template']);
 $content['alink']['alink_template_space'] = get_tmpl_section('TEASER_ENTRY_SPACER', $content['alink']['alink_template']);
 $content['alink']['alink_template_row'] = get_tmpl_section('TEASER_ROW_SPACER', $content['alink']['alink_template']);
 $content['alink']['alink_template_column'] = trim(get_tmpl_section('TEASER_COLUMN_OVERWRITE', $content['alink']['alink_template']));
 $content['alink']['alink_template_head'] = str_replace('{LINK_ARTICLE_CLASS}', get_class_attrib($template_default["article"]["link_article_class"]), $content['alink']['alink_template_head']);
 $content['alink']['result'] = _dbQuery($alink_sql);
 if (isset($content['alink']['result'][0])) {
     // lets handle columns and rows
     if ($content['alink']['alink_template_column'] !== '') {
         $content['alink']['alink_columns'] = abs(intval($content['alink']['alink_template_column']));
     } elseif (empty($content['alink']['alink_columns'])) {
         $content['alink']['alink_columns'] = 0;
     } else {
         $content['alink']['alink_columns'] = $content['alink']['alink_columns'];
     }
     $content['alink']['column'] = 1;
     $content['alink']['row'] = 1;
     $content['alink']['row_space'] = false;
     // before finding a faster solution...
if (!defined('PHPWCMS_ROOT')) {
    die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
// frontend login
$CNT_TMP .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]);
if (!empty($crow["acontent_template"]) && is_file(PHPWCMS_TEMPLATE . 'inc_cntpart/felogin/' . $crow["acontent_template"])) {
    $_loginData = @unserialize($crow["acontent_form"]);
    $_loginData['template'] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_cntpart/felogin/' . $crow["acontent_template"]));
    $_loginData['form'] = get_tmpl_section('LOGIN_FORM', $_loginData['template']);
    $_loginData['logged_in'] = get_tmpl_section('LOGIN_IS', $_loginData['template']);
    $_loginData['register'] = get_tmpl_section('PROFILE_REGISTER', $_loginData['template']);
    $_loginData['manage'] = get_tmpl_section('PROFILE_MANAGE', $_loginData['template']);
    $_loginData['reminder'] = get_tmpl_section('REMINDER_FORM', $_loginData['template']);
    $_loginData['reminder_success'] = get_tmpl_section('REMINDER_SUCCESS', $_loginData['template']);
    $_loginData['reminder_email'] = get_tmpl_section('REMINDER_EMAIL', $_loginData['template']);
    $_loginData['session_key'] = session_id();
    $_loginData['template'] = $_loginData['form'];
    $_loginData['error'] = false;
    $_loginData['login'] = '';
    $_loginData['password'] = '';
    $_loginData['remember'] = 0;
    $_loginData['remind_data'] = '';
    $_loginData['felogin_profile_registration'] = empty($_loginData['felogin_profile_registration']) ? 0 : 1;
    $_loginData['felogin_profile_manage'] = empty($_loginData['felogin_profile_manage']) ? 0 : 1;
    $_loginData['validate_db']['userdetail'] = empty($_loginData['felogin_validate_userdetail']) ? 0 : 1;
    $_loginData['validate_db']['backenduser'] = empty($_loginData['felogin_validate_backenduser']) ? 0 : 1;
    // handle Login
    if (isset($_POST['feLogin'])) {
        $_loginData['login'] = slweg($_POST['feLogin']);
        $_loginData['password'] = slweg($_POST['fePassword']);