Example #1
0
    $smarty->assign('AUDIO_FILES', $audioFiles);
    // other files
    $otherFiles = $prg->getAssociatedObjects('sotf_other_files', 'filename');
    $smarty->assign('OTHER_FILES', $otherFiles);
    // links
    $smarty->assign('LINKS', $prg->getAssociatedObjects('sotf_links', 'caption'));
    // referencing portals
    $smarty->assign('REFS', $prg->getRefs());
    // statistics
    $smarty->assign('STATS', $prg->getStats());
    // add this visit to statistics
    $prg->addStat('', "visits");
    // rating
    $rating = new sotf_Rating();
    $smarty->assign('RATING', $rating->getInstantRating($id));
    // my rating?
    $myRating = $rating->getMyRating($id);
    debug("r", $myRating);
    $smarty->assign('MY_RATING', $myRating);
    if ($page->loggedIn()) {
        // is in my playlist?
        $smarty->assign('inplaylist', sotf_UserPlaylist::contains($id));
    }
}
$db->commit();
if (sotf_Utils::getParameter('popup')) {
    $smarty->assign('POPUP', 1);
    $page->sendPopup();
} else {
    $page->send();
}
Example #2
0
<?php

// -*- tab-width: 3; indent-tabs-mode: 1; -*-
/*  
 * $Id$
 * Created for the StreamOnTheFly project (IST-2001-32226)
 * Authors: András Micsik, Máté Pataki, Tamás Déri 
 *          at MTA SZTAKI DSD, http://dsd.sztaki.hu
 */
require "init.inc.php";
$page->forceLogin();
//sotf_Utils::getParameter("");
$playlist = new sotf_UserPlaylist();
if (sotf_Utils::getParameter("delete_selected") != "") {
    $checkbox = sotf_Utils::getParameter("checkbox");
    $max = count($checkbox);
    for ($i = 0; $i < $max; $i++) {
        $playlist->delete($checkbox[$i]);
    }
    $page->redirect("playlist.php");
}
if (sotf_Utils::getParameter("play_selected") != "") {
    $pl = new sotf_Playlist();
    $checkbox = sotf_Utils::getParameter("checkbox");
    for ($i = 0; $i < count($checkbox); $i++) {
        $prg = new sotf_Programme($checkbox[$i]);
        $pl->addProg($prg);
    }
    $pl->startStreaming();
    $pl->sendRemotePlaylist();
    $page->logRequest();
<?php

// -*- tab-width: 3; indent-tabs-mode: 1; -*-
/*  
 * $Id$
 * Created for the StreamOnTheFly project (IST-2001-32226)
 * Authors: András Micsik, Máté Pataki, Tamás Déri 
 *          at MTA SZTAKI DSD, http://dsd.sztaki.hu
 */
require "init.inc.php";
$page->forceLogin();
$playlist = new sotf_UserPlaylist();
if (sotf_Utils::getParameter("close") == "true") {
    $lista = sotf_Utils::getParameter("lista");
    $list = split("\\|", $lista);
    $max = count($list);
    for ($i = 1; $i < $max; $i++) {
        $l = split(":", $list[$i]);
        if ($l[1] != $i) {
            //print($l[0].":".$l[1]." -> ".$i."<br>");
            $playlist->setOrder($l[0], $i);
        }
    }
    $page->redirect("closeAndRefresh.php");
    //var_dump($lista);
    //die("<HTML><HEAD></HEAD><BODY onload='javascript:window.opener.location.reload();window.close();'></BODY></HTML>");
}
$result = $playlist->load();
$programmes = array();
foreach ($result as $value) {
    $programmes[$value["id"] . ":" . $value["order_id"]] = $value["title"];
Example #4
0
$smarty->assign('STATIONS', sotf_Station::listStationNames());
$searchLangs = $config['languages'];
array_unshift($searchLangs, "any_language");
for ($i = 0; $i < count($searchLangs); $i++) {
    $langNames[$i] = $page->getlocalized($searchLangs[$i]);
}
$smarty->assign('searchLangs', $searchLangs);
$smarty->assign('langNames', $langNames);
$now = getDate();
//$dayInThePast = mktime(0,0,0, $now['mon'], $now['mday']-10, $now['year']);
$dayInThePast = time() - 60 * 60 * 24 * 30;
// 30 days back
$fromDay = date('Y-m-d', $dayInThePast);
if ($page->loggedIn()) {
    // get users's playlist
    $playlist = new sotf_UserPlaylist();
    $smarty->assign('PLAYLIST', $playlist->load());
    // check if user has default query
    $advsearch = new sotf_AdvSearch();
    $prefs = $user->getPreferences();
    $defQuery = $prefs->getDefaultQuery();
}
// show default query or new programmes
$maxItemsIndexPage = $sotfVars->get("maxItemsIndexPage", 10);
if ($defQuery) {
    $smarty->assign("DEF_QUERY", 1);
    debug("default query", $defQuery);
    $advsearch->Deserialize($defQuery);
    $query = $advsearch->GetSQLCommand();
    debug("query", $query);
    //get the number of results
Example #5
0
    $x = new sotf_Object("sotf_user_progs");
    $x->set('user_id', $user->id);
    $x->set('prog_id', $id);
    $x->find();
    $x->set('flags', $value);
    if ($x->id) {
        if ($value == "none") {
            $x->delete();
        } else {
            $x->update();
        }
    } else {
        $x->create();
    }
    //	else print("<script type=\"text/javascript\" language=\"javascript1.1\">error();</script>");
    print "success";
} elseif ($name == "addplaylist") {
    $playlist = new sotf_UserPlaylist();
    $playlist->add($id);
    print "success";
} else {
    print "<script type=\"text/javascript\" language=\"javascript1.1\">error();</script>";
}
$page->alertWithErrors();
?>

</body>

</html>

$data['allFiles']['length_hour'] = $videoFileStats['length_hour'] + $audioFileStats['length_hour'];
$data['numAllProgs'] = $data['numAudioProgs'] + $data['numVideoProgs'];
$data['numUsers'] = sotf_User::countUsers();
$smarty->assign($data);
// end $data assignements
// STATIONS assignement
$smarty->assign('STATIONS', sotf_Station::listStationNames());
// search languages assignements for searchbox
$searchLangs = $config['languages'];
array_unshift($searchLangs, "any_language");
for ($i = 0; $i < count($searchLangs); $i++) {
    $langNames[$i] = $page->getlocalized($searchLangs[$i]);
}
$smarty->assign('searchLangs', $searchLangs);
$smarty->assign('langNames', $langNames);
// end search languages assignements
// userspecific assignements
// YET TO BE TESTED
if ($page->loggedIn()) {
    // get users's playlist
    $playlist = new sotf_UserPlaylist();
    $smarty->assign('PLAYLIST', array_reverse($playlist->load()));
    //changed by Klaus Temper, to show newest first
    $smarty->assign('PLAYLIST_COUNT', count($playlist->load()));
    //added by Klaus Temper
}
// userspecific assignements
// TOPIC assignements
// get topics with most content
$smarty->assign('TOPICS', $vocabularies->getTopTopics(5));
// end TOPIC assignements