*
* 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.
*/
define('IN_ADMIN', 1);
require_once('common.php');
$today_users_count = 0;
$today_pastes_count = 0;
require_once('../includes/functions.php');
updateAdminHistory($conn);
$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'];
}
}
?>
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 "
${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'; }
?>