ponepaste/pages.php

45 lines
1.4 KiB
PHP
Raw Normal View History

2021-07-10 19:18:17 +01:00
<?php
/*
* Paste <https://github.com/jordansamuel/PASTE>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License in GPL.txt for more details.
*/
2021-07-11 12:48:48 -04:00
define('IN_PONEPASTE', 1);
require_once('includes/common.php');
2021-07-10 19:18:17 +01:00
require_once('includes/functions.php');
// UTF-8
header('Content-Type: text/html; charset=utf-8');
$date = date('jS F Y');
$ip = $_SERVER['REMOTE_ADDR'];
2021-07-11 12:48:48 -04:00
updatePageViews($conn);
2021-07-10 19:18:17 +01:00
2021-07-10 18:21:03 -04:00
if (isset($_GET['page'])) {
2021-07-11 12:48:48 -04:00
$page_name = htmlspecialchars(trim($_GET['page']));
$query = $conn->prepare('SELECT page_title, page_content, last_date FROM pages WHERE page_name = ?');
$query->execute([$page_name]);
if ($row = $query->fetch()) {
2021-07-10 19:18:17 +01:00
$page_title = $row['page_title'];
$page_content = $row['page_content'];
$last_date = $row['last_date'];
$stats = "OK";
$p_title = $page_title;
}
}
// Theme
require_once('theme/' . $default_theme . '/header.php');
require_once('theme/' . $default_theme . '/pages.php');
require_once('theme/' . $default_theme . '/footer.php');
2021-07-11 12:48:48 -04:00