Пример #1
0
 public static function getFbUser()
 {
     $fbID = Yii::app()->facebook->getUser();
     $apiFbKey = md5(trim("Yii::app()->facebook->api({$fbID})"));
     if (Yii::app()->cache->get($apiFbKey) == false) {
         $results = Yii::app()->facebook->api($fbID);
         Yii::app()->cache->set($apiFbKey, $results, 1800);
         GetController::fbSync($fbID);
         return $results;
     } else {
         return Yii::app()->cache->get($apiFbKey);
     }
 }
Пример #2
0
<?php

/**
 * Created by JetBrains PhpStorm.
 * User: aOmMiez ( Mir4ge )
 * Date: 12/7/12 AD
 * Time: 2:35 PM
 * Email : aommiez@gmail.com
 * File Name : album.php
 */
Helper::YiiImport("GetController");
$albums = GetController::getAlbums();
?>
<style>
    .fbPhoto {
        margin-top: 10px;
        -moz-box-shadow: 0 0 5px #888;
        -webkit-box-shadow: 0 0 5px#888;
        box-shadow: 0 0 5px #888;
        margin-right: 16px;
    }
</style>
<script type="text/javascript">
    $(document).ready(function() {
            $("#albumList").change( function() {
                $("#photoCount").html("");
                $("#photoAlbum").html("");
                var albumID = $(this).val();
                var count = $(this).find("option[value="+albumID+"]").attr("count");
                FB.api("/"+albumID+"/photos?offset=0&limit="+count+"",function(response){
                    var photos = response["data"];
Пример #3
0
 * Email : aommiez@gmail.com
 * File Name : menutop.php
 */
$user_id = Yii::app()->facebook->getUser();
if (!$user_id) {
    $params = array('scope' => 'email ,user_about_me, user_activities, user_likes, user_location ,user_photos, user_status, user_videos, friends_about_me, friends_likes, friends_photos, publish_actions ,  publish_stream, offline_access , status_update , photo_upload , video_upload , publish_checkins', 'redirect_uri' => 'http://www.pla2gram.com/');
    $fbUrl = Yii::app()->facebook->getLoginUrl($params);
    echo <<<HTML
    <div id="facebook-login-btb">
\t\t<a href="{$fbUrl}">login with <span>facebook</span></a>
\t</div>
HTML;
} else {
    try {
        Helper::YiiImport("GetController");
        $fbInfo = GetController::getFbUser();
        //$params = array( 'next' => 'http://www.pla2gram.com/' );
        //$fbUrl = Yii::app()->facebook->getLogoutUrl($params);
        $fbNickname = $fbInfo['name'];
        $fbID = Yii::app()->facebook->getUser();
        $albumLink = Yii::app()->createUrl("site/album");
        echo <<<HTML
<div id="userZone">
    <div id="fbImg">
        <img src="https://graph.facebook.com/{$fbID}/picture"/>
    </div>
    <div id="fbNickname">
        {$fbNickname}<br>
    </div>
    <!--
    <div id="userMenu">
Пример #4
0
<?php

Yii::app()->getController();
Helper::YiiImport("GetController");
$photo = GetController::getPhoto($p);
$id = $photo['id'];
$link = $photo['link'];
$ip = $photo['ip'];
$timeCreate = $photo['timeCreate'];
$thumb = str_replace("photo/", "", $link);
$user = GetController::getUser($photo['fbid']);
$name = $user['name'];
$mid = str_replace("photo/", "", $photo['link']);
$mid = Yii::app()->baseUrl . "thumb/thumb320_" . $thumb;
Yii::app()->facebook->ogTags['og:image'] = "http://www.pla2gram.com/thumb/thumb_" . $thumb;
if (isset($_GET['theater'])) {
    $theater = 1;
} else {
    $theater = 0;
}
?>
<script type="text/javascript">
    $(document).ready(function() {
        $("#photo_img").click(function(){
            $("html, body").animate({ scrollTop: 0 }, "slow");
            $("html, body").css("overflow","hidden");
            $("#lightBoxPhoto").show();
        });

        $("#lightBoxPhoto").click(function(){
            $("html, body").css("overflow","auto");
Пример #5
0
            });
        });
    };



    window.addEventListener( 'DOMContentLoaded', init, false);

</script>

<div id="lastShow">
    <div id="slider1" class="slider">
        <ul class="cats" id="cats">
            <?php 
Helper::YiiImport("GetController");
$last = GetController::last_upload(11);
foreach ($last as $key => $value) {
    $thumb = str_replace("photo/", "", $value['link']);
    $l = Yii::app()->baseUrl . "/thumb/thumb230_" . $thumb;
    $i = $value['id'];
    echo <<<HTML
    <li >
    <a href="/?p={$i}" class="aLast">
        <img src="{$l}" class="PhotoImg"/>
    </a>
</li>
HTML;
}
?>
        </ul>
    </div>
Пример #6
0
 private function setRequestId()
 {
     if (isset($_GET['id'])) {
         self::$id = (int) $_GET['id'];
     }
 }