mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 14:40:09 +01:00
code clean up
Removed unneeded code.
This commit is contained in:
parent
e872baf7b4
commit
485d0e1da3
2 changed files with 12 additions and 15 deletions
|
@ -26,6 +26,12 @@ function getSiteAds(PDO $conn) : array | bool {
|
|||
function getSiteTotalPastes(PDO $conn) : int {
|
||||
return intval($conn->query('SELECT COUNT(*) FROM pastes')->fetch(PDO::FETCH_NUM)[0]);
|
||||
}
|
||||
function getSiteTotalviews(PDO $conn) : int {
|
||||
return intval($conn->query('SELECT tpage FROM page_view ORDER BY id DESC LIMIT 1')->fetch(PDO::FETCH_NUM)[0]);
|
||||
}
|
||||
function getSiteTotal_unique_views(PDO $conn) : int {
|
||||
return intval($conn->query('SELECT tvisit FROM page_view ORDER BY id DESC LIMIT 1')->fetch(PDO::FETCH_NUM)[0]);
|
||||
}
|
||||
|
||||
function updatePageViews(PDO $conn) : void {
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
|
@ -132,3 +138,6 @@ if (isset($_GET['logout'])) {
|
|||
}
|
||||
|
||||
$site_ads = getSiteAds($conn);
|
||||
$total_pastes = getSiteTotalPastes($conn);
|
||||
$total_page_views = getSiteTotalviews($conn);
|
||||
$total_unique_views= getSiteTotal_unique_views($conn);
|
|
@ -1,15 +1,3 @@
|
|||
<?php
|
||||
$get_view_count = $conn->query("SELECT * FROM page_view");
|
||||
while ($row = $get_view_count->fetch()) {
|
||||
$total_page = Trim($row['tpage']);
|
||||
$total_un = Trim($row['tvisit']);
|
||||
}
|
||||
|
||||
$paste_counter = $conn->query("SELECT COUNT(id) from pastes");
|
||||
while ($row = $paste_counter->fetch()) {
|
||||
$get_paste_count = $row['COUNT(id)'];
|
||||
}
|
||||
?>
|
||||
|
||||
<footer class="footer has-background-white" style="border-top: 1px solid #ebeaeb">
|
||||
|
||||
|
@ -66,13 +54,13 @@
|
|||
?>
|
||||
</li>
|
||||
<li>
|
||||
<?php echo 'Page Hits Today: '. $total_page .''; ?>
|
||||
<?php echo 'Page Hits Today: '. $total_page_views .''; ?>
|
||||
</li>
|
||||
<li>
|
||||
<?php echo 'Unique Visitors Today: '. $total_un .''; ?>
|
||||
<?php echo 'Unique Visitors Today: '. $total_unique_views .''; ?>
|
||||
</li>
|
||||
<li>
|
||||
<?php echo 'Total Pastes: ' . $get_paste_count . ''; ?>
|
||||
<?php echo 'Total Pastes: ' . $total_pastes . ''; ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue