Exemplo n.º 1
0
function buildCalendarLink($date_value = '')
{
    global $_getVar;
    $_oldCalValue = '';
    if (!empty($_getVar['calendardate'])) {
        $_oldCalValue = $_getVar['calendardate'];
    }
    //save old value
    if (!empty($date_value)) {
        $_getVar['calendardate'] = $date_value;
    }
    //set new value
    $link = rel_url(array(), array(), '', 'urlencode');
    //build Link
    if ($_oldCalValue) {
        $_getVar['calendardate'] = $_oldCalValue;
    }
    //restore old value
    return $link;
}
Exemplo n.º 2
0
 function listRecipeCategories($option)
 {
     global $_getVar;
     $cat = _dbQuery('SELECT acontent_text FROM ' . DB_PREPEND . 'phpwcms_articlecontent WHERE acontent_type=26 AND acontent_trash=0');
     $cat_all = '';
     if ($cat) {
         foreach ($cat as $temp) {
             if ($temp['acontent_text']) {
                 if ($cat_all) {
                     $cat_all .= ', ';
                 }
                 $cat_all .= $temp['acontent_text'];
             }
         }
         $cat_all = convertStringToArray($cat_all);
         sort($cat_all, SORT_LOCALE_STRING);
     } else {
         $cat_all = array();
     }
     $cat = '';
     unset($_getVar['recipecat']);
     foreach ($cat_all as $temp) {
         $cat .= '	<li><a href="' . rel_url(array('recipecat' => $temp)) . '" ';
         $temp = html_specialchars($temp);
         $cat .= 'title="' . $temp . '">' . $temp . '</a></li>' . LF;
     }
     if ($cat) {
         $cat = LF . '<ul>' . LF . $cat . '</ul>' . LF;
     }
     if (isset($option['LISTCAT'][0])) {
         $cat = $option['LISTCAT'][0] . $cat;
     }
     if (isset($option['LISTCAT'][1])) {
         $cat .= $option['LISTCAT'][1];
     }
     return $cat;
 }
Exemplo n.º 3
0
function struct_articlelist($struct_id, $counter, $copy_article_content, $cut_article_content, $copy_article, $cut_article, $article_order = 0)
{
    global $BL;
    $article = array();
    // empty article array
    $sort_array = array();
    // empty array to store all sort values for the category
    $article_order = intval($article_order);
    $max_article_count = 0;
    $show_sort = !$article_order || $article_order == 1 ? 1 : 0;
    $ao = get_order_sort($article_order);
    $count_article = 0;
    $sbutton_string = array();
    $sql = "SELECT *, ";
    $sql .= "DATE_FORMAT(article_tstamp, '%Y-%m-%d %H:%i:%s') AS article_date ";
    //, article_deleted
    $sql .= "FROM " . DB_PREPEND . "phpwcms_article ";
    $sql .= "WHERE article_cid='" . $struct_id . "' AND article_deleted=0 ORDER BY " . $ao[2];
    if ($result = mysql_query($sql, $GLOBALS['db']) or die("error while browsing related articles")) {
        // 1st get max count to know the last index ($max_article_count - 1)
        $max_article_count = mysql_num_rows($result);
        // take all entryies and build new array with it
        while ($row = mysql_fetch_assoc($result)) {
            $article[$count_article] = $row;
            if ($row['article_sort'] > 0) {
                $sort_array[$count_article] = $row['article_sort'];
            }
            // count up for article array index
            $count_article++;
        }
        mysql_free_result($result);
    }
    // now check if all sort values are unique
    // if not do a re-sort for all articles
    if ($max_article_count > count(array_unique($sort_array))) {
        $article = getArticleReSorted($struct_id, $article_order);
    }
    // reset article counter
    $count_article = 0;
    /*
     * now we know ALL articles and can run array index +/-
     * to set correct sorting UP and DOWN based on article
     * listing -> so the correct sort value is used
     */
    foreach ($article as $akey => $avalue) {
        // set up correct article sorting
        // can be sorted UP
        if ($count_article == 0) {
            // this is the first in list -> so no sorting up possible
            // the sort up icon will be invisible
            $sort_up = false;
        } else {
            // this article has a pre entry
            // so use these by setting (current index - 1)
            $article[$akey]['sort_up'] = $article[$akey - 1]['article_sort'];
            $sort_up = $show_sort ? true : false;
        }
        // count up for article array index
        $count_article++;
        // can be sorted DOWN
        if ($count_article == $max_article_count) {
            // this is the last in list -> so no sorting down possible
            // the sort up icon will be invisible
            $sort_down = false;
        } else {
            // this article has a follower
            // so use these by setting (current index + 1)
            $article[$akey]['sort_down'] = $article[$akey + 1]['article_sort'];
            $sort_down = $show_sort ? true : false;
        }
        // now do some checks to be sure that all sort values
        // are different to have it sorting in the correct way
        // sort up
        if ($sort_up) {
            $sort_up = '<a href="include/inc_act/act_structure.php?do=4%7C';
            $sort_up .= $article[$akey]["article_id"] . '%7C' . $article[$akey]['sort_up'] . '%7C';
            $sort_up .= $article[$akey - 1]["article_id"] . '%7C' . $article[$akey]['article_sort'];
            $sort_up .= '" title="' . $BL['be_func_struct_sort_up'] . '">';
            $sort_up .= '<img src="img/button/sort_1_1.gif" width="11" height="11" border="0" alt="" /></a>';
        } else {
            $sort_up = '<img src="img/button/sort_1_0.gif" width="11" height="11" border="0" alt="" />';
        }
        // sort down
        if ($sort_down) {
            $sort_down = '<a href="include/inc_act/act_structure.php?do=4%7C';
            $sort_down .= $article[$akey]["article_id"] . '%7C' . $article[$akey]['sort_down'] . '%7C';
            $sort_down .= $article[$akey + 1]["article_id"] . '%7C' . $article[$akey]['article_sort'];
            $sort_down .= '" title="' . $BL['be_func_struct_sort_down'] . '">';
            $sort_down .= '<img src="img/button/sort_2_1.gif" width="11" height="11" border="0" alt="" /></a>';
        } else {
            $sort_down = '<img src="img/button/sort_2_0.gif" width="11" height="11" border="0" alt="" />';
        }
        $at = html($article[$akey]["article_title"]);
        if ($cut_article == $article[$akey]["article_id"]) {
            $a = "<tr bgColor='#B4E101'>\n";
        } elseif ($copy_article == $article[$akey]["article_id"]) {
            $a = "<tr bgColor='#B4E101'>\n";
        } else {
            $a = "<tr onMouseOver=\"this.bgColor='#CCFF00';\" onMouseOut=\"this.bgColor='#FFFFFF';\">\n";
        }
        $a .= '<td width="461">';
        $a .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" summary=\"\">\n<tr>\n";
        $acontent_count = get_article_content_count($article[$akey]["article_id"], $GLOBALS['db']);
        if ($article[$akey]["article_uid"] == $_SESSION["wcs_user_id"] || $_SESSION["wcs_user_admin"]) {
            $a .= "<td nowrap=\"nowrap\"><img src=\"img/leer.gif\" width=\"" . (14 + 14 + 14 * ($counter - 1)) . "\" height=\"1\" alt=\"\" />";
            $a .= $acontent_count ? "<a href=\"phpwcms.php?do=articles&amp;opena=" . rawurlencode($article[$akey]["article_id"] . ":" . (!empty($_SESSION["structure"]["article"][$article[$akey]["article_id"]]) ? 0 : 1)) . "\">" : "";
            $a .= "<img src=\"img/symbole/plus_" . ($acontent_count ? !empty($_SESSION["structure"]["article"][$article[$akey]["article_id"]]) ? "close" : "open" : "empty");
            $a .= ".gif\" width=\"15\" height=\"15\" border=\"0\" alt=\"\" />" . ($acontent_count ? "</a>" : "");
        } else {
            $a .= "<td nowrap=\"nowrap\"><img src=\"img/leer.gif\" width=\"" . (14 + 29 + 14 * ($counter - 1)) . "\" height=\"1\" alt=\"\" />";
        }
        $a .= "<img src=\"img/symbole/text_1.gif\" width=\"11\" height=\"15\" ";
        $info = '<table cellspacing=0 cellpadding=1 border=0>';
        $info .= '<tr><td>' . $BL['be_func_struct_articleID'] . ':</td><td><b>' . $article[$akey]["article_id"] . '</b></td></tr>';
        if (!empty($article[$akey]["article_alias"])) {
            $info .= '<tr><td>ALIAS:</td><td><b>' . $article[$akey]["article_alias"] . '</b></td></tr>';
        }
        if (!empty($article[$akey]["article_begin"])) {
            $info .= '<tr><td>' . $BL['be_article_cnt_start'] . ':</td><td><b>' . phpwcms_strtotime($article[$akey]["article_begin"], $BL['be_longdatetime'], '&nbsp;') . '</b></td></tr>';
        }
        if (!empty($article[$akey]["article_end"])) {
            $info .= '<tr><td>' . $BL['be_article_cnt_end'] . ':</td><td><b>' . phpwcms_strtotime($article[$akey]["article_end"], $BL['be_longdatetime'], '&nbsp;') . '</b></td></tr>';
        }
        $info .= '<tr><td>' . $BL['be_cnt_sortvalue'] . ':</td><td>' . $article[$akey]["article_sort"] . '</td></tr>';
        if (isset($article[$akey]["article_end"])) {
            $info .= '<tr><td>' . $BL['be_priorize'] . ':</td><td>' . $article[$akey]["article_priorize"] . '</td></tr>';
        }
        $info .= '</table>';
        $a .= 'onmouseover="Tip(\'' . $info . '\');" onmouseout="UnTip()" alt=""';
        //$a .= getAltTitle($info);
        $a .= " /></td>\n";
        $a .= "<td><img src=\"img/leer.gif\" width=\"2\" height=\"15\" alt=\"\" /></td>\n";
        $a .= '<td class="dir" width="95%"><a href="';
        $a .= rel_url(array('phpwcms-preview' => 1), array(), empty($article[$akey]["article_alias"]) ? 'aid=' . $article[$akey]["article_id"] : $article[$akey]["article_alias"]);
        $a .= '" target="_blank" title="' . $BL['be_func_struct_preview'] . ': ' . $at . '">';
        $a .= $at . "</a></td>\n</tr>\n</table></td>\n<td width=\"77\" nowrap=\"nowrap\">";
        if ($article[$akey]["article_uid"] == $_SESSION["wcs_user_id"] || $_SESSION["wcs_user_admin"]) {
            $a .= "<a href=\"phpwcms.php?do=articles&amp;p=2&amp;s=1&amp;id=" . $article[$akey]["article_id"];
            $a .= "\" title=\"" . $BL['be_func_struct_edit'] . " \n[" . $at . "]\">";
            $a .= "<img src=\"img/button/edit_11x11.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\"></a>";
        } else {
            $a .= "<img src=\"img/button/edit_11x11_0.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\" />";
        }
        if ($cut_article != $article[$akey]["article_id"] && !$cut_article_content) {
            $a .= "<a href=\"phpwcms.php?do=articles&amp;acut=" . $article[$akey]["article_id"];
            $a .= "\" title=\"" . $BL['be_func_struct_cut'] . " \n[" . $at . "]\">";
            $a .= "<img src=\"img/button/cut_11x11_0.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\" /></a>";
        } elseif ($cut_article_content) {
            $a .= '<a href="include/inc_act/act_structure.php?do=' . rawurlencode('7|' . $cut_article_content . '|' . $article[$akey]["article_id"] . '|-10');
            $a .= '" title="' . $BL['be_func_content_paste0'];
            $a .= " [" . $at . "]\"><img src=\"img/button/cut_11x11_1.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\" /></a>";
        } else {
            $a .= "<a href=\"phpwcms.php?do=articles\" title=\"" . $BL['be_func_struct_nocut'] . '">';
            $a .= "<img src=\"img/button/cut_11x11_3.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\" /></a>";
        }
        if ($copy_article != $article[$akey]["article_id"] && !$copy_article_content) {
            $a .= "<a href=\"phpwcms.php?do=articles&amp;acopy=" . $article[$akey]["article_id"];
            $a .= "\" title=\"" . $BL['be_func_struct_copy'] . " \n[" . $at . "]\">";
            $a .= "<img src=\"img/button/copy_11x11_0.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\" /></a>";
        } elseif ($copy_article_content) {
            $a .= '<a href="include/inc_act/act_structure.php?do=' . rawurlencode('8|' . $copy_article_content . '|' . $article[$akey]["article_id"] . '|-10');
            $a .= "\" title=\"" . $BL['be_func_content_paste0'];
            $a .= " [" . $at . "]\"><img src=\"img/button/copy_11x11_1.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\" /></a>";
        } else {
            $a .= "<a href=\"phpwcms.php?do=articles\" title=\"" . $BL['be_func_struct_nocopy'] . '">';
            $a .= "<img src=\"img/button/copy_11x11_3.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\" /></a>";
        }
        //Sortierungslink
        //davor sortieren
        $a .= $sort_up;
        //dahinter sortieren
        $a .= $sort_down;
        //switch active status
        $a .= "<a href=\"include/inc_act/act_articlecontent.php?do=3," . $article[$akey]["article_id"] . ",," . ($article[$akey]["article_aktiv"] ? 0 : 1);
        $a .= '" title="' . $BL['be_func_struct_svisible'] . '">';
        $a .= "<img src=\"img/button/visible_11x11_" . $article[$akey]["article_aktiv"] . ".gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\" /></a>";
        //delete article
        if ($article[$akey]["article_uid"] == $_SESSION["wcs_user_id"] || $_SESSION["wcs_user_admin"]) {
            $a .= "<a href=\"include/inc_act/act_articlecontent.php?do=1," . $article[$akey]["article_id"];
            $a .= "\" title=\"" . $BL['be_func_struct_del_article'] . " \n[" . $at . "]\" ";
            $a .= "onclick=\"return confirm('" . $BL['be_func_struct_del_jsmsg'] . " \\n[" . js_singlequote($at) . "] ');\">";
            $a .= "<img src=\"img/button/del_11x11.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\" /></a>";
        } else {
            $a .= "<img src=\"img/button/del_11x11_0.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"\" />";
        }
        $a .= "</td>\n</tr>\n";
        echo $a;
        $sql = "SELECT acontent_id, acontent_sorting, acontent_trash, acontent_block FROM " . DB_PREPEND . "phpwcms_articlecontent ";
        $sql .= "WHERE acontent_aid=" . $article[$akey]["article_id"] . " ORDER BY acontent_block, acontent_sorting, acontent_id";
        if ($result = mysql_query($sql, $GLOBALS['db']) or die("error while listing contents for this article")) {
            $sc = 0;
            $scc = 0;
            //Sort-Zwischenz�hler
            while ($row = mysql_fetch_row($result)) {
                $scc++;
                if ($row[2] == 0) {
                    $sc++;
                    $sbutton[$sc]["id"] = $row[0];
                    $sbutton[$sc]["sort"] = $row[1];
                    $sbutton[$sc]["block"] = $row[3];
                }
            }
        }
        if ($sc) {
            //Jetzt aufbauen der Sortieranweisung
            foreach ($sbutton as $key => $value) {
                if ($key == 1) {
                    // if 1st content part in list
                    $sbutton[$key]["top"] = "<img src=\"img/button/sort_1_0.gif\" border=\"0\" alt=\"\" />";
                } elseif (isset($sbutton[$key - 1]["block"]) && $sbutton[$key - 1]["block"] != $sbutton[$key]["block"]) {
                    // if this content part is selected for different block than previous
                    $sbutton[$key]["top"] = "<img src=\"img/button/sort_1_0.gif\" border=\"0\" alt=\"\" />";
                } else {
                    $sbutton[$key]["top"] = "<a href=\"include/inc_act/act_articlecontent.php?sort=" . rawurlencode($sbutton[$key]["id"] . ":" . $sbutton[$key - 1]["sort"] . "|" . $sbutton[$key - 1]["id"] . ":" . $sbutton[$key]["sort"]) . "\" title=\"" . $BL['be_article_cnt_up'] . "\"><img src=\"img/button/sort_1_1.gif\" border=\"0\" alt=\"\" /></a>";
                }
                if ($key == $sc) {
                    // if this is the last content part in list
                    $sbutton[$key]["bottom"] = "<img src=\"img/button/sort_2_0.gif\" border=\"0\" alt=\"\" />";
                } elseif (isset($sbutton[$key + 1]["block"]) && $sbutton[$key + 1]["block"] != $sbutton[$key]["block"]) {
                    // if this is the last content part in current block and next is different
                    $sbutton[$key]["bottom"] = "<img src=\"img/button/sort_2_0.gif\" border=\"0\" alt=\"\" />";
                } else {
                    $sbutton[$key]["bottom"] = "<a href=\"include/inc_act/act_articlecontent.php?sort=" . rawurlencode($sbutton[$key]["id"] . ":" . $sbutton[$key + 1]["sort"] . "|" . $sbutton[$key + 1]["id"] . ":" . $sbutton[$key]["sort"]) . "\" title=\"" . $BL['be_article_cnt_down'] . "\"><img src=\"img/button/sort_2_1.gif\" border=\"0\" alt=\"\" /></a>";
                }
                $sbutton_string[$sbutton[$key]["id"]] = $sbutton[$key]["top"] . $sbutton[$key]["bottom"];
            }
            unset($sbutton);
        }
        if ($article[$akey]["article_uid"] == $_SESSION["wcs_user_id"] || $_SESSION["wcs_user_admin"]) {
            if (isset($_SESSION["structure"]["article"][$article[$akey]["article_id"]]) && $_SESSION["structure"]["article"][$article[$akey]["article_id"]]) {
                struct_articlecontentlist($article, $akey, $copy_article_content, $cut_article_content, $counter, $sbutton_string, $GLOBALS['db']);
            }
        }
    }
}
<?php 
    }
    // end paginate check
    // end non content part setting mode
}
?>

	<tr><td colspan="2" class="rowspacer"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>

	<tr bgcolor="#F3F5F8">
		<td>&nbsp;</td>
		<td style="padding:7px 0 7px 0;">
<?php 
// render buttons only once and save the buffer
if (!empty($content["id"])) {
    $buttonActionLink = rel_url(array('phpwcms-preview' => 1), array(), empty($content['article']["article_alias"]) ? empty($content["aid"]) ? 'id=' . $content["id"] : 'aid=' . $content["aid"] : $content['article']["article_alias"]);
    $buttonAction = '	<div style="float:right;margin-right:25px;padding:0;">';
    $buttonAction .= '	<button type="button" value="' . $BL['be_func_struct_preview'] . '" class="button" title="' . $BL['be_func_struct_preview'] . '" ';
    $buttonAction .= 'onclick="window.open(\'' . $buttonActionLink . "', 'articlePreviewWindows');return false;\">";
    $buttonAction .= $BL['be_func_struct_preview'] . "</button></div>" . LF;
} else {
    $buttonAction = '';
}
ob_start();
?>
<div>
	<?php 
echo $buttonAction;
?>
	<div style="float:left;padding:0;">
	<input name="Submit" type="submit" class="button" value="<?php 
Exemplo n.º 5
0
 function search()
 {
     $this->now = now();
     if (empty($this->search_words)) {
         return NULL;
     }
     $cnt_ts_livedate = 'IF(UNIX_TIMESTAMP(pc.cnt_livedate) > 0, UNIX_TIMESTAMP(pc.cnt_livedate), pc.cnt_created)';
     $cnt_ts_killdate = 'IF(UNIX_TIMESTAMP(pc.cnt_killdate) > 0, UNIX_TIMESTAMP(pc.cnt_killdate), pc.cnt_created + 31536000)';
     $sql = 'SELECT pc.*, ';
     $sql .= $cnt_ts_livedate . ' AS cnt_ts_livedate, ';
     $sql .= $cnt_ts_killdate . ' AS cnt_ts_killdate ';
     $sql .= 'FROM ' . DB_PREPEND . 'phpwcms_content pc ';
     $sql_where = 'WHERE ';
     $sql_where .= 'pc.cnt_status=1 AND ';
     $sql_where .= "pc.cnt_module='news' AND ";
     $sql_where .= $cnt_ts_livedate . ' < ' . $this->now . ' AND ';
     $sql_where .= '(' . $cnt_ts_killdate . ' > ' . $this->now . ' OR cnt_archive_status = 1) ';
     $sql_group = '';
     // choose by category
     if (count($this->search_category)) {
         $cat_sql = array();
         // and/or/not mode
         switch ($this->search_andor) {
             case 'AND':
                 $news_andor = ' AND ';
                 $news_compare = '=';
                 break;
             case 'NOT':
                 $news_andor = ' AND ';
                 $news_compare = '!=';
                 break;
             default:
                 //OR
                 $news_andor = ' OR ';
                 $news_compare = '=';
         }
         foreach ($this->search_category as $value) {
             $cat_sql[] = 'pcat.cat_name' . $news_compare . _dbEscape($value);
         }
         $sql .= "LEFT JOIN " . DB_PREPEND . "phpwcms_categories pcat ON (pcat.cat_type='news' AND pcat.cat_pid=pc.cnt_id) ";
         $sql_where .= 'AND (' . implode($news_andor, $cat_sql) . ') ';
         $sql_group = 'GROUP BY pc.cnt_id ';
     }
     // language selection
     if (count($this->search_language)) {
         $sql_where .= "AND pc.cnt_lang IN ('" . str_replace('#', "','", _dbEscape(implode('#', $this->search_language), false)) . "') ";
     }
     $sql .= $sql_where;
     $sql .= $sql_group;
     $sql = trim($sql);
     $data = _dbQuery($sql);
     $search_target_url_test = strtolower(substr($this->search_target_url, 0, 4));
     if ($search_target_url_test !== 'http' && $search_target_url_test !== '{sit') {
         // expected alias here or aid=123 or id=123
         if ($this->search_highlight) {
             $this->search_target_url = rel_url(array('newsdetail' => '___NEWSDETAIL__', 'highlight' => '___HIGHLIGHT__'), array('searchstart', 'searchwords'), $this->search_target_url);
         } else {
             $this->search_target_url = rel_url(array('newsdetail' => '___NEWSDETAIL__'), array('highlight', 'searchstart', 'searchwords'), $this->search_target_url);
         }
         $search_replace_newsdetail = true;
     } else {
         $search_replace_newsdetail = strpos($this->search_target_url, '___NEWSDETAIL__') !== false ? true : false;
         $this->search_target_url = html_specialchars($this->search_target_url);
     }
     if ($this->search_highlight_words && is_array($this->search_highlight_words)) {
         $s_highlight_words = rawurlencode(implode(' ', $this->search_highlight_words));
     } else {
         $s_highlight_words = '';
     }
     foreach ($data as $value) {
         $s_result = array();
         $s_text = $value['cnt_text'] . ', ' . $value['cnt_teasertext'] . ', ' . $value['cnt_place'] . ', ';
         $s_text .= $value['cnt_subtitle'] . ', ' . $value['cnt_title'];
         if ($this->search_username) {
             $s_text .= ', ' . $value['cnt_editor'];
         }
         $value['cnt_object'] = @unserialize($value['cnt_object']);
         if (!empty($value['cnt_object']['cnt_searchoff'])) {
             continue;
         }
         if (isset($value['cnt_object']['cnt_category'])) {
             if ($this->search_keyword) {
                 $s_text .= ' ' . $value['cnt_object']['cnt_category'];
             }
             if ($this->search_caption) {
                 $s_text .= ' ' . $value['cnt_object']['cnt_image']['caption'];
                 $s_text .= ' ' . $value['cnt_object']['cnt_files']['caption'];
             }
         }
         $s_text = preg_replace('/<script[^>]*>.*?<\\/script>/is', '', $s_text);
         // strip all <script> Tags
         $s_text = str_replace(array('~', '|', ':', 'http', '//', '_blank', '&nbsp;'), ' ', $s_text);
         $s_text = clean_search_text($s_text);
         preg_match_all('/' . $this->search_words . '/is', $s_text, $s_result);
         $s_count = count($s_result[0]);
         //set search_result to 0
         if ($s_count && SEARCH_TYPE_AND) {
             $s_and_or = array();
             foreach ($s_result[0] as $svalue) {
                 $s_and_or[strtolower($svalue)] = 1;
             }
             $s_and_or = count($s_and_or);
             if ($s_and_or != $this->search_word_count) {
                 $s_count = 0;
             }
         }
         if ($s_count) {
             $id = $this->search_result_entry;
             $this->search_results[$id]["id"] = $value['cnt_id'];
             $this->search_results[$id]["cid"] = 0;
             $this->search_results[$id]["rank"] = $s_count;
             if ($this->search_highlight) {
                 $this->search_results[$id]["title"] = highlightSearchResult(html($value['cnt_title']), $this->search_highlight_words);
                 $this->search_results[$id]["subtitle"] = highlightSearchResult(html($value['cnt_subtitle']), $this->search_highlight_words);
             } else {
                 $this->search_results[$id]["title"] = html($value['cnt_title']);
                 $this->search_results[$id]["subtitle"] = html($value['cnt_subtitle']);
             }
             $this->search_results[$id]["date"] = $value['cnt_ts_livedate'];
             $this->search_results[$id]["user"] = html($value['cnt_editor']);
             $value['detail_link'] = date('Ymd', $value['cnt_ts_livedate']) . '-' . $value['cnt_id'] . '_';
             //$crow['acontent_aid']
             $value['detail_link'] .= empty($value['cnt_alias']) ? $value['cnt_id'] : urlencode($value['cnt_alias']);
             if (strpos($this->search_target_url, '___NEWSDETAIL__') !== false) {
                 $this->search_results[$id]['link'] = str_replace(array('___NEWSDETAIL__', '___HIGHLIGHT__'), array($value['detail_link'], $s_highlight_words), $this->search_target_url);
             } else {
                 $this->search_results[$id]['link'] = $this->search_target_url . '&amp;newsdetail=' . $value['detail_link'];
                 if ($this->search_highlight) {
                     $this->search_results[$id]['link'] .= '&amp;highlight=' . $s_highlight_words;
                 }
             }
             $s_text = trim(trim(str_replace(', ,', ',', $s_text)), ' ,');
             $s_text = html(getCleanSubString($s_text, $this->search_wordlimit, $this->ellipse_sign, 'word'), false);
             if ($this->search_highlight) {
                 $s_text = highlightSearchResult($s_text, $this->search_highlight_words);
             }
             $this->search_results[$id]["text"] = $s_text;
             $this->search_results[$id]["image"] = false;
             if ($this->image_render && !empty($value['cnt_object']['cnt_image']['id'])) {
                 $value['cnt_object']['cnt_image'] = _dbGet('phpwcms_file', 'f_id AS `id`, f_hash AS `hash`, f_ext AS `ext`, f_name AS `name`', 'f_id=' . _dbEscape($value['cnt_object']['cnt_image']['id']) . ' AND f_trash=0 AND f_aktiv=1 AND f_public=1');
                 if (isset($value['cnt_object']['cnt_image'][0]['id'])) {
                     $this->search_results[$id]["image"] = $value['cnt_object']['cnt_image'][0];
                 }
             }
             $this->search_result_entry++;
         }
     }
 }
Exemplo n.º 6
0
        $_loginData['template'] = render_cnt_template($_loginData['template'], 'ERROR', $_loginData['error'] ? 'login/pass wrong' : '');
        $_loginData['template'] = render_cnt_template($_loginData['template'], 'LOGIN', html_specialchars($_loginData['login']));
        $_loginData['template'] = render_cnt_template($_loginData['template'], 'PASSWORD', '');
        $_loginData['template'] = render_cnt_template($_loginData['template'], 'REMEMBER', $_loginData['remember'] ? ' checked="checked"' : '');
    }
    // check register profile
    if ($_loginData['felogin_profile_registration']) {
        // possible -> set link to form
        $_loginData['uri'] = rel_url(array('profile_register' => $_loginData['get_profile_register']), array('profile_manage', 'profile_reminder'));
        $_loginData['template'] = render_cnt_template($_loginData['template'], 'REGISTER_PROFILE', $_loginData['uri']);
    } else {
        // not possible
        $_loginData['template'] = render_cnt_template($_loginData['template'], 'REGISTER_PROFILE', '');
    }
    // check manage profile
    if ($_loginData['felogin_profile_manage']) {
        if (isset($_GET['profile_manage'])) {
            $_loginData['template'] = render_cnt_template($_loginData['template'], 'MANAGE_PROFILE', '');
        }
        // possible -> set link to form
        $_loginData['uri'] = rel_url(array('profile_manage' => $_loginData['get_profile_manage']), array('profile_register', 'profile_reminder'), empty($_loginData['felogin_profile_manage_redirect']) ? '' : $_loginData['felogin_profile_manage_redirect']);
        $_loginData['template'] = render_cnt_template($_loginData['template'], 'MANAGE_PROFILE', $_loginData['uri']);
    } else {
        // not possible
        $_loginData['template'] = render_cnt_template($_loginData['template'], 'MANAGE_PROFILE', '');
    }
    $_loginData['uri'] = rel_url(array('profile_reminder' => '1'), array('profile_manage', 'profile_register'));
    $_loginData['template'] = render_cnt_template($_loginData['template'], 'REMINDER_FORM', $_loginData['uri']);
    $_loginData['uri'] = rel_url(array(), array('profile_manage', 'profile_register', 'profile_reminder'));
    $CNT_TMP .= str_replace(array('{FORM_TARGET}', '{LOGIN_URL}'), $_loginData['uri'], $_loginData['template']);
}
Exemplo n.º 7
0
     case 'terms':
         $cart_items[$x] = $_tmpl['term_entry'];
         break;
     case 'mail1':
         $cart_items[$x] = trim($_tmpl['mail_item']);
         if (empty($cart_items[$x])) {
             $cart_items[$x] = 'Qty:   {COUNT}' . LF;
             $cart_items[$x] .= 'Ord#:  {ORDER_NUM}' . LF;
             $cart_items[$x] .= 'Item:  {PRODUCT_TITLE}' . LF;
             $cart_items[$x] .= 'Net:   {PRODUCT_NET_PRICE} {CURRENCY_SYMBOL}' . LF;
             $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]);
 }
Exemplo n.º 8
0
        $crow['template']['form'] .= 'value="' . $content["search_word"] . '"';
        if ($content["search"]["style_input"]) {
            $crow['template']['form'] .= ' class="' . $content["search"]["style_input"] . '"';
        }
        $crow['template']['form'] .= " /></td><td>";
        $crow['template']['form'] .= '<input type="submit" name="submit" id="search_submit_button" value="';
        $crow['template']['form'] .= $content["search"]["label_button"];
        $crow['template']['form'] .= '"';
        if ($content["search"]["style_button"]) {
            $crow['template']['form'] .= ' class="' . $content["search"]["style_button"] . '"';
        }
        $crow['template']['form'] .= " /></td>";
        $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'];
Exemplo n.º 9
0
     $content['CpTitleParams'][2] = empty($content['CpTitleParams'][2]) ? '' : trim($content['CpTitleParams'][2]);
     $content['CpTitleParams'][3] = empty($content['CpTitleParams'][3]) ? 0 : 1;
     $content['CpTitleParams'][4] = '';
     $content['CpTitleParams'][5] = '';
 } else {
     $content['CpTitleParams'][0] = '<li>';
     $content['CpTitleParams'][1] = '</li>';
     $content['CpTitleParams'][2] = 'active';
     $content['CpTitleParams'][3] = 0;
     $content['CpTitleParams'][4] = '<ul class="cpmenu">';
     $content['CpTitleParams'][5] = '</ul>';
 }
 $content['CpTitleMenu'] = array();
 // cp menu items
 foreach ($content['CpPageTitles'] as $key => $value) {
     $content['CpItem'] = '<a href="' . rel_url(array(), array(), $key ? 'aid=' . $aktion[1] . '-' . $key : PHPWCMS_ALIAS) . '"';
     if ($key == $content['aId_CpPage']) {
         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]);
Exemplo n.º 10
0
function getContentPartTopLink($param = 0)
{
    global $template_default;
    $toplink = '';
    if ($param) {
        if ($template_default["article"]["top_sign_before"] . $template_default["article"]["top_sign_after"]) {
            $toplink .= $template_default["article"]["top_sign_before"];
            $toplink .= '<a href="' . rel_url() . '#top">' . $template_default["article"]["top_sign"] . '</a>';
            $toplink .= $template_default["article"]["top_sign_after"];
        } else {
            $toplink .= '<br /><a href="' . rel_url() . '#top">' . $template_default["article"]["top_sign"] . '</a>';
        }
    }
    return $toplink;
}
Exemplo n.º 11
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;
 }
Exemplo n.º 12
0
 } else {
     $_uri_alias = '';
 }
 switch ($fe_action) {
     case '{FE_USER_MANAGE}':
         $_uri = rel_url(array('profile_manage' => 'edit'), array('profile_register', 'profile_reminder'), $_uri_alias);
         // at the moment it is only possible to edit user data of "real" FRONTEND users
         // all BACKEND users should login to backend and edit their data there
         $result = _dbGet('phpwcms_userdetail', '*', "detail_filter='" . aporeplace(FEUSER_REGKEY) . "' AND detail_id=" . intval($_SESSION[$_loginData['session_key'] . '_userdata']['id']), '', '', '1');
         if (isset($result[0])) {
             $fe_data = $result[0];
             $fe_data['detail_password'] = '';
         }
         break;
     case '{FE_USER_REGISTER}':
         $_uri = rel_url(array('profile_register' => 'create'), array('profile_manage', 'profile_reminder'), $_uri_alias);
         break;
 }
 if (isset($_POST['detail_login'])) {
     $udata['user_login'] = clean_slweg($_POST['user_login']);
     $udata['user_password'] = slweg($_POST['user_password']);
     $udata['user_password2'] = slweg($_POST['user_password2']);
     $udata['user_company'] = clean_slweg($_POST['user_company']);
     $udata['user_title'] = clean_slweg($_POST['user_title']);
     $udata['user_name'] = clean_slweg($_POST['user_name']);
     $udata['user_firstname'] = clean_slweg($_POST['user_firstname']);
     $udata['user_street'] = clean_slweg($_POST['user_street']);
     $udata['user_zip'] = clean_slweg($_POST['user_zip']);
     $udata['user_city'] = clean_slweg($_POST['user_city']);
     $udata['user_tel'] = preg_replace('/[^0-9\\+\\-\\(\\) ]/', '', clean_slweg($_POST['user_tel']));
     $udata['user_email'] = clean_slweg($_POST['user_email']);
Exemplo n.º 13
0
function get_category_products($selected_product_cat, $shop_detail_id, $shop_cat_selected, $shop_subcat_selected, $shop_alias)
{
    $shop_cat_prods = '';
    $sql = "SELECT * FROM " . DB_PREPEND . 'phpwcms_shop_products WHERE ';
    $sql .= "shopprod_status=1";
    $sql .= ' AND (';
    $sql .= "shopprod_category = '" . $selected_product_cat . "' OR ";
    $sql .= "shopprod_category LIKE '%," . $selected_product_cat . ",%' OR ";
    $sql .= "shopprod_category LIKE '" . $selected_product_cat . ",%' OR ";
    $sql .= "shopprod_category LIKE '%," . $selected_product_cat . "'";
    $sql .= ')';
    // FE language
    $sql .= SHOP_FELANG_SQL;
    $pdata = _dbQuery($sql);
    if (is_array($pdata) && count($pdata)) {
        $z = 0;
        $shop_cat_prods = array();
        foreach ($pdata as $prow) {
            $shop_cat_prods[$z] = '<li id="shopcat-product-' . $prow['shopprod_id'] . '"';
            if ($prow['shopprod_id'] == $shop_detail_id) {
                $shop_cat_prods[$z] .= ' class="active"';
            }
            $shop_cat_prods[$z] .= '>';
            $prow['get'] = array('shop_cat' => $shop_cat_selected, 'shop_detail' => $prow['shopprod_id']);
            if ($shop_subcat_selected) {
                $prow['get']['shop_cat'] .= '_' . $shop_subcat_selected;
            }
            $shop_cat_prods[$z] .= '<a href="' . rel_url($prow['get'], array(), $shop_alias) . '">';
            $shop_cat_prods[$z] .= html($prow['shopprod_name1']);
            $shop_cat_prods[$z] .= '</a>';
            $shop_cat_prods[$z] .= '</li>';
            $z++;
        }
        if (count($shop_cat_prods)) {
            $shop_cat_prods = LF . '		<ul class="' . $GLOBALS['template_default']['classes']['shop-products-menu'] . '">' . LF . '			' . implode(LF . '			', $shop_cat_prods) . LF . '		</ul>' . LF . '	';
        }
    }
    return $shop_cat_prods;
}
 * @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.");
}
// ----------------------------------------------------------------
$buttonAction = '<table cellpadding="0" cellspacing="0" border="0"><tr>' . LF;
// Article List
$buttonAction .= '<td><input type="button" value="' . $BL['be_article_cnt_center'];
$buttonAction .= '" class="button" title="' . $BL['be_article_cnt_center'] . '" onclick="';
$buttonAction .= "location.href='phpwcms.php?do=articles';return false;\"></td>\n<td>&nbsp;</td>\n";
// Article Preview (new window)
$buttonActionLink = rel_url(array('phpwcms-preview' => 1), array(), empty($article["article_alias"]) ? 'aid=' . $article["article_id"] : $article["article_alias"]);
$buttonAction .= '<td><input type="button" value="' . $BL['be_func_struct_preview'] . '" class="button" title="' . $BL['be_func_struct_preview'] . '" onclick="';
$buttonAction .= "window.open('" . $buttonActionLink . "', 'articlePreviewWindows');return false;\"></td>";
$buttonAction .= '</tr></table>';
?>
<form action="phpwcms.php?do=articles&amp;p=2&amp;s=1&amp;aktion=2&amp;id=<?php 
echo $article["article_id"];
?>
" method="post" name="addcontent" id="addcontent">
<table width="538" border="0" cellpadding="0" cellspacing="0" summary="">
	<tr><td colspan="3" class="title"><?php 
echo $BL['be_article_cnt_ltitle'];
?>
</td></tr>
	<tr><td colspan="3"><img src="img/leer.gif" alt="" width="1" height="8" /></td>
	</tr>
Exemplo n.º 15
0
     switch ($guestbook['post']['show']) {
         case 0:
             $guestbook['GBSHOW_0'] = ' checked="checked"';
             break;
         case 1:
             $guestbook['GBSHOW_1'] = ' checked="checked"';
             break;
         case 2:
             $guestbook['GBSHOW_2'] = ' checked="checked"';
             break;
     }
     $guestbook['form'] = str_replace('{GBSHOW_0}', $guestbook['GBSHOW_0'], $guestbook['form']);
     $guestbook['form'] = str_replace('{GBSHOW_1}', $guestbook['GBSHOW_1'], $guestbook['form']);
     $guestbook['form'] = str_replace('{GBSHOW_2}', $guestbook['GBSHOW_2'], $guestbook['form']);
     // build sign guestbook form
     $guestbook['form'] = '<form name="sign_guestbook" action="' . rel_url() . '" method="post"' . (empty($guestbook["image_upload"]) ? '' : ' enctype="multipart/form-data"') . '>' . $guestbook['form'];
     if (!empty($guestbook['hidden'])) {
         $guestbook['form'] .= $guestbook['hidden'];
     }
     $guestbook['form'] .= getFormTrackingValue() . '</form>';
 } else {
     if (!$guestbook['flooding']) {
         // if successfully signed show signed info
         $guestbook['signed'] = render_cnt_template($guestbook['signed'], 'EMAIL', html_specialchars($guestbook['post']['email']));
         $guestbook['signed'] = render_cnt_template($guestbook['signed'], 'NAME', html_specialchars($guestbook['post']['name']));
         $guestbook['signed'] = render_cnt_template($guestbook['signed'], 'URL', html_specialchars($guestbook['post']['url']));
         $guestbook['signed'] = render_cnt_template($guestbook['signed'], 'MSG', html_specialchars($guestbook['post']['msg']));
         $guestbook['form'] = $guestbook['signed'];
     } else {
         $guestbook['form'] = $guestbook['spamalert'];
     }
Exemplo n.º 16
0
function get_link_anchor($matches)
{
    $anchor = trim($matches[1]);
    $anchor = explode('#', $anchor);
    if (!empty($anchor[1])) {
        if ($anchor[0] === '') {
            return '<a id="' . $anchor[1] . '"' . (empty($GLOBALS['template_default']['classes']['link-anchor']) ? '' : ' class="' . $GLOBALS['template_default']['classes']['link-anchor'] . '"') . '></a>';
        }
        $anchor[0] = strtoupper($anchor[0]);
        if ($anchor[0] === 'REL') {
            return rel_url() . '#' . $anchor[1];
        } elseif ($anchor[0] === 'ABS') {
            return abs_url() . '#' . $anchor[1];
        }
    }
    return $matches[0];
}
Exemplo n.º 17
0
            $CNT_TMP .= LF . $cnt_form['startup'] . LF;
        }
    }
}
if ($form_cnt) {
    $form_cnt = str_replace('###RESET###', '', $form_cnt);
    $cnt_form["class_close"] = '';
    if ($cnt_form["class"]) {
        $CNT_TMP .= '<div class="' . $cnt_form["class"] . '">';
        $cnt_form["class_close"] = '</div>';
        $cnt_form['class'] = ' class="form-' . $cnt_form["class"] . '"';
    } else {
        $cnt_form['class'] = '';
    }
    $CNT_TMP .= $form_error_text;
    $CNT_TMP .= '<form id="phpwcmsForm' . $crow["acontent_id"] . '"' . $cnt_form['class'] . ' action="' . rel_url();
    if (!empty($cnt_form['anchor_name'])) {
        $CNT_TMP .= '#' . html($cnt_form['anchor_name']);
    } elseif (empty($cnt_form['anchor_off'])) {
        $CNT_TMP .= '#jumpForm' . $crow["acontent_id"];
    }
    $CNT_TMP .= '" ';
    if ($cnt_form['is_enctype']) {
        $CNT_TMP .= 'enctype="multipart/form-data" ';
    }
    $CNT_TMP .= 'method="post">';
    if ($cnt_form['labelpos'] == 2) {
        if (isset($POST_ERR) && count($POST_ERR)) {
            $form_cnt = preg_replace('/\\[IF_ERROR\\](.*?)\\[\\/IF_ERROR\\]/s', '$1', $form_cnt);
            $form_cnt = preg_replace('/\\[ELSE_ERROR\\].*?\\[\\/ELSE_ERROR\\]/s', '', $form_cnt);
        } else {
Exemplo n.º 18
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']);
}
Exemplo n.º 19
0
        $_filter_entities = html_specialchars($content['glossary']['filter_value']);
        $_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']));
Exemplo n.º 20
0
     $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'));
 } 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'];
Exemplo n.º 21
0
 $galleries = array();
 // List the galleries in selected sub gallery
 if (isset($_getVar['subgallery'])) {
     $_getVar['subgallery'] = intval($_getVar['subgallery']);
     $sql = 'SELECT pf.*, pj.f_id AS f_root_id, pj.f_name AS f_root_name ';
     $sql .= 'FROM ' . DB_PREPEND . 'phpwcms_file pf ';
     $sql .= 'LEFT JOIN ' . DB_PREPEND . 'phpwcms_file pj ';
     $sql .= 'ON pf.f_pid=pj.f_id ';
     $sql .= 'WHERE pf.f_id=' . $_getVar['subgallery'];
     $subgallery = _dbQuery($sql);
     $gallery_breadcrumb = array();
     if (isset($subgallery[0])) {
         $subgallery = $subgallery[0];
         $subgallery_get = '';
         $subgallery_class = 'root';
         $gallery_breadcrumb_url = rel_url(array(), array('gallery', 'subgallery'), $gallery->alias);
         // check if parent directory exists
         if (!empty($subgallery['f_root_id'])) {
             $gallery_breadcrumb[] = '<a href="' . $gallery_breadcrumb_url . '" class="root">' . html_specialchars($subgallery['f_root_name']) . '</a>';
             $subgallery_get = '&amp;subgallery=' . $_getVar['subgallery'];
             $subgallery_class = 'sub';
         }
         $gallery_breadcrumb[] = '<a href="' . $gallery_breadcrumb_url . $subgallery_get . '" class="' . $subgallery_class . '">' . html_specialchars($subgallery['f_name']) . '</a>';
     }
     // show gallery
     if (isset($_getVar['gallery'])) {
         $gallery->thumb_width = 160;
         $gallery->thumb_height = 160;
         $gallery->width = 750;
         $gallery->height = 700;
         $gallery->detail_thumbnail_crop = 1;
Exemplo n.º 22
0
<?php

// compare against current domain and redirect to correct if neccessary
//check active Domain
if (isset($LEVEL_ID[1]) && $LEVEL_ID[1] == 1 && strpos(PHPWCMS_URL, 'mydomain1.com') === false) {
    headerRedirect('http://www.mydomain1.com/' . rel_url(array(), array(), '', 'urlencode'));
} elseif (isset($LEVEL_ID[1]) && $LEVEL_ID[1] == 2 && strpos(PHPWCMS_URL, 'mydomain2.com') === false) {
    headerRedirect('http://www.mydomain2.com/' . rel_url(array(), array(), '', 'urlencode'));
}
Exemplo n.º 23
0
                     $tabitem['content-class'] = $template_default['classes']['tab-content'];
                     if ($template_default['classes']['tab-content-item']) {
                         $tabitem['content-class'] = trim($tabitem['content-class'] . ' ' . $template_default['classes']['tab-content-item']) . '-' . $g['counter'];
                     }
                     if ($tabitem['content-class']) {
                         $tabitem['content-class'] = ' class="' . $tabitem['content-class'] . '"';
                     }
                     if ($template_default['classes']['tab-first'] && $g['counter'] === 1) {
                         $tabitem['class'] .= ' ' . $template_default['classes']['tab-first'];
                     }
                     if ($template_default['classes']['tab-last'] && $g['counter'] === $g['max']) {
                         $tabitem['class'] .= ' ' . $template_default['classes']['tab-last'];
                     }
                     $tabitem['class'] = trim($tabitem['class']);
                     $tabitem['class'] = $tabitem['class'] ? ' class="' . $tabitem['class'] . '"' : '';
                     $g['wrap'][] = '		<li' . $tabitem['class'] . '><a href="' . rel_url() . '#' . $tabitem['id'] . '">' . html_specialchars($tabitem['title']) . '</a></li>';
                     $g['cnt'][] = '	<div id="' . $tabitem['id'] . '"' . $tabitem['content-class'] . '>' . LF . $tabitem['content'] . LF . '	</div>';
                     $g['counter']++;
                 }
                 $g['wrap'][] = '	</ul>';
                 $g['wrap'][] = implode(LF, $g['cnt']);
                 if ($template_default['classes']['tab-container-clear']) {
                     $g['wrap'][] = '	<span class="' . $template_default['classes']['tab-container-clear'] . '"></span>';
                 }
                 $g['wrap'][] = '</div>';
             }
             $content['cptab'][$CNT_TAB] = implode(LF, $g['wrap']);
         }
         unset($g);
     }
 }
Exemplo n.º 24
0
 function search()
 {
     if (!$this->search_word_count) {
         return NULL;
     }
     $shop_url = _getConfig('shop_pref_id_shop', '_shopPref');
     $shop_lang_support = _getConfig('shop_pref_felang') ? true : false;
     if (!is_intval($shop_url) && is_string($shop_url)) {
         $shop_url = trim($shop_url);
     } elseif (is_intval($shop_url) && intval($shop_url)) {
         $shop_url = 'aid=' . intval($shop_url);
     } else {
         $shop_url = $GLOBALS['aktion'][1] ? 'aid=' . $GLOBALS['aktion'][1] : 'id=' . $GLOBALS['aktion'][0];
     }
     if ($this->search_highlight_words && is_array($this->search_highlight_words)) {
         $s_highlight_words = implode(' ', $this->search_highlight_words);
     } else {
         $s_highlight_words = '';
         $this->search_highlight = false;
     }
     $sql = 'SELECT shopprod_id, shopprod_category, shopprod_ordernumber, ';
     $sql .= 'shopprod_name1, shopprod_var, ';
     $sql .= 'UNIX_TIMESTAMP(shopprod_changedate) AS shopprod_date, ';
     $sql .= 'CONCAT(';
     $sql .= "\tshopprod_description0,' ',";
     $sql .= "\tshopprod_description1,' ',";
     $sql .= "\tshopprod_description2,' ',";
     $sql .= "\tshopprod_description3,' ',";
     $sql .= "\tshopprod_color,' ',";
     $sql .= "\tshopprod_size,' ',";
     $sql .= "\tshopprod_ordernumber,' ',";
     $sql .= "\tshopprod_model,' ',";
     $sql .= "\tshopprod_name1,' ',";
     $sql .= "\tshopprod_name2,' '";
     $sql .= ') AS shopprod_search ';
     $sql .= 'FROM ' . DB_PREPEND . 'phpwcms_shop_products WHERE shopprod_status=1';
     if ($shop_lang_support && !empty($GLOBALS['phpwcms']['default_lang'])) {
         $sql .= " AND (shopprod_lang='' OR shopprod_lang=" . _dbEscape($GLOBALS['phpwcms']['default_lang']) . ')';
     }
     $data = _dbQuery($sql);
     foreach ($data as $value) {
         $s_result = array();
         $s_text = $value['shopprod_search'];
         $s_text = str_replace(array('~', '|', ':', 'http', '//', '_blank', '&nbsp;'), ' ', $s_text);
         $s_text = clean_search_text($s_text);
         preg_match_all('/' . $this->search_words . '/is', $s_text, $s_result);
         $s_count = count($s_result[0]);
         if ($s_count && SEARCH_TYPE_AND) {
             $s_and_or = array();
             foreach ($s_result[0] as $svalue) {
                 $s_and_or[strtolower($svalue)] = 1;
             }
             $s_and_or = count($s_and_or);
             if ($s_and_or != $this->search_word_count) {
                 $s_count = 0;
             }
         }
         if ($s_count) {
             $id = $this->search_result_entry;
             $s_title = $value['shopprod_ordernumber'] ? trim($value['shopprod_ordernumber']) . ': ' : '';
             $s_title .= $value['shopprod_name1'];
             $s_title = html($s_title);
             $s_text = trim($s_text);
             if ($this->search_wordlimit) {
                 $s_text = getCleanSubString($s_text, $this->search_wordlimit, $this->ellipse_sign, 'word');
             }
             $s_text = html($s_text);
             $this->search_results[$id]["id"] = $value['shopprod_id'];
             $this->search_results[$id]["cid"] = 0;
             $this->search_results[$id]["rank"] = $s_count;
             $this->search_results[$id]["date"] = $value['shopprod_date'];
             $this->search_results[$id]["user"] = '';
             $this->search_results[$id]["subtitle"] = '';
             $this->search_results[$id]['query'] = $shop_url;
             //.'&amp;shop_cat='.$value['shopprod_category'].'&amp;shop_detail='.$value['shopprod_id'];
             $this->search_results[$id]['image'] = false;
             if ($this->image_render) {
                 $value['shopprod_var'] = unserialize($value['shopprod_var']);
                 if (isset($value['shopprod_var']['images'][0]['f_hash'])) {
                     $this->search_results[$id]['image'] = array('id' => $value['shopprod_var']['images'][0]['f_id'], 'hash' => $value['shopprod_var']['images'][0]['f_hash'], 'ext' => $value['shopprod_var']['images'][0]['f_ext'], 'name' => $value['shopprod_var']['images'][0]['f_name']);
                 }
             }
             if ($this->search_highlight) {
                 $this->search_results[$id]["title"] = highlightSearchResult($s_title, $this->search_highlight_words);
                 $this->search_results[$id]["text"] = highlightSearchResult($s_text, $this->search_highlight_words);
                 $this->search_results[$id]['link'] = rel_url(array('shop_cat' => $value['shopprod_category'], 'shop_detail' => $value['shopprod_id'], 'highlight' => $s_highlight_words), array('searchstart', 'searchwords'), $shop_url);
             } else {
                 $this->search_results[$id]["title"] = $s_title;
                 $this->search_results[$id]["text"] = $s_text;
                 $this->search_results[$id]['link'] = rel_url(array('shop_cat' => $value['shopprod_category'], 'shop_detail' => $value['shopprod_id']), array('highlight', 'searchstart', 'searchwords'), $shop_url);
             }
             $this->search_result_entry++;
         }
     }
 }