-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
57 lines (49 loc) · 1.4 KB
/
example.php
File metadata and controls
57 lines (49 loc) · 1.4 KB
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
<?php require "_partials/header.php"; ?>
<main>
<?php
if ($url->segment(2)) {
$get_int = filter_var($url->segment(2), FILTER_SANITIZE_NUMBER_INT);
if (!empty($get_int)) {
$int = filter_var($get_int, FILTER_VALIDATE_INT);
}
else{
$int = 1;
}
}
else{
$int = 1;
}
$paginator->setStatePaginateArrows("http://localhost/farnost/example/(:num)", "notices", $int);
$results = get_notices( $paginator->getOffset(), $paginator->getLimit() );
?>
<section>
<h2 class="view_title">Farské oznamy</h2>
<?php if ( count($results) ) :foreach ( $results as $notice ) : $notice = format_notice( $notice )?>
<article id="notice_<?= $notices->id ?>" class="notice">
<h2>
<a href=" <?= $notice->link ?> ">
<?= $notice->title ?>
</a>
</h2>
<div class="notice_content">
<?= $notice->teaser ?>
</div>
<time datetime="<?=$notice->created_at?>">
<small>
Vytvorené: <?=$notice->created_at;?>
</small>
</time>
<time datetime="<?=$notice->updated_at?>">
<small>
Aktualizované: <?=$notice->updated_at?>
</small>
</time>
<span class="read_more">
<a href=" <?= $notice->link ?> ">Pozrieť celé</a>
</span>
</article>
<?php endforeach; endif; ?>
<?php $paginator->printNormalAndMobile(); ?>
</section>
</main>
<?php require "_partials/footer.php"; ?>