Example #1
0
 */
require_once 'includes/config.php';
ini_set('upload_max_filesize', '10M');
ini_set('post_max_size', '20M');
$id = -1;
$done = false;
$ownerid = -1;
$errors = array();
$collabs = array();
$values = array();
if (isset($_GET['id'])) {
    $id = safeString($_GET['id']);
}
if ($meta = getExperiment($id)) {
    $ownerid = $meta['owner_id'];
    $collabs = getExperimentCollaborators($session->userid, $id);
}
if (isset($_POST['video_create'])) {
    /* Setup Zend */
    require_once 'Zend/Loader.php';
    Zend_Loader::loadClass('Zend_Gdata_YouTube');
    Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
    $appId = 'iSENSE';
    $clientId = 'iSENSE';
    $httpClient = null;
    try {
        $authURL = 'https://www.google.com/youtube/accounts/ClientLogin';
        $httpClient = Zend_Gdata_ClientLogin::getHttpClient($username = YOUTUBE_USER, $password = YOUTUBE_PASS, $service = 'youtube', $client = null, $source = 'iSENSE', $loginToken = null, $loginCaptcha = null, $authURL);
    } catch (Zend_Gdata_App_AuthException $e) {
        array_push($errors, $e->getMessage());
    }
Example #2
0
 $videos = array();
 $images = array();
 $sessions = array();
 $collabs = array();
 if ($is_activity) {
     $fields = getFields($meta['activity_for']);
     $tags = getTagsForExperiment($meta['activity_for']);
     $sessions = getSessionsForExperiment($id);
     $vises = getResponsesForActivity($id);
 } else {
     $fields = getFields($id);
     $vises = getVisByExperiment($id);
     $tags = getTagsForExperiment($id);
     $videos = getVideosForExperiment($id);
     $images = getImagesForExperiment($id);
     $collabs = getExperimentCollaborators($ownerid, $id);
     $sessions = getSessionsForExperiment($id);
 }
 // Process the images for display
 $image_urls = array();
 if ($images) {
     foreach ($images as $img) {
         array_push($image_urls, array('source' => $img['provider_url'], 'set_url' => $img['provider_url']));
     }
 }
 // Push data to smarty template
 $smarty->assign('meta', $meta);
 $smarty->assign('tags', $tags);
 $smarty->assign('vises', $vises);
 $smarty->assign('fields', $fields);
 $smarty->assign('pictures', $image_urls);