当前位置: 首页>>代码示例>>PHP>>正文


PHP page_link函数代码示例

本文整理汇总了PHP中page_link函数的典型用法代码示例。如果您正苦于以下问题:PHP page_link函数的具体用法?PHP page_link怎么用?PHP page_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了page_link函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

                    
                  </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">
开发者ID:Gninety,项目名称:Microweber,代码行数:30,代码来源:header.php

示例2: _mod_used

    $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 
}
开发者ID:WebsiteBaker-modules,项目名称:sysinfo,代码行数:31,代码来源:pages.php

示例3: exit

    $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
开发者ID:WBCE,项目名称:WebsiteBaker_CommunityEdition,代码行数:31,代码来源:view.topic.php

示例4: __

        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;">&nbsp;&nbsp;&nbsp;<?php 
    _e('Malware scan results are cached for one hour.', 'it-l10n-backupbuddy');
开发者ID:Coop920,项目名称:Sterling-Wellness,代码行数:31,代码来源:malware_scan.php

示例5: foreach

            </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 
开发者ID:arnaudlewis,项目名称:php-websitestarter-virtuoso,代码行数:31,代码来源:sidebar.php

示例6: time

 // 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 != "") {
开发者ID:pixelhulk,项目名称:LEPTON,代码行数:31,代码来源:view.php

示例7: exit

    //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) {
开发者ID:WBCE,项目名称:WebsiteBaker_CommunityEdition,代码行数:31,代码来源:view.php

示例8: index

 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;
 }
开发者ID:Gninety,项目名称:Microweber,代码行数:70,代码来源:login.php

示例9: date

       
      </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>
    &copy; <?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 &amp; 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">&nbsp;</div>
<div id="preloader"><span>&nbsp;</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>
开发者ID:Gninety,项目名称:Microweber,代码行数:30,代码来源:footer.php

示例10: linkToPage

function linkToPage($id = "")
{
    return page_link($id);
}
开发者ID:Codechanic,项目名称:The-Secretary,代码行数:4,代码来源:view.php

示例11: htmlspecialchars

$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 . '">&laquo; ' . htmlspecialchars(stripslashes($previous['title'])) . '</a>';
            }
开发者ID:WebsiteBaker-modules,项目名称:bakery,代码行数:31,代码来源:view_item.php

示例12: content_helpers_getPagesAsUlTree

 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 {
     }
 }
开发者ID:Gninety,项目名称:Microweber,代码行数:76,代码来源:content_model.php

示例13: list_news

 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', '&amp;');
     }
     // 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) {
//.........这里部分代码省略.........
开发者ID:WebsiteBaker-modules,项目名称:newslist,代码行数:101,代码来源:include.php

示例14: print_excerpt2

/**
 * 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'] = "&amp;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])) {
//.........这里部分代码省略.........
开发者ID:ircoco,项目名称:BlackCatCMS,代码行数:101,代码来源:search.module.php

示例15: breadcrumb

 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;
                         }
                     }
                 }
//.........这里部分代码省略.........
开发者ID:microweber,项目名称:microweber,代码行数:101,代码来源:ContentManager.php


注:本文中的page_link函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。