当前位置: 首页>>代码示例>>PHP>>正文


PHP Facebook::fetch方法代码示例

本文整理汇总了PHP中Facebook::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP Facebook::fetch方法的具体用法?PHP Facebook::fetch怎么用?PHP Facebook::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Facebook的用法示例。


在下文中一共展示了Facebook::fetch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Facebook

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
$object->fetch('date', '5');
// Returns date of publishing
开发者ID:viaprestige,项目名称:viasocial,代码行数:31,代码来源:index.php

示例2: widget


//.........这里部分代码省略.........
								<?php 
            if (Avada()->settings->get('blog_comments') && get_post_meta($post->ID, 'pyre_post_comments', true) != 'yes' || !Avada()->settings->get('blog_comments') && get_post_meta($post->ID, 'pyre_post_comments', true) == 'no') {
                ?>
											<?php 
                global $wpdb;
                $number = $instance['comments'];
                $recent_comments = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved, comment_type, comment_author_url, SUBSTRING(comment_content,1,110) AS com_excerpt FROM {$wpdb->comments} LEFT OUTER JOIN {$wpdb->posts} ON ({$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT {$number}";
                $the_comments = $wpdb->get_results($recent_comments);
                ?>
											<?php 
                if ($the_comments) {
                    ?>
												<?php 
                    foreach ($the_comments as $comment) {
                        ?>
													<li>
														<div class="image">
															<a><?php 
                        echo get_avatar($comment, '52');
                        ?>
</a>
														</div>
														<div class="post-holder">
															<p><?php 
                        echo strip_tags($comment->comment_author);
                        ?>
 <?php 
                        _e('says:', 'Avada');
                        ?>
</p>
															<div class="fusion-meta">
															<a class="comment-text-side" href="<?php 
                        echo get_permalink($comment->ID);
                        ?>
#comment-<?php 
                        echo $comment->comment_ID;
                        ?>
" title="<?php 
                        printf(__('%1$s on %2$s', 'Avada'), strip_tags($comment->comment_author), $comment->post_title);
                        ?>
"><?php 
                        printf(__('%s...', 'Avada'), fusion_string_limit_words(strip_tags($comment->com_excerpt), 12));
                        ?>
</a>
															</div>
														</div>
													</li>
												<?php 
                    }
                    ?>
											<?php 
                } else {
                    ?>
											<li><?php 
                    _e('No comments have been published yet.', 'Avada');
                    ?>
</li>
											<?php 
                }
                ?>
								<?php 
            } else {
                ?>
								<?php 
                include_once 'Viasocial/class/facebook.class.php';
                $viasocial = new Facebook('{app-id}', '{app-secret}');
                $viasocial->count('commentCount');
                ?>
								<?php 
                if ($viasocial->count('commentCount') !== 0) {
                    ?>
								<?php 
                    $viasocial->fetch('all', '4');
                    ?>
								<?php 
                } elseif ($viasocial->count('commentCount') == 0) {
                    ?>
								<li><?php 
                    _e('No comments have been published yet.', 'Avada');
                    ?>
</li>
								<?php 
                }
                ?>
								<?php 
            }
            ?>
							<!-- END Viasocial -->
							</ul>
						</div>

					<?php 
        }
        ?>
				</div>
			</div>
		</div>
		<?php 
        echo $after_widget;
    }
开发者ID:viaprestige,项目名称:viasocial,代码行数:101,代码来源:class-fusion-widget-tabs.php


注:本文中的Facebook::fetch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。