本文整理汇总了PHP中content_link函数的典型用法代码示例。如果您正苦于以下问题:PHP content_link函数的具体用法?PHP content_link怎么用?PHP content_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了content_link函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPages
public function testPages()
{
$params = array('title' => 'My test page', 'content_type' => 'page', 'is_active' => 1);
//saving
$parent_page = save_content($params);
$page_link = content_link($parent_page);
$params = array('title' => 'My test sub page', 'content_type' => 'page', 'parent' => $parent_page, 'is_active' => 1);
$sub_page = save_content($params);
//getting
$params = array('parent' => $parent_page, 'content_type' => 'page', 'single' => true, 'is_active' => 1);
$get_sub_page = get_content($params);
$sub_page_parents = content_parents($get_sub_page['id']);
//clean
$delete_parent = delete_content($parent_page);
$delete_sub_page = delete_content($sub_page);
//PHPUnit
$this->assertEquals(true, in_array($parent_page, $sub_page_parents));
$this->assertEquals(true, strval($page_link) != '');
$this->assertEquals(true, intval($parent_page) > 0);
$this->assertEquals(true, intval($sub_page) > 0);
$this->assertEquals(true, is_array($get_sub_page));
$this->assertEquals(true, is_array($delete_parent));
$this->assertEquals(true, is_array($delete_sub_page));
$this->assertEquals('My test sub page', $get_sub_page['title']);
$this->assertEquals($sub_page, $get_sub_page['id']);
}
示例2: rss
public function rss()
{
if (mw_is_installed() == true) {
event_trigger('mw_cron');
}
header('Content-Type: application/rss+xml; charset=UTF-8');
$cont = get_content('is_active=1&is_deleted=0&limit=2500&orderby=updated_at desc');
$site_title = $this->app->option_manager->get('website_title', 'website');
$site_desc = $this->app->option_manager->get('website_description', 'website');
$rssfeed = '<?xml version="1.0" encoding="UTF-8"?>';
$rssfeed .= '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">' . "\n";
$rssfeed .= '<channel>' . "\n";
$rssfeed .= '<atom:link href="' . site_url('rss') . '" rel="self" type="application/rss+xml" />' . "\n";
$rssfeed .= '<title>' . $site_title . '</title>' . "\n";
$rssfeed .= '<link>' . site_url() . '</link>' . "\n";
$rssfeed .= '<description>' . $site_desc . '</description>' . "\n";
foreach ($cont as $row) {
if (!isset($row['description']) or $row['description'] == '') {
$row['description'] = $row['content'];
}
$row['description'] = character_limiter(strip_tags($row['description']), 500);
$rssfeed .= '<item>' . "\n";
$rssfeed .= '<title>' . $row['title'] . '</title>' . "\n";
$rssfeed .= '<description><![CDATA[' . $row['description'] . ' ]]></description>' . "\n";
$rssfeed .= '<link>' . content_link($row['id']) . '</link>' . "\n";
$rssfeed .= '<pubDate>' . date('D, d M Y H:i:s O', strtotime($row['created_at'])) . '</pubDate>' . "\n";
$rssfeed .= '<guid>' . content_link($row['id']) . '</guid>' . "\n";
$rssfeed .= '</item>' . "\n";
}
$rssfeed .= '</channel>' . "\n";
$rssfeed .= '</rss>';
event_trigger('mw_robot_url_hit');
echo $rssfeed;
$this->app->content_manager->ping();
}
示例3: content_link
?>
</span>
<?php
}
?>
</span>
<div class="comment-post-content-side">
<h3><a href="javascript:;" class="mw-ui-link"><?php
print $item['title'];
?>
</a></h3>
<a class="comment-post-url" href="<?php
print content_link($item['id']);
?>
?editmode=y"> <?php
print content_link($item['id']);
?>
</a> <br>
<!-- <a class="mw-ui-link" href="<?php
print $item['url'];
?>
/editmode:y">Live edit</a>--> </div>
</div>
<div class="comments-holder">
<?php
include $config["path_to_module"] . 'admin_items.php';
?>
</div>
<?php
示例4: content_link
$grandtotal = $subtotal + $ord['shipping'];
?>
<tr
data-index="<?php
print $index;
?>
"
class="mw-order-item mw-order-item-<?php
print $item['id'];
?>
mw-order-item-index-<?php
print $index;
?>
">
<td class="mw-order-item-id"><a href="<?php
print content_link($item['rel_id']);
?>
" target="_blank"><span><?php
print $item['title'];
?>
</span></a>
<?php
if ($item['rel_type'] == 'content') {
?>
<?php
$data_fields = mw()->content_manager->data($item['rel_id']);
?>
<?php
if (isset($data_fields['sku']) and $data_fields['sku'] != '') {
?>
<small class="mw-ui-label-help">
示例5: get_category_by_id
<?php
$cont = get_category_by_id($data["categories_id"]);
if (isset($cont['title'])) {
$data['title'] = $cont['title'];
$item_url = category_link($cont['id']);
}
?>
<?php
}
?>
<?php
}
?>
<?php
if (isset($data['content_id']) and intval($data['content_id']) != 0) {
$item_url = content_link($data['content_id']);
}
if (isset($data['categories_id']) and intval($data['categories_id']) != 0) {
$item_url = category_link($data['categories_id']);
}
if (isset($item_url) and $item_url != false and (!isset($data['url']) or trim($data['url']) == '')) {
$data['url'] = $item_url;
}
?>
<div id="custom_link_inline_controller" class="mw-ui-gbox" style="display: none;">
<div id="custom_link_inline_controller_edit_<?php
print $data['id'];
?>
">
<h4><?php
_e("Edit menu item");
示例6: index
//.........这里部分代码省略.........
//
// }
$post_params['order_by'] = 'position desc';
}
if (isset($params['search_in_fields']) and $params['search_in_fields'] != false) {
$post_params['search_in_fields'] = $params['search_in_fields'];
}
$content = get_content($post_params);
if ($posts_parent_related != false and empty($content) and isset($post_params['category'])) {
unset($post_params['category']);
$content = get_content($post_params);
}
$data = array();
if (!empty($content)) {
foreach ($content as $item) {
$iu = get_picture($item['id'], $for = 'post', $full = false);
if ($iu != false) {
$item['image'] = $iu;
} else {
$item['image'] = false;
}
if ($item['image'] != false) {
$item['tn_image'] = thumbnail($item['image'], $tn[0], $tn[1]);
} else {
$item['tn_image'] = false;
}
$item['content'] = htmlspecialchars_decode($item['content']);
if (isset($item['created_at']) and trim($item['created_at']) != '') {
$item['created_at'] = date($date_format, strtotime($item['created_at']));
}
if (isset($item['updated_at']) and trim($item['updated_at']) != '') {
$item['updated_at'] = date($date_format, strtotime($item['updated_at']));
}
$item['link'] = content_link($item['id']);
$item['full_description'] = '';
if (!isset($item['description']) or $item['description'] == '') {
if (isset($item['content']) and $item['content'] != '') {
$item['description'] = character_limiter(strip_tags($item['content']), $character_limit);
$item['full_description'] = strip_tags($item['content']);
} elseif (isset($item['content_body']) and $item['content_body'] != '') {
$item['full_description'] = strip_tags($item['content']);
$item['description'] = character_limiter(strip_tags($item['content_body']), $character_limit);
}
} else {
$item['full_description'] = trim($item['description']);
$item['description'] = character_limiter(strip_tags($item['description']), $character_limit);
}
if (isset($item['title']) and $item['title'] != '') {
$item['full_title'] = $item['title'];
$item['title'] = character_limiter($item['title'], $title_character_limit);
}
if (isset($post_params['content_type']) and $post_params['content_type'] == 'product') {
$item['prices'] = get_custom_fields("field_type=price&for=content&for_id=" . $item['id']);
} else {
$item['prices'] = false;
}
if (isset($item['prices']) and is_array($item['prices']) and !empty($item['prices'])) {
$vals2 = array_values($item['prices']);
$val1 = array_shift($vals2);
$item['price'] = $val1;
} else {
$item['price'] = false;
}
if (isset($show_fields) and is_array($show_fields) and !empty($show_fields)) {
if (!in_array('title', $show_fields)) {
$item['title'] = false;
示例7: get_option
<?php
if (!isset($params['checkout-link-enabled'])) {
$checkout_link_enanbled = get_option('data-checkout-link-enabled', $params['id']);
} else {
$checkout_link_enanbled = $params['checkout-link-enabled'];
}
?>
<?php
if ($checkout_link_enanbled != 'n') {
?>
<?php
$checkout_page = get_option('data-checkout-page', $params['id']);
?>
<?php
if ($checkout_page != false and strtolower($checkout_page) != 'default' and intval($checkout_page) > 0) {
$checkout_page_link = content_link($checkout_page) . '/view:checkout';
} else {
$checkout_page_link = site_url('checkout');
}
?>
<a class="btn btn-warning pull-right" href="<?php
print $checkout_page_link;
?>
">
<?php
_e("Checkout");
?>
</a>
<?php
}
?>
示例8: _e
print $params["edit_page_id"];
?>
')">
<div id="preview-edit-links">
<a class="mw-ui-btn mw-ui-btn-invert" href="#action=editpage:<?php
print $params["edit_page_id"];
?>
" onclick="mw.event.cancel(event);">
<span class="mw-icon-page"></span>
<span><?php
_e("Edit Page");
?>
</span>
</a>
<a class="mw-ui-btn mw-ui-btn-info" target="_top" href="<?php
print content_link($params["edit_page_id"]);
?>
/editmode:y" onclick="mw.event.cancel(event);">
<span class="mw-icon-live"></span>
<?php
_e("Live Edit");
?>
</a>
</div>
</div>
<?php
}
?>
</div>
</div>
示例9: content_link
var titlefield = mwd.getElementById('content-title-field');
if (slugEdited === false) {
var slug = mw.slug.create(titlefield.value);
mw.$('.view-post-slug').html(slug);
mw.$('#edit-content-url').val(slug);
}
}
</script>
</div>
<?php
if (isset($data['url']) and $data['id'] > 0) {
?>
<script>
$(function () {
$('.go-live-edit-href-set').attr('href', '<?php
print content_link($data['id']);
?>
');
});
</script>
<?php
}
?>
<?php
if ($data['content_type'] == 'page') {
?>
<div class="mw-admin-edit-page-primary-settings parent-selector ">
<div class="mw-ui-field-holder">
<div class="quick-parent-selector">
示例10: content_link
</div>
<div class="mw-ui-col" style="width:45%">
<div class="mw-ui-col-container">
<div class="product-description">
<div class="item-box pad">
<div class="mw-ui-row">
<div class="mw-ui-col">
<module type="breadcrumb">
</div>
<div class="mw-ui-col" style="width: 70px;">
<div class="next-previous-content">
<?php
if ($prev != false) {
?>
<a href="<?php
print content_link($prev['id']);
?>
"
class="mw-icon-arrow-left-slim prev-content tip"
data-tip="#prev-tip"></a>
<div id="prev-tip" style="display: none">
<div class="next-previous-tip-content">
<img src="<?php
print get_picture($prev['id']);
?>
" alt="" width="90"/>
<h6><?php
print $prev['title'];
?>
</h6>
</div>