Skip directly to content

Post Your #DREAMSANDNIGHTMARESTOUR Photos

error) { $accessToken = getFB($app_id, $app_secret, $showGalleryUrl); } } if (!empty($accessToken)) { if ($_SERVER['REQUEST_METHOD'] == 'POST') { $incrementors = $_POST["fbIndices"]; $fbUserName = $_POST["fbUserName"]; if (module_exists("tour_gallery") && function_exists("tour_gallery_import_loop") && $incrementors) { $msg = ""; tour_gallery_import_loop($incrementors, $fbUserName); //drupal_set_message("You’re In Check For Your Photo", "status"); drupal_goto('tour'); } else{ drupal_set_message("FB Messed Up Thou – Try Again", "error"); drupal_goto('tour'); } } else { if ($listing == 'photos') { $photos = graphRequest($accessToken, $albumId . '/photos'); showPhotos($accessToken, $photos); } else { $albums = graphRequest($accessToken, 'me/albums'); showAlbums($accessToken, $albums); } } } function getFB($app_id, $app_secret, $showGalleryUrl) { $code = $_REQUEST["code"]; $params = null; if (empty($code)) { echo "

Awaiting Facebook authentication...

"; $_SESSION['state'] = md5(uniqid(rand(), TRUE)); $dialog_url = "https://www.facebook.com/dialog/oauth?client_id=" . $app_id . "&redirect_uri=" . urlencode($showGalleryUrl) . "&state=" . $_SESSION['state'] . "&scope=user_photos"; echo(""); } if ($_SESSION['state'] && ($_SESSION['state'] === $_REQUEST['state'])) { $token_url = "https://graph.facebook.com/oauth/access_token?" . "client_id=" . $app_id . "&redirect_uri=" . urlencode($showGalleryUrl) . "&client_secret=" . $app_secret . "&code=" . $code; $response = file_get_contents($token_url); parse_str($response, $params); } setcookie("tourGallery_aToken", $params['access_token'], time()+3600); return $params['access_token']; } function graphRequest($accessToken, $type) { $graph_url = "https://graph.facebook.com/"; $graph_url .= $type; $graph_url .= "?access_token="; $graph_url .= $accessToken; if(strstr($type, 'albums') || strstr($type, 'photos')){ $graph_url .= "&limit=100"; } //tagIt("variable", "graph_url: ", $graph_url); $content = json_decode(curl_get_file_contents($graph_url)); return $content; } function curl_get_file_contents($URL) { $c = curl_init(); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_URL, $URL); $contents = curl_exec($c); $err = curl_getinfo($c,CURLINFO_HTTP_CODE); curl_close($c); if ($contents) return $contents; else return FALSE; } function showAlbums($accessToken, $albums) { $showGalleryUrl = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?>
Pick any album
    data as $album) { $albumName = $album -> name; $albumCoverPhoto = $album -> cover_photo; $album_Id = $album -> id; $aIncrementor++; $photoQuery = (count($_GET) > 1) ? '&listing=photos&albumId=' : '?listing=photos&albumId='; $photoListingUrl = $showGalleryUrl . $photoQuery . $album_Id; $coverPhoto = "/sites/default/themes/june_meekmilldreamteam_reskin/images/defaultAlbum.png"; $coverPhotoDimensions = "width='200'"; ?>
  • source; $albumAcc = getimagesize($coverPhoto); $attr = imageResize($albumAcc[0], $albumAcc[1], 200); $coverPhotoDimensions = "width='".$attr["width"]."' height='".$attr["height"]."'"; } //echo ""; echo ""; ?>
    ".$albumName.""; ?>
Select as many photos as you wish and click Import
You have not selected any photos to import.
    data as $photo) { $arePhotosPresent = true; $photoSource = $photo -> source; $photoId = $photo -> id; $photoUserName = $photo -> from -> name; $photoName = $photo -> name; $photoName = trim_text($photoName, 29, true, true); $incrementor++; $photoAcc = getimagesize($photoSource); $attr = imageResize($photoAcc[0], $photoAcc[1], 200); ?>
There are no photos in this album.
(Array) " . $name . " size: " . sizeof($var) . ""; echo "
";
		print_r($var);
		echo "
"; } else { echo "
" . $name . ": " . $var . "
"; } } function imageResize($width, $height, $target) { if ($width > $height) { $percentage = ($target / $width); } else { $percentage = ($target / $height); } $width = round($width * $percentage); $height = round($height * $percentage); $attr["width"] = $width; $attr["height"] = $height; return $attr; } function trim_text($input, $length, $ellipses = true, $strip_html = true) { //strip tags, if desired if ($strip_html) { $input = strip_tags($input); } //no need to trim, already shorter than trim length if (strlen($input)