<?php
define("KILL_GLOBALS", 1);
define("IN_MYBB", 1);
require_once("global.php");
add_breadcrumb('Thread Views');
$query = $db->simple_select("threads", "SUM(views) AS gesamt");
$threadviews = $db->fetch_field($query, "gesamt");
$uid = (int)$mybb->user['uid'];
$today = TIME_NOW - 604800;
$query_user = $db->simple_select("threads", "SUM(views) AS usergesamt", "uid = '{$uid}'");
$threadviews_user = $db->fetch_field($query_user, "usergesamt");
$query_usertoday = $db->simple_select("threads", "SUM(views) AS usertoday", "uid = '{$uid}' AND dateline >= '{$today}'");
$threadviews_usertoday = $db->fetch_field($query_usertoday, "usertoday");
$html ='<html>
<head>
<title>'.$settings['bbname'].' - Thread Views</title>
'.$headerinclude.'
</head>
<body>
'.$header.'
<table border="0" cellspacing="'.$theme['borderwidth'].'" cellpadding="'.$theme['tablespace'].'" class="tborder">
<tr>
<td class="thead"><strong>Thread Views</strong></td>
</tr>
<tr>
<td class="trow1">
Themen-Views Insgesamt: '.$threadviews.'<br />
Eigene Themen-Views (Startthemen): '.$threadviews_user.'<br />
Eigene Themen-Views von Themen der letzten 7 Tage: '.$threadviews_usertoday.'<br />
(Diese Zahl bezieht sich nur auf Themen, die in den vergangenen<br />
7 Tagen gepostet worden sind. Bei 0 Aktivität auch 0 Views!)
</td>
</tr>
</table>
'.$footer.'
</body>
</html>';
output_page($html);
?>