本文整理汇总了PHP中Social::facebook方法的典型用法代码示例。如果您正苦于以下问题:PHP Social::facebook方法的具体用法?PHP Social::facebook怎么用?PHP Social::facebook使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Social
的用法示例。
在下文中一共展示了Social::facebook方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLogin
public function getLogin($social)
{
try {
switch ($social) {
case 'facebook':
$su = \Social::facebook('user');
break;
case 'google':
$su = \Social::google('user');
break;
default:
$su = null;
}
if ($su === null) {
return \Redirect::route('frontend.index');
}
$m = \Member::where('uid', '=', $su->id)->where('social', '=', $social)->first();
if ($m == null) {
$m = new \Member();
$m->uid = $su->id;
$m->social = $social;
$m->name = $su->name;
$m->email = $su->email;
if ($social == 'facebook') {
if (isset($su->birthday)) {
$m->birthday = date('Y-m-d', strtotime($su->birthday));
}
if (isset($su->gender)) {
$m->gender = substr($su->gender, 0, 1);
}
}
$m->save();
}
// register user into Auth that is a global variable
\Auth::login($m);
return \Redirect::route('frontend.index');
} catch (Exception $e) {
echo $e->getMessage();
exit;
}
}
示例2: widget
function widget($args, $instance)
{
extract($args);
$Social = new Social();
echo $before_widget;
if (!empty($instance['title'])) {
echo $before_title;
echo $instance['title'];
echo $after_title;
}
?>
<ul class="subscribe">
<?php
if (!empty($instance['dribbble'])) {
$dribbble = $Social->dribbble($instance['dribbble']);
?>
<li class="clearfix dribbble">
<a href="<?php
echo $instance['dribbble'];
?>
" target="_blank">
<span><i><?php
echo @number_format($dribbble);
?>
</i> <?php
_e('Followers');
?>
</span>
</a>
</li>
<?php
}
?>
<?php
if (!empty($instance['vimeo'])) {
$vimeo = $Social->vimeo($instance['vimeo']);
?>
<li class="clearfix vimeo">
<a href="<?php
echo $instance['vimeo'];
?>
" target="_blank">
<span><i><?php
echo @number_format($vimeo);
?>
</i> <?php
_e('Subscribers');
?>
</span>
</a>
</li>
<?php
}
?>
<?php
if (!empty($instance['youtube'])) {
$youtube = $Social->youtube($instance['youtube']);
?>
<li class="clearfix YouTube">
<a href="<?php
echo $instance['youtube'];
?>
" target="_blank">
<span><i><?php
echo @number_format($youtube);
?>
</i> <?php
_e('Subscribers');
?>
</span>
</a>
</li>
<?php
}
?>
<?php
if (!empty($instance['facebook'])) {
$facebook = $Social->facebook($instance['facebook']);
?>
<li class="clearfix facebook">
<a href="<?php
echo $instance['facebook'];
?>
" target="_blank">
<span><i><?php
//.........这里部分代码省略.........
示例3: Social
<?php
/*-----------------------------------------------------------------------------------
File contains the Facebook signin + after signin close window
-------------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------
START Facebook signin process
-------------------------------------------------------------------------------------*/
require 'facebook.php';
$FACEBOOK = new Social();
if (isset($_GET['facebook'])) {
$FACEBOOK->facebook();
//Sotring data in signup session
$_SESSION["SIGNUP"]["DETAILS"]["email"] = $_SESSION['User']['email'];
$_SESSION["SIGNUP"]["DETAILS"]["email"] = $_SESSION['User']['first_name'];
$_SESSION["SIGNUP"]["DETAILS"]["email"] = $_SESSION['User']['last_name'];
$_SESSION["SIGNUP"]["DETAILS"]["email"] = $_SESSION['User']['email'];
}
?>
<!-- after authentication close the popup -->
<script type="text/javascript">
window.close();
</script>
<?php
/*-----------------------------------------------------------------------------------
END Google signin
-------------------------------------------------------------------------------------*/