static.php
32 lines
| 759 B
| text/x-php
|
XmlPhpLexer
| r2 | <?php | |||
| include('frontend.inc.php'); | ||||
| $qr = mysqli_query($link,'SELECT title, body, style, UNIX_TIMESTAMP(pubdate) AS published, status | ||||
| FROM static_page | ||||
| WHERE url_name = "' . mysqli_real_escape_string($link, $_GET['name']) . '"') or die(mysqli_error($link)); | ||||
| $PAGE = mysqli_fetch_assoc($qr); | ||||
| if(!$PAGE) { | ||||
| header('HTTP/1.0 404 Not Found'); | ||||
| exit(0); | ||||
| } | ||||
| if($PAGE['status'] != 'published') { | ||||
| header('HTTP/1.0 403 Forbidden'); | ||||
| exit(0); | ||||
| } | ||||
| conditional_exit($PAGE['published']); | ||||
| pagehead('static', $PAGE['title'], $PAGE['style']); | ||||
| ?> | ||||
| <div class="content"> | ||||
| <h2><?php echo utfentities($PAGE['title']) ?></h2> | ||||
| <div id="<?php echo utfentities($_GET['name']) ?>"> | ||||
| <?php echo $PAGE['body'] ?> | ||||
| </div></div> | ||||
| <?php pagefoot() ?> | ||||
| </body> | ||||
| </html> | ||||
