~studentersamfundet-web/studentersamfundet-web/web

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php include("header.php"); ?>

<?php
$defaults = array(
    'type' => 'events',
    'sort' => 'tid',
    'sort2' => 'asc',
    'sted' => false,
    'd' => 0,
    'm' => 0,
    'y' => 0,
    'limit' => 9999
    );

load_posts( wp_parse_args( $_SERVER['QUERY_STRING'] , $defaults ) );
if( isset($_GET['type']) ) { // hvis man ser på en type arrangement akkurat nå
	$tillatte_typer = array('konsert', 'debatt', 'film', 'fest', 'teater', 'annet'); //definerer gyldige arrangementstyper
	if( in_array($_GET['type'], $tillatte_typer) ) {
		$arr_type = $_GET['type'];
	}
}
?>

        <div id="content">
            <ul id="sorting">
                <li>
                    <span class="event-name"><a href="prog.php?type=<?=$arr_type?>&sort=tittel&amp;sort2=<?php echo( "tittel" == $sort && "asc" == $sort2 ? "desc" : "asc" ); ?>">Tittel:</a></span>
                    <span class="event-type"><a href="prog.php?type=<?=$arr_type?>&sort=type&amp;sort2=<?php echo( "type" == $sort && "asc" == $sort2 ? "desc" : "asc" ); ?>">Type:</a></span>
                    <span class="event-date"><a href="prog.php?type=<?=$arr_type?>&sort=tid&amp;sort2=<?php echo( "tid" == $sort && "asc" == $sort2 ? "desc" : "asc" ); ?>">Dato:</a></span>
                    <span class="event-place"><a href="prog.php?type=<?=$arr_type?>&sort=sted&amp;sort2=<?php echo( "sted" == $sort && "asc" == $sort2 ? "desc" : "asc" ); ?>">Sted:</a></span>
                </li>
            </ul>

            <ul id="program">
                <?php $i = 0; ?>
                <?php if ( $posts ) : foreach ( $posts as $post ) : ?>
                <li id="event-<?php echo(++$i); ?>" class="event<?php if ( $i % 2 == 0) echo(' alt"'); ?>"> 
                <span class="event-name">
                        <a href="vis.php?ID=<?php echo($post->id); ?>"><?php echo($post->title); ?></a>
                        <?php if( isset($post->ticket_url) && "http://" != $post->ticket_url && "" != $post->ticket_url ) {
                                echo('<a href="'.$post->ticket_url.'"> <img src="'.get_bloginfo('image-root').'/bilder/logo_billettservice.gif" alt="Billettservice" /></a>');
                        } ?>
                    </span> <!-- .event-name -->
                    <span class="event-type"><?php echo($post->type); ?></span>
                    <span class="event-date">
                    <?php echo(date("j. M",strtotime($post->date))); ?>
                    </span> <!-- .event-date -->
                    <span class="event-place"><a href="lokaler.php?lokale=<?php echo($post->place); ?>"><?php echo($post->place); ?></a></span> 
                </li> 
<?php endforeach; else: ?>
                <li>Ingen treff passer med dette s&oslash;ket.</li>
<?php endif; ?>

                <li>
                    <div class="knapp">
                        <?php
                        $thisyear = date("Y");
                        for ($year = $thisyear; $year >= 2004; $year--) {
                            print "<a href=\"prog.php?y=$year";
                            if (isset($_GET['type'])) print "&amp;type=$type_knapp";
                            print "\">vis alle $year</a>\n";
                            if ((($year-2004) % 7) == 6) print "<br /><br />";
                        }
                        ?>
                    </div>
                </li>	
            </ul> <!-- #program -->

            <?php include("sidebar.php"); ?>

        </div> <!-- #content -->

<?php include("footer.php"); ?>