<?php require 'include/init.php'; if (!global_check_login()) { global_redirect('index.php'); } $topics = array("contacts_photos" => "Contacts' Photos", "contacts_faves" => "Contacts' Faves", "photos_of_contacts" => "Photos of my Contacts", "photos_of_me" => "Photos of Me", "my_photos" => "My Photos", "my_faves" => "My Faves", "geo" => "Geo", "commons" => "Commons", "tags" => "Tags"); $user_nsid = $cfg['account']['auth']['user']['nsid']; $token = $cfg['account']['auth']['token']['_content']; $flickr = new Flickr($cfg['flickr_key'], $cfg['flickr_secret']); // What does Flickr say we are subscribed to? $subscriptions = $flickr->call_method('flickr.push.getSubscriptions', array('auth_token' => $token), 1); $live_subscriptions = array(); $active_subscriptions = array(); // Figure out what we are currently subscribed to so we'll know what we need to add from the passed-in form data if (isset($subscriptions['subscriptions']['subscription'])) { foreach ($subscriptions['subscriptions']['subscription'] as $sub) { if (strpos($sub['callback'], $cfg['base_push_url']) === 0) { $pieces = explode('&', parse_url($sub['callback'], PHP_URL_QUERY)); foreach ($pieces as $piece) { list($k, $v) = explode('=', $piece, 2); if ($k == 'sub') { $live_subscriptions[$v] = 1; } } } } } $titles = array(); foreach ($_POST['streams'] as $topic) { switch ($topic) {
<?php require 'include/init.php'; $flickr = new Flickr($GLOBALS['cfg']['flickr_key'], $GLOBALS['cfg']['flickr_secret']); $result = $flickr->call_method('flickr.auth.getToken', array('frob' => $_GET['frob']), true); $_SESSION['flickr_token'] = $result; header('Location: index.php'); exit;