本文整理汇总了PHP中Facebook::count方法的典型用法代码示例。如果您正苦于以下问题:PHP Facebook::count方法的具体用法?PHP Facebook::count怎么用?PHP Facebook::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Facebook
的用法示例。
在下文中一共展示了Facebook::count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Facebook
<?php
include_once 'Avada 3.8.6/Viasocial/class/facebook.class.php';
$object = new Facebook('{app-id}', '{app-secret}');
// count('{option}') :
$object->count('sourceId');
// Returns the object's ID
$object->count('sourceType');
// Returns the object's Type eg. Website
$object->count('sourceUrl');
// Returns the object's URL
$object->count('commentCount');
// Returns comments count
$object->count('shareCount');
// Returns shares & likes count *
// * shares and likes are both counted in the same time
// fetch('{option},{limit}') :
$object->fetch('all', '5');
// Returns full data : comment, author, date&time, limited by 5
$object->fetch('custom', '5');
// Returns full data except profile picture
$object->fetch('authorId', '5');
// Returns authors IDs
$object->fetch('author', '5');
// Returns authors names
$object->fetch('picture', '5');
// Returns user's profile picture
$object->fetch('message', '5');
// Returns messages (comments)
$object->fetch('datetime', '5');
// Returns date&time of publishing
示例2: widget
function widget($args, $instance)
{
global $post;
extract($args);
$posts = isset($instance['posts']) ? $instance['posts'] : 3;
$comments = isset($instance['comments']) ? $instance['comments'] : '3';
$tags_count = isset($instance['tags']) ? $instance['tags'] : 3;
$show_popular_posts = isset($instance['show_popular_posts']) ? 'true' : 'false';
$show_recent_posts = isset($instance['show_recent_posts']) ? 'true' : 'false';
$show_comments = isset($instance['show_comments']) ? 'true' : 'false';
$show_tags = isset($instance['show_tags']) ? 'true' : 'false';
if (isset($instance['orderby'])) {
$orderby = $instance['orderby'];
} else {
$orderby = 'Highest Comments';
}
echo $before_widget;
?>
<div class="tab-holder tabs-widget">
<div class="tab-hold tabs-wrapper">
<ul id="tabs" class="tabset tabs">
<?php
if ('true' == $show_popular_posts) {
?>
<li><a href="#tab-popular"><?php
echo __('Popular', 'Avada');
?>
</a></li>
<?php
}
?>
<?php
if ('true' == $show_recent_posts) {
?>
<li><a href="#tab-recent"><?php
echo __('Recent', 'Avada');
?>
</a></li>
<?php
}
?>
<?php
if ('true' == $show_comments) {
?>
<li><a href="#tab-comments"><span class="fusion-icon-bubbles"></span></a></li>
<?php
}
?>
</ul>
<div class="tab-box tabs-container">
<?php
if ('true' == $show_popular_posts) {
?>
<div id="tab-popular" class="tab tab_content" style="display: none;">
<?php
if ('Highest Comments' == $orderby) {
$order_string = '&orderby=comment_count';
} else {
$order_string = '&meta_key=avada_post_views_count&orderby=meta_value_num';
}
$popular_posts = new WP_Query('showposts=' . $posts . $order_string . '&order=DESC&ignore_sticky_posts=1');
?>
<ul class="news-list">
<?php
if ($popular_posts->have_posts()) {
?>
<?php
while ($popular_posts->have_posts()) {
$popular_posts->the_post();
?>
<li>
<?php
if (has_post_thumbnail()) {
?>
<div class="image">
<a href="<?php
the_permalink();
?>
"><?php
the_post_thumbnail('tabs-img');
?>
</a>
</div>
<?php
}
?>
<div class="post-holder">
<a href="<?php
the_permalink();
//.........这里部分代码省略.........