本文整理汇总了PHP中perch_get函数的典型用法代码示例。如果您正苦于以下问题:PHP perch_get函数的具体用法?PHP perch_get怎么用?PHP perch_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了perch_get函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: perch_content_check_preview
function perch_content_check_preview()
{
if (!defined('PERCH_PREVIEW_ARG')) {
define('PERCH_PREVIEW_ARG', 'preview');
}
if (perch_get(PERCH_PREVIEW_ARG)) {
$contentID = 'all';
$rev = false;
$var = perch_get(PERCH_PREVIEW_ARG);
if ($var != 'all' && $var != 'preview') {
$rev = $var;
if (strpos($rev, 'r')) {
$parts = explode('r', $rev);
$contentID = (int) $parts[0];
$rev = (int) $parts[1];
}
}
$Users = new PerchUsers();
$CurrentUser = $Users->get_current_user();
if (is_object($CurrentUser) && $CurrentUser->logged_in()) {
$Content = PerchContent::fetch();
$Content->set_preview($contentID, $rev);
}
}
}
示例2: perch_blog_categories
</div>
</div>
<nav class="sidebar">
<h2>Filter archive</h2>
<!-- By category listing -->
<?php
perch_blog_categories(array('section' => perch_get('s')));
?>
<!-- By tag -->
<?php
perch_blog_tags(array('section' => perch_get('s')));
?>
<!-- By year -->
<?php
perch_blog_date_archive_years(array('section' => perch_get('s')));
?>
</nav>
</div>
<footer class="layout-footer">
<div class="wrapper">
<ul class="social-links">
<li class="twitter"><a href="#" rel="me">Twitter</a></li>
<li class="facebook"><a href="#" rel="me">Facebook</a></li>
<li class="flickr"><a href="#" rel="me">Flickr</a></li>
<li class="linkedin"><a href="#" rel="me">LinkedIn</a></li>
<li class="rss"><a href="#">RSS</a></li>
</ul>
<small>Copyright © <?php
echo date('Y');
?>
示例3: perch_layout
<body class="events">
<div class="flex-container">
<?php
perch_layout('page-header');
?>
<div class="house empty-top">
<div class="reed">
<?php
perch_events_custom(array('filter' => 'eventSlug', 'match' => 'eq', 'value' => perch_get('s'), 'template' => 'listing/event-detail.html'));
?>
</div>
<div class="side">
<h3>Event Categories</h3>
<?php
perch_events_categories(array('sort-order' => 'desc', 'template' => 'listing/events-categories.html'));
?>
</div>
</div>
<?php
示例4: perch_blog_post_categories
<?php
perch_blog_post_categories(perch_get('s'));
?>
</div>
<div class="tags">
<?php
perch_blog_post_tags(perch_get('s'));
?>
</div>
</div>
<div class="addthis_sharing_toolbox"></div>
<?php
perch_blog_post_comments(perch_get('s'));
?>
<?php
perch_blog_post_comment_form(perch_get('s'));
?>
</div>
<div class="blog-post-recent">
<h2>Recent Blogs...</h2>
<?php
perch_blog_custom(array('sort' => 'postDateTime', 'sort-order' => 'RAND', 'template' => 'blog/post_in_homepage.html', 'count' => '4'));
?>
</div>
<div class="footer">
<footer>
<ul>
<li>
<a href="https://uk.linkedin.com/in/scottbrabazon" target="blank">
<img src="../images/linkedin.png">
示例5: perch_pages_navigation
<?php
perch_pages_navigation(array('levels' => 1));
?>
</nav>
</header>
<!-- change cols2-nav-right to cols2-nav-left if you want the sidebar on the left -->
<div class="wrapper cols2-nav-right">
<div class="primary-content">
<?php
if (perch_get('s')) {
// Output the large images
perch_gallery_album_images(perch_get('s'), array('template' => 'd_list_image.html'));
// Output the small images used for navigation
perch_gallery_album_images(perch_get('s'), array('template' => 'd_nav_image.html'));
}
?>
</div>
<nav class="sidebar">
<h2>Albums</h2>
<ul class="glist albums">
<?php
perch_gallery_albums();
?>
</ul>
</nav>
</div>
<footer class="layout-footer">
<div class="wrapper">
示例6: PerchAPI
<?php
use DrewM\MailChimp\Webhook as MailChimpWebhook;
include __DIR__ . '/../../env_runtime.php';
$API = new PerchAPI(1.0, 'perch_mailchimp');
$Settings = $API->get('Settings');
$secret = $Settings->get('perch_mailchimp_secret')->val();
if ($secret != perch_get('secret')) {
die('Unauthorised.');
}
$Subscribers = new PerchMailChimp_Subscribers($API);
MailChimpWebhook::subscribe('subscribe', function ($data) use($API, $Subscribers) {
$Subscriber = $Subscribers->get_one_by('subscriberMailChimpID', $data['id']);
if (!$Subscriber) {
$Subscriber = $Subscribers->lookup_and_create($data);
}
if ($Subscriber) {
$Subscriber->update_subscription($data['list_id'], 'subscribe');
}
$Lists = new PerchMailChimp_Lists($API);
$Lists->import();
});
MailChimpWebhook::subscribe('unsubscribe', function ($data) use($API, $Subscribers) {
$Subscriber = $Subscribers->get_one_by('subscriberMailChimpID', $data['id']);
if ($Subscriber) {
$Subscriber->update_subscription($data['list_id'], 'unsubscribed');
}
$Lists = new PerchMailChimp_Lists($API);
$Lists->import();
});
MailChimpWebhook::subscribe('cleaned', function ($data) use($API, $Subscribers) {
示例7: ini_set
<?php
ini_set('display_errors', 1);
include '../admin/runtime.php';
if (perch_get('s')) {
// Detail mode
$page_details = perch_content_custom('Projects', array('template' => 'project.html', 'filter' => 'slug', 'match' => 'eq', 'value' => perch_get('s'), 'count' => 1, 'skip-template' => true));
perch_layout('header', array('title' => $page_details[0]['title'], 'desc' => $page_details[0]['info']));
} else {
perch_layout('header');
}
if (perch_get('s')) {
// Detail mode
perch_content_custom('Projects', array('template' => 'project.html', 'filter' => 'slug', 'match' => 'eq', 'value' => perch_get('s'), 'count' => 1));
} else {
?>
<div class="wrapper">
<div class="home-photography">
<div class="head-photo" style="background-image: url(/images/work-banner.jpg);"></div>
<div class="title-holder">
<?php
perch_content('Page Title Banner');
?>
</div>
</div>
<div class="portfolio portfolio-v2">
<div class="container">
<div class="filters">
<ul id="filters">
<li class="active" data-filter="*">All</li>
示例8: perch_blog_post_meta
<!DOCTYPE html>
<html>
<head>
<?php
if (perch_layout_has('blog-post')) {
perch_blog_post_meta(perch_get('s'));
echo PHP_EOL;
echo '<meta name="description" content="';
echo perch_blog_post_field(perch_get('s'), 'postTitle') . '" />';
} else {
echo '<title>';
echo perch_content('title-tag') . '</title>';
echo '<meta name="description" content="';
echo perch_content('meta-desc') . '" />';
}
?>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
示例9: perch_blog_post
</div>
</div>
<!-- /LOCATION -->
<!-- MAIN -->
<div id="main" class="blog">
<div class="top_main"></div>
<div class="middle_main">
<!-- Main content -->
<!-- Fullwidth -->
<div class="left_content_590">
<div class="post">
<?php
perch_blog_post($_GET['s']);
?>
<?php
perch_blog_post_tags(perch_get('s'));
?>
</div>
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = '4hair'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
示例10: root_locator_get_custom
locations.forEach(function(address) {
var marker = new google.maps.Marker({
position: new google.maps.LatLng(address.addressLatitude, address.addressLongitude),
map: map,
title: address.locationTitle
});
bounds.extend(marker.getPosition());
});
}
// Zoom to map to fit the markers on display
map.fitBounds(bounds);
}
</script>
<!-- This is *not* the key you use in the Perch settings area. You will need a Browser key -->
<script src="https://maps.googleapis.com/maps/api/js?callback=initMap&key=XXXXXXXXXX" async defer></script>
<?php
root_locator_get_custom(array('address' => perch_get('address'), 'range' => 50));
?>
<?php
}
?>
</div>
</body>
</html>
<?php
PerchUtil::output_debug();
示例11: intval
$title_date_format = '%Y';
// Month and Year?
if (perch_get('month')) {
$month = intval(perch_get('month'));
$date_from = $year . '-' . str_pad($month, 2, '0', STR_PAD_LEFT) . '-01 00:00:00';
$date_to = $year . '-' . str_pad($month, 2, '0', STR_PAD_LEFT) . '-31 23:59:59';
$title_date_format = '%B, %Y';
}
echo '<h2 class="page-title">Archive of: ' . strftime($title_date_format, strtotime($date_from)) . '</h2>';
perch_blog_custom(array('filter' => 'postDateTime', 'match' => 'eqbetween', 'value' => $date_from . ',' . $date_to, 'template' => $template, 'count' => $posts_per_page, 'sort' => $sort_by, 'sort-order' => $sort_order, 'paginate' => true, 'page-links' => true, 'page-link-style' => 'all'));
$posts_displayed = true;
}
/* --------------------------- POSTS BY AUTHOR --------------------------- */
if (perch_get('author')) {
echo '<h2 class="page-title">Posts by ' . perch_blog_author(perch_get('author'), array('template' => 'author_name.html'), true) . '</h2>';
perch_blog_custom(array('author' => perch_get('author'), 'template' => $template, 'count' => $posts_per_page, 'sort' => $sort_by, 'sort-order' => $sort_order, 'paginate' => true, 'page-links' => true, 'page-link-style' => 'all'));
$posts_displayed = true;
}
/* --------------------------- DEFAULT: ALL POSTS --------------------------- */
if ($posts_displayed == false) {
// No other options have been used; no posts have been displayed yet.
// So display all posts.
echo '<h2 class="page-title">Archive</h2>';
perch_blog_custom(array('template' => $template, 'count' => $posts_per_page, 'sort' => $sort_by, 'sort-order' => $sort_order, 'paginate' => true, 'page-links' => true, 'page-link-style' => 'all'));
}
?>
</main>
<?php
perch_layout('sidebar');
?>
</div>
示例12: perch_blog_author
print perch_blog_author(perch_get('author'));
?>
</section>
<section>
<h2>Beiträge von <?php
echo perch_blog_author(perch_get('author'), array('template' => 'author_name.html'), true);
?>
</h2>
<?php
perch_blog_custom(array('author' => perch_get('author'), 'template' => 'post_in_list.html', 'sort' => 'postDateTime', 'sort-order' => 'DESC'));
?>
</section>
<?php
} else {
if (perch_get('year')) {
$year = intval(perch_get('year'));
$date_from = $year . '-01-01 00:00:00';
$date_to = $year . '-12-31 23:59:59';
?>
<h1><span class="arrow detail">Jahr</span> <?php
print strftime('%Y', strtotime($date_from));
?>
</h1>
<section>
<?php
perch_blog_custom(array('filter' => 'postDateTime', 'match' => 'eqbetween', 'value' => $date_from . ',' . $date_to, 'template' => 'post_in_list.html', 'sort' => 'postDateTime', 'sort-order' => 'DESC'));
?>
</section>
<?php
} else {
示例13: perch_members_secure_download
<?php
include '../perch/runtime.php';
// config
$bucket_name = 'secure';
$url_param = 'file';
// By default, deny downloads unless we've proved the member is allowed this file.
$allow_download = false;
// Check a member is logged in
if (perch_member_logged_in()) {
$allow_download = true;
}
/*
Alternatively, you could check for a specific tag, e.g.
if (perch_member_has_tag('subscriber')) {
$allow_download = true;
}
*/
// Deliver the file.
if ($allow_download) {
perch_members_secure_download(perch_get($url_param), $bucket_name);
}
exit;
示例14: get_tags
<div class="outer-container">
<main class="main-body">
<h2 class="page-title">Handy links from around the web</h2>
<p>It's early days. And we promise, at some stage, the following will be sorted much better, but here is a list of some great Perch resources from around the web. If you've got something to add, email <a href="mailto:hello@perchd.io">hello@perchd.io</a>.</p>
<?php
$tags = get_tags();
echo '<div class="tags">';
$active = perch_get('tag') == null ? ' active' : '';
echo '<a class="btn--secondary ' . $active . '" href="/links">All</a> ';
foreach ($tags as $tag) {
$active = perch_get('tag') == $tag ? ' active' : '';
echo '<a class="btn--secondary' . $active . '" href="/links?tag=' . $tag . '">' . ucfirst(substr($tag, 6)) . '</a> ';
}
echo '</div>';
$items = pinboard_bookmarks('perch ' . perch_get('tag'));
foreach ($items as $item) {
echo '<article class="post--extended">';
echo '<header class="post__header"><h3 class="post__title"><a href="' . $item['url'] . '">' . $item['title'] . '</a></h3>';
//echo '<div class="post__byline"><time class="dt-published">'.$item['date'].'</time></div></header>';
echo '<div class="post__content"><p>' . $item['description'] . '</p></div>';
echo '</article>';
echo '<hr />';
}
?>
</main>
<?php
perch_layout('sidebar');
?>
</div>
示例15: perch_pages_title
<?php
if (!defined('PERCH_RUNWAY')) {
include $_SERVER['DOCUMENT_ROOT'] . '/perch/runtime.php';
}
$title = perch_pages_title(true);
perch_layout('header', ['title' => $title . ' | perch.io']);
// perch_layout('homepage-header');
?>
<div class="outer-container">
<main class="main-body">
<?php
listing(perch_get('s'), array('template' => 'addons_item.html'));
?>
</main>
<?php
perch_layout('user-sidebar');
?>
</div>
<?php
perch_layout('footer');