~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
<?php include("header.php"); ?>

        <div id="content">

            <div id="articles" class="hfeed">

                <?php load_posts( 'type=news&page=' . $_GET['page'] ); if($posts) : foreach($posts as $post) : ?>

                <div class="hentry forsidesak">
                    <h2 class="entry-title"><a href="nyhet.php?ID=<?php echo($post->id); ?>" rel="bookmark"><?php echo($post->title); ?></a></h2>
                    <!-- small class="infoboks"><?php echo(date("d-m-Y", strtotime($post->date)) ); ?></small -->
                    <div class="entry-summary">
                    <?php if ($post->attachment) { ?>
                        <div class="vedlegg"><a href="nyhet.php?ID=<?php echo($post->id); ?>"><img src="<?php bloginfo('url'); ?>/imageResize.php?pic=bilder/nyheter/<?php echo($post->attachment); ?>&amp;maxwidth=300&amp;maxheight=200" alt="" /></a></div>
                    <?php } ?>

                        <p><?php echo(stripSlashes($post->intro)); ?></p>
                    </div> <!-- .entry-summary -->

                </div> <!-- .hentry.forsidesak -->

                <?php endforeach; ?>

                <div id="paging">
                    <?php $page = $page ? $page : 1; ?>
                    <?php if ( $page > 1 ) { ?>
                        <a id="previous" href="<?php bloginfo('url'); ?>/nyheter.php?page=<?php echo($page-1); ?>">Forrige side</a>
                    <?php } ?>
                        <a id="next" href="<?php bloginfo('url'); ?>/nyheter.php?page=<?php echo($page+1); ?>">Neste side</a>
                </div> <!-- #paging -->

                <?php else: ?>

                <div class="hentry">
                    <h2>Tomt!</h2>
                    <p>Ingen nyheter passer med dette oppslaget. Pr&oslash;v &aring; finne fram fra <a href="<?php bloginfo('url'); ?>">forsida</a>?</p>
                </div>
                
                <?php endif; ?>

            </div> <!-- #forsidesaker.hfeed -->

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

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

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