</div> </div> <div id="nav"> <microweber module="content/menu" name="main_menu" /> <? $shop_page = array(); $shop_page['content_layout_name'] = 'shop'; $shop_page=get_pages($shop_page); $shop_page = $shop_page[0]; // var_dump($shop_page); ?> <? if(!empty($shop_page)): ?> <div id="nav_cart"> <a href="<? print page_link($shop_page['id']); ?>/view:cart"> <span class="items cart_items_qty"><? print get_items_qty() ; ?></span> <strong>Items</strong></a> <img src="<? print TEMPLATE_URL ?>img/cart.png" alt="" /> <a href="<? print page_link($shop_page['id']); ?>/view:cart">View cart </a> </div> <? endif; ?> </div> </div><!-- /#header --> <div id="content">
$used = _mod_used($link['page_id']); if (!$mod && !$lang || strpos($used, $mod) !== false || $link['language'] == $lang) { echo "<tr>\r\n\t\t\t\t<td class='v small'>" . $link['page_id'] . "</td>\r\n\t\t\t\t<td class='v'><a title='Open this page' href='" . page_link($link['link']) . "' target='_blank'>" . str_repeat("+ ", $link['level']) . $link['page_title'] . "</a></td>\r\n\t\t\t\t<td class='v'>" . $link['visibility'] . "</td>\r\n\t\t\t\t<td class='v'>" . $link['language'] . "</td>\r\n\t\t\t\t<td class='v'>" . $link['link'] . "</td>\r\n\t\t\t\t<td class='v'>" . _mod_used($link['page_id']) . "</td>\r\n\t\t\t\t<td class='v small'>" . _page_exists($link['link']) . "</td>\r\n\t\t\t\t<td class='v small'><a href='" . $thisurl . "&create=" . $link['page_id'] . "'>Recreate</a></td>\r\n\t\t\t\t</tr>"; } } ?> </table><br/> <?php if (!$mod && !$lang) { $links = array(); _build_posts(); ?> <h2>News posts</h2> <table cellpadding='3' border='0'> <tr> <td class='h'>ID</td> <td class='h'>Title</td> <td class='h'>active</td> <td class='h'>Link</td> <td class='h'>Check</td> <td class='h'>Rebuild</td> </tr> <?php foreach ($links as $link) { echo "<tr>\r\n\t\t\t\t<td class='v small'>" . $link['post_id'] . "</td>\r\n\t\t\t\t<td class='v'><a title='Open this page' href='" . page_link($link['link']) . "' target='_blank'>" . $link['title'] . "</a></td>\r\n\t\t\t\t<td class='v'>" . $link['active'] . "</td>\r\n\t\t\t\t<td class='v'>" . $link['link'] . "</td>\r\n\t\t\t\t<td class='v small'>" . _page_exists($link['link']) . "</td>\r\n\t\t\t\t<td class='v small'><a href='" . $thisurl . "&post=" . $link['post_id'] . "'>Recreate</a></td>\r\n\t\t\t\t</tr>"; } ?> </table><br/> <?php }
$next_link_title = ''; $previous_link_title = ''; } $showmax_prev_next_links = (int) $settings_fetch['pnsa_max']; //Neu: Enthält auch die Daten zu den additional pictures $setting_additionalpics_string = '{THUMB}'; if (is_array($setting_pnsa_array) and count($setting_pnsa_array) > 5) { $setting_additionalpics_string = $setting_pnsa_array[5]; } // Get page info $query_page = $database->query("SELECT link, parent, position FROM " . TABLE_PREFIX . "pages WHERE page_id = '" . PAGE_ID . "'"); if ($query_page->numRows() < 1) { exit('Page not found'); } $page = $query_page->fetchRow(); $page_link = page_link($page['link']); if ($page['parent'] == 0 and $page['position'] == 1) { $page_link = WB_URL . '/'; } //Seem to be the homepage if ($showoffset > 0) { $page_link .= '?p=' . $showoffset; } $qactive = " active > '1' "; if ($wb->is_authenticated()) { $qactive = " active > '0' "; } if ($sort_topics == 3) { $query_extra = ''; } //Evencalendar: Dont hide
echo '<i>', __('none', 'it-l10n-backupbuddy'), '</i><br />'; } ?> </div> </div> </div> </div> </div> <br /><br /><br /><br /> <div style="color: #AFAFAF; width: 793px;"> <a href="<?php if (defined('pluginbuddy_importbuddy')) { echo page_link('malware_scan', 'view_malware'); } else { if (is_network_admin()) { echo network_admin_url('admin.php'); } else { echo admin_url('admin.php'); } echo '?page=pb_backupbuddy_malware_scan'; } ?> &refresh=true" class="button-secondary"><?php _e('Perform New Scan Now', 'it-l10n-backupbuddy'); ?> </a> <span class="description" style="vertical-align: -4px;"> <?php _e('Malware scan results are cached for one hour.', 'it-l10n-backupbuddy');
</div> <?php foreach (get_pages() as $page) { ?> <div class="navbar-section"> <h3><?php echo page_link($page); ?> </h3> <ul> <?php foreach ($page['children'] as $subpage) { ?> <li><?php echo page_link($subpage); ?> </li> <?php } ?> </ul> </div> <?php } ?> <div class="navbar-section"> <h3>Archives</h3> <ul> <?php
// User who last modified the post // Workout date and time of last modified post if ($post['published_when'] === '0') { $post['published_when'] = time(); } if ($post['published_when'] > $post['posted_when']) { $post_date = date(DATE_FORMAT, $post['published_when']); $post_time = date(TIME_FORMAT, $post['published_when']); } else { $post_date = date(DATE_FORMAT, $post['posted_when']); $post_time = date(TIME_FORMAT, $post['posted_when']); } $publ_date = date(DATE_FORMAT, $post['published_when']); $publ_time = date(TIME_FORMAT, $post['published_when']); // Work-out the post link $post_link = page_link($post['link']); $post_link_path = str_replace(LEPTON_URL, LEPTON_PATH, $post_link); if (file_exists($post_link_path)) { $create_date = date(DATE_FORMAT, filemtime($post_link_path)); $create_time = date(TIME_FORMAT, filemtime($post_link_path)); } else { $create_date = $publ_date; $create_time = $publ_time; } // Get group id, title, and group image $group_id = $post['group_id']; $group_title = $groups[$group_id]['title']; $group_image = $groups[$group_id]['image']; $display_image = $group_image == '' ? "none" : "inherit"; $display_group = $group_id == 0 ? 'none' : 'inherit'; if ($group_image != "") {
//This is a Single Topics Page, figure out the TOPIC ID //TODO: Das könnte bei TopicMasters Ärger machen. $theq = "SELECT topic_id, link, page_id FROM " . TABLE_PREFIX . "mod_" . $tablename . " WHERE " . $sectionquery . " AND " . $qactive . $query_extra . " ORDER BY " . $sort_topics_by . " LIMIT 1"; $query_topics = $database->query($theq); $num_topics = $query_topics->numRows(); if ($num_topics == 1) { $topic = $query_topics->fetchRow(); $topic_link = WB_URL . $topics_virtual_directory . $topic['link'] . PAGE_EXTENSION; $singletopic_id = $topic['topic_id']; // If THIS is a single-topic page, we need to change all topiclinks to the main page $query_page = $database->query("SELECT link FROM " . TABLE_PREFIX . "pages WHERE page_id = '" . $topic['page_id'] . "'"); if ($query_page->numRows() < 1) { exit('Page not found'); } $page = $query_page->fetchRow(); $singletopic_link = page_link($page['link']); } } // Check if we should show the list page or a topic itself if (!defined('TOPIC_ID') or !is_numeric(TOPIC_ID)) { //-------------------------------------------------------------------------------------------------------------------------- //Main Page (List) // Work-out if we need to add limit code to sql OR if this is a single topic $setting_topics_per_page = $settings_fetch['topics_per_page']; $limit_sql = ''; if ($setting_topics_per_page == 1) { //This is a Single Topics Page; Define the TOPIC ID define('TOPIC_ID', $singletopic_id); } else { //This is the Main Page if ($setting_topics_per_page > 1) {
function index() { if ($_POST) { $user = $_POST['username']; $pass = $_POST['password']; $email = $_POST['email']; $data = array(); $data['username'] = $user; $data['password'] = $pass; $data['is_active'] = 'y'; // p ( $data ); //p ( $_POST ); $data = CI::model('users')->getUsers($data); $data = $data[0]; if (empty($data)) { if (trim($email) != '') { $data = array(); $data['email'] = $email; $data['password'] = $pass; $data['is_active'] = 'y'; $data = CI::model('users')->getUsers($data); $data = $data[0]; } } if (empty($data)) { CI::library('session')->unset_userdata('the_user'); safe_redirect('login'); exit; } else { CI::library('session')->set_userdata('the_user', $data); $user_session = array(); $user_session['is_logged'] = 'yes'; $user_session['user_id'] = $data['id']; //p ( $data ); //p ( $user_session ); CI::library('session')->set_userdata('user_session', $user_session); if ($data["is_admin"] == 'y') { if ($_POST['where_to'] == 'live_edit') { $p = get_page(); if (!empty($p)) { $link = page_link($p['id']); $link = $link . '/editmode:y'; safe_redirect($link); //p($link,1); } else { safe_redirect('admin'); } //p($p,1); } else { safe_redirect('admin'); } } else { $go = site_url(); safe_redirect("{$go}"); } //$data = $data[0]; //var_dump($data); //var_dump($_POST); exit; } } $this->template['functionName'] = strtolower(__FUNCTION__); $this->load->vars($this->template); // $layout = CI::view ( 'layout', true, true ); $primarycontent = CI::view('login', true, true); print $primarycontent; // $layout = str_ireplace ( '{primarycontent}', $primarycontent, $layout ); //CI::library('output')->set_output ( $primarycontent ); exit; }
</ul> </div> </div> <!-- /#footer-content --> </div> <!-- /#footer --> <?php //p(CI::model('core')->path_list); //p(CI::model('core')->cache_storage_hits); include ACTIVE_TEMPLATE_DIR . 'footer_stats_scripts.php'; ?> <div id="addr"> <div id="addr-content"> <address> © <?php echo date('Y'); ?> <a href="<? print site_url(); ?>">Skid-e-Kids Network</a>. All Rights Reserved - <a href="<? print page_link(518); ?>">Terms and of use</a> | <a href="<? print page_link(519); ?>">Privacy policy</a> | <a href="<? print site_url('toy-swap-terms-and-conditions'); ?>">Toy swap terms & conditions</a> | <a href="<? print site_url('contacts') ?>">Contact us</a> </address> <span id="web-design">Created by <a href="http://ooyes.net" title="Website Design">ooYes.net</a></span> </div> </div> <div id="overlay" style="display: none"> </div> <div id="preloader"><span> </span></div> <div id="header_login_form"> <microweber module="users/login"></microweber> <span class="modalclose" title="Close" onclick="modal.close()"></span> </div> <div id="tip"></div> </body></html>
function linkToPage($id = "") { return page_link($id); }
$total_num = $query_total_num->numRows(); // Get item info $query_item = $database->query("SELECT * FROM " . TABLE_PREFIX . "mod_bakery_items WHERE item_id = '" . ITEM_ID . "' AND active = '1'"); if ($query_item->numRows() > 0) { $item = $query_item->fetchRow(); $position = $item['position']; $title = htmlspecialchars(stripslashes($item['title'])); $price = number_format(stripslashes($item['price']), 2, $setting_dec_point, $setting_thousands_sep); // Initialize vars $next_link = ''; $previous_link = ''; // If number of items is limited on overview pages, // add saved position as a get parameter to the page link if ($setting_items_per_page > 0) { $p = empty($_SESSION['bakery']['position']) ? 0 : $_SESSION['bakery']['position']; $page_link = page_link($page['link']) . '?p=' . $p; } // Create previous and next links $query_surrounding = $database->query("SELECT item_id FROM " . TABLE_PREFIX . "mod_bakery_items WHERE position != '{$position}' AND section_id = '{$section_id}' AND active = '1' LIMIT 1"); if ($query_surrounding->numRows() > 0) { // Get previous if ($position > 1) { $query_previous = $database->query("SELECT title, link FROM " . TABLE_PREFIX . "mod_bakery_items WHERE position < '{$position}' AND section_id = '{$section_id}' AND active = '1' ORDER BY position DESC LIMIT 1"); if ($query_previous->numRows() > 0) { $previous = $query_previous->fetchRow(); // Truncate text and add horizontal ellipsis if (strlen($previous['title']) > $link_length) { $previous['title'] = substr($previous['title'], 0, $link_length) . '…'; } $previous_link = '<a href="' . WB_URL . PAGES_DIRECTORY . $previous['link'] . PAGE_EXTENSION . '">« ' . htmlspecialchars(stripslashes($previous['title'])) . '</a>'; }
function content_helpers_getPagesAsUlTree($content_parent = 0, $link = false, $actve_ids = false, $active_code = false, $remove_ids = false, $removed_ids_code = false) { global $cms_db_tables; $table = $cms_db_tables['table_content']; if ($content_parent == false) { $content_parent = intval(0); } $sql = "SELECT * from {$table} where content_parent={$content_parent} and content_type='page' "; $q = CI::model('core')->dbQuery($sql); $result = $q; if (!empty($result)) { //$output = "<ul>"; print "<ul>"; foreach ($result as $item) { $output = $output . $item['content_title']; $content_type_li_class = false; if ($item['is_home'] != 'y') { switch ($item['content_subtype']) { case 'blog_section': $content_type_li_class = 'is_category'; break; case 'module': $content_type_li_class = 'is_module'; break; default: $content_type_li_class = 'is_page'; break; } } else { $content_type_li_class = 'is_home'; } print "<li class='{$content_type_li_class}'>"; if ($link != false) { $to_print = false; $to_print = str_ireplace('{id}', $item['id'], $link); $to_print = str_ireplace('{content_title}', $item['content_title'], $to_print); $to_print = str_ireplace('{link}', page_link($item['id']), $to_print); foreach ($item as $item_k => $item_v) { $to_print = str_ireplace('{' . $item_k . '}', $item_v, $to_print); } if (is_array($actve_ids) == true) { $is_there_active_ids = false; foreach ($actve_ids as $active_id) { if (strval($item['id']) == strval($active_id)) { $is_there_active_ids = true; $to_print = str_ireplace('{active_code}', $active_code, $to_print); } } if ($is_there_active_ids == false) { $to_print = str_ireplace('{active_code}', '', $to_print); } } else { $to_print = str_ireplace('{active_code}', '', $to_print); } if (is_array($remove_ids) == true) { if (in_array($item['id'], $remove_ids)) { if ($removed_ids_code == false) { $to_print = false; } else { $to_print = str_ireplace('{removed_ids_code}', $removed_ids_code, $to_print); } } else { $to_print = str_ireplace('{removed_ids_code}', '', $to_print); } } print $to_print; } else { print $item['content_title']; } $children = $this->content_helpers_getPagesAsUlTree($item['id'], $link, $actve_ids, $active_code, $remove_ids, $removed_ids_code); print "</li>"; } print "</ul>"; } else { } }
function list_news($section_id = 0, $g = 0, $p = 0) { // the following is mainly taken from view.php of the news module global $post_id, $post_section, $TEXT, $MESSAGE, $MOD_NEWS, $database; // load module language file $lang = WB_PATH . '/modules/news/languages/' . LANGUAGE . '.php'; require_once !file_exists($lang) ? WB_PATH . '/modules/news/languages/EN.php' : $lang; //overwrite php.ini on Apache servers for valid SESSION ID Separator if (function_exists('ini_set')) { ini_set('arg_separator.output', '&'); } // Get user's username, display name, email, and id - needed for insertion into post info $users = array(); $sql = 'SELECT `user_id`,`username`,`display_name`,`email` FROM `' . TABLE_PREFIX . 'users`'; if ($resUsers = $database->query($sql)) { while ($recUser = $resUsers->fetchRow()) { $users[$recUser['user_id']] = $recUser; } } // Get all groups (id, title, active, image) $groups = array(0 => array('group_id' => 0, 'title' => '', 'active' => true, 'image' => '')); $sql = 'SELECT `group_id`, `title`, `active` FROM `' . TABLE_PREFIX . 'mod_news_groups` ' . 'WHERE `section_id`=' . (int) $section_id . ' ' . 'ORDER BY `position` ASC'; if ($query_users = $database->query($sql)) { while ($group = $query_users->fetchRow()) { // Insert user info into users array $groups[$group['group_id']] = $group; $sImageUrl = MEDIA_DIRECTORY . '/.news/image' . $group['group_id'] . '.jpg'; $groups[$group['group_id']]['image'] = is_readable(WB_PATH . $sImageUrl) ? WB_URL . $sImageUrl : ''; } } // Check if we should only list posts from a certain group if ($g != 0) { $query_extra = 'AND `group_id`=' . (int) $g . ' '; } else { $query_extra = ''; } // Get settings $setting_header = $setting_post_loop = $setting_footer = $setting_posts_per_page = ''; $sql = 'SELECT `header`, `post_loop`, `footer`, `posts_per_page` ' . 'FROM `' . TABLE_PREFIX . 'mod_news_settings` ' . 'WHERE `section_id`=' . (int) $section_id; if ($resSettings = $database->query($sql)) { if ($recSettings = $resSettings->fetchRow(MYSQL_ASSOC)) { foreach ($recSettings as $key => $val) { ${'setting_' . $key} = $val; } } } // Get total number of posts relatet to now $t = time(); $sql = 'SELECT COUNT(*) FROM `' . TABLE_PREFIX . 'mod_news_posts` ' . 'WHERE `section_id`=' . (int) $section_id . ' AND `active`=1 ' . 'AND `title`!=\'\' ' . 'AND (`published_when`=0 OR `published_when`<=' . $t . ') ' . 'AND (`published_until`=0 OR `published_until`>=' . $t . ') ' . $query_extra; $total_num = intval($database->get_one($sql)); // Work-out if we need to add limit code to sql if ($setting_posts_per_page != 0 && $p != 0) { $limit_sql = ' LIMIT ' . $p . ', ' . $setting_posts_per_page; } else { $limit_sql = ''; } // Query posts (for this page) $sql = 'SELECT * FROM `' . TABLE_PREFIX . 'mod_news_posts` ' . 'WHERE `section_id`=' . $section_id . ' ' . 'AND `active`=1 ' . 'AND `title`!=\'\' ' . 'AND (`published_when`=0 OR `published_when`<=' . $t . ') ' . 'AND (`published_until`=0 OR `published_until`>=' . $t . ') ' . $query_extra . 'ORDER BY `position` DESC' . $limit_sql; $query_posts = $database->query($sql); $num_posts = $query_posts->numRows(); $display_previous_next_links = 'none'; if ($num_posts === 0) { $setting_header = ''; $setting_post_loop = ''; $setting_footer = ''; $setting_posts_per_page = ''; } // Print header $aPlaceHolders = addBracketNewsList('DISPLAY_PREVIOUS_NEXT_LINKS', 'NEXT_PAGE_LINK', 'NEXT_LINK', 'PREVIOUS_PAGE_LINK', 'PREVIOUS_LINK', 'OUT_OF', 'OF'); $aReplacements = array($display_previous_next_links); print preg_replace($aPlaceHolders, $aReplacements, $setting_header); if ($num_posts > 0) { $aPlaceHolders = addBracketNewsList('PAGE_TITLE', 'GROUP_ID', 'GROUP_TITLE', 'GROUP_IMAGE', 'DISPLAY_GROUP', 'DISPLAY_IMAGE', 'TITLE', 'SHORT', 'MODI_DATE', 'MODI_TIME', 'CREATED_DATE', 'CREATED_TIME', 'PUBLISHED_DATE', 'PUBLISHED_TIME', 'LINK', 'SHOW_READ_MORE', 'TEXT_READ_MORE', 'USER_ID', 'USERNAME', 'DISPLAY_NAME', 'EMAIL'); while ($post = $query_posts->fetchRow()) { if (isset($groups[$post['group_id']]['active']) and $groups[$post['group_id']]['active'] != false) { // Make sure parent group is active $uid = $post['posted_by']; // User who last modified the post // Workout date and time of last modified post if ($post['published_when'] === '0') { $post['published_when'] = time(); } if ($post['published_when'] > $post['posted_when']) { $post_date = date(DATE_FORMAT, $post['published_when'] + TIMEZONE); $post_time = date(TIME_FORMAT, $post['published_when'] + TIMEZONE); } else { $post_date = date(DATE_FORMAT, $post['posted_when'] + TIMEZONE); $post_time = date(TIME_FORMAT, $post['posted_when'] + TIMEZONE); } $publ_date = date(DATE_FORMAT, $post['published_when']); $publ_time = date(TIME_FORMAT, $post['published_when']); // Work-out the post link $post_link = page_link($post['link']); $post_link_path = str_replace(WB_URL, WB_PATH, $post_link); $create_date = date(DATE_FORMAT, $post['created_when']); $create_time = date(TIME_FORMAT, $post['created_when']); if ($p > 0) { $post_link .= '?p=' . $p; } if ($g != 0) { if ($p > 0) { $post_link .= '&'; } else { $post_link .= '?'; } $post_link .= 'g=' . $g; } // Get group id, title, and image $group_id = $post['group_id']; $group_title = $groups[$group_id]['title']; $group_image = $groups[$group_id]['image']; $display_image = $group_image == '' ? "none" : "inherit"; $display_group = $group_id == 0 ? 'none' : 'inherit'; if ($group_image != "") { $group_image = "<img src='" . $group_image . "' alt='" . $group_title . "' />"; } // Replace [wblink--PAGE_ID--] with real link $short = ""; // Replace vars with values $post_long_len = strlen($post['content_long']); // set replacements for exchange $aReplacements = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_date, $post_time, $create_date, $create_time, $publ_date, $publ_time); if (isset($users[$uid]['username']) and $users[$uid]['username'] != '') { $aReplacements[] = $post_link; $aReplacements[] = 'hidden'; $aReplacements[] = ''; $aReplacements[] = $uid; $aReplacements[] = $users[$uid]['username']; $aReplacements[] = $users[$uid]['display_name']; $aReplacements[] = $users[$uid]['email']; } else { $aReplacements[] = $post_link; $aReplacements[] = 'hidden'; $aReplacements[] = ''; } print str_replace($aPlaceHolders, $aReplacements, $setting_post_loop); } } } // Print footer $aPlaceHolders = addBracketNewsList('DISPLAY_PREVIOUS_NEXT_LINKS', 'NEXT_PAGE_LINK', 'NEXT_LINK', 'PREVIOUS_PAGE_LINK', 'PREVIOUS_LINK', 'OUT_OF', 'OF'); $aReplacements = array($display_previous_next_links); print str_replace($aPlaceHolders, $aReplacements, $setting_footer); }
/** * This is the main function for all module search functions. * * @param array $search_result - variables given from the module or droplep * @param array $search_parameter - variables given from the LEPTON search to the module * @return boolean true if the search result of the module match or false in all other cases */ function print_excerpt2($search_result, $search_parameter) { // check the search result variables if ($search_result['text'] == "") { return false; } if (!isset($search_result['page_link'])) { $search_result['page_link'] = $search_parameter['page_link']; } if (!isset($search_result['page_link_target'])) { $search_result['page_link_target'] = ""; } if (!isset($search_result['page_title'])) { $search_result['page_title'] = $search_parameter['page_title']; } if (!isset($search_result['page_description'])) { $search_result['page_description'] = $search_parameter['page_description']; } if (!isset($search_result['page_modified_when'])) { $search_result['page_modified_when'] = $search_parameter['page_modified_when']; } if (!isset($search_result['page_modified_by'])) { $search_result['page_modified_by'] = $search_parameter['page_modified_by']; } if (!isset($search_result['text'])) { $search_result['text'] = ""; } if (!isset($search_result['max_excerpt_num'])) { $search_result['max_excerpt_num'] = $search_parameter['default_max_excerpt']; } // special: image links if (!isset($search_result['pic_link'])) { $search_result['pic_link'] = ''; } if (!isset($search_result['image_link'])) { $search_result['image_link'] = $search_result['pic_link']; } if (!isset($search_result['no_highlight'])) { $search_result['no_highlight'] = false; } if (isset($search_result['ext_charset'])) { $search_result['ext_charset'] = strtolower($search_result['ext_charset']); } else { $search_result['ext_charset'] = ''; } if ($search_result['no_highlight']) { // suppress highlighting of search results $search_result['page_link_target'] = "&nohighlight=1" . $search_result['page_link_target']; } // clean the text: $search_result['text'] = preg_replace('#<(br|dt|/dd|/?(?:h[1-6]|tr|table|p|li|ul|pre|code|div|hr))[^>]*>#i', '.', $search_result['text']); $search_result['text'] = preg_replace('#<(!--.*--|style.*</style|script.*</script)>#iU', ' ', $search_result['text']); $search_result['text'] = preg_replace('#\\[\\[.*?\\]\\]#', '', $search_result['text']); //Filter droplets from the page data // strip_tags() is called below if ($search_result['ext_charset'] != '') { // data from external database may have a different charset require_once CAT_PATH . '/framework/functions-utf8.php'; switch ($search_result['ext_charset']) { case 'latin1': case 'cp1252': $search_result['text'] = charset_to_utf8($search_result['text'], 'CP1252'); break; case 'cp1251': $search_result['text'] = charset_to_utf8($search_result['text'], 'CP1251'); break; case 'latin2': $search_result['text'] = charset_to_utf8($search_result['text'], 'ISO-8859-2'); break; case 'hebrew': $search_result['text'] = charset_to_utf8($search_result['text'], 'ISO-8859-8'); break; case 'greek': $search_result['text'] = charset_to_utf8($search_result['text'], 'ISO-8859-7'); break; case 'latin5': $search_result['text'] = charset_to_utf8($search_result['text'], 'ISO-8859-9'); break; case 'latin7': $search_result['text'] = charset_to_utf8($search_result['text'], 'ISO-8859-13'); break; case 'utf8': default: $search_result['text'] = charset_to_utf8($search_result['text'], 'UTF-8'); } } else { $search_result['text'] = entities_to_umlauts($search_result['text'], 'UTF-8'); } $content_locked = ''; $add_anchor = true; if (isset($_SESSION[SESSION_SEARCH_NON_PUBLIC_CONTENT])) { // show non-public contents, so add some extra informations if (isset($_SESSION[SESSION_SEARCH_LINK_NON_PUBLIC_CONTENT]) && !empty($_SESSION[SESSION_SEARCH_LINK_NON_PUBLIC_CONTENT])) { // link to a special page, defined in search as CFG_LINK_NON_PUBLIC_CONTENT $search_result['page_link'] = CAT_URL . $_SESSION[SESSION_SEARCH_LINK_NON_PUBLIC_CONTENT]; } else { $search_result['page_link'] = ''; } // $_SESSION reset unset($_SESSION[SESSION_SEARCH_NON_PUBLIC_CONTENT]); unset($_SESSION[SESSION_SEARCH_LINK_NON_PUBLIC_CONTENT]); $add_anchor = false; } $anchor_text = $search_result['text']; // make an copy containing html-tags $search_result['text'] = strip_tags($search_result['text']); $search_result['text'] = str_replace(array('>', '<', '&', '"', ''', ''', ' '), array('>', '<', '&', '"', '\'', '\'', ' '), $search_result['text']); $search_result['text'] = '.' . trim($search_result['text']) . '.'; // create empty image array $images = array(); if ($search_parameter['settings'][CFG_SEARCH_IMAGES] || $search_parameter['settings'][CFG_CONTENT_IMAGE]) { // we need a image array for the search preg_match_all('/<img[^>]*>/', $anchor_text, $matches); foreach ($matches as $match) { foreach ($match as $img_tag) { // <img ...> zerlegen preg_match_all('/([a-zA-Z]*[a-zA-Z])\\s{0,3}[=]\\s{0,3}("[^"\\r\\n]*)"/', $img_tag, $attr); foreach ($attr as $attributes) { $img = array(); foreach ($attributes as $attribut) { if (strpos($attribut, "=") !== false) { list($key, $value) = explode("=", $attribut); $value = trim($value); $value = substr($value, 1, strlen($value) - 2); $img[strtolower(trim($key))] = trim($value); } } if (isset($img['src'])) { $images[] = $img; } } } } } if (!$search_parameter['settings'][CFG_SEARCH_IMAGES] && $search_parameter['settings'][CFG_CONTENT_IMAGE] == CONTENT_IMAGE_NONE) { // Do a fast scan over the search result first. This may speedup things a lot. if ($search_parameter['search_match'] == SEARCH_TYPE_ALL) { if (!is_all_matched($search_result['text'], $search_parameter['search_words'])) { return false; } } elseif (!is_any_matched($search_result['text'], $search_parameter['search_words'])) { return false; } } else { // create a dummy string to check matches in the images $divider = '.'; $image_text = ''; foreach ($images as $image) { $file = basename($image['src']); $file = urldecode(substr($file, 0, strrpos($file, '.'))); $alt = isset($image['alt']) && !empty($image['alt']) ? $image['alt'] : ''; $title = isset($image['title']) && !empty($image['title']) ? $image['title'] : ''; $image_text .= $alt == $title ? $divider . $alt . $divider . $file . $divider : $divider . $alt . $divider . $title . $divider . $file . $divider; } if ($search_parameter['search_match'] == SEARCH_TYPE_ALL) { if (!is_all_matched($search_result['text'] . $image_text, $search_parameter['search_words'])) { return false; } } elseif (!is_any_matched($search_result['text'] . $image_text, $search_parameter['search_words'])) { return false; } } // search for an better anchor - this have to be done before strip_tags() (may fail if search-string contains <, &, amp, gt, lt, ...) $anchor = make_url_target($search_result['page_link_target'], $anchor_text, $search_parameter['search_words']); // make the link from $mod_page_link, add anchor $link = ""; if (!empty($search_result['page_link'])) { $link = page_link($search_result['page_link']); if (strpos($search_result['page_link'], 'http:') === false) { $link .= make_url_searchstring($search_parameter['search_match'], $search_parameter['search_url_array']); } // add anchor only if content is not locked! if ($add_anchor) { $link .= $anchor; } } // now get the excerpt $excerpt = ""; $excerpt_array = array(); // dont create excerpts if we are only searching for images! if ($search_parameter['search_match'] != SEARCH_TYPE_IMAGE && $search_result['max_excerpt_num'] > 0) { if (false !== ($excerpt_array = get_excerpts($search_result['text'], $search_parameter['search_words'], $search_result['max_excerpt_num']))) { $excerpt = prepare_excerpts($excerpt_array, $search_parameter['search_words'], $search_result['max_excerpt_num']); } } // no image matches now ... $image_match = false; $image_array = array(); if ($search_parameter['settings'][CFG_SEARCH_IMAGES] || $search_parameter['search_match'] == SEARCH_TYPE_ALL) { // ok - now we are looking for matching images ... foreach ($images as $image) { $file = urldecode(basename($image['src'])); $file = substr($file, 0, strrpos($file, '.')); $alt = isset($image['alt']) && !empty($image['alt']) ? $image['alt'] : ''; $title = isset($image['title']) && !empty($image['title']) ? $image['title'] : ''; $image_text = $alt == $title ? $divider . $alt . $divider . $file . $divider : $divider . $alt . $divider . $title . $divider . $file . $divider; if (false !== ($excerpt_array = get_excerpts($image_text, $search_parameter['search_words'], $search_result['max_excerpt_num']))) { // image match! $image_excerpt = prepare_excerpts($excerpt_array, $search_parameter['search_words'], $search_result['max_excerpt_num']); // accept only images with complete URL if (false === strpos($image['src'], CAT_URL)) { continue; } $src = str_ireplace(CAT_URL, CAT_PATH, urldecode($image['src'])); $target = CAT_PATH . '/temp/search/' . urldecode(basename($image['src'])); makeThumbnail($src, $target, $search_parameter['settings'][CFG_THUMBS_WIDTH]); $image_array[] = array('excerpt' => $image_excerpt, 'src' => CAT_URL . '/temp/search/' . urldecode(basename($image['src'])), 'alt' => isset($image['alt']) ? $image['alt'] : '', 'title' => isset($image['title']) ? $image['title'] : '', 'width' => $search_parameter['settings'][CFG_THUMBS_WIDTH]); $image_match = true; } } } // leave here if nothing matches ... if (empty($excerpt) && !$image_match) { return false; } $thumb_array = array(); // if no images are matching to the search it's possible to show a image // of the content or to use a desired image_link from the module $use_thumb = 0; if (!$image_match && ($search_parameter['settings'][CFG_CONTENT_IMAGE] != CONTENT_IMAGE_NONE || !empty($search_result['image_link']))) { if (!empty($search_result['image_link'])) { if (strpos($search_result['image_link'], CAT_URL) === false) { $src = CAT_PATH . MEDIA_DIRECTORY . DIRECTORY_SEPARATOR . $search_result['image_link']; } else { $src = str_ireplace(CAT_URL, CAT_PATH, $search_result['image_link']); } // the path to the temporary thumbnail $target = CAT_PATH . '/temp/search/' . basename($search_result['image_link']); // create a thumbnail and place it in the temporary directory if (makeThumbnail($src, $target, $search_parameter['settings'][CFG_THUMBS_WIDTH])) { $thumb_array = array('src' => CAT_URL . '/temp/search/' . urldecode(basename($search_result['image_link'])), 'alt' => $search_result['page_title'], 'title' => $search_result['page_title'], 'width' => $search_parameter['settings'][CFG_THUMBS_WIDTH]); $use_thumb = 1; } else { $use_thumb = 0; } } else { switch ($search_parameter['settings'][CFG_CONTENT_IMAGE]) { case CONTENT_IMAGE_FIRST: $i = 0; break; case CONTENT_IMAGE_LAST: $i = count($images) - 1; break; case CONTENT_IMAGE_RANDOM: $i = rand(0, count($images) - 1); break; default: $i = 0; } if (isset($images[$i]['src']) && false !== strpos($images[$i]['src'], CAT_URL)) { $src = str_ireplace(CAT_URL, CAT_PATH, urldecode($images[$i]['src'])); // the path to the temporary thumbnail $target = CAT_PATH . '/temp/search/' . urldecode(basename($images[$i]['src'])); // create a thumbnail and place it in the temporary directory if (makeThumbnail($src, $target, $search_parameter['settings'][CFG_THUMBS_WIDTH])) { $thumb_array = array('src' => CAT_URL . '/temp/search/' . urldecode(basename($images[$i]['src'])), 'alt' => isset($images[$i]['alt']) ? $images[$i]['alt'] : '', 'title' => isset($images[$i]['title']) ? $images[$i]['title'] : '', 'width' => $search_parameter['settings'][CFG_THUMBS_WIDTH]); $use_thumb = 1; } else { $use_thumb = 0; } } else { $use_thumb = 0; } } } else { $use_thumb = 0; } list($date, $time) = get_page_modified($search_result['page_modified_when']); list($username, $displayname) = get_page_modified_by($search_result['page_modified_by'], $search_parameter['users']); $item = array('page' => array('link' => $link, 'title' => $search_result['page_title'], 'description' => $search_result['page_description'], 'excerpt' => $excerpt, 'images' => array('items' => $image_array, 'count' => count($image_array)), 'thumb' => array('active' => $use_thumb, 'image' => $thumb_array), 'last_changed' => array('unix_time' => $search_result['page_modified_when'], 'date_formatted' => $date, 'time_formatted' => $time), 'visibility' => $search_parameter['page_visibility']), 'user' => array('name' => $username, 'display_name' => $displayname)); // all search results are temporary saved in the $_SESSION['SEARCH_RESULT_ITEMS'] if (!isset($_SESSION[SESSION_SEARCH_RESULT_ITEMS])) { $_SESSION[SESSION_SEARCH_RESULT_ITEMS] = array(); } $_SESSION[SESSION_SEARCH_RESULT_ITEMS][] = $item; return true; }
public function breadcrumb($params = false) { $result = array(); $cur_page = false; $cur_content = false; $cur_category = false; if (defined('PAGE_ID') and PAGE_ID != false) { $cur_page = PAGE_ID; } if (defined('POST_ID') and CONTENT_ID != false) { $cur_content = CONTENT_ID; if ($cur_content == $cur_page) { $cur_content = false; } } if (defined('CATEGORY_ID') and CATEGORY_ID != false) { $cur_category = CATEGORY_ID; } $start_from = false; if (isset($params['start_from'])) { $start_from = trim($params['start_from']); } if ($cur_page != false) { if ($start_from != 'category') { $content_parents = $this->get_parents($cur_page); if (!empty($content_parents)) { foreach ($content_parents as $item) { $item = intval($item); if ($item > 0) { $content = $this->get_by_id($item); if (isset($content['id'])) { $result_item = array(); $result_item['title'] = $content['title']; $result_item['url'] = $this->link($content['id']); $result_item['description'] = $content['description']; if ($cur_content == $content['id']) { $result_item['is_active'] = true; } else { $result_item['is_active'] = false; } $result_item['parent_content_id'] = $content['parent']; $result_item['content_type'] = $content['content_type']; $result_item['subtype'] = $content['subtype']; $result[] = $result_item; } } } } $content = $this->get_by_id($cur_page); if (isset($content['id'])) { $result_item = array(); $result_item['title'] = $content['title']; $result_item['url'] = $this->link($content['id']); $result_item['description'] = $content['description']; $result_item['is_active'] = false; if ($cur_content == $content['id']) { $result_item['is_active'] = true; } elseif ($cur_content != false and $cur_page == $content['id']) { $result_item['is_active_as_parent'] = true; $result_item['is_active'] = false; } elseif ($cur_category == false and $cur_content == false and $cur_page == $content['id']) { $result_item['is_active'] = true; } else { $result_item['is_active'] = false; } $result_item['parent_content_id'] = $content['parent']; $result_item['content_type'] = $content['content_type']; $result_item['subtype'] = $content['subtype']; $result[] = $result_item; } } } if ($cur_category != false) { $cur_category_data = $this->app->category_manager->get_by_id($cur_category); if ($cur_category_data != false and isset($cur_category_data['id'])) { $cat_parents = $this->app->category_manager->get_parents($cur_category); if (!empty($cat_parents)) { foreach ($cat_parents as $item) { $item = intval($item); if ($item > 0) { $content = $this->app->category_manager->get_by_id($item); if (isset($content['id'])) { $result_item = array(); $result_item['title'] = $content['title']; $result_item['description'] = $content['description']; if (isset($params['current-page-as-root']) and $params['current-page-as-root'] != false) { $result_item['url'] = page_link() . '/category:' . $content['id']; } else { $result_item['url'] = $this->app->category_manager->link($content['id']); } $result_item['content_type'] = 'category'; if ($cur_content == false and $cur_category == $content['id']) { $result_item['is_active'] = true; } else { $result_item['is_active'] = false; } $result[] = $result_item; } } } } } $content = $cur_category_data; if (isset($content['id'])) { $result_item = array(); $result_item['title'] = $content['title']; $result_item['description'] = $content['description']; $result_item['url'] = $this->app->category_manager->link($content['id']); $result_item['content_type'] = 'category'; if ($cur_content == false and $cur_category == $content['id']) { $result_item['is_active'] = true; } else { $result_item['is_active'] = false; } $result[] = $result_item; } } if ($cur_content != false) { $content = $this->get_by_id($cur_content); if (isset($content['id'])) { $result_item = array(); $result_item['title'] = $content['title']; $result_item['url'] = $this->link($content['id']); $result_item['description'] = $content['description']; if ($cur_content == $content['id']) { $result_item['is_active'] = true; } else { $result_item['is_active'] = false; } $result_item['parent_content_id'] = $content['parent']; $result_item['content_type'] = $content['content_type']; $result_item['subtype'] = $content['subtype']; $result[] = $result_item; } } return $result; }
type: layout name: shop2 layout description: shop2 layout */ ?> <?php include TEMPLATE_DIR . "header.php"; ?> <div class="wrap"> <div id="main_content"> <div id="user_sidebar"> <h3 class="user_sidebar_title nomargin"><a href="<? print page_link($page['id']); ?>"><? print ucwords($page['content_title']); ?></a></h3> <? $cat_params = array(); $cat_params['parent'] = intval($page['content_subtype_value']); //begin from this parent category $cat_params['get_only_ids'] = false; //if true will return only the category ids $categories = get_categories($cat_params); ?> <ul class="user_side_nav user_side_nav_nobg"> <? foreach($categories as $category): ?> <li><a href="<? print get_category_url($category['id']); ?>" class="<? is_active_category($category['id'],' active') ?>" ><? print $category['taxonomy_value'] ?></a> </li> <? endforeach; ?> </ul> <block id="shop_sidebar">
function show_breadcrumbs($sep = ' » ', $level = 0, $links = true, $depth = -1, $title = '') { global $wb, $database, $MENU; $page_id = $wb->page_id; $title = trim($title) == '' ? $MENU['BREADCRUMB'] : $title; if ($page_id != 0) { $counter = 0; // get links as array $bread_crumbs = $wb->page_trail; $count = sizeof($bread_crumbs); // level can't be greater than sum of links $level = $count <= $level ? $count - 1 : $level; // set level from which to show, delete indexes in array $crumbs = array_slice($bread_crumbs, $level); $depth = $depth <= 0 ? sizeof($crumbs) : $depth; // if empty array, set orginal links $crumbs = !empty($crumbs) ? $crumbs : $wb->page_trail; $total_crumbs = $depth <= 0 || $depth > sizeof($crumbs) ? sizeof($crumbs) : $depth; print '<div class="breadcrumb"><span class="title">' . $title . '</span>'; // print_r($crumbs); foreach ($crumbs as $temp) { if ($counter == $depth) { break; } // set links and separator $sql = 'SELECT * FROM `' . TABLE_PREFIX . 'pages` WHERE `page_id`=' . (int) $temp; $query_menu = $database->query($sql); $page = $query_menu->fetchRow(); $show_crumb = $links == true && $temp != $page_id ? '<a href="' . page_link($page['link']) . '" class="link">' . $page['menu_title'] . '</a>' : '<span class="crumb">' . $page['menu_title'] . '</span>'; // Permission switch ($page['visibility']) { case 'none': case 'hidden': // if show, you know there is an error in a hidden page print $show_crumb . ' '; break; default: print $show_crumb; break; } if ($counter != $total_crumbs - 1) { print '<span class="separator">' . $sep . '</span>'; } $counter++; } print "</div>\n"; } }
<? $pages = get_pages_old(); $pages = $pages['posts']; ?> <? if(!empty($pages)): ?> <? foreach($pages as $page): ?> <div class="field" style="display:none"> <input type="text" value="<? print $page['content_title'] ?>" /> <a target="_blank" class="btn2" href="<? print site_url('admin/edit/url:'); ?><? print base64_encode(page_link( $page['id'] )) ?>">iframe</a> | <a target="_blank" class="btn2" href="<? print page_link( $page['id'] ) ?>/editmode:y">editmode</a> | <a target="_blank" class="btn2" href="<? print page_link( $page['id'] ) ?>">visit</a> | <a class="btn2" href="<? print ADMIN_URL ?>/action:page_edit/id:<? print $page['id'] ?>">edit</a> </div> <? endforeach; ?> <? endif; ?> <script type="text/javascript"> $(document).ready(function(){ $('.Pages ul:first').nestedSortable({ disableNesting: 'no-nest', forcePlaceholderSize: true, handle: 'h2', items: 'li', opacity: .6, placeholder: 'placehulder', tabSize: 25, tulerance: 'pointer', update: function(serialized) { /*serialized = $('ul.category_tree').nestedSortable('serialize'); $.post("http://pecata/microweber/api/content/save_taxonomy_items_order", { items: serialized }, function(data){
function create($value) { global $c; extract($value); $chapter_id = chapter_id($value['id']); $chapter_title = page_title($chapter_id); $chapter_link = page_link($chapter_id); if ($value['prev']) { $prev_link = page_link($value['prev']); $prev_title = page_title($value['prev']); } if ($value['next']) { $next_link = page_link($value['next']); $next_title = page_title($value['next']); } ob_start(); require 'tpl.html'; $content = ob_get_contents(); ob_end_clean(); file_put_contents("html/" . page_link($id), $content); }
?> "><?php _e('Home'); ?> </a></li> <?php while (page_next()) { ?> <li<?php if (page_current()) { ?> class="current"<?php } ?> ><a href="<?php page_link(); ?> " title="<?php page_title(); ?> "><?php page_title(); ?> </a></li> <?php } ?> </ul> </div> <?php
<div id="user_sidebar"> <? $categories = get_categories(); ?> <h3 class="user_sidebar_title nomargin"><a href="<? print page_link($page['id']); ?>">Games by category</a></h3> <ul class="user_side_nav user_side_nav_nobg"> <? foreach($categories as $category): ?> <li><a href="<? print get_category_url($category['id']); ?>" class="<? is_active_category($category['id'],' active') ?>" ><? print $category['taxonomy_value'] ?></a> </li> <? endforeach; ?> </ul> <script type="text/javascript"> function content_list($kw){ if(($kw == false) || ($kw == '')){ $kw = ''; $('#results_holder').fadeOut(); $('#top_games_holder').fadeIn(); $('#top_games_holder_title').fadeIn(); $('#results_holder_title').fadeOut(); } else { $.ajax({ url: '<? print site_url('api/module') ?>', type: "POST", data: ({module : 'posts/list' , // user_id : $user_id, file : 'posts_list_games', category : 'games', keyword : $kw }), // dataType: "html",
function print_excerpt2($mod_vars, $func_vars) { extract($func_vars, EXTR_PREFIX_ALL, 'func'); extract($mod_vars, EXTR_PREFIX_ALL, 'mod'); global $TEXT; // check $mod_...vars if (!isset($mod_page_link)) { $mod_page_link = $func_page_link; } if (!isset($mod_page_link_target)) { $mod_page_link_target = ""; } if (!isset($mod_page_title)) { $mod_page_title = $func_page_title; } if (!isset($mod_page_description)) { $mod_page_description = $func_page_description; } if (!isset($mod_page_modified_when)) { $mod_page_modified_when = $func_page_modified_when; } if (!isset($mod_page_modified_by)) { $mod_page_modified_by = $func_page_modified_by; } if (!isset($mod_text)) { $mod_text = ""; } if (!isset($mod_max_excerpt_num)) { $mod_max_excerpt_num = $func_default_max_excerpt; } if (!isset($mod_pic_link)) { $mod_pic_link = ""; } if (!isset($mod_no_highlight)) { $mod_no_highlight = false; } if (!isset($func_enable_flush)) { $func_enable_flush = false; } // set this in db: wb_search.cfg_enable_flush [READ THE DOC BEFORE] if (isset($mod_ext_charset)) { $mod_ext_charset = strtolower($mod_ext_charset); } else { $mod_ext_charset = ''; } if ($mod_text == "") { return false; } if ($mod_no_highlight) { $mod_page_link_target = "&nohighlight=1" . $mod_page_link_target; } // clean the text: $mod_text = preg_replace('#<(br|dt|/dd|/?(?:h[1-6]|tr|table|p|li|ul|pre|code|div|hr))[^>]*>#i', '.', $mod_text); $mod_text = preg_replace('#<(!--.*--|style.*</style|script.*</script)>#iU', ' ', $mod_text); $mod_text = preg_replace('#\\[\\[.*?\\]\\]#', '', $mod_text); //Filter droplets from the page data // strip_tags() is called below if ($mod_ext_charset != '') { // data from external database may have a different charset require_once WB_PATH . '/framework/functions-utf8.php'; switch ($mod_ext_charset) { case 'latin1': case 'cp1252': $mod_text = charset_to_utf8($mod_text, 'CP1252'); break; case 'cp1251': $mod_text = charset_to_utf8($mod_text, 'CP1251'); break; case 'latin2': $mod_text = charset_to_utf8($mod_text, 'ISO-8859-2'); break; case 'hebrew': $mod_text = charset_to_utf8($mod_text, 'ISO-8859-8'); break; case 'greek': $mod_text = charset_to_utf8($mod_text, 'ISO-8859-7'); break; case 'latin5': $mod_text = charset_to_utf8($mod_text, 'ISO-8859-9'); break; case 'latin7': $mod_text = charset_to_utf8($mod_text, 'ISO-8859-13'); break; case 'utf8': default: $mod_text = charset_to_utf8($mod_text, 'UTF-8'); } } else { $mod_text = entities_to_umlauts($mod_text, 'UTF-8'); } $anchor_text = $mod_text; // make an copy containing html-tags $mod_text = strip_tags($mod_text); $mod_text = str_replace(array('>', '<', '&', '"', ''', ''', ' '), array('>', '<', '&', '"', '\'', '\'', ' '), $mod_text); $mod_text = '.' . trim($mod_text) . '.'; // Do a fast scan over $mod_text first. This may speedup things a lot. if ($func_search_match == 'all') { if (!is_all_matched($mod_text, $func_search_words)) { return false; } } elseif (!is_any_matched($mod_text, $func_search_words)) { return false; } // search for an better anchor - this have to be done before strip_tags() (may fail if search-string contains <, &, amp, gt, lt, ...) $anchor = make_url_target($mod_page_link_target, $anchor_text, $func_search_words); // make the link from $mod_page_link, add anchor $link = ""; $link = page_link($mod_page_link); if (strpos($mod_page_link, 'http:') === FALSE) { $link .= make_url_searchstring($func_search_match, $func_search_url_array); } $link .= $anchor; // now get the excerpt $excerpt = ""; $excerpt_array = array(); if ($mod_max_excerpt_num > 0) { if (!($excerpt_array = get_excerpts($mod_text, $func_search_words, $mod_max_excerpt_num))) { return false; } $excerpt = prepare_excerpts($excerpt_array, $func_search_words, $mod_max_excerpt_num); } // handle thumbs - to deactivate this look in the module's search.php: $show_thumb (or maybe in the module's settings-page) if ($mod_pic_link != "") { if (isset($mod_special) && $mod_special == 'lightbox2_plus') { $excerpt = '<table class="excerpt_thumb" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td width="110" valign="top">' . $mod_special_piclink . '<img src="' . WB_URL . '/' . MEDIA_DIRECTORY . $mod_pic_link . '" alt="" /></a></td><td>' . $excerpt . '</td></tr></tbody></table>'; } else { $excerpt = '<table class="excerpt_thumb" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td width="110" valign="top"><a href="' . $link . '"><img src="' . WB_URL . '/' . MEDIA_DIRECTORY . $mod_pic_link . '" alt="" /></a></td><td>' . $excerpt . '</td></tr></tbody></table>'; } } // print-out the excerpt $vars = array(); $values = array(); list($date, $time) = get_page_modified($mod_page_modified_when); list($username, $displayname) = get_page_modified_by($mod_page_modified_by, $func_users); $vars = array('[LINK]', '[TITLE]', '[PAGE_TITLE]', '[MENU_TITLE]', '[DESCRIPTION]', '[USERNAME]', '[DISPLAY_NAME]', '[DATE]', '[TIME]', '[TEXT_LAST_UPDATED_BY]', '[TEXT_ON]', '[EXCERPT]'); $values = array($link, $mod_page_title, $func_page_title, $func_page_menu_title, $mod_page_description, $username, $displayname, $date, $time, $TEXT['LAST_UPDATED_BY'], $TEXT['ON'], $excerpt); echo str_replace($vars, $values, $func_results_loop_string); if ($func_enable_flush) { // ATTN: this will bypass output-filters and may break template-layout or -filters ob_flush(); flush(); } return true; }
<div class="pages-tree"><?php $par = CI::model('content')->getParentPagesIdsForPageIdAndCache($page['id']); $last = end($par); // last if ($last == 0) { $from = $page['id']; } else { $from = $last; } ?> <h2><a href="<? print page_link($from);?>"><? print page_title($from);?></a></h2> <? CI::model('content')->content_helpers_getPagesAsUlTree($from , "<a href='{link}' {removed_ids_code} {active_code} value='{id}' >{content_title}</a>", array($form_values['content_parent']), 'class="active"', array($form_values['id']) , 'class="hidden"' ); ?></div>
var template = template.replace('/', '___'); } if (layout != undefined) { if (typeof(form) == 'object' && form.querySelector('input[name="layout_file"]') != null) { form.querySelector('input[name="layout_file"]').value = layout } var layout = safe_chars_to_str(layout); var layout = layout.replace('/', '___'); } <?php if ($iframe_cont_id == 0) { $iframe_start = site_url('home'); } else { $iframe_start = page_link($iframe_cont_id); } ?> var inherit_from_param = ''; if (inherit_from != undefined) { inherit_from_param = '&inherit_template_from=' + inherit_from; } var preview_template_param = ''; if (template != undefined) { preview_template_param = '&preview_template=' + template; mw.$("#<?php print $params['id']; ?>
if (count($third['sub']) > 0) { ?> </span><?php } ?> </a> <?php if (count($third['sub']) > 0) { ?> <ul> <?php foreach ($third['sub'] as $fourth) { if ($user->isAdmin && $fourth['restricted'] || !$fourth['restricted']) { ?> <li><a href="<?php page_link($fourth['url']); ?> " title="<?php echo $fourth['title']; ?> "><?php if ($fourth['icon'] != '') { ?> <i class="fa fa-lg fa-fw fa-<?php echo $fourth['icon']; ?> "> </i><?php } if (count($fourth['sub']) > 0) { ?> <span class="menu-item-parent"><?php
<ul class="user_side_nav user_side_nav_nobg"> <? foreach($categories as $category): ?> <li><a href="<? print get_category_url($category['id']); ?>" class="<? is_active_category($category['id'],' active') ?>" ><? print $category['taxonomy_value'] ?></a> </li> <? endforeach; ?> </ul> </div> <!-- /#user_sidebar --> <div id="main_side"> <? /* Q & A Start */ ?> <? $questions = get_page('questions'); ?> <? if( $questions['id'] == $page['id']): ?> <? if(url_param('action') == 'add'): ?> <microweber module="posts/add" title="Post your question" submit_btn_text="Post your question" category="questions" redirect_on_success="<? print page_link($page['id']); ?>" title_label="Question title: " body_label="Question: "> <? else:?> <div class="c"> </div> <h2>Questions and answers</h2> <br /> <? if(empty($post)): ?> <div class="post_list"> <microweber module="posts/list" category="<? print intval($questions['content_subtype_value']) ?>" display="questions_and_answers" > </div> <? else : ?> <microweber module="posts/read" post_id="<? print intval($post['id']) ?>" display="read_questions_and_answers"> <? endif; ?> <? endif; ?> <? /* /Q & A END */ ?>
?> <button class="btn btn-warning pull-right mw-checkout-btn" onclick="mw.cart.checkout('#checkout_form_<?php print $params['id']; ?> ');" type="button"> <?php _e("Complete order"); ?> </button> <?php if (is_array($shop_page)) { ?> <a href="<?php print page_link($shop_page[0]['id']); ?> " class="btn btn-default pull-left" type="button"> <?php _e("Continue Shopping"); ?> </a> <?php } ?> <div class="clear"></div> </div> </form> <div class="mw-checkout-responce"></div> <?php
function page_link_to_layout($laout_name) { $page = array(); $page['content_layout_name'] = trim($laout_name); $page = get_pages($page); $page = $page[0]; return page_link($page['id']); }
/** * Print nested tree of pages * * @example * <pre> * // Example Usage: * $pt_opts = array(); * $pt_opts['link'] = "{title}"; * $pt_opts['list_tag'] = "ol"; * $pt_opts['list_item_tag'] = "li"; * pages_tree($pt_opts); * </pre> * * @example * <pre> * // Example Usage to make <select> with <option>: * $pt_opts = array(); * $pt_opts['link'] = "{title}"; * $pt_opts['list_tag'] = " "; * $pt_opts['list_item_tag'] = "option"; * $pt_opts['active_ids'] = $data['parent']; * $pt_opts['active_code_tag'] = ' selected="selected" '; * $pt_opts['ul_class'] = 'nav'; * $pt_opts['li_class'] = 'nav-item'; * pages_tree($pt_opts); * </pre> * @example * <pre> * // Other options * $pt_opts['parent'] = "8"; * $pt_opts['include_first'] = true; //includes the parent in the tree * $pt_opts['id_prefix'] = 'my_id'; * </pre> * * * * @package Content * @param int $parent * @param bool $link * @param bool $active_ids * @param bool $active_code * @param bool $remove_ids * @param bool $removed_ids_code * @param bool $ul_class_name * @param bool $include_first * @return sting Prints the pages tree */ public function pages_tree($parent = 0, $link = false, $active_ids = false, $active_code = false, $remove_ids = false, $removed_ids_code = false, $ul_class_name = false, $include_first = false) { $params2 = array(); $params = false; $output = ''; if (is_integer($parent)) { } else { $params = $parent; if (is_string($params)) { $params = parse_str($params, $params2); $params = $params2; extract($params); } if (is_array($params)) { $parent = 0; extract($params); } } if (!defined('CONTENT_ID')) { $this->define_constants(); } $function_cache_id = false; $args = func_get_args(); foreach ($args as $k => $v) { $function_cache_id = $function_cache_id . serialize($k) . serialize($v); } $function_cache_id = __FUNCTION__ . crc32($function_cache_id) . PAGE_ID . $parent; if ($parent == 0) { $cache_group = 'content/global'; } else { $cache_group = 'categories/global'; } if (isset($include_categories) and $include_categories == true) { $cache_group = 'categories/global'; } $nest_level = 0; if (isset($params['nest_level'])) { $nest_level = $params['nest_level']; } $nest_level_orig = $nest_level; //$params['no_cache'] = 1; if ($nest_level_orig == 0) { $cache_content = $this->app->cache_manager->get($function_cache_id, $cache_group); if (isset($params['no_cache'])) { $cache_content = false; } // $cache_content = false; if ($cache_content != false) { if (isset($params['return_data'])) { return $cache_content; } else { print $cache_content; } return; } } $nest_level = 0; if (isset($params['nest_level'])) { $nest_level = $params['nest_level']; } $max_level = false; if (isset($params['max_level'])) { $max_level = $params['max_level']; } else { if (isset($params['maxdepth'])) { $max_level = $params['max_level'] = $params['maxdepth']; } else { if (isset($params['depth'])) { $max_level = $params['max_level'] = $params['depth']; } } } if ($max_level != false) { if (intval($nest_level) >= intval($max_level)) { print ''; return; } } $is_shop = ''; if (isset($params['is_shop'])) { if ($params['is_shop'] == 'y') { $params['is_shop'] = 1; } else { if ($params['is_shop'] == 'n') { $params['is_shop'] = 0; } } $is_shop = $this->app->database_manager->escape_string($params['is_shop']); $is_shop = " and is_shop='{$is_shop} '"; $include_first = false; } $ul_class = 'pages_tree'; if (isset($params['ul_class'])) { $ul_class_name = $ul_class = $params['ul_class']; } $content_link_class = 'mw-tree-content-link'; if (isset($params['content_link_class'])) { $content_link_class = $params['content_link_class']; } $li_class = 'pages_tree_item'; if (isset($params['li_class'])) { $li_class = $params['li_class']; } if (isset($params['ul_tag'])) { $list_tag = $params['ul_tag']; } if (isset($params['li_tag'])) { $list_item_tag = $params['li_tag']; } if (isset($params['include_categories'])) { $include_categories = $params['include_categories']; } ob_start(); $table = $this->tables['content']; $par_q = ''; if ($parent == false) { $parent = 0; } else { $par_q = " parent={$parent} and "; } if ($include_first == true) { $sql = "SELECT * from {$table} where id={$parent} and is_deleted=0 and content_type='page' " . $is_shop . " order by position desc limit 0,1"; } else { $sql = "SELECT * from {$table} where " . $par_q . " content_type='page' and is_deleted=0 {$is_shop} order by position desc limit 0,100"; } $cid = __FUNCTION__ . crc32($sql); $cidg = 'content/' . $parent; if (!is_array($params)) { $params = array(); } if (isset($append_to_link) == false) { $append_to_link = ''; } if (isset($id_prefix) == false) { $id_prefix = ''; } if (isset($link) == false) { $link = '<span data-page-id="{id}" class="pages_tree_link {nest_level} {active_class} {active_parent_class}" href="{link}' . $append_to_link . '">{title}</span>'; } if (isset($list_tag) == false) { $list_tag = 'ul'; } if (isset($active_code_tag) == false) { $active_code_tag = ''; } if (isset($list_item_tag) == false) { $list_item_tag = 'li'; } if (isset($params['remove_ids'])) { $remove_ids = $params['remove_ids']; } if (isset($remove_ids) and is_string($remove_ids)) { $remove_ids = explode(',', $remove_ids); } if (isset($active_ids)) { $active_ids = $active_ids; } if (isset($active_ids) and is_string($active_ids)) { $active_ids = explode(',', $active_ids); } $the_active_class = 'active'; if (isset($params['active_class'])) { $the_active_class = $params['active_class']; } $params['content_type'] = 'page'; $include_first_set = false; if ($include_first == true) { $include_first_set = 1; $include_first = false; $include_first_set = $parent; if (isset($params['include_first'])) { unset($params['include_first']); } } else { $params['parent'] = $parent; } if (isset($params['is_shop']) and $params['is_shop'] == 1) { if (isset($params['parent']) and $params['parent'] == 0) { unset($params['parent']); } if (isset($params['parent']) and $params['parent'] == 'any') { unset($params['parent']); } } else { if (isset($params['parent']) and $params['parent'] == 'any') { $params['parent'] = 0; } } $params['limit'] = 500; $params['orderby'] = 'position desc'; $params['curent_page'] = 1; $params['is_deleted'] = 0; $params['cache_group'] = false; $params['no_cache'] = true; $skip_pages_with_no_categories = false; $skip_pages_from_tree = false; if (isset($params['skip_sub_pages']) and $params['skip_sub_pages'] != '') { $skip_pages_from_tree = $params['skip_sub_pages']; } if (isset($params['skip-static-pages']) and $params['skip-static-pages'] != false) { $skip_pages_with_no_categories = 1; } $params2 = $params; if (isset($params2['id'])) { unset($params2['id']); } if (isset($params2['link'])) { unset($params2['link']); } if ($include_first_set != false) { $q = $this->get("id=" . $include_first_set); } else { $q = $this->get($params2); } $result = $q; if (is_array($result) and !empty($result)) { $nest_level++; if (trim($list_tag) != '') { if ($ul_class_name == false) { print "<{$list_tag} class='pages_tree depth-{$nest_level}'>"; } else { print "<{$list_tag} class='{$ul_class_name} depth-{$nest_level}'>"; } } $res_count = 0; foreach ($result as $item) { if (is_array($item) != false and isset($item['title']) and $item['title'] != null) { $skip_me_cause_iam_removed = false; if (is_array($remove_ids) == true) { if (in_array($item['id'], $remove_ids)) { $skip_me_cause_iam_removed = true; } } if ($skip_pages_with_no_categories == true) { if (isset($item['subtype']) and $item['subtype'] != 'dynamic') { $skip_me_cause_iam_removed = true; } } if ($skip_me_cause_iam_removed == false) { $output = $output . $item['title']; $content_type_li_class = false; switch ($item['subtype']) { case 'dynamic': $content_type_li_class = 'have_category'; break; case 'module': $content_type_li_class = 'is_module'; break; default: $content_type_li_class = 'is_page'; break; } if (isset($item['layout_file']) and stristr($item['layout_file'], 'blog')) { $content_type_li_class .= ' is_blog'; } if ($item['is_home'] == 1) { $content_type_li_class .= ' is_home'; } $st_str = ''; $st_str2 = ''; $st_str3 = ''; if (isset($item['subtype']) and trim($item['subtype']) != '') { $st_str = " data-subtype='{$item['subtype']}' "; } if (isset($item['subtype_value']) and trim($item['subtype_value']) != '') { $st_str2 = " data-subtype-value='{$item['subtype_value']}' "; } if (isset($item['is_shop']) and trim($item['is_shop']) == 1) { $st_str3 = " data-is-shop=true "; $content_type_li_class .= ' is_shop'; } $iid = $item['id']; $to_pr_2 = "<{$list_item_tag} class='{$li_class} {$content_type_li_class} {active_class} {active_parent_class} depth-{$nest_level} item_{$iid} {exteded_classes} menu-item-id-{$item['id']}' data-page-id='{$item['id']}' value='{$item['id']}' data-item-id='{$item['id']}' {active_code_tag} data-parent-page-id='{$item['parent']}' {$st_str} {$st_str2} {$st_str3} title='" . addslashes($item['title']) . "' >"; if ($link != false) { $active_parent_class = ''; if (intval($item['parent']) != 0 and intval($item['parent']) == intval(MAIN_PAGE_ID)) { $active_parent_class = 'active-parent'; } elseif (intval($item['id']) == intval(MAIN_PAGE_ID)) { $active_parent_class = 'active-parent'; } else { $active_parent_class = ''; } if ($item['id'] == CONTENT_ID) { $active_class = 'active'; } elseif (isset($active_ids) and !is_array($active_ids) and $item['id'] == $active_ids) { $active_class = 'active'; } if (isset($active_ids) and is_array($active_ids) and in_array($item['id'], $active_ids)) { $active_class = 'active'; } elseif ($item['id'] == PAGE_ID) { $active_class = 'active'; } elseif ($item['id'] == POST_ID) { $active_class = 'active'; } elseif (CATEGORY_ID != false and intval($item['subtype_value']) != 0 and $item['subtype_value'] == CATEGORY_ID) { $active_class = 'active'; } else { $active_class = ''; } $ext_classes = ''; if ($res_count == 0) { $ext_classes .= ' first-child '; $ext_classes .= ' child-' . $res_count . ''; } else { if (!isset($result[$res_count + 1])) { $ext_classes .= ' last-child'; $ext_classes .= ' child-' . $res_count . ''; } else { $ext_classes .= ' child-' . $res_count . ''; } } if (isset($item['parent']) and intval($item['parent']) > 0) { $ext_classes .= ' have-parent'; } if (isset($item['subtype_value']) and intval($item['subtype_value']) != 0) { $ext_classes .= ' have-category'; } if (isset($item['is_active']) and $item['is_active'] == 'n') { $ext_classes = $ext_classes . ' content-unpublished '; } $ext_classes = trim($ext_classes); $the_active_class = $active_class; $to_print = str_replace('{id}', $item['id'], $link); $to_print = str_replace('{active_class}', $active_class, $to_print); $to_print = str_replace('{active_parent_class}', $active_parent_class, $to_print); $to_print = str_replace('{exteded_classes}', $ext_classes, $to_print); $to_pr_2 = str_replace('{exteded_classes}', $ext_classes, $to_pr_2); $to_pr_2 = str_replace('{active_class}', $active_class, $to_pr_2); $to_pr_2 = str_replace('{active_parent_class}', $active_parent_class, $to_pr_2); $to_print = str_replace('{title}', $item['title'], $to_print); $to_print = str_replace('{nest_level}', 'depth-' . $nest_level, $to_print); $to_print = str_replace('{content_link_class}', $content_link_class, $to_print); if (strstr($to_print, '{link}')) { $to_print = str_replace('{link}', page_link($item['id']), $to_print); } $empty1 = intval($nest_level); $empty = ''; for ($i1 = 0; $i1 < $empty1; $i1++) { $empty = $empty . ' '; } $to_print = str_replace('{empty}', $empty, $to_print); if (strstr($to_print, '{tn}')) { $to_print = str_replace('{tn}', thumbnail($item['id'], 'original'), $to_print); } foreach ($item as $item_k => $item_v) { $to_print = str_replace('{' . $item_k . '}', $item_v, $to_print); } $res_count++; if (isset($active_ids) and is_array($active_ids) == true) { $is_there_active_ids = false; foreach ($active_ids as $active_id) { if (intval($item['id']) == intval($active_id)) { $is_there_active_ids = true; $to_print = str_ireplace('{active_code}', $active_code, $to_print); $to_print = str_ireplace('{active_class}', $the_active_class, $to_print); $to_pr_2 = str_ireplace('{active_class}', $the_active_class, $to_pr_2); $to_pr_2 = str_ireplace('{active_code_tag}', $active_code_tag, $to_pr_2); } } } else { if (isset($active_ids) and !is_array($active_ids)) { if (intval($item['id']) == intval($active_ids)) { $is_there_active_ids = true; $to_print = str_ireplace('{active_code}', $active_code, $to_print); $to_print = str_ireplace('{active_class}', $the_active_class, $to_print); $to_pr_2 = str_ireplace('{active_class}', $the_active_class, $to_pr_2); $to_pr_2 = str_ireplace('{active_code_tag}', $active_code_tag, $to_pr_2); } } } $to_print = str_ireplace('{active_code}', '', $to_print); $to_print = str_ireplace('{active_class}', '', $to_print); $to_pr_2 = str_ireplace('{active_class}', '', $to_pr_2); $to_pr_2 = str_ireplace('{active_code_tag}', '', $to_pr_2); $to_pr_2 = str_ireplace('{content_link_class}', '', $to_pr_2); $to_print = str_replace('{exteded_classes}', '', $to_print); $to_print = str_replace('{content_link_class}', '', $to_print); if ($item['id'] == $item['parent']) { $remove_ids[] = $item['id']; } if (is_array($remove_ids) == true) { if (in_array($item['id'], $remove_ids)) { if ($removed_ids_code == false) { $to_print = false; } else { $remove_ids[] = $item['id']; $to_print = str_ireplace('{removed_ids_code}', $removed_ids_code, $to_print); } } else { $to_print = str_ireplace('{removed_ids_code}', '', $to_print); } } $to_pr_2 = str_replace('{active_class}', '', $to_pr_2); $to_pr_2 = str_replace('{exteded_classes}', '', $to_pr_2); print $to_pr_2; $to_pr_2 = false; print $to_print; } else { $to_pr_2 = str_ireplace('{active_class}', '', $to_pr_2); $to_pr_2 = str_replace('{exteded_classes}', '', $to_pr_2); $to_pr_2 = str_replace('{active_parent_class}', '', $to_pr_2); print $to_pr_2; $to_pr_2 = false; print $item['title']; } if (is_array($params)) { $params['parent'] = $item['id']; if ($max_level != false) { $params['max_level'] = $max_level; } if (isset($params['is_shop'])) { unset($params['is_shop']); } // $nest_level++; $params['nest_level'] = $nest_level; $params['ul_class_name'] = false; $params['ul_class'] = false; if (isset($include_categories)) { $params['include_categories'] = $include_categories; } if (isset($params['ul_class_deep'])) { $params['ul_class'] = $params['ul_class_deep']; } if (isset($maxdepth)) { $params['maxdepth'] = $maxdepth; } if (isset($params['li_class_deep'])) { $params['li_class'] = $params['li_class_deep']; } if (isset($params['return_data'])) { unset($params['return_data']); } $params['remove_ids'] = $remove_ids; if ($skip_pages_from_tree == false) { if ($item['id'] != $item['parent']) { $children = $this->pages_tree($params); } } } else { if ($skip_pages_from_tree == false) { if ($item['id'] != $item['parent']) { $children = $this->pages_tree(intval($item['id']), $link, $active_ids, $active_code, $remove_ids, $removed_ids_code, $ul_class_name = false); } } } if (isset($include_categories) and $include_categories == true) { $content_cats = array(); if (isset($item['subtype_value']) and intval($item['subtype_value']) == true) { } $cat_params = array(); if (isset($item['subtype_value']) and intval($item['subtype_value']) != 0) { //$cat_params['subtype_value'] = $item['subtype_value']; } //$cat_params['try_rel_id'] = $item['id']; if (isset($categores_link)) { $cat_params['link'] = $categores_link; } else { $cat_params['link'] = $link; } if (isset($categories_active_ids)) { $cat_params['active_ids'] = $categories_active_ids; } if (isset($categories_removed_ids)) { $cat_params['remove_ids'] = $categories_removed_ids; } if (isset($active_code)) { $cat_params['active_code'] = $active_code; } //$cat_params['for'] = 'content'; $cat_params['list_tag'] = $list_tag; $cat_params['list_item_tag'] = $list_item_tag; $cat_params['rel_type'] = 'content'; $cat_params['rel_id'] = $item['id']; $cat_params['include_first'] = 1; $cat_params['nest_level'] = $nest_level; if ($max_level != false) { $cat_params['max_level'] = $max_level; } if ($nest_level > 1) { if (isset($params['ul_class_deep'])) { $cat_params['ul_class'] = $params['ul_class_deep']; } if (isset($params['li_class_deep'])) { $cat_params['li_class'] = $params['li_class_deep']; } } else { if (isset($params['ul_class'])) { $cat_params['ul_class'] = $params['ul_class']; } if (isset($params['li_class'])) { $cat_params['li_class'] = $params['li_class']; } } $this->app->category_manager->tree($cat_params); } } print "</{$list_item_tag}>"; } } if (trim($list_tag) != '') { print "</{$list_tag}>"; } } $content = ob_get_contents(); if ($nest_level_orig == 0) { $this->app->cache_manager->save($content, $function_cache_id, $cache_group); } ob_end_clean(); if (isset($params['return_data'])) { return $content; } else { print $content; } return false; }
function get_page_url($value) { global $database; $return_value = strtolower(WB_URL . PAGES_DIRECTORY . '/' . strtolower(LANGUAGE) . PAGE_EXTENSION); // if(!isset($langPageArray)) { return $return_value; } $sql = 'SELECT `page_id`, `menu_title`,`link` FROM `' . TABLE_PREFIX . 'pages` '; $sql .= 'WHERE `page_code` = ' . intval($value['page_code']) . ' '; $sql .= 'AND `language` = \'' . $value['language'] . '\' '; if ($query_menu = $database->query($sql)) { if ($query_menu->numRows() > 0) { $page = $query_menu->fetchRow(MYSQL_ASSOC); $return_value = page_link($page['link']); } } return $return_value; }