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


PHP Social::facebook方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:kettanyam,项目名称:20141001done,代码行数:41,代码来源:MemberController.php

示例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 
//.........这里部分代码省略.........
开发者ID:mustafaismail22,项目名称:social-counter,代码行数:101,代码来源:widget.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
-------------------------------------------------------------------------------------*/
开发者ID:business-expert,项目名称:bellimodeling,代码行数:28,代码来源:login.php


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