本文整理汇总了PHP中post::index_count方法的典型用法代码示例。如果您正苦于以下问题:PHP post::index_count方法的具体用法?PHP post::index_count怎么用?PHP post::index_count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类post
的用法示例。
在下文中一共展示了post::index_count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<div>
<input id="stags" name="tags" class="search_list" type="text" />
<br />
<input name="commit" class="secondary_search" type="submit" value="" /><br /><br />
</div>
</form>
</div>
</center>
</div>
<div class="sidebar2 sidebar4">
<center>
<div class="sidebar3">
<h5>Tags</h5><br />
<ul id="tag-sidebar">';
foreach ($ttags as $current) {
$count = $post->index_count($current);
echo '<li><span style="color: #a0a0a0;">? <a href="index.php?page=post&s=list&tags=' . $current . '">' . str_replace('_', ' ', $current) . "</a> " . $count['index_count'] . "</span></li>";
}
echo '</ul><br /><br /><br /><br /><br /><br /><br /><br /><div id="stats">
<h5>Statistics</h5><br />
<ul>
<li>Id: ' . $id . '</li>
<li>Posted: ' . $post_data['creation_date'] . '<br /> by <a href="index.php?page=account_profile&uname=' . $post_data['owner'] . '">' . $post_data['owner'] . '</a></li>
<li>Size: ' . $post_data['height'] . 'x' . $post_data['width'] . '</li>
<li>Source: <a href="' . $post_data['source'] . '" rel="nofollow">Click here</a></li>
<li>Rating: ' . $post_data['rating'] . '</li>
<li>Score: <a id="psc">' . $post_data['score'] . '</a> (vote <a href="#" onclick="Javascript:post_vote(\'' . $id . '\', \'up\')">up</a>/<a href="#" onclick="Javascript:post_vote(\'' . $id . '\', \'down\')">down</a>)
</li>';
echo '</ul><li style="padding-top: 10px;"></li>
<div>
<h5>Options</h5><br />
示例2: foreach
<div id="tag_list">
<!--<h5>Tags</h5>-->
<ul>';
//foreach($special_tags as $cur_tag)
foreach ($categories as $cat => $tag_arr) {
echo "<h5>" . ucfirst(str_replace('_', ' ', $cat));
if (count($tag_arr) > 1) {
if (substr($cat, -1) == 's') {
echo "'";
} else {
echo "s";
}
}
echo "</h5>";
foreach ($tag_arr as $spec_tag) {
$count = $post->index_count($spec_tag);
//Capitalize characters immediatly after a period
for ($i = 1; $i < strlen($spec_tag); $i++) {
if (ctype_alpha($spec_tag[$i]) && ($spec_tag[$i - 1] == '.' || $spec_tag[$i - 1] == '(')) {
$spec_tag[$i] = strtoupper($spec_tag[$i]);
}
}
echo '<li><span style="color: #a0a0a0;">? ' . '<a href="index.php?page=post&s=list&tags=' . $spec_tag . '" class="' . $cat . '">' . ucwords(str_replace('_', ' ', $spec_tag)) . "</a> " . $count['index_count'] . "</span></li>";
}
echo "<br/>";
}
echo "<h5>Tags</h5>";
foreach ($ttags as $current) {
$count = $post->index_count($current);
echo '<li><span style="color: #a0a0a0;">? <a href="index.php?page=post&s=list&tags=' . $current . '" class="' . $categories[$current] . '">' . str_replace('_', ' ', $current) . "</a> " . $count['index_count'] . "</span></li>";
}