* * 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. */ session_start(); if (isset($_SESSION['login'])) { // Do nothing } else { header("Location: ."); exit(); } if (isset($_GET['logout'])) { if (isset($_SESSION['login'])) unset($_SESSION['login']); session_destroy(); header("Location: ."); exit(); } $date = date('jS F Y'); $ip = $_SERVER['REMOTE_ADDR']; require_once('../config.php'); $con = mysqli_connect($dbhost, $dbuser, $dbpassword, $dbname); if (mysqli_connect_errno()) { $sql_error = mysqli_connect_error(); die("Unable connect to database"); } $query = "SELECT @last_id := MAX(id) FROM admin_history"; $result = mysqli_query($con, $query); while ($row = mysqli_fetch_array($result)) { $last_id = $row['@last_id := MAX(id)']; } $query = "SELECT * FROM admin_history WHERE id=" . Trim($last_id); $result = mysqli_query($con, $query); while ($row = mysqli_fetch_array($result)) { $last_date = $row['last_date']; $last_ip = $row['ip']; } if ($last_ip == $ip) { if ($last_date == $date) { } else { $query = "INSERT INTO admin_history (last_date,ip) VALUES ('$date','$ip')"; mysqli_query($con, $query); } } else { $query = "INSERT INTO admin_history (last_date,ip) VALUES ('$date','$ip')"; mysqli_query($con, $query); } $query = "Select * From sitemap_options WHERE id='1'"; $result = mysqli_query($con, $query); while ($row = mysqli_fetch_array($result)) { $priority = $row['priority']; $changefreq = $row['changefreq']; } ?> Paste - Sitemap
' . mysqli_error($con) . '
'; } else { echo '
Sitemap saved.
'; } } ?>
Sitemap

' . $protocol . $_SERVER['SERVER_NAME'] . $levelup . '/ 1.0 daily ' . $c_date . ' '; file_put_contents("../sitemap.xml", $data); $rec_limit = 10; $query = "SELECT count(id) FROM pastes"; $retval = mysqli_query($con, $query); $row = mysqli_fetch_array($retval); $rec_count = Trim($row[0]); $offset = 0; // Set the specific query to display in the table $sql = "SELECT * FROM `pastes` WHERE visible='0' LIMIT $offset, $rec_count "; $result = mysqli_query($con, $sql); // Loop through each record while ($row = mysqli_fetch_array($result)) { $paste_id = Trim($row['id']); $site_data = file_get_contents("../sitemap.xml"); $site_data = str_replace("", "", $site_data); if ($mod_rewrite == "1") { $server_name = $protocol . $_SERVER['SERVER_NAME'] . $levelup . "/" . $paste_id; } else { $server_name = $protocol . $_SERVER['SERVER_NAME'] . $levelup . "/paste.php?id=" . $paste_id; } $c_date = date('Y-m-d'); $c_sitemap = ' ' . $server_name . ' ' . $priority . ' ' . $changefreq . ' ' . $c_date . ' '; $full_map = $site_data . $c_sitemap; file_put_contents("../sitemap.xml", $full_map); } } ?> sitemap.xml rebuilt
'; } ?>