query("SELECT COUNT(*) FROM notification WHERE recepient='".$_SESSION['username']."' AND unread='1'"); $nota_count = $num_nota->fetch_row(); $nota_detail = "SELECT detail FROM notification WHERE recepient='".$_SESSION['username']."' AND unread='1'"; $nota_res = $conn->query($nota_detail); $nota_row = $nota_res->fetch_assoc(); $sql="SELECT * FROM `forum_category` ORDER BY `id` DESC"; $result = $conn->query($sql); $announcement = "SELECT * FROM `announcements` ORDER BY `id` DESC"; $aresult = $conn->query($announcement); if (!isset($_SESSION['username']) && empty($_SESSION['username'])) { echo 'You are not logged in! Login here.'; } else { echo 'Welcome ' . $_SESSION['username'] . '. Not you? Logout.'; echo '
Profile'; echo 'Notifications: '; echo $nota_count[0]; ?> Signup'; date_default_timezone_set(America/Los_Angeles); if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 120)) { $act = "DELETE FROM online WHERE USERNAME = '".$_SESSION['username']."'"; $actresult = $conn->query($act); session_unset(); session_destroy(); Header("HTTP/1.1 301 Moved Permanently"); Header("Location: https://coreliamc.com/forum/no_activity.php"); } $_SESSION['LAST_ACTIVITY'] = time(); function time_elapsed_string($datetime, $full = false) { $now = new DateTime; $ago = new DateTime($datetime); $diff = $now->diff($ago); $diff->w = floor($diff->d / 7); $diff->d -= $diff->w * 7; $string = array( 'y' => 'year', 'm' => 'month', 'w' => 'week', 'd' => 'day', 'h' => 'hour', 'i' => 'minute', 's' => 'second', ); foreach ($string as $k => &$v) { if ($diff->$k) { $v = $diff->$k . ' ' . $v . ($diff->$k > 1 ? 's' : ''); } else { unset($string[$k]); } } if (!$full) $string = array_slice($string, 0, 1); return $string ? implode(', ', $string) . ' ago' : 'just now'; } ?> Forums Back Home

Welcome to the Corelia Forums!

Please note that this is a work-in-progress but it is functional.

num_rows > 0) { while ($arow = $aresult->fetch_assoc()) { ?> No announcements."; } ?>
id Announcements User Time Created
'".$arow['id']."'"; ?> '".$arow['name']."'"; ?>
num_rows > 0) { while ($row = $result->fetch_assoc()) { ?> No categories yet! Contact an Administrator."; } ?>
Category Image id Category Name Detail User Time Created
'".$row['id']."'"; ?> '".$row['name']."'"; ?>
query($rank); $rrow = $rresult->fetch_assoc(); if ($rrow['LEVEL'] == 1) { echo 'Delete
'; echo 'Create Category'; echo 'Create Announcement'; } $users = $conn->query("SELECT COUNT(*) FROM online"); $usresult = $users->fetch_row(); $staff = $conn->query("SELECT COUNT(*) FROM online WHERE LEVEL=1"); $staffresult = $staff->fetch_row(); echo "
Total staff online: " . $staffresult[0] . "."; echo "
Total users online: " . $usresult[0] . "."; exit(); ?>