function perch_blog_post($id_or_slug, $return = false)
{
    $id_or_slug = rtrim($id_or_slug, '/');
    $opts = array('template' => false);
    if (is_numeric($id_or_slug)) {
        $opts['_id'] = intval($id_or_slug);
    } else {
        $opts['filter'] = 'postSlug';
        $opts['match'] = 'eq';
        $opts['value'] = $id_or_slug;
    }
    $r = perch_blog_custom($opts, $return);
    if ($return) {
        return $r;
    }
    echo $r;
}
		</header>
		<div class="big-grid">
			<section>
				<ul>
					<li><img src="../images/wd40cans1.jpg" alt="WD40 Cans, Framework"></li>
					<li><img src="../images/wd40cans2.jpg" alt="WD40 Cans, Rendered"></li>
				</ul>	
			</section>
		</div>
		<div class="flourish-tablet-a">
			<img src="../images/flourish.svg" alt="Flourish">
		</div>
		<div class="blog-homepage">
			<h2>Recent Blogs...</h2>	
			<?php 
perch_blog_custom(array('sort' => 'postDateTime', 'sort-order' => 'RAND', 'template' => 'blog/post_in_homepage.html', 'count' => '2'));
?>
	
		</div>	
		<footer>
			<ul>
				<li>	
					<a href="https://uk.linkedin.com/in/scottbrabazon" target="blank">
						<img src="../images/linkedin.png" alt="LinkedIn">
					</a>
				</li>
				<li>	
					<p>&copy; 2016 Scott Brabazon</p>
				</li>
			</ul>
		</footer>
Example #3
0
    echo '<h1>Archive of: ' . strftime($title_date_format, strtotime($date_from)) . '</h1>';
    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));
    $posts_displayed = true;
}
/* --------------------------- POSTS BY AUTHOR --------------------------- */
if (perch_get('author')) {
    echo '<h1>Posts by ' . perch_blog_author(perch_get('author'), array('template' => 'author_name.html'), true) . '</h1>';
    perch_blog_custom(array('author' => perch_get('author'), 'template' => $template, 'count' => $posts_per_page, 'sort' => $sort_by, 'sort-order' => $sort_order));
    $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 '<h1>Archive</h1>';
    perch_blog_custom(array('template' => $template, 'count' => $posts_per_page, 'sort' => $sort_by, 'sort-order' => $sort_order));
}
?>
	    </div>
		<nav class="sidebar">
		    <h2>Filter archive</h2>
		    <!--  By category listing -->
		    <?php 
perch_blog_categories();
?>
		    <!--  By tag -->
		    <?php 
perch_blog_tags();
?>
		    <!--  By year -->
		    <?php 
			</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">
			   
			    
			    <div class="post">
			    	<?php 
perch_blog_section(perch_get('s'));
?>

			    	<?php 
perch_blog_custom(['section' => perch_get('s')]);
?>

			    </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')));
?>
Example #5
0
<?php

if (!defined('PERCH_RUNWAY')) {
    include $_SERVER['DOCUMENT_ROOT'] . '/perch/runtime.php';
}
perch_layout('header', ['title' => 'Homepage | perch.io']);
// perch_layout('homepage-header');
?>
      
        <div class="outer-container">
            <main class="main-body">
                <h2 class="page-title">Latest Perch tutorials, tips &amp; insights</h2>
                <?php 
perch_blog_custom(array('count' => 10, 'template' => 'post_in_list.html', 'sort' => 'postDateTime', 'sort-order' => 'DESC', 'paginate' => true, 'page-links' => true, 'page-link-style' => 'all'));
?>
            </main>
            <?php 
perch_layout('sidebar');
?>
        </div>
        
    <?php 
perch_layout('footer');
Example #6
0
<?php

include $_SERVER['DOCUMENT_ROOT'] . '/perch/runtime.php';
$domain = 'http://' . $_SERVER['HTTP_HOST'];
PerchSystem::set_var('domain', $domain);
header('Content-Type: application/rss+xml');
echo '<' . '?xml version="1.0"?' . '>';
?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Latest school notices from Waterford Kamhlaba UWCSA</title>
        <link><?php 
echo PerchUtil::html($domain);
?>
/news/notices/</link>
        <description>Waterford Kamhlaba UWCSA is a remarkable and pioneering secondary school located in Mbabane, Swaziland.</description>
        <atom:link href="<?php 
echo PerchUtil::html($domain);
?>
/news/notices/rss.php" rel="self" type="application/rss+xml" />
        <?php 
perch_blog_custom(array('template' => 'rss_post.html', 'count' => 20, 'section' => 'school-notices', 'sort' => 'postDateTime', 'sort-order' => 'DESC'));
?>
    </channel>
</rss>
Example #7
0
    </div>
  </div>
</header>

<section>
  <div class="article-background">
    <article id="article" class="m0a">
      <?php 
perch_blog_post(perch_get('s'));
?>
    </article>
  </div>
</section>
</span>

<section class="cards">
  <div class="cards article-width--3">
    <header class="fp-header-ctnr">
      <h1 class="float-left medium blue">Latest news</h1>
      <p class="small"><a class="float-right link margin-top-05" href="/news/newsfeed/">All latest news &#8250;</a></p>
    </header>

    <?php 
perch_blog_custom(array('count' => 3, 'section' => 'newsfeed', 'template' => 'post_recent.html', 'sort' => 'postDateTime', 'sort-order' => 'DESC'));
?>
  </div>
</section>
<div class="article-background"></div>

<?php 
perch_layout('footer');
Example #8
0
			      <h3>SOUNDTRACKS</h3>
			    </span>
			  </div>
			</a>
			<a href="http://bdmusichub.local/blog" class="outer-box" style="background-image:url(http://bdmusichub.local/cms/resources/blog-concert-small-full-width.jpg);">
			  <div>
			    <span>
			      <h3>MUSIC HUB BLOG</h3>
			    </span>
			  </div>
			</a>	
			</div>														
		</section>

		<?php 
perch_blog_custom(array('sort' => 'postDateTime', 'sort-order' => 'DESC', 'template' => 'blog/homepage_post_in_list.html', 'count' => 1));
?>
		


		<?php 
perch_layout('twitter');
?>
						
		<?php 
perch_content('email-signup');
?>

		<?php 
perch_layout('footer');
?>
Example #9
0
<?php

include '../../perch/runtime.php';
perch_layout('header');
?>
  <title>School notices | Waterford Kamhlaba UWCSA</title>
  <meta name="description" itemprop="description" content="Stay up to date with notices to parents and students." />
<?php 
perch_layout('navigation');
?>

<section class="margin-subnav" style="padding-top:1em;">
  <div class="b-gradient-vp notice shadow-3">
    <?php 
perch_blog_custom(array('template' => 'alert_banner.html', 'count' => 1, 'section' => 'alert', 'sort' => 'postDateTime', 'sort-order' => 'DESC'));
?>
  </div>
</section>

<section class="cards">
  <?php 
perch_blog_custom(array('count' => 3, 'section' => 'school-notices', 'template' => 'post_in_notices.html', 'sort' => 'postDateTime', 'sort-order' => 'DESC'));
?>
</section>
<?php 
perch_layout('footer');
Example #10
0
<section class="notice shadow-3">
  <div class="fp-content-ctnr">
  <?php 
perch_blog_custom(array('template' => 'alert_banner.html', 'count' => 1, 'section' => 'alert', 'sort' => 'postDateTime', 'sort-order' => 'DESC'));
?>
  </div>
</section>

<section class="cards">
  <header class="fp-header-ctnr">
      <h1 class="float-left"><a class="blue no-link" href="/news/newsfeed/">Latest News</a></h1>
      <a class="fp-section-link block float-right link" href="/news/newsfeed/">All latest news &#8250;</a>
  </header>
  <div class="fp-content-ctnr">
  <?php 
perch_blog_custom(array('template' => 'news_cards.html', 'count' => 4, 'section' => 'newsfeed', 'sort' => 'postDateTime', 'sort-order' => 'DESC'));
?>
  </div>
</section>

<section class="cards margin-footer">
  <h1 class="fp-header-ctnr">Our Partners</h1>
  <div class="card-ctnr layout-331">
    <div class="card-3 card-3-hover">
      <a class="no-link" href="/about/united-world-colleges.php">
        <img class="card-content small partner" src="/img/logo_uwc.png">
      </a>
    </div>
  </div>
  <div class="card-ctnr layout-331">
    <div class="card-3 card-3-hover">
Example #11
0
			
					<?php 
/*
			$categories = perch_blog_post_categories(perch_get('s'), array(
			'skip-template'=>true, ));
			
			if (count($categories)) {
				$cat_slugs = array();

				foreach($categories as $cat) {

					$cat_slugs[] = $cat['catSlug'];

				}
*/
perch_blog_custom(array('sort-order' => 'RAND', 'count' => 3, 'template' => 'blog/related_posts.html'));
/*
				perch_blog_custom(array( 
				'filter' => 'postSlug',
				'match' => 'neq',
				'value' => perch_get('s'),
				'category' => $cat_slugs,
				'sort-order'=> RAND,
				'count'=> 3,
				'template'=> 'blog/related-cat.html',
				'section'=> 'projects'
				));

 			}
*/
?>
Example #12
0
<?php

include '../perch/runtime.php';
$domain = 'http://' . $_SERVER['HTTP_HOST'];
PerchSystem::set_var('domain', $domain);
header('Content-Type: application/rss+xml');
echo '<' . '?xml version="1.0"?' . '>';
?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Perch Blog Example</title>
        <link><?php 
echo PerchUtil::html($domain);
?>
/blog/</link>
        <description>My awesome website.</description>
        <atom:link href="<?php 
echo PerchUtil::html($domain);
?>
/blog/rss.php" rel="self" type="application/rss+xml" />
        <?php 
perch_blog_custom(array('template' => 'rss_post.html', 'count' => 10, 'sort' => 'postDateTime', 'sort-order' => 'DESC'));
?>
    </channel>
</rss>
Example #13
0
    //         );
    //     break;
    case 'tag':
        $opts = array('tag' => rtrim($tagSlug, '/'));
        break;
    case 'date':
        $opts = array('filter' => 'postDateTime', 'match' => 'eqbetween', 'value' => $date_from . ',' . $date_to);
        break;
}
// show 10 items per page
$opts['count'] = 10;
// order by date, newest to oldest
$opts['sort'] = 'postDateTime';
$opts['sort-order'] = 'DESC';
$opts['template'] = 'post_in_list.html';
perch_blog_custom($opts);
?>

      </div>
            <!-- /Left Content --> 
            <!-- rhs -->
                <div id="sidebar"> 
                  <div class="line"></div> 
                  <!-- container --> 
                  <div class="container">  
                    <!-- The following functions are different ways to display archives. You can use any or all of these. 
                    
                    All of these functions can take a parameter of a template to overwrite the default template, for example:
                    
                    perch_blog_categories('my_template.html');
                    
Example #14
0
        $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>
        
    <?php 
perch_layout('footer');
Example #15
0
            ?>
            </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 {
                ?>
            <section>
                <?php 
                perch_blog_recent_posts(10);
                ?>
            </section>
        <?php 
            }
        }
    }