本文整理匯總了PHP中post::rp方法的典型用法代碼示例。如果您正苦於以下問題:PHP post::rp方法的具體用法?PHP post::rp怎麽用?PHP post::rp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類post
的用法示例。
在下文中一共展示了post::rp方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
<?php
echo '<aside id="right-nav">
<div class="news">
<h2>Recent <span>Posts</span></h2>';
$rpContents = post::rp();
if ($rpContents == 'empty') {
echo '<center><img src="' . $website . 'assets/img/smile_face.png" /><br /><p style="color:#AAA;font-size:1.5em;">No Recent Posts to Show</p></center>';
} else {
foreach ($rpContents as $rp) {
$dateArray = getdate(strtotime($rp['postDate']));
echo '<a href="' . generate_link($rp['postTitle'], $rp['postId']) . '" class="rp-link">
<div class="rp">
<span class="date"><span>' . $dateArray['mday'] . '</span><br /><span>' . substr($dateArray['month'], 0, 3) . '</span></span>
<h3>' . $rp['postTitle'] . '</h3>
<p>' . $rp['class'] . ' | ' . $rp['facultyName'] . ' | ' . $rp['subjectName'] . ' | ' . $rp['postTyp'] . '</p>
<div class="cleaner"></div>
</div><!--end of .rp -->
<div class="cleaner"></div>
</a><!--end of .rp-link -->';
}
}
echo '
</div> <!--end of .news -->
<div class="news">
<h2>We are <span>Social</span></h2>
<div id="social-sites">
<a href="https://www.facebook.com/plustwonotes"><img src="' . $website . 'assets/img/facebook.png" alt="Plus Two Notes Facebook Page"/></a>
<a href="https://plus.google.com/+Plustwonotespage/"><img src="' . $website . 'assets/img/googleplus.png" alt="Plus Two Notes Google+ Page"/></a>