$content['alink']['tr'][$key] = render_cnt_template($content['alink']['tr'][$key], 'CAPTION_DETAIL', $row['article_image']['caption'][0]); } else { $content['alink']['tr'][$key] = render_cnt_template($content['alink']['tr'][$key], 'IMAGE_DETAIL', ''); } // article summary if (strpos($content['alink']['tr'][$key], 'SUMMARY_RAW') !== false) { $content['alink']['tr'][$key] = render_cnt_template($content['alink']['tr'][$key], 'SUMMARY_RAW', empty($content['alink']['alink_hidesummary']) ? $row['article_summary'] : ''); } if (strpos($content['alink']['tr'][$key], 'SUMMARY') !== false) { if (empty($content['alink']['alink_hidesummary'])) { if (empty($content['alink']['alink_wordlimit']) && !empty($row['article_image']['list_maxwords'])) { $content['alink']['alink_wordlimit'] = $row['article_image']['list_maxwords']; } $row['article_summary'] = empty($content['alink']['alink_allowedtags']) ? strip_tags($row['article_summary']) : strip_tags($row['article_summary'], $content['alink']['alink_allowedtags']); if (!empty($content['alink']['alink_wordlimit'])) { $row['article_summary'] = getCleanSubString($row['article_summary'], abs($content['alink']['alink_wordlimit']), $template_default['ellipse_sign'], $content['alink']['alink_wordlimit'] < 0 ? 'char' : 'word'); } } else { $row['article_summary'] = ''; } $content['alink']['tr'][$key] = render_cnt_template($content['alink']['tr'][$key], 'SUMMARY', $row['article_summary']); } // $content['struct'][ $row['article_cid'] ]['acat_articlecount'] // count the articles per category and decide where to link on that basis // store it if used once if ($content['alink']['alink_categoryalias'] && ($row['article_structalias'] = get_structurelevel_single_article_alias($row['article_cid']))) { $row['article_alias'] = $row['article_structalias']; } // link to article detail $content['alink']['tr'][$key] = render_cnt_template($content['alink']['tr'][$key], 'ARTICLELINK', $row['article_morelink'] ? 'index.php?' . setGetArticleAid($row) : ''); // article category
<td> </td> <?php $_aliasID_Query = 'SELECT acontent_id, acontent_visible, article_title, acontent_form FROM ' . DB_PREPEND . 'phpwcms_articlecontent'; $_aliasID_Query .= ' LEFT JOIN ' . DB_PREPEND . 'phpwcms_article ON '; $_aliasID_Query .= ' (' . DB_PREPEND . 'phpwcms_articlecontent.acontent_aid = ' . DB_PREPEND . 'phpwcms_article.article_id)'; $_aliasID_Query .= ' WHERE ' . DB_PREPEND . 'phpwcms_articlecontent.acontent_id != ' . $content["id"]; $_aliasID_Query .= ' AND ' . DB_PREPEND . 'phpwcms_articlecontent.acontent_type=18'; $_aliasID_Query .= ' AND ' . DB_PREPEND . 'phpwcms_articlecontent.acontent_trash=0'; $_available_aliasID = _dbQuery($_aliasID_Query); if (count($_available_aliasID)) { echo '<td><select name="cguestbook_aliasID_select" id="cguestbook_aliasID_select" class="v10">' . LF; foreach ($_available_aliasID as $_aliasValue) { $_temp_gb_data = unserialize($_aliasValue['acontent_form']); if (empty($_temp_gb_data['aliasID'])) { echo ' <option value="' . $_aliasValue['acontent_id'] . '">[' . $_aliasValue['acontent_id'] . '] '; echo html(getCleanSubString($_aliasValue['article_title'], 6, '…', 'word')); echo '</option>' . LF; } } echo LF . '</select></td>'; } ?> </tr> </table></td> </tr> <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8" /></td></tr> <tr><td colspan="2"><img src="img/lines/l538_70.gif" alt="" width="538" height="1" /></td></tr>
$s_list[$s_run]['subtitle'] = highlightSearchResult($s_list[$s_run]['subtitle'], $content['highlight']); } $s_list[$s_run]["date"] = $s_date; $s_list[$s_run]["user"] = $s_user; $s_list[$s_run]['query'] = $srow['article_alias'] ? $srow['article_alias'] : 'aid=' . $s_id; $s_list[$s_run]['link'] = ''; $s_list[$s_run]["text"] = ''; $s_list[$s_run]['image'] = false; if ($crow['template']['image_render'] && $srow["article_image"]) { $srow["article_image"] = setArticleSummaryImageData(unserialize($srow["article_image"])); if (!empty($srow["article_image"]['list_hash'])) { $s_list[$s_run]['image'] = array('id' => $srow["article_image"]['list_id'], 'hash' => $srow["article_image"]['list_hash'], 'ext' => $srow["article_image"]['list_ext'], 'name' => $srow["article_image"]['list_name']); } } if ($content['search']['show_summary'] && !empty($content['search']['wordlimit'])) { $s_list[$s_run]["text"] = getCleanSubString($s_text, abs($content['search']['wordlimit']), $template_default['ellipse_sign'], $content['search']['wordlimit'] < 0 ? 'char' : 'word'); $s_list[$s_run]["text"] = html($s_list[$s_run]["text"], false); if ($content['search']['highlight_result']) { $s_list[$s_run]["text"] = highlightSearchResult($s_list[$s_run]["text"], $content['highlight']); } } $s_run++; } } mysql_free_result($sresult); } // at this point we inject search by module search results if (isset($content['search']['module']) && is_array($content['search']['module']) && count($content['search']['module'])) { foreach ($content['search']['module'] as $key => $value) { if (isset($phpwcms['modules'][$key]) && is_file($phpwcms['modules'][$key]['path'] . 'frontend.search.php')) { // include module search
function cut_string($string, $endchar = '…', $length = 20, $trim = 1) { // alias function for older function return getCleanSubString($string, $length, $endchar); }
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', ' '), ' ', $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 . '&newsdetail=' . $value['detail_link']; if ($this->search_highlight) { $this->search_results[$id]['link'] .= '&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++; } } }
$_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']));
$content['images']['shop'][] = array('id' => $row['shopprod_var']['images'][$img_key]['f_id'], 'name' => $row['shopprod_var']['images'][$img_key]['f_name'], 'hash' => $row['shopprod_var']['images'][$img_key]['f_hash'], 'ext' => $row['shopprod_var']['images'][$img_key]['f_ext']); } } $_prod_list_img = implode($_tmpl['image_space'], $_prod_list_img); // Files $_prod_list_files = isset($row['shopprod_var']['files'][0]['f_id']) ? shop_files($row['shopprod_var']['files']) : ''; if ($row['shopprod_description0']) { $row['meta_description'] = $row['shopprod_description0']; } elseif ($row['shopprod_description1']) { $row['meta_description'] = $row['shopprod_description1']; } else { $row['meta_description'] = ''; } if ($row['meta_description']) { $row['meta_description'] = trim(strip_tags(strip_bbcode($row['meta_description']))); $row['meta_description'] = getCleanSubString($row['meta_description'], 75, '', 'word'); $row['meta_description_rendered'] = true; } else { $row['meta_description_rendered'] = false; } if (!empty($row['shopprod_overwrite_meta'])) { $content["pagetitle"] = setPageTitle($content["pagetitle"], $article['cat'], $shop_pagetitle); if ($row['meta_description_rendered']) { set_meta('description', $row['meta_description']); } } if ($row['shopprod_opengraph']) { $content['opengraph']['type'] = 'og:product'; $content['opengraph']['title'] = $shop_pagetitle; $content['opengraph']['url'] = abs_url(array('shop_detail' => $shop_detail_id), array('shop_cat', 'shop_cart', 'phpwcms_output_action', 'print', 'phpwcms-preview', 'unsubscribe', 'subscribe')); if ($row['meta_description_rendered']) {
$news['entries'][$key] = getFrontendEditLink('news', $value['cnt_id']); if (empty($value['cnt_object']['cnt_files']['gallery'])) { $news['tmpl_gallery_item'] = ''; $news['entries'][$key] .= $news['tmpl_entry']; } else { if (empty($news['tmpl_gallery_item'])) { $news['tmpl_gallery_item'] = get_tmpl_section('GALLERY_ITEM', $news['tmpl_entry']); } $news['entries'][$key] .= replace_tmpl_section('GALLERY_ITEM', $news['tmpl_entry']); } if ($value['cnt_teasertext']) { $value['cnt_opengraph_teasertext'] = $value['cnt_teasertext']; if ($news['config']['news_teaser_limit_chars']) { $value['cnt_teasertext'] = getCleanSubString($value['cnt_teasertext'], $news['config']['news_teaser_limit_chars'], $news['config']['news_teaser_limit_ellipse'], 'char'); } elseif ($news['config']['news_teaser_limit_words']) { $value['cnt_teasertext'] = getCleanSubString($value['cnt_teasertext'], $news['config']['news_teaser_limit_words'], $news['config']['news_teaser_limit_ellipse'], 'word'); } if (empty($value['cnt_object']['cnt_textformat']) || $value['cnt_object']['cnt_textformat'] == 'plain') { $value['cnt_teasertext'] = plaintext_htmlencode($value['cnt_teasertext']); } elseif ($value['cnt_object']['cnt_textformat'] == 'br') { $value['cnt_teasertext'] = br_htmlencode($value['cnt_teasertext']); } elseif ($value['cnt_object']['cnt_textformat'] == 'markdown') { if (!isset($phpwcms['parsedown_class'])) { require_once PHPWCMS_ROOT . '/include/inc_ext/parsedown/Parsedown.php'; require_once PHPWCMS_ROOT . '/include/inc_ext/parsedown-extra/ParsedownExtra.php'; $phpwcms['parsedown_class'] = new ParsedownExtra(); } $value['cnt_teasertext'] = $phpwcms['parsedown_class']->text($value['cnt_teasertext']); } elseif ($value['cnt_object']['cnt_textformat'] == 'textile') { if (!isset($phpwcms['textile_class'])) { require_once PHPWCMS_ROOT . '/include/inc_ext/classTextile.php';
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 . '&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; }
/** * Return menu or menu elements based on article menu title information * starting at given structure level ID, limited to single level (non-nested) * * @return mixed (array/string) * @param array **/ function getArticleMenu($data = array()) { global $content; global $aktion; $defaults = array('level_id' => 0, 'class_active' => array(0 => 'active', 1 => ''), 'wrap_title_prefix' => '', 'wrap_title_suffix' => '', 'item_prefix' => "\t", 'item_suffix' => '', 'sort' => 'level', 'item_tag' => 'li', 'wrap_tag' => 'ul', 'attribute_wrap_tag' => '', 'class_item_tag' => '', 'class_first_item_tag' => '', 'class_last_item_tag' => '', 'return_format' => 'string', 'articlemenu_options' => array('enable' => false, 'image' => false, 'text' => false, 'width' => 0, 'height' => 0, 'crop' => 0, 'textlength' => 0, 'position' => 'inside', 'template' => '<span class="amenu-extended">[IMAGE]<img src="{IMAGE}" alt="{IMAGE_NAME}" />[/IMAGE][TEXT]<span class="p">{TEXT}</span>[/TEXT]</span>')); $data = is_array($data) && count($data) ? array_merge($defaults, $data) : $defaults; $li = array(); $articles = get_actcat_articles_data($data['level_id']); $key = 0; $total = count($articles) - 1; foreach ($articles as $item) { $class = ''; $class_a = ''; if ($data['class_item_tag']) { $class .= $data['class_item_tag'] . ' '; } if ($key === 0 && $data['class_first_item_tag']) { $class .= $data['class_first_item_tag'] . ' '; } elseif ($key === $total && $data['class_last_item_tag']) { $class .= $data['class_last_item_tag'] . ' '; } if ($item['article_id'] == $aktion[1]) { if (!empty($data['class_active'][0])) { $class .= $data['class_active'][0] . ' '; } if (!empty($data['class_active'][1])) { $class_a = ' class="' . $data['class_active'][1] . '"'; // set active link class } } $class = trim($class); $item['outside'] = ''; $item['inside'] = ''; if ($data['articlemenu_options']['enable']) { $item['img_src'] = ''; $item['img_name'] = ''; $item['amenu_text'] = ''; if ($data['articlemenu_options']['image'] && (!empty($item['article_image']['list_id']) || !empty($item['article_image']['id']))) { if (!empty($item['article_image']['list_usesummary']) && !empty($item['article_image']['id'])) { $item['img_src'] = $item['article_image']['hash'] . '.' . $item['article_image']['ext']; $item['img_name'] = html($item['article_image']['name']); } elseif (!empty($item['article_image']['list_id'])) { $item['img_src'] = $item['article_image']['list_hash'] . '.' . $item['article_image']['list_ext']; $item['img_name'] = html($item['article_image']['list_name']); } if ($item['img_src']) { $item['img_src'] = 'x' . $data['articlemenu_options']['height'] . 'x' . $data['articlemenu_options']['crop'] . '/' . $item['img_src']; $item['img_src'] = 'img/cmsimage.php/' . $data['articlemenu_options']['width'] . $item['img_src']; } } if ($data['articlemenu_options']['text']) { switch ($data['articlemenu_options']['text']) { case 'description': $item['amenu_text'] = html(getCleanSubString($item['article_description'], abs($data['articlemenu_options']['textlength']), $GLOBALS['template_default']['ellipse_sign'], $data['articlemenu_options']['textlength'] < 0 ? 'char' : 'word')); break; case 'menutitle': $item['amenu_text'] = html(getCleanSubString($item['article_menutitle'], abs($data['articlemenu_options']['textlength']), $GLOBALS['template_default']['ellipse_sign'], $data['articlemenu_options']['textlength'] < 0 ? 'char' : 'word')); break; case 'teaser': if ($data['articlemenu_options']['textlength'] === 'HTML') { $item['amenu_text'] = $item['article_summary']; } else { $item['amenu_text'] = trim(strip_tags($item['article_summary'])); $item['amenu_text'] = getCleanSubString($item['amenu_text'], abs($data['articlemenu_options']['textlength']), $GLOBALS['template_default']['ellipse_sign'], $data['articlemenu_options']['textlength'] < 0 ? 'char' : 'word'); } break; } } $item[$data['articlemenu_options']['position']] = $data['articlemenu_options']['template']; $item[$data['articlemenu_options']['position']] = str_replace('{IMAGE_NAME}', $item['img_name'], $item[$data['articlemenu_options']['position']]); $item[$data['articlemenu_options']['position']] = render_cnt_template($item[$data['articlemenu_options']['position']], 'IMAGE', $item['img_src']); $item[$data['articlemenu_options']['position']] = render_cnt_template($item[$data['articlemenu_options']['position']], 'TEXT', $item['amenu_text']); } $li[$key] = $data['item_prefix'] . '<' . $data['item_tag'] . ($class != '' ? ' class="' . $class . '"' : '') . '>'; $li[$key] .= '<a href="' . rel_url(array(), array('newsdetail'), setGetArticleAid($item)) . '"' . $class_a . '>'; $li[$key] .= $data['wrap_title_prefix']; $li[$key] .= html(getArticleMenuTitle($item)); $li[$key] .= $data['wrap_title_suffix']; $li[$key] .= $item['inside']; $li[$key] .= '</a>'; $li[$key] .= $item['outside']; $li[$key] .= '</' . $data['item_tag'] . '>' . $data['item_suffix']; $key++; } if ($data['wrap_tag'] && count($li)) { array_unshift($li, '<' . trim($data['wrap_tag'] . ' ' . trim($data['attribute_wrap_tag'])) . '>'); array_push($li, '</' . $data['wrap_tag'] . '>'); } return $data['return_format'] == 'string' ? implode(LF, $li) : $li; }
function createSocialBookmark($matches) { if (empty($matches[1])) { return ''; } if (strpos($matches[1], '<!--DETAIL_ONLY-->') === false) { if (empty($GLOBALS['aktion'][1])) { $bm['url'] = PHPWCMS_URL . 'index.php?id=' . $GLOBALS['aktion'][0]; } else { $bm['url'] = PHPWCMS_URL . 'index.php?aid=' . $GLOBALS['aktion'][1]; } } else { if (empty($GLOBALS['aktion'][1])) { return ''; } $bm['url'] = PHPWCMS_URL . 'index.php?aid=' . $GLOBALS['aktion'][1]; $matches[1] = str_replace('<!--DETAIL_ONLY-->', '', $matches[1]); } $bm['uurl'] = $bm['url']; $bm['url'] = rawurlencode($bm['url']); $bm['title'] = clean_replacement_tags(empty($GLOBALS['content']['article_title']) ? $GLOBALS['content']["pagetitle"] : $GLOBALS['content']['article_title'], ''); $bm['title'] = cleanUpSpecialHtmlEntities($bm['title']); $bm['title'] = rawurlencode($bm['title']); $bm['bodytext'] = empty($GLOBALS['content']['article_summary']) ? '' : clean_replacement_tags($GLOBALS['content']['article_summary'], ''); $bm['bodytext'] = cleanUpSpecialHtmlEntities($bm['bodytext']); $bm['bodytext'] = getCleanSubString($bm['bodytext'], 25, '…', 'word'); $bm['bodytext'] = rawurlencode($bm['bodytext']); $bm['topic'] = rawurlencode($GLOBALS['content']['struct'][$GLOBALS['aktion'][0]]['acat_name']); // now set all sepcific data $bm['service']['wong']['url'] = 'http://www.mister-wong.de/index.php?action=addurl'; $bm['service']['wong']['url'] .= '&bm_url=' . $bm['url']; $bm['service']['wong']['url'] .= '&bm_description=' . $bm['title']; $bm['service']['wong']['alt'] = 'Wong It!'; $bm['service']['furl']['url'] = 'http://www.furl.net/savedialog.jsp?p=1&t=' . $bm['title'] . '&u=' . $bm['url'] . '&c=&r='; $bm['service']['furl']['alt'] = 'Furl It'; $bm['service']['spurl']['url'] = 'http://www.spurl.net/spurl.php?title=' . $bm['title'] . '&url=' . $bm['url']; //&blocked=__tags__s'; $bm['service']['spurl']['alt'] = 'Spurl!'; $bm['service']['technorati']['url'] = 'http://technorati.com/faves?add=' . rawurlencode(PHPWCMS_URL); $bm['service']['technorati']['alt'] = 'TechnoratiFaves'; $bm['service']['delicious']['url'] = 'http://del.icio.us/post?url=' . $bm['url'] . '&title=' . $bm['title'] . '&jump=no'; $bm['service']['delicious']['alt'] = 'Del.icio.us'; $bm['service']['digg']['url'] = 'http://digg.com/submit?phase=2&url=' . $bm['url'] . '&title=' . $bm['title']; $bm['service']['digg']['url'] .= '&bodytext=' . $bm['bodytext'] . '&topic='; $bm['service']['digg']['alt'] = 'DiggIt!'; $bm['service']['yahoo']['url'] = 'http://myweb2.search.yahoo.com/myresults/bookmarklet?t=' . $bm['title'] . '&u=' . $bm['url'] . '&d=' . $bm['bodytext'] . '&ei=' . PHPWCMS_CHARSET; $bm['service']['yahoo']['alt'] = 'Save to Yahoo! My Web'; $bm['service']['google']['url'] = 'http://www.google.com/bookmarks/mark?op=add&bkmk=' . $bm['url'] . '&title=' . $bm['title'] . '&annotation=' . $bm['bodytext']; $bm['service']['google']['alt'] = 'Google Bookmark'; $bm['service']['magnolia']['url'] = 'http://ma.gnolia.com/bookmarklet/add?url=' . $bm['url'] . '&title=' . $bm['title'] . '&description=' . $bm['bodytext']; $bm['service']['magnolia']['alt'] = 'Ma.gnolia'; $bm['service']['newsvine']['url'] = 'http://www.newsvine.com/_tools/seed&save?url=' . $bm['url'] . '&title=' . $bm['title']; $bm['service']['newsvine']['alt'] = 'Newsvine'; $bm['service']['reddit']['url'] = 'http://reddit.com/submit?url=' . $bm['url'] . '&title=' . $bm['title']; $bm['service']['reddit']['alt'] = 'Reddit'; $bm['service']['webnews']['url'] = 'http://www.webnews.de/einstellen?url=' . $bm['url'] . '&title=' . $bm['title'] . '&desc=' . $bm['bodytext']; $bm['service']['webnews']['alt'] = 'Diese Nachricht bei Webnews einstellen'; $bm['service']['wikio']['url'] = 'http://www.wikio.com/vote?url=' . $bm['url']; $bm['service']['wikio']['alt'] = 'Wikio'; $bm['service']['yigg']['url'] = 'http://yigg.de/neu?exturl=' . $bm['url'] . '&exttitle=' . $bm['title'] . '&extdesc=' . $bm['bodytext']; $bm['service']['yigg']['alt'] = 'YiGG it'; $bm['service']['facebook']['url'] = 'http://www.facebook.com/sharer.php?u=' . $bm['url'] . '&t=' . $bm['title']; $bm['service']['facebook']['alt'] = 'Share on Facebook'; $bm['service']['folkd']['url'] = 'http://www.folkd.com/submit/' . $bm['uurl']; $bm['service']['folkd']['alt'] = 'folk it!'; $bm['service']['oneview']['url'] = 'http://www.oneview.de/quickadd/neu/addBookmark.jsf?URL=' . $bm['url'] . '&title=' . $bm['title']; $bm['service']['oneview']['alt'] = 'oneview - das merk ich mir!'; foreach ($bm['service'] as $key => $value) { $bmt = '<a href="' . $bm['service'][$key]['url'] . '" title="' . $bm['service'][$key]['alt'] . '" '; $bmt .= 'target="_blank" rel="nofollow"><img src="' . TEMPLATE_PATH . 'img/bookmarklets/' . $key . '.gif" '; $bmt .= 'alt="' . $bm['service'][$key]['alt'] . '" border="0" /></a>'; $matches[1] = str_replace('{' . strtoupper($key) . '}', $bmt, $matches[1]); } return $matches[1]; }
**/ // ---------------------------------------------------------------- // obligate check for phpwcms constants if (!defined('PHPWCMS_ROOT')) { die("You Cannot Access This Script Directly, Have a Nice Day."); } // ---------------------------------------------------------------- // File List $cinfo["result"] = ''; if ($row["acontent_title"]) { $cinfo["result"] .= getCleanSubString($row["acontent_title"], 55, '…'); } if ($cinfo["result"] && $row["acontent_subtitle"]) { $cinfo["result"] .= ' / '; } if ($row["acontent_subtitle"]) { $cinfo["result"] .= getCleanSubString($row["acontent_subtitle"], 55, '…'); } $cinfo["result"] = html($cinfo["result"]); if ($row["acontent_template"]) { if ($cinfo["result"]) { $cinfo["result"] .= ' / '; } $cinfo["result"] .= $BL['be_admin_struct_template'] . ': <strong>' . html($row["acontent_template"]) . '</strong>'; } if ($cinfo["result"]) { //Zeige Inhaltinfo echo '<tr><td> </td><td class="v10">'; echo '<a href="phpwcms.php?do=articles&p=2&s=1&aktion=2&id=' . $article["article_id"] . "&acid=" . $row["acontent_id"] . '">'; echo $cinfo["result"] . '</a></td><td> </td></tr>'; }
if ($row_count) { echo '<tr><td colspan="5" bgcolor="#D9DEE3"><img src="img/leer.gif" alt="" width="1" height="1"></td></tr>' . LF; } echo '<tr' . ($row_count % 2 ? ' bgcolor="#F3F5F8"' : '') . ' class="listrow" style="cursor:pointer" '; echo 'onclick="document.location.href=\'phpwcms.php?do=articles&p=2&s=1&aktion=2&'; echo 'id=' . $value['acontent_aid'] . '&acid=' . $value['acontent_id'] . '\'" title="' . $BL['be_func_content_edit'] . '">' . LF; echo ' <td style="padding:1px 4px 1px 2px;width:11px;"><img src="img/symbole/add_content.gif" alt="" /></td>' . LF; echo ' <td class="overflow-ellipsis home-type">' . $wcs_content_type[$value["acontent_type"]]; if ($value["acontent_type"] == 30) { echo ': ' . $BL['modules'][$value["acontent_module"]]['listing_title']; } echo ' </td>' . LF; $value['notice'] = str_replace('###', ', ', trim($value['acontent_title'] . '###' . $value['acontent_subtitle'] . '###' . $value['acontent_comment'], '#')); if ($value['notice']) { $value['notice_long'] = $value['article_title'] . ' > ' . $value['notice']; $value['notice'] = getCleanSubString($value['article_title'], 15, '.') . ' > ' . $value['notice']; } else { $value['notice_long'] = $value['notice'] = $value['article_title']; } $value['notice'] = html(preg_replace('/\\s+/', ' ', $value['notice'], false)); echo ' <td class="overflow-ellipsis home-cp" title="' . $BL['be_func_content_edit'] . ': ' . html($value['notice_long'], false) . '" style="font-weight:normal">' . $value['notice'] . '</td>' . LF; echo ' <td align="center" nowrap="nowrap" style="width:115px"> ' . $value['acontent_changed'] . ' </td>' . LF; echo ' <td style="padding:3px;width:42px;" nowrap="nowrap">'; echo '<img src="img/button/visible_12x13_' . $value["acontent_visible"] . '.gif" alt="" border="0" style="margin-right:2px;" />'; echo '<a href="phpwcms.php?do=articles&p=2&s=1&aktion=2&'; echo 'id=' . $value['acontent_aid'] . '&acid=' . $value['acontent_id']; echo '"><img src="img/button/edit_22x13.gif" alt="Edit" border="0" /></a>'; echo '</td>' . LF; echo '</tr>' . LF; $row_count++; }
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="1" /></td> </tr> <?php } ?> <?php if (!empty($article["article_summary"])) { ?> <tr> <td valign="top" class="v10" style="color:#727889"><?php echo $BL['be_article_asummary']; ?> : </td> <td valign="top" class="v10"><?php echo html(getCleanSubString(strip_tags($article["article_summary"]), 250, '…'), false); ?> </td> </tr> <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="1" /></td> </tr> <?php } ?> <tr> <td valign="top" class="v10" style="color:#727889"><?php echo $BL['be_article_cat']; ?> : </td> <td valign="top" class="v10"><?php
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', ' '), ' ', $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; //.'&shop_cat='.$value['shopprod_category'].'&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++; } } }