コード例 #1
0
 function replace_glossary_tag($matches)
 {
     global $content;
     $inner = trim($matches[2]);
     // search keyword in glossary table
     $keyword = trim($matches[1]);
     if ($keyword !== '') {
         $keyword = html_entity_decode($keyword, ENT_QUOTES, PHPWCMS_CHARSET);
         // check against cache
         if (!isset($content['glossary_cache'][$keyword])) {
             $like = aporeplace($keyword);
             $where = 'glossary_status=1 AND glossary_highlight=1 AND (';
             $where .= "glossary_keyword LIKE '" . $like . "' OR ";
             $where .= "glossary_keyword LIKE '" . $like . ",%' OR ";
             $where .= "glossary_keyword LIKE '%, " . $like . ",%' OR ";
             $where .= "glossary_keyword LIKE '%, " . $like . "'";
             $where .= ')';
             // retrieve only single keyword that matches best
             $entry = _dbGet('phpwcms_glossary', 'glossary_title, glossary_keyword, glossary_text, COUNT(glossary_id) AS count_all', $where, 'glossary_id', 'count_all DESC', '1');
             if (isset($entry[0])) {
                 // get keywords to store each in cache
                 $keywords = convertStringToArray($entry[0]['glossary_keyword']);
                 $title = empty($entry[0]['glossary_title']) ? $inner : html($entry[0]['glossary_title']);
                 $text = trim(clean_slweg($entry[0]['glossary_text']));
                 // store glossary item in cache
                 foreach ($keywords as $key) {
                     $content['glossary_cache'][$key] = array('title' => $title, 'text' => $text);
                 }
             }
         }
         // create ABBR
         if (isset($content['glossary_cache'][$keyword])) {
             $inner = '<abbr class="glossary" title="' . $content['glossary_cache'][$keyword]['title'] . ' :: ' . $content['glossary_cache'][$keyword]['text'] . '">' . $inner . '</abbr>';
         }
     }
     return $inner;
 }
コード例 #2
0
if (isset($_GET['page'])) {
    $_SESSION['seolog_page'] = intval($_GET['page']);
}
// set default values for paginating
if (empty($_SESSION['list_user_count'])) {
    $_SESSION['list_user_count'] = 25;
}
// paginate and search form processing
if (isset($_POST['do_pagination'])) {
    $_SESSION['list_active'] = empty($_POST['showactive']) ? 0 : 1;
    $_SESSION['list_inactive'] = empty($_POST['showinactive']) ? 0 : 1;
    $_SESSION['filter_seo'] = clean_slweg($_POST['filter']);
    if (empty($_SESSION['filter_seo'])) {
        unset($_SESSION['filter_seo']);
    } else {
        $_SESSION['filter_seo'] = convertStringToArray($_SESSION['filter_seo'], ' ');
        $_POST['filter'] = $_SESSION['filter_seo'];
    }
    $_SESSION['seolog_page'] = intval($_POST['page']);
}
if (empty($_SESSION['seolog_page'])) {
    $_SESSION['seolog_page'] = 1;
}
$_entry['list_active'] = isset($_SESSION['list_active']) ? $_SESSION['list_active'] : 1;
$_entry['list_inactive'] = isset($_SESSION['list_inactive']) ? $_SESSION['list_inactive'] : 1;
$_entry['query'] = '';
if (isset($_SESSION['filter_seo']) && is_array($_SESSION['filter_seo']) && count($_SESSION['filter_seo'])) {
    $_entry['filter_array'] = array();
    foreach ($_SESSION['filter_seo'] as $_entry['filter']) {
        //usr_name, usr_login, usr_email
        $_entry['filter_array'][] = "CONCAT(domain,query) LIKE '%" . aporeplace($_entry['filter']) . "%'";
コード例 #3
0
 } else {
     $fileName = sanitize_filename($_FILES["file"]["name"]);
     $fileExt = check_image_extension($_FILES["file"]["tmp_name"], $fileName);
     $fileExt = $fileExt === false ? which_ext($fileName) : $fileExt;
     $fileHash = md5($fileName . microtime());
     $fileType = is_mimetype_format($_FILES["file"]["type"]) ? $_FILES["file"]["type"] : get_mimetype_by_extension($fileExt);
     $fileSize = intval($_FILES["file"]["size"]);
     // Check against forbidden file names
     $forbiddenUploadName = array('.htaccess', 'web.config', 'lighttpd.conf', 'nginx.conf');
     if (in_array(strtolower($fileName), $forbiddenUploadName)) {
         $file_error["file"] = sprintf($BL['be_fprivup_err7'], $fileName);
     }
     // Only allowed file extensions
     if (empty($file_error["file"])) {
         if (is_string($phpwcms['allowed_upload_ext'])) {
             $phpwcms['allowed_upload_ext'] = convertStringToArray(strtolower($phpwcms['allowed_upload_ext']));
         }
         if ($fileExt === '') {
             $file_error["file"] = sprintf($BL['be_fprivup_err9'], implode(', ', $phpwcms['allowed_upload_ext']));
         } elseif (is_array($phpwcms['allowed_upload_ext']) && count($phpwcms['allowed_upload_ext']) && !in_array(strtolower($fileExt), $phpwcms['allowed_upload_ext'])) {
             $file_error["file"] = sprintf($BL['be_fprivup_err8'], strtoupper($fileName), implode(', ', $phpwcms['allowed_upload_ext']));
         }
     }
 }
 if (empty($file_error)) {
     if (isset($file_vars)) {
         $fileVarsField = ',f_vars';
         $fileVarsValue = ',' . _dbEscape(serialize($file_vars));
     } else {
         $fileVarsField = '';
         $fileVarsValue = '';
コード例 #4
0
/**
 * Simple MooTools Plugin Loader
 */
function initJSPlugin($plugin = '', $more = false)
{
    // enhance teplate JS parser for MooTools More
    // sample: <!-- JS: MORE:Fx/Fx.Elements,Fx/Fx.Accordion -->
    if (is_string($plugin) && $more === false && substr(strtoupper($plugin), 0, 5) == 'MORE:') {
        $plugin = trim(substr($plugin, 5));
        $more = true;
    }
    if ($more === false) {
        $plugin = 'mootools.' . $plugin . '.js';
        if (empty($GLOBALS['block']['custom_htmlhead'][$plugin])) {
            initJSLib();
            $GLOBALS['block']['custom_htmlhead'][$plugin] = getJavaScriptSourceLink(TEMPLATE_PATH . 'lib/mootools/plugin-1.4/' . $plugin);
        }
    } else {
        // Load MooTools More Plugins - simple Wrapper 'Fx/Fx.Slide,Fx/Fx.Scroll...'
        // it does not check dependents
        if (!is_array($plugin)) {
            $plugin = convertStringToArray($plugin);
        }
        if (count($plugin)) {
            initJSLib();
            // add mootools more core
            array_unshift($plugin, 'More/More');
            foreach ($plugin as $more) {
                if (empty($GLOBALS['block']['custom_htmlhead'][$more]) && is_file(PHPWCMS_TEMPLATE . 'lib/mootools/more-1.4/' . $more . '.js')) {
                    $GLOBALS['block']['custom_htmlhead'][$more] = getJavaScriptSourceLink(TEMPLATE_PATH . 'lib/mootools/more-1.4/' . $more . '.js');
                }
            }
        }
    }
    return TRUE;
}
コード例 #5
0
ファイル: general.inc.php プロジェクト: EDVLanger/phpwcms
function sanitize_multiple_emails($string)
{
    $string = preg_replace('/\\s|\\,]/', ';', $string);
    $string = convertStringToArray($string, ';');
    $string = implode(';', $string);
    return $string;
}
コード例 #6
0
$content["guestbook"]["aliasID"] = intval($_POST["cguestbook_aliasID"]);
if (!$content["guestbook"]["aliasID"]) {
    $content["guestbook"]["aliasID"] = '';
}
$content["guestbook"]["time"] = intval($_POST["cguestbook_time"]);
$content["guestbook"]["cookie"] = empty($_POST["cguestbook_cookie"]) ? 0 : 1;
$content["guestbook"]["captcha"] = empty($_POST["cguestbook_captcha"]) ? 0 : 1;
$content["guestbook"]["gb_login_show"] = empty($_POST["cguestbook_login_show"]) ? 0 : 1;
$content["guestbook"]["gb_login_post"] = empty($_POST["cguestbook_login_post"]) ? 0 : 1;
$content["guestbook"]["gb_urlcheck"] = empty($_POST["cguestbook_urlcheck"]) ? 0 : 1;
$content["guestbook"]["notify"] = empty($_POST["cguestbook_notify"]) ? 0 : 1;
$content["guestbook"]["notify_email"] = clean_slweg($_POST["cguestbook_notify_email"]);
if (empty($content["guestbook"]["notify_email"])) {
    $content["guestbook"]["notify"] = 0;
} else {
    $content["guestbook"]["notify_email"] = convertStringToArray(str_replace(',', ';', $content["guestbook"]["notify_email"]), ';');
    foreach ($content["guestbook"]["notify_email"] as $key => $item) {
        if (!is_valid_email($item)) {
            unset($content["guestbook"]["notify_email"][$key]);
        }
    }
    $content["guestbook"]["notify_email"] = implode(';', $content["guestbook"]["notify_email"]);
    if ($content["guestbook"]["notify_email"] == '') {
        $content["guestbook"]["notify"] = 0;
    }
}
$content["guestbook"]["captcha_maxchar"] = intval($_POST['cguestbook_captchamaxchar']);
if (!$content["guestbook"]["captcha_maxchar"]) {
    $content["guestbook"]["captcha_maxchar"] = 5;
} elseif ($content["guestbook"]["captcha_maxchar"] > 15) {
    $content["guestbook"]["captcha_maxchar"] = 15;
コード例 #7
0
}
// render JavaScript Plugins and/or JavaScript scripts that should be loaded in <head>
$content['all'] = preg_replace_callback('/<!--\\s+JS:(.*?)\\s+-->/s', 'renderHeadJS', $content['all']);
$content['all'] = preg_replace_callback('/<!--\\s+CSS:(.*?)\\s+-->/s', 'renderHeadCSS', $content['all']);
// test for frontend.js
if (!isset($GLOBALS['block']['custom_htmlhead']['frontend.js']) && preg_match('/MM_swapImage|BookMark_Page|clickZoom|mailtoLink/', $content['all'])) {
    initFrontendJS();
}
//check for additional template based onLoad JavaScript Code
if ($block["jsonload"]) {
    if (empty($pagelayout["layout_jsonload"])) {
        $pagelayout["layout_jsonload"] = '';
    } else {
        $pagelayout["layout_jsonload"] .= ';';
    }
    $pagelayout["layout_jsonload"] = convertStringToArray($pagelayout["layout_jsonload"] . $block["jsonload"], ';');
    $block['js_ondomready'][] = '		' . implode(';' . LF . '	', $pagelayout["layout_jsonload"]) . ';';
    $pagelayout["layout_jsonload"] = '';
}
// set OnLoad (DomReady) JavaScript
if (count($block['js_ondomready'])) {
    jsOnDomReady(implode(LF, $block['js_ondomready']));
}
// set OnUnLoad JavaScript
if (count($block['js_onunload'])) {
    jsOnUnLoad(implode(LF, $block['js_onunload']));
}
// set Inline JS
if (count($block['js_inline'])) {
    $block['custom_htmlhead']['inline'] = '  <script' . SCRIPT_ATTRIBUTE_TYPE . '>' . LF . SCRIPT_CDATA_START . LF;
    $block['custom_htmlhead']['inline'] .= implode(LF, $block['js_inline']);
コード例 #8
0
 $guestbook['post']['show'] = intval($_POST['guestbook_show']);
 if ($guestbook['post']['show'] > 2) {
     $guestbook['post']['show'] = 0;
 }
 // email error
 if (!is_valid_email($guestbook['post']['email'])) {
     $guestbook['error']['email'] = 'Proof the email address: it is empty or false.';
 }
 // name error
 if (empty($guestbook['post']['name'])) {
     $guestbook['error']['name'] = 'Don&#039;t forget to insert your name.';
 }
 // banned stuff
 $guestbook['ban_count'] = 0;
 if ($guestbook['ban']) {
     $guestbook['ban'] = convertStringToArray($guestbook['ban'], ' ');
     if (is_array($guestbook['ban']) && count($guestbook['ban'])) {
         foreach ($guestbook['ban'] as $key => $value) {
             if ($value = trim($value)) {
                 $guestbook['ban'][$key] = '/' . preg_quote($value, '/') . '/i';
                 $guestbook['ban_count']++;
             }
         }
     }
     if ($guestbook['ban_count']) {
         $guestbook['post']['msg'] = preg_replace($guestbook['ban'], $guestbook['replace'], $guestbook['post']['msg']);
     }
 }
 // processing image upload
 if (!empty($guestbook["image_upload"])) {
     $guestbook['error']['image'] = array();
コード例 #9
0
ファイル: front.func.inc.php プロジェクト: EDVLanger/phpwcms
function render_if_not_category($matches)
{
    $cat_ids = convertStringToArray($matches[1]);
    if (!count($cat_ids)) {
        return '';
    }
    $current = intval($GLOBALS['content']['cat_id']);
    foreach ($cat_ids as $id) {
        $id = intval($id);
        if ($id !== $current) {
            return str_replace('{IF_NOTCAT_ID}', $id, $matches[2]);
        }
    }
    return '';
}
コード例 #10
0
function _dbSaveCategories($categories = array(), $type = '', $pid = 0, $seperator = ',')
{
    $pid = intval($pid);
    $type = trim($type);
    if (is_string($categories)) {
        $categories = convertStringToArray($categories, $seperator);
    }
    // delete all related categories first
    if ($type && $pid) {
        $sql = 'DELETE FROM ' . DB_PREPEND . 'phpwcms_categories WHERE cat_pid=' . $pid . " AND cat_type=" . _dbEscape($type);
        _dbQuery($sql, 'DELETE');
    }
    if (is_array($categories) && count($categories) && $type && $pid) {
        $data = array('cat_type' => $type, 'cat_pid' => $pid, 'cat_status' => 1, 'cat_createdate' => date('Y-m-d H:i:s'), 'cat_changedate' => date('Y-m-d H:i:s'), 'cat_name' => '', 'cat_info' => '');
        foreach ($categories as $value) {
            $value = trim($value);
            if ($value != '') {
                $data['cat_name'] = $value;
                _dbInsert('phpwcms_categories', $data);
            }
        }
    }
}
コード例 #11
0
function parse_downloads($match)
{
    if (isset($match[1])) {
        $value = array();
        $value['cnt_object']['cnt_files']['id'] = convertStringToArray($match[1]);
        if (isset($value['cnt_object']['cnt_files']['id']) && is_array($value['cnt_object']['cnt_files']['id']) && count($value['cnt_object']['cnt_files']['id'])) {
            global $phpwcms;
            $value['cnt_object']['cnt_files']['caption'] = isset($match[3]) ? @html_entity_decode(trim($match[3]), ENT_QUOTES, PHPWCMS_CHARSET) : '';
            $value['files_direct_download'] = 0;
            $value['files_template'] = 'download-inline';
            if (!empty($match[2])) {
                $match[2] = explode('=', trim($match[2]));
                if (!empty($match[2][1])) {
                    $value['files_template'] = trim($match[2][1]);
                    if (which_ext($value['files_template']) == '') {
                        $value['files_template'] .= '.tmpl';
                    }
                }
            }
            $IS_NEWS_CP = true;
            $crow = array();
            $news = array('files_result' => '');
            // include content part files renderer
            include PHPWCMS_ROOT . '/include/inc_front/content/cnt7.article.inc.php';
            if ($news['files_result']) {
                return $news['files_result'];
            }
        }
    }
    return isset($match[3]) ? $match[3] : '';
}
コード例 #12
0
if (isset($_GET['page'])) {
    $_SESSION['detail_page'] = intval($_GET['page']);
}
// set default values for paginating
if (empty($_SESSION['list_count'])) {
    $_SESSION['list_count'] = 25;
}
// paginate and search form processing
if (isset($_POST['do_pagination'])) {
    $_SESSION['list_active'] = empty($_POST['showactive']) ? 0 : 1;
    $_SESSION['list_inactive'] = empty($_POST['showinactive']) ? 0 : 1;
    $_SESSION['filter_shop_category'] = clean_slweg($_POST['filter']);
    if (empty($_SESSION['filter_shop_category'])) {
        unset($_SESSION['filter_shop_category']);
    } else {
        $_SESSION['filter_shop_category'] = convertStringToArray($_SESSION['filter_shop_category'], ' ');
        $_POST['filter'] = $_SESSION['filter_shop_category'];
    }
    $_SESSION['detail_page'] = intval($_POST['page']);
}
if (empty($_SESSION['detail_page'])) {
    $_SESSION['detail_page'] = 1;
}
$_entry['list_active'] = isset($_SESSION['list_active']) ? $_SESSION['list_active'] : 1;
$_entry['list_inactive'] = isset($_SESSION['list_inactive']) ? $_SESSION['list_inactive'] : 1;
// set correct status query
if ($_entry['list_active'] != $_entry['list_inactive']) {
    if (!$_entry['list_active']) {
        $_entry['query'] .= 'cat_status=0';
    }
    if (!$_entry['list_inactive']) {
コード例 #13
0
     break;
 case 'list':
     /*
      * Liste
      */
     $content['form']["fields"][$field_counter]['size'] = intval($_POST['cform_field_size'][$key]) ? intval($_POST['cform_field_size'][$key]) : 3;
     $content['form']["fields"][$field_counter]['max'] = intval($_POST['cform_field_max'][$key]) ? 1 : 0;
     //mutiple or not
     break;
 case 'newsletter':
     /*
      * Newsletter
      */
     $content['form']["fields"][$field_counter]['size'] = intval($_POST['cform_field_size'][$key]) ? intval($_POST['cform_field_size'][$key]) : '';
     $content['form']["fields"][$field_counter]['max'] = '';
     $content['form']["fields"][$field_counter]['value'] = convertStringToArray($content['form']["fields"][$field_counter]['value'], "\n", 'UNIQUE', false);
     $newletter_array = array();
     $newletter_array['double_optin'] = 0;
     $newletter_array['subject'] = 'Verify your newsletter subscription';
     foreach ($content['form']["fields"][$field_counter]['value'] as $newsletter) {
         $newsletter = explode('=', $newsletter, 2);
         $newsletter[0] = trim($newsletter[0]);
         $newsletter[1] = empty($newsletter[1]) ? '' : trim($newsletter[1]);
         if (empty($newsletter[0]) || empty($newsletter[1])) {
             continue;
         } else {
             switch ($newsletter[0]) {
                 case 'all':
                     $newletter_array['all'] = $newsletter[1];
                     break;
                 case 'email_field':
コード例 #14
0
 } else {
     // Take article Post data
     $article_err = array();
     $article["article_catid"] = intval($_POST["article_cid"]);
     $article["article_title"] = clean_slweg($_POST["article_title"], 255);
     $article["article_alias"] = proof_alias($article["article_id"], $_POST["article_alias"], 'ARTICLE');
     $article["article_subtitle"] = clean_slweg($_POST["article_subtitle"], 255);
     $article["article_menutitle"] = clean_slweg($_POST["article_menutitle"], 255);
     $article["article_description"] = clean_slweg($_POST["article_description"]);
     $article["article_summary"] = str_replace('<p></p>', '<p>&nbsp;</p>', slweg($_POST["article_summary"]));
     $article["article_notitle"] = isset($_POST["article_notitle"]) ? 1 : 0;
     $article["article_hidesummary"] = isset($_POST["article_hidesummary"]) ? 1 : 0;
     $article["article_aktiv"] = isset($_POST["article_aktiv"]) ? 1 : 0;
     $article["article_begin"] = clean_slweg($_POST["article_begin"]);
     $article["article_end"] = clean_slweg($_POST["article_end"]);
     $article["article_keyword"] = implode(', ', convertStringToArray(clean_slweg($_POST["article_keyword"]), ','));
     $article["article_lang"] = isset($_POST["article_lang"]) ? clean_slweg($_POST["article_lang"]) : '';
     $article['article_lang_type'] = $article["article_lang"] == '' || empty($_POST["article_lang_type"]) ? '' : in_array($_POST["article_lang_type"], array('category', 'article')) ? $_POST["article_lang_type"] : '';
     $article['article_lang_id'] = $article['article_lang_type'] == '' || empty($_POST["article_lang_id"]) ? 0 : intval($_POST["article_lang_id"]);
     $article["article_redirect"] = clean_slweg($_POST["article_redirect"]);
     $set_begin = isset($_POST["set_begin"]) ? 1 : 0;
     $set_end = isset($_POST["set_end"]) ? 1 : 0;
     $article['article_nosearch'] = isset($_POST['article_nosearch']) ? 1 : '';
     $article['article_nositemap'] = isset($_POST['article_nositemap']) ? 1 : 0;
     $article['article_aliasid'] = intval($_POST["article_aliasid"]);
     $article['article_headerdata'] = isset($_POST["article_headerdata"]) ? 1 : 0;
     $article['article_morelink'] = isset($_POST["article_morelink"]) ? 1 : 0;
     $article['article_noteaser'] = isset($_POST["article_noteaser"]) ? 1 : 0;
     $article["article_pagetitle"] = clean_slweg($_POST["article_pagetitle"]);
     $article['article_paginate'] = isset($_POST["article_paginate"]) ? 1 : 0;
     $article['article_sort'] = empty($_POST["article_sort"]) ? 0 : intval($_POST["article_sort"]);
コード例 #15
0
     $acat_hidden = 1;
     if (isset($_POST["acat_hiddenactive"])) {
         $acat_hidden = 2;
     }
 }
 $acat_cntpart = '';
 if (isset($_POST['acat_cp']) && is_array($_POST['acat_cp'])) {
     $acat_cntpart = $_POST['acat_cp'];
     $acat_cntpart = array_unique($acat_cntpart);
     $acat_cntpart = implode(',', $acat_cntpart);
 }
 $acat_class = empty($_POST["acat_class"]) ? '' : preg_replace('/[^a-zA-Z0-9_\\- ]/', '', clean_slweg($_POST["acat_class"], 150));
 if (empty($_POST["acat_keywords"])) {
     $acat_keywords = '';
 } else {
     $acat_keywords = substr(implode(', ', convertStringToArray(clean_slweg($_POST["acat_keywords"], 255))), 0, 255);
 }
 $acat_breadcrumb = 0;
 if (!empty($_POST["acat_breadcrumb_nothidden"])) {
     $acat_breadcrumb = 1;
 }
 if (!empty($_POST["acat_breadcrumb_nolink"])) {
     $acat_breadcrumb += 2;
 }
 if (isset($_POST["acat_id"]) && $_POST["acat_id"] === 'index') {
     // write index page config into flat file
     $sql = "<?php\n";
     $sql .= "\$indexpage['acat_name']\t\t= '" . str_replace("''", "\\'", clean_slweg($_POST["acat_name"])) . "';\n";
     $sql .= "\$indexpage['acat_info']\t\t= '" . str_replace("''", "\\'", clean_slweg($_POST["acat_info"], 32000)) . "';\n";
     $sql .= "\$indexpage['acat_alias']\t\t= '" . proof_alias($_POST["acat_id"], $_POST["acat_alias"]) . "';\n";
     $sql .= "\$indexpage['acat_aktiv']\t\t= " . (isset($_POST["acat_aktiv"]) ? 1 : 0) . ";\n";
コード例 #16
0
    echo 'No valid newsletter ID given.';
} elseif ($_SESSION["wcs_user_admin"] == 1) {
    $notest = 1;
    $recipient = array();
    $loop = isset($_GET['loop']) ? intval($_GET['loop']) : 0;
    if (!$loop && @ini_get('safe_mode') == '1') {
        $loop = 25;
    }
    $pause = isset($_GET['pause']) ? intval($_GET['pause']) : 1;
    //check if a test email should be send
    if (!empty($_GET['send_testemail'])) {
        $notest = 0;
        $test_email_error = array();
        $test_email = clean_slweg($_GET['send_testemail']);
        $test_email = str_replace(array(' ', ','), ';', $test_email);
        $test_email = convertStringToArray($test_email, ';');
        foreach ($test_email as $test_email_value) {
            if (is_valid_email($test_email_value)) {
                $recipient[] = array('address_name' => 'Newsletter test recipient', 'address_email' => $test_email_value, 'address_key' => '', 'queue_id' => 0);
                echo '<p><strong>' . $BL['be_newsletter_testemail'] . '</strong></p>';
            } else {
                $test_email_error[] = $test_email_value;
            }
        }
        if (count($test_email_error)) {
            echo str_replace('###TEST###', '&nbsp;&#8226; ' . implode('&nbsp;&#8226; ', $test_email_error), $BL['be_newsletter_testerror']);
        }
    } elseif (isset($_GET['send_confirm']) && $_GET['send_confirm'] == 'confirmed') {
        // retrieve all recipients now
        // disable time limit
        if (!$loop) {
コード例 #17
0
 * @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.");
}
// ----------------------------------------------------------------
// Content Type Newsletter Subscription
$content["newsletter"]["text"] = html_specialchars(clean_slweg($_POST["cnewsletter_text"]));
$content["newsletter"]["label_email"] = html_specialchars(clean_slweg($_POST["cnewsletter_label_email"]));
$content["newsletter"]["label_name"] = html_specialchars(clean_slweg($_POST["cnewsletter_label_name"]));
$content["newsletter"]["label_subscriptions"] = html_specialchars(clean_slweg($_POST["cnewsletter_label_subscriptions"]));
$content["newsletter"]["all_subscriptions"] = html_specialchars(clean_slweg($_POST["cnewsletter_all_subscriptions"]));
$content["newsletter"]["button_text"] = html_specialchars(clean_slweg($_POST["cnewsletter_button_text"]));
$content["newsletter"]["success_text"] = html_specialchars(clean_slweg($_POST["cnewsletter_success_text"]));
$content["newsletter"]["reg_text"] = html_specialchars(clean_slweg($_POST["cnewsletter_reg_text"]));
$content["newsletter"]["logoff_text"] = html_specialchars(clean_slweg($_POST["cnewsletter_logoff_text"]));
$content["newsletter"]["change_text"] = html_specialchars(clean_slweg($_POST["cnewsletter_change_text"]));
$content["newsletter"]["url1"] = clean_slweg($_POST["cnewsletter_url1"]);
$content["newsletter"]["url2"] = clean_slweg($_POST["cnewsletter_url2"]);
$content['subscription_temp'] = convertStringToArray($_POST['cnewsletter_subscription_left']);
$content["newsletter"]["subscription"] = array();
foreach ($content['subscription_temp'] as $subscr_value) {
    $subscr_value = intval($subscr_value);
    $content["newsletter"]["subscription"][$subscr_value] = $subscr_value;
}
$content["newsletter"]["pos"] = intval($_POST["cnewsletter_pos"]);
コード例 #18
0
ファイル: cnt26.inc.php プロジェクト: EDVLanger/phpwcms
    $content['recipe']['severity'] = 1;
}
// retrieve all available keywords
$content['recipe']['get_keywords'] = _dbQuery('SELECT acontent_text FROM ' . DB_PREPEND . 'phpwcms_articlecontent WHERE acontent_type=26 AND acontent_trash=0');
$content['recipe']['all_keywords'] = '';
if ($content['recipe']['get_keywords']) {
    foreach ($content['recipe']['get_keywords'] as $temp_val) {
        if ($temp_val['acontent_text']) {
            if ($content['recipe']['all_keywords']) {
                $content['recipe']['all_keywords'] .= ', ';
            }
            $content['recipe']['all_keywords'] .= $temp_val['acontent_text'];
        }
    }
}
$content['recipe']['all_keywords'] = convertStringToArray($content['recipe']['all_keywords']);
?>
<!--
<link href="../../inc_css/phpwcms.css" rel="stylesheet" type="text/css">
<table cellspacing="0" cellpadding="0" border="0" bgcolor="#FFFFFF" width="440">

//-->

<tr><td colspan="2"><img src="img/lines/l538_70.gif" alt=""></td></tr>
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8"></td></tr>
<?php 
if (count($content['recipe']['all_keywords'])) {
    echo '<tr><td>&nbsp;</td><td>';
    echo '<table cellpadding="0" cellspacing="0" border="0" bgcolor="#E7E8EB"><tr><td style="padding:2px;">';
    echo '<select name="ph1" id="ph1" class="v10" ';
    echo 'onChange="insertAtCursorPos(document.articlecontent.recipe_category, ';
コード例 #19
0
     // check if "copy to" email template is equal recipient
     // email template and set it the same
     if ($cnt_form['template_equal'] == 1) {
         $cnt_form['template_format_copy'] = $cnt_form['template_format'];
         $cnt_form['template_copy'] = $cnt_form['template'];
     }
 }
 // get email addresses of recipients and senders
 $cnt_form["target"] = convertStringToArray($cnt_form["target"], ';');
 if (empty($cnt_form["subject"])) {
     $cnt_form["alt_subj"] = str_replace('http://', '', $phpwcms['site']);
     $cnt_form["alt_subj"] = substr($cnt_form["alt_subj"], 0, trim($phpwcms['site'], '/'));
     $cnt_form["subject"] = 'Webform: ' . $cnt_form["alt_subj"];
 }
 // check for BCC Addresses
 $cnt_form['cc'] = empty($cnt_form['cc']) ? array() : convertStringToArray($cnt_form['cc'], ';');
 // first try to send copy message
 if (!empty($cnt_form['sendcopy']) && !empty($cnt_form["copyto"]) && is_valid_email($cnt_form["copyto"])) {
     // check if user has avoided receiving email copy
     if ($cnt_form['option_email_copy'] !== false) {
         $cnt_form['cc'][] = $cnt_form["copyto"];
     }
     $cnt_form['fromEmail'] = $cnt_form["copyto"];
 }
 // check for unique recipients (target) and sender (fromEmail)
 if (!empty($cnt_form['checktofrom']) && !empty($cnt_form['fromEmail'])) {
     foreach ($cnt_form["target"] as $value) {
         if (strtolower($cnt_form['fromEmail']) == strtolower($value)) {
             $POST_ERR[] = '@@Sender&#8217;s email must be different from recipient&#8217;s email@@';
             break;
         }
コード例 #20
0
 }
 $mail_customer = str_replace(array('{CURRENCY_SYMBOL}', '{$}'), $_shopPref['shop_pref_currency'], $mail_customer);
 $mail_neworder = str_replace(array('{CURRENCY_SYMBOL}', '{$}'), $_shopPref['shop_pref_currency'], $mail_neworder);
 // store order in database
 $order_data = array('order_number' => $order_num, 'order_date' => gmdate('Y-m-d H:i'), 'order_name' => $_SESSION[CART_KEY]['step1']['INV_NAME'], 'order_firstname' => $_SESSION[CART_KEY]['step1']['INV_FIRSTNAME'], 'order_email' => $_SESSION[CART_KEY]['step1']['EMAIL'], 'order_net' => $subtotal['float_total_net'], 'order_gross' => $subtotal['float_total_gross'], 'order_payment' => $payment, 'order_data' => @serialize(array('cart' => $cart_data, 'address' => $_SESSION[CART_KEY]['step1'], 'mail_customer' => $mail_customer, 'mail_self' => $mail_neworder, 'subtotal' => array('subtotal_net' => $subtotal['float_net'], 'subtotal_gross' => $subtotal['float_gross']), 'shipping' => array('shipping_net' => $subtotal['float_shipping_net'], 'shipping_gross' => $subtotal['float_shipping_gross'], 'shipping_distance' => $subtotal['shipping_distance'] === false ? 0 : $subtotal['shipping_distance']), 'discount' => array('discount_net' => $subtotal['float_discount_net'], 'discount_gross' => $subtotal['float_discount_gross']), 'loworder' => array('loworder_net' => $subtotal['float_loworder_net'], 'loworder_gross' => $subtotal['float_loworder_gross']), 'weight' => $subtotal['float_weight'], 'lang' => $phpwcms['default_lang'], 'distance' => $subtotal['shipping_distance'] === false ? null : $subtotal['shipping_distance_details'])), 'order_status' => 'NEW-ORDER');
 // receive order db ID
 $order_data = _dbInsert('phpwcms_shop_orders', $order_data);
 // send mail to customer
 $email_from = _getConfig('shop_pref_email_from', '_shopPref');
 if (!is_valid_email($email_from)) {
     $email_from = $phpwcms['SMTP_FROM_EMAIL'];
 }
 $order_mail_customer = array('recipient' => $_SESSION[CART_KEY]['step1']['EMAIL'], 'toName' => $_SESSION[CART_KEY]['step1']['INV_FIRSTNAME'] . ' ' . $_SESSION[CART_KEY]['step1']['INV_NAME'], 'subject' => str_replace('{ORDER}', $order_num, $_tmpl['config']['mail_customer_subject']), 'text' => $mail_customer, 'from' => $email_from, 'sender' => $email_from);
 $order_data_mail_customer = sendEmail($order_mail_customer);
 // send mail to shop
 $send_order_to = convertStringToArray(_getConfig('shop_pref_email_to', '_shopPref'), ';');
 if (empty($send_order_to[0]) || !is_valid_email($send_order_to[0])) {
     $email_to = $phpwcms['SMTP_FROM_EMAIL'];
 } else {
     $email_to = $send_order_to[0];
     unset($send_order_to[0]);
 }
 $order_mail_self = array('from' => $_SESSION[CART_KEY]['step1']['EMAIL'], 'fromName' => $_SESSION[CART_KEY]['step1']['INV_FIRSTNAME'] . ' ' . $_SESSION[CART_KEY]['step1']['INV_NAME'], 'subject' => str_replace('{ORDER}', $order_num, $_tmpl['config']['mail_neworder_subject']), 'text' => $mail_neworder, 'recipient' => $email_to, 'sender' => $_SESSION[CART_KEY]['step1']['EMAIL']);
 $order_data_mail_self = sendEmail($order_mail_self);
 // are there additional recipients for orders?
 if (count($send_order_to)) {
     foreach ($send_order_to as $value) {
         $order_mail_self['recipient'] = $value;
         @sendEmail($order_mail_self);
     }
 }
コード例 #21
0
ファイル: cnt.article.php プロジェクト: EDVLanger/phpwcms
    $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;
                foreach ($content['glossary']['glossary_alphabet'] as $content['glossary']['char']) {
                    // OK start here
                    if ($content['glossary']['char'] == $content['glossary']['filter'][0]) {
コード例 #22
0
$crow["acontent_form"] = unserialize($crow["acontent_form"]);
if (file_exists(PHPWCMS_TEMPLATE . 'inc_cntpart/recipe/' . $crow["acontent_form"]['template'])) {
    $crow["acontent_form"]['template'] = render_device(@file_get_contents(PHPWCMS_TEMPLATE . 'inc_cntpart/recipe/' . $crow["acontent_form"]['template']));
} else {
    $crow["acontent_form"]['template'] = '<div class="recipe">[TITLE]
	<h3>{TITLE}</h3>[/TITLE][SUBTITLE]
	<h4>{SUBTITLE}</h4>[/SUBTITLE][INGREDIENTS]
	<p>{INGREDIENTS}</p>[/INGREDIENTS][CALORIES]
	<p>{CALORIES} kJ / {KCAL} kcal[CALORIESADD] ({CALORIESADD})[/CALORIESADD]</p>[/CALORIES][PREPARATION]
	<p>{PREPARATION}</p>[/PREPARATION][TIME]
	<div class="time">{TIME} Minuten[TIMEADD], {TIMEADD}[/TIMEADD]</div>[/TIME]
	<div class="severity"><img src="img/severity_{SEVERITY}.gif" alt="" /></div>[CAT]
	<div class="cat">{CAT}</div>[/CAT]</div>';
}
$crow["acontent_form"]['kcal'] = ceil($crow["acontent_form"]['calorificvalue'] / 4.1868);
$crow["acontent_form"]['ingredients'] = convertStringToArray($crow["acontent_form"]['ingredients'], "\n", 'NOT-UNIQUE', false);
if (count($crow["acontent_form"]['ingredients'])) {
    $crow["acontent_form"]['temp'] = array();
    $ingrediens_counter = 0;
    foreach ($crow["acontent_form"]['ingredients'] as $temp_val) {
        $temp_val = html_specialchars($temp_val);
        if ($temp_val[0] == '*') {
            //headline
            if (isset($crow["acontent_form"]['temp'][$ingrediens_counter]['h'])) {
                $ingrediens_counter++;
            }
            $crow["acontent_form"]['temp'][$ingrediens_counter]['h'] = substr($temp_val, 1);
            continue;
        }
        $crow["acontent_form"]['temp1'] = explode('|', $temp_val, 2);
        $temp_val = implode(' ', $crow["acontent_form"]['temp1']);
コード例 #23
0
// 初始化日志
$log->LogInfo("===========处理后台请求开始============");
$params = array('version' => '5.0.0', 'encoding' => 'utf-8', 'certId' => getSignCertId(), 'signMethod' => '01', 'txnType' => '03', 'txnSubType' => '00', 'bizType' => '000201', 'accessType' => '0', 'channelType' => '07', 'backUrl' => SDK_BACK_NOTIFY_URL, 'orderId' => $_POST["orderId"], 'merId' => $_POST["merId"], 'origQryId' => $_POST["origQryId"], 'txnTime' => $_POST["txnTime"], 'txnAmt' => $_POST["txnAmt"]);
sign($params);
// 签名
$url = SDK_BACK_TRANS_URL;
$log->LogInfo("后台请求地址为>" . $url);
$result = post($params, $url, $errMsg);
if (!$result) {
    //没收到200应答的情况
    printResult($url, $params, "");
    echo "POST请求失败:" . $errMsg;
    return;
}
$log->LogInfo("后台返回结果为>" . $result);
$result_arr = convertStringToArray($result);
printResult($url, $params, $result);
//页面打印请求应答数据
if (!verify($result_arr)) {
    echo "应答报文验签失败<br>\n";
    return;
}
echo "应答报文验签成功<br>\n";
if ($result_arr["respCode"] == "00") {
    //交易已受理,等待接收后台通知更新订单状态,如果通知长时间未收到也可发起交易状态查询
    //TODO
    echo "受理成功。<br>\n";
} else {
    if ($result_arr["respCode"] == "03" || $result_arr["respCode"] == "04" || $result_arr["respCode"] == "05") {
        //后续需发起交易状态查询交易确定交易状态
        //TODO
コード例 #24
0
$content['alink']['alink_categoryalias'] = empty($_POST['calink_categoryalias']) ? 0 : 1;
// max auto article
$content['alink']['alink_max'] = intval($_POST['calink_max']);
// image settings
$content['alink']['alink_width'] = intval($_POST['calink_width']);
$content['alink']['alink_height'] = intval($_POST['calink_height']);
$content['alink']['alink_zoom'] = empty($_POST['calink_zoom']) ? 0 : 1;
$content['alink']['alink_unique'] = empty($_POST['calink_unique']) ? 0 : 1;
$content['alink']['alink_crop'] = empty($_POST['calink_crop']) ? 0 : 1;
$content['alink']['alink_prio'] = empty($_POST['calink_prio']) ? 0 : 1;
if (empty($_POST['calink_andor'])) {
    $content['alink']['alink_andor'] = 'OR';
} else {
    $content['alink']['alink_andor'] = in_array($_POST['calink_andor'], array('OR', 'AND', 'NOT')) ? $_POST['calink_andor'] : 'OR';
}
$content['alink']['alink_category'] = convertStringToArray(clean_slweg($_POST['calink_category']));
if (empty($content['alink']['alink_width'])) {
    $content['alink']['alink_width'] = '';
}
if (empty($content['alink']['alink_height'])) {
    $content['alink']['alink_height'] = '';
}
if (empty($content['alink']['alink_wordlimit'])) {
    $content['alink']['alink_wordlimit'] = '';
}
if (empty($content['alink']['alink_max'])) {
    $content['alink']['alink_max'] = '';
}
foreach ($content['alink']['alink_id'] as $key => $value) {
    $value = intval($value);
    if ($value) {
コード例 #25
0
<script>
<?php 
$item = $db->getItem();
$rows = array();
while ($row = $item->fetchArray()) {
    $row["taglie"] = convertStringToArray($row["taglie"]);
    $rows[$row["nome"]] = $row;
}
echo "var db=" . json_encode($rows) . ";";
?>
var row_count = 0;
var total = 0;

function print_row(){
	var row = $("<tr></tr>");
	row.attr("id", "n"+row_count);
	row_count++;
	var tdnome = $("<td></td>");
	select_nome = $("<select></select>");
	select_nome.addClass("form-control");
	select_nome.attr("onchange", "item_selected(this)");
	select_nome.append($("<option disabled selected></option>").text("Scegli un articolo"));
	for(var i in db){
		var option = $("<option></option>");
		option.append(db[i].nome);
		select_nome.append(option);
	}
	tdnome.append(select_nome);
	row.append(tdnome);
	row.append('<td id="td_descr"></td><td id="td_taglie"></td><td id="td_prezzo"></td><td id="td_quantity"></td><td id="td_button"></td>');
	$("tbody").append(row);
コード例 #26
0
        $group["member"] = isset($_POST["acat_access"]) && is_array($_POST["acat_access"]) ? implode(',', $_POST["acat_access"]) : '';
        $group["value"] = clean_slweg($_POST["group_value"]);
        $group["trash"] = empty($_POST["group_trash"]) ? 0 : intval($_POST["group_trash"]);
        $group["active"] = empty($_POST["group_active"]) ? 0 : 1;
        if (empty($group["name"])) {
            $group["error"] = 1;
        } else {
            $data = array('group_name' => $group["name"], 'group_member' => $group["member"], 'group_value' => $group["value"], 'group_trash' => $group["trash"], 'group_active' => $group["active"]);
            $result = $group["id"] ? _dbUpdate('phpwcms_usergroup', $data, 'group_id=' . $group["id"]) : _dbInsert('phpwcms_usergroup', $data);
            if (isset($result['AFFECTED_ROWS']) || isset($result['INSERT_ID'])) {
                headerRedirect(PHPWCMS_URL . 'phpwcms.php?' . get_token_get_string('csrftoken') . '&do=admin&p=1');
            } else {
                echo mysql_error();
            }
        }
        $group["member"] = convertStringToArray($group["member"]);
    }
    ?>



		  <form action="phpwcms.php?do=admin&amp;p=1&amp;create_group=1" method="post" name="editsitestructure" id="editsitestructure" onsubmit="selectAllOptions(this.acat_access);selectAllOptions(this.acat_cp);var x = wordcount(this.acat_name.value);if(x&lt;1) {alert('Fill in a category title! \n\n('+x+' words total)');this.acat_name.focus();return false;}">
		  <tr align="center" bgcolor="#F0F2F4"><td colspan="2"><table border="0" cellpadding="0" cellspacing="0" summary="">
		  	<?php 
    if (!empty($group["error"])) {
        ?>
		    <tr>
		      <td align="right" class="chatlist"><font color="#FF3300"><?php 
        echo $BL['be_admin_usr_err'];
        ?>
:</font>&nbsp;</td>
コード例 #27
0
}
// set default values for paginating
if (empty($_SESSION['list_user_count'])) {
    $_SESSION['list_user_count'] = 25;
}
// get filter and paginating form values
if (isset($_POST['do_pagination'])) {
    $_SESSION['list_active'] = empty($_POST['showactive']) ? 0 : 1;
    $_SESSION['list_inactive'] = empty($_POST['showinactive']) ? 0 : 1;
    $_SESSION['list_channel'] = empty($_POST['showchannel']) ? 0 : 1;
    $_SESSION['subscriber_page'] = intval($_POST['page']);
    $_SESSION['filter_subscriber'] = clean_slweg($_POST['filter']);
    if (empty($_SESSION['filter_subscriber'])) {
        unset($_SESSION['filter_subscriber']);
    } else {
        $_SESSION['filter_subscriber'] = convertStringToArray($_SESSION['filter_subscriber'], ' ');
    }
}
if (empty($_SESSION['subscriber_page'])) {
    $_SESSION['subscriber_page'] = 1;
}
// default settings for listing selected users
$_userInfo['list_active'] = isset($_SESSION['list_active']) ? $_SESSION['list_active'] : 1;
$_userInfo['list_inactive'] = isset($_SESSION['list_inactive']) ? $_SESSION['list_inactive'] : 1;
$_userInfo['list_channel'] = isset($_SESSION['list_channel']) ? $_SESSION['list_channel'] : 0;
if ($_userInfo['list_channel'] && isset($_POST['showchannel'])) {
    $_userInfo['channel'] = empty($_POST['subscribe_select']) ? false : $_POST['subscribe_select'];
    $_SESSION['channel'] = $_userInfo['channel'];
} elseif ($_userInfo['list_channel'] && isset($_SESSION['channel'])) {
    $_userInfo['channel'] = $_SESSION['channel'];
} else {
コード例 #28
0
$content["search"]["label_pages"] = slweg($_POST['csearch_label_pages']);
$content["search"]["minchar"] = intval($_POST['csearch_minchar']);
if (!$content["search"]["minchar"]) {
    $content["search"]["minchar"] = 3;
}
$content["search"]["start_at"] = isset($_POST['csearch_start_at']) && is_array($_POST['csearch_start_at']) ? $_POST['csearch_start_at'] : array();
$content["search"]["show_always"] = empty($_POST['csearch_show_always']) ? 0 : 1;
$content["search"]["show_top"] = empty($_POST['csearch_show_top']) ? 0 : 1;
$content["search"]["show_bottom"] = empty($_POST['csearch_show_bottom']) ? 0 : 1;
$content["search"]["show_next"] = empty($_POST['csearch_show_next']) ? 0 : 1;
$content["search"]["show_prev"] = empty($_POST['csearch_show_prev']) ? 0 : 1;
$content["search"]["module"] = array();
if (isset($_POST['csearch_module']) && is_array($_POST['csearch_module']) && count($_POST['csearch_module'])) {
    foreach ($_POST['csearch_module'] as $key => $value) {
        $value = strtolower(trim($key));
        if ($value) {
            $content["search"]["module"][$value] = true;
        }
    }
}
$content['search']["search_news"] = empty($_POST['csearch_news']) ? 0 : 1;
$content['search']["news_lang"] = empty($_POST['csearch_news_lang']) ? array() : convertStringToArray(strtolower(clean_slweg($_POST['csearch_news_lang'])));
$content['search']["news_category"] = empty($_POST['csearch_news_category']) ? array() : convertStringToArray(strtolower(clean_slweg($_POST['csearch_news_category'])));
$content['search']["news_andor"] = clean_slweg($_POST['csearch_news_andor']);
$content['search']["news_url"] = clean_slweg($_POST['csearch_news_url']);
$content['search']["no_filenames"] = empty($_POST['csearch_nofilenames']) ? 0 : 1;
$content['search']["no_username"] = empty($_POST['csearch_nousername']) ? 0 : 1;
$content['search']["no_caption"] = empty($_POST['csearch_nocaption']) ? 0 : 1;
$content['search']["no_keyword"] = empty($_POST['csearch_nokeyword']) ? 0 : 1;
$content['search']["hide_summary"] = empty($_POST['csearch_hidesummary']) ? 0 : 1;
$content['search']["type"] = empty($_POST['csearch_type']) || strtoupper($_POST['csearch_type']) == 'OR' ? 'OR' : 'AND';
コード例 #29
0
     $plugin['data']['shopprod_weight'] = 0;
     $plugin['data']['shopprod_size'] = '';
     $plugin['data']['shopprod_color'] = '';
     $plugin['data']['shopprod_url'] = '';
     $plugin['data']['shopprod_listall'] = 0;
     $plugin['data']['shopprod_lang'] = '';
     $plugin['data']['shopprod_overwrite_meta'] = 1;
     $plugin['data']['shopprod_opengraph'] = empty($phpwcms['set_sociallink']['shop']) ? 0 : 1;
 } else {
     $sql = 'SELECT * FROM ' . DB_PREPEND . 'phpwcms_shop_products WHERE ';
     $sql .= "shopprod_id = " . $plugin['data']['shopprod_id'] . ' LIMIT 1';
     $plugin['data'] = _dbQuery($sql);
     if (isset($plugin['data'][0])) {
         $plugin['data'] = $plugin['data'][0];
         $plugin['data']['shopprod_changedate'] = strtotime($plugin['data']['shopprod_changedate']);
         $plugin['data']['shopprod_category'] = convertStringToArray($plugin['data']['shopprod_category']);
         $plugin['data']['shopprod_var'] = @unserialize($plugin['data']['shopprod_var']);
         if (isset($plugin['data']['shopprod_var']['images']) && is_array($plugin['data']['shopprod_var']['images'])) {
             $plugin['data']['shopprod_images'] = $plugin['data']['shopprod_var']['images'];
         } else {
             $plugin['data']['shopprod_images'] = array();
         }
         if (isset($plugin['data']['shopprod_var']['files']) && is_array($plugin['data']['shopprod_var']['files'])) {
             $plugin['data']['shopprod_files'] = $plugin['data']['shopprod_var']['files'];
         } else {
             $plugin['data']['shopprod_files'] = array();
         }
         $plugin['data']['shopprod_caption'] = array();
         $plugin['data']['shopprod_filecaption'] = array();
         $plugin['data']['shopprod_url'] = isset($plugin['data']['shopprod_var']['url']) ? $plugin['data']['shopprod_var']['url'] : '';
     } else {
コード例 #30
0
     $news['tmpl_row_space'] = get_tmpl_section('NEWS_LIST_ROW_SPACE', $news['template']);
 } else {
     // or not in list mode
     $news['tmpl_news'] = '[NEWS_ENTRIES]{NEWS_ENTRIES}[/NEWS_ENTRIES]';
     $news['tmpl_entry'] = get_tmpl_section('NEWS_DETAIL', $news['template']);
     $news['tmpl_entry_space'] = '';
     $news['tmpl_row_space'] = '';
 }
 $news['tmpl_gallery_item'] = '';
 // get template based config and merge with defaults
 $news['config'] = array_merge(array('news_per_row' => 1, 'news_teaser_limit_chars' => 0, 'news_teaser_limit_words' => 0, 'news_teaser_limit_ellipse' => $GLOBALS['template_default']['ellipse_sign'], 'files_template_list' => 'default', 'files_template_detail' => 'default', 'files_direct_download' => 0, 'gallery_allowed_ext' => 'jpg,jpeg,png', 'gallery_filecenter_info' => 1), parse_ini_str(get_tmpl_section('NEWS_SETTINGS', $news['template']), false));
 $news['config']['news_per_row'] = abs(intval($news['config']['news_per_row']));
 $news['config']['news_teaser_limit_chars'] = intval($news['config']['news_teaser_limit_chars']);
 $news['config']['news_teaser_limit_words'] = intval($news['config']['news_teaser_limit_words']);
 $news['config']['check_lang'] = count($phpwcms['allowed_lang']) > 1 ? true : false;
 $news['config']['gallery_allowed_ext'] = convertStringToArray(strtolower($news['config']['gallery_allowed_ext']));
 if (count($news['config']['gallery_allowed_ext'])) {
     foreach ($news['config']['gallery_allowed_ext'] as $ikey => $ivalue) {
         $news['config']['gallery_allowed_ext'][$ikey] = _dbEscape($ivalue);
     }
     $news['config']['gallery_allowed_ext'] = implode(',', $news['config']['gallery_allowed_ext']);
 } else {
     $news['config']['gallery_allowed_ext'] = '';
 }
 // start parsing news entries
 $news['row_count'] = 1;
 $news['total_count'] = 1;
 $news['entry_count'] = count($news['result']);
 // set new target if necessary
 if (empty($news['news_detail_link'])) {
     $news['base_href'] = rel_url($news['listing_page'], array('newsdetail'));