예제 #1
0
파일: index.php 프로젝트: switchUA/stuff
$to = time();
//get requests
if ($_REQUEST[from]) {
    $from = $_REQUEST[from];
}
if ($_REQUEST[to]) {
    $to = $_REQUEST[to];
}
if ($to > time()) {
    $to = time();
}
//get data
if ($_REQUEST[top]) {
    $movies = DbGetTop(20);
} else {
    $movies = getmovies("biercam", $from, $to, 240);
}
//dermine oldest and newest movie timestamps
$newest = array_keys($movies);
$newest = movie2timestamp($newest[0]);
$oldest = array_reverse(array_keys($movies));
$oldest = movie2timestamp($oldest[0]);
$nav .= "<a href='?'>Nu</a> ";
if (!$_REQUEST[top]) {
    $nav .= "<a href='?to=" . ($oldest - 1) . "'>Iets eerder</a> ";
    $nav .= "<a href='?to=" . ($to - 24 * 3600) . "'>1 dag eerder</a> ";
}
//anders fixen:	if ($to < time())
//		$nav.="<a href='?to=".($newest+$step)."'>Later</a>";
$nav .= " <a href='?top=jahwohl'>Top 20</a>";
$nav .= " <a href='javascript:pop(\"live.php?url=mms://lounge.datux.nl:9192&desc=BirdyCam Live stream voor Windows Media Speler\");'>Livestream 1</a>";
예제 #2
0
파일: index2.php 프로젝트: switchUA/stuff
//head zooi
head();
//stappen grootte, dus hoeveel uur per keer laten zien
$step = 4 * 3600;
//default setttings
$from = time() - $step;
$to = time();
//get requests
if ($_REQUEST[from]) {
    $from = $_REQUEST[from];
}
if ($_REQUEST[to]) {
    $to = $_REQUEST[to];
}
//get data
$movies = getmovies("biercam", $from, $to);
$nav = "<a href='?from=" . ($from - $step) . "&to=" . ($to - $step) . "'>Eerder</a> ";
if ($from + $step < time()) {
    $nav .= "<a href='?from=" . ($from + $step) . "&to=" . ($to + $step) . "'>Later</a>";
}
$nav .= " <a href='?'>Nu</a>";
$nav .= " <a href='view.php?url=mms://lounge.datux.nl:9192&desc=Biercam Live stream 1'>Livestream 1</a>";
$nav .= " <a href='view.php?url=mmsh://lounge.datux.nl:9192&desc=Biercam Live stream 2'>Livestream 2</a>";
$nav .= " <a href='view.php?url=http://lounge.datux.nl:9192&desc=Biercam Live stream 3'>Livestream 3</a>";
//print navigation
echo "{$nav}";
//print the grand movie table
foreach ($movies as $movie => $thumbs) {
    echo "<h1>";
    $time = movie2timestamp($movie);
    printtime($time);
예제 #3
0
function DbCleanup()
{
    //ALLE movies van ouder dan 5 dagen
    $movies = getmovies("biercam", 0, time() - 5 * 3600 * 24);
    foreach ($movies as $movie_name => $thumbs) {
        //heeft ie al een entry in de database?
        $id = DbGetMovieId($movie_name, 0);
        if ($id) {
            //ja hij heeft al stemmen
            //heeft ie stemmen hoger dan 1?
            $votes = db_QueryFetchRow("\n\t\t    SELECT *\n\t\t    FROM votes\n\t\t    WHERE movie_id={$id}\n\t\t    AND vote_value>1\n\t\t    LIMIT 1\n\t\t");
            if ($votes) {
                continue;
            }
        }
        //hij kan dus weg:
        echo "{$movie_name} kan weg!\n";
        //	    echo " <a href='view.php?movie_name=$movie_name'>zien</a><br>";
        //verwijder thumbs, movies, dbentry en votes
        unlink($movie_name);
        foreach ($thumbs as $thumb) {
            unlink($thumb);
        }
        Db_DoQuery("\n\t\tDELETE FROM votes\n\t\tWHERE movie_id={$id}\n\t    ");
        Db_DoQuery("\n\t\tDELETE FROM movies\n\t\tWHERE movie_id={$id}\n\t    ");
    }
}