* * 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'])) { header('Location: .'); exit(); } if (isset($_GET['logout'])) { if (isset($_SESSION['login'])) unset($_SESSION['login']); session_destroy(); header("Location: ."); exit(); } $today_users_count = 0; $today_pastes_count = 0; $date = date('jS F Y'); $ip = $_SERVER['REMOTE_ADDR']; require_once('../config.php'); require_once('../includes/functions.php'); $conn = new PDO( "mysql:host=$db_host;dbname=$db_schema;charset=utf8", $db_user, $db_pass, $db_opts ); $query = $conn->query('SELECT @last_id := MAX(id) FROM admin_history'); while ($row = $query->fetch()) { $last_id = $row['@last_id := MAX(id)']; } $query = $conn->prepare('SELECT ip, last_date FROM admin_history WHERE id = ?'); $query->execute([$last_id]); while ($row = $query->fetch()) { $last_date = $row['last_date']; $last_ip = $row['ip']; } if ($last_ip !== $ip || $last_date !== $date) { $conn->prepare('INSERT INTO admin_history (ip, last_date) VALUES (?, ?)')->execute([$date, $ip]); } $query = $conn->query("SELECT @last_id := MAX(id) FROM page_view"); $row = $query->fetch(PDO::FETCH_NUM); $page_last_id = intval($row[0]); $query = $conn->prepare('SELECT tpage, tvisit FROM page_view WHERE id = ?'); $query->execute([$page_last_id]); while ($row = $query->fetch()) { $today_page = $row['tpage']; $today_visit = $row['tvisit']; } $query = $conn->query('SELECT email FROM site_info'); while ($row = $query->fetch()) { $admin_email = Trim($row['email']); } $c_date = date('jS F Y'); /* Number of users today */ $query = $conn->prepare('SELECT COUNT(*) FROM users WHERE `date` = ?'); $query->execute([$c_date]); $today_users_count = intval($query->fetch(PDO::FETCH_NUM)[0]); /* Number of pastes today */ $query = $conn->prepare('SELECT COUNT(*) FROM pastes where s_date = ?'); $query->execute([$c_date]); $today_pastes_count = intval($query->fetch(PDO::FETCH_NUM)[0]); for ($loop = 0; $loop <= 6; $loop++) { $myid = $page_last_id - $loop; $query = $conn->prepare("SELECT date, tpage, tvisit FROM page_view WHERE id = ?"); $query->execute([$myid]); while ($row = $query->fetch()) { $sdate = $row['date']; $sdate = str_replace(date('Y'), '', $sdate); $sdate = str_replace('January', 'Jan', $sdate); $sdate = str_replace('February', 'Feb', $sdate); $sdate = str_replace('March', 'Mar', $sdate); $sdate = str_replace('April', 'Apr', $sdate); $sdate = str_replace('August', 'Aug', $sdate); $sdate = str_replace('September', 'Sep', $sdate); $sdate = str_replace('October', 'Oct', $sdate); $sdate = str_replace('November', 'Nov', $sdate); $sdate = str_replace('December', 'Dec', $sdate); $ldate[$loop] = $sdate; $tpage[$loop] = $row['tpage']; $tvisit[$loop] = $row['tvisit']; } } ?> Ponepaste - Dashboard
  • Views

    Today
  • Pastes

    Today
  • Users

    Today
  • Unique Views

    Today
Recent Pastes
"; } ?>
ID Username Date IP Views
$p_id $p_member $p_date $p_ip $p_view
Recent Users
query('SELECT id, username, date, ip FROM users ORDER BY id DESC LIMIT 7')->fetchAll(); $last_id = intval( $conn->query('SELECT MAX(id) FROM users')->fetch(PDO::FETCH_NUM)[0] ); foreach ($most_recent_users as $user) { echo " "; } ?>
ID Username Date IP
${user['id']} ${user['username']} ${user['date']} ${user['ip']}
Admin History
'; } ?>
ID Last Login Date IP ID Last Login Date
' . $r_id . ' ' . $r_paste . ' ' . $m_report . ' ' . $r_date . ' ' . $r_reason . '

You have the latest version'; } else { echo '
Your Paste installation is outdated. Get the latest version from SourceForge'; } ?>