Example #1
0
		<?php 
html_nav('stats', $_SESSION['user']);
?>

	  <div class="row" style='border-bottom: 1px solid #000; margin-bottom: 10px;'>
		  <div class="row" style='padding-left: 10px; padding-right: 10px; padding-top: 5px;'>
				<div class="col-md-10"><h2>Most Active Users</h2></div>
		  </div>
		</div>
<?php 
$num_result = 0;
$resp = get_most_active_users($dbh, 5);
if ($resp['status'] == 1) {
    $users = $resp['users'];
    for ($i = 0; $i < count($users); $i++) {
        html_user($dbh, $users[$i], $_SESSION['user']);
        $num_result++;
    }
    if ($num_result == 0) {
        echo '<p>There appears to be no user here</p>';
    }
}
?>

<?php 
$filter = "";
if (isset($_GET['filter'])) {
    $filter = $_GET['filter'];
}
$from = 0;
$span_all = '<span style="font-size:12px; color: #888; padding:5px; padding-left: 10px;"><a href="stats.php?filter=all">all</a></span>';
Example #2
0
?>
<html>
	<head>
		<title>Yak</title>
		<?php 
html_output_head();
?>
	</head>
	<body>
 <div class="container">
		<?php 
html_nav('user', $_SESSION['user']);
?>

<?php 
html_user($dbh, $_GET['user'], $_SESSION['user']);
?>

<?php 
$num_posts = 0;
if (isset($_GET['start'])) {
    $resp = get_user_posts($dbh, $_GET['user'], 15, $_GET['start']);
} else {
    $resp = get_user_posts($dbh, $_GET['user'], 15);
}
$last_time = -1;
if ($resp['status'] == 1) {
    $posts = $resp['posts'];
    for ($i = 0; $i < count($posts); $i++) {
        html_post($dbh, $posts[$i]);
        $num_posts++;
/**
 * head part of the page and not yet displayed output
 *
 * @param string  $title
 * @param boolean $help  (optional) display a help block next to <h1>
 */
function html_head($title, $help=false) {

	$output = ob_get_clean();

	// we use HTML 5
?>
<!DOCTYPE html>
<html lang="<?=LANG?>">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title><?=h(TITLE." - ".$title)?></title>
	<link rel="stylesheet" media="all" href="css/style.css?<?=version()?>">
<?
	if (Login::$admin) {
?>
	<link rel="stylesheet" media="all" href="css/admin.css?<?=version()?>">
<?
	}
	// generated by http://realfavicongenerator.net/
	// If the installation is in a subfolder, all these icons and favicon.ico have to be either copied to the webroot or deleted from this html head.
?>
	<link rel="apple-touch-icon" sizes="57x57"   href="/apple-touch-icon-57x57.png">
	<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png">
	<link rel="apple-touch-icon" sizes="72x72"   href="/apple-touch-icon-72x72.png">
	<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
	<link rel="apple-touch-icon" sizes="60x60"   href="/apple-touch-icon-60x60.png">
	<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
	<link rel="apple-touch-icon" sizes="76x76"   href="/apple-touch-icon-76x76.png">
	<link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
	<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png">
	<link rel="icon" type="image/png" href="/favicon-192x192.png" sizes="192x192">
	<link rel="icon" type="image/png" href="/favicon-160x160.png" sizes="160x160">
	<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
	<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
	<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
	<meta name="msapplication-TileColor" content="#603cba">
	<meta name="msapplication-TileImage" content="/mstile-144x144.png">
<?
	// end of favicons
?>
	<!--[if lt IE 9]>
	<script src="js/html5shiv-printshiv.js"></script>
	<![endif]-->
</head>
<body>

<?
	if (DEBUG) {
?>
<!--
<?=strtr( print_r(
				array(
					'BN'          => BN,
					'REQUEST_URI' => $_SERVER['REQUEST_URI'],
					'GET'         => $_GET,
					'POST'        => $_POST,
					'SESSION'     => $_SESSION
				),
				true ), array("<!--"=>"<!-", "-->"=>"->") );
		unset($_SESSION['redirects']);
?>
-->
<?
	}
?>

<header>
	<a href="index.php" id="logo" tabindex="-1"><img src="img/logo.png" width="58" height="50" alt=""></a>
	<div id="header">
		<div id="user">
			<? html_user(); ?>
		</div>
		<nav>
			<ul>
				<li><a href="index.php" id="home" tabindex="1">Basisentscheid</a></li>
				<li>
<?
	Ngroup::display_switch();
?>
				</li>
<?
	navlink('proposals.php', _("Proposals"), true);
	navlink('periods.php', _("Periods"), true);
	if (Login::$admin) {
		navlink('admin_areas.php', _("Areas"), true);
	} else {
		navlink('areas.php', _("Areas"), true);
	}
?>
			</ul>
			<ul class="manual">
<?
	navlink('manual.php', _("Manual"));
?>
			</ul>
<?
	if (Login::$admin) {
?>
			<ul class="admin">
<?
		navlink('admin_members.php', _("Members"));
		navlink('admins.php', _("Admins"));
		navlink('admin_ngroups.php', _("Groups"));
?>
			</ul>
<?
	}
?>
		</nav>
		<div class="rclear"></div>
	</div>
</header>

<h1><?=$title?></h1>
<?
	if ($help) help("", true);
?>
<div class="clearfix"></div>
<?

	// show MOTD once for each session and always on the home page
	if (
		defined("MOTD") and
		// display it always on the home page
		(empty($_SESSION['motd_seen']) or BN=="index.php") and
		// never display it on these pages
		BN != "register.php" and
		BN != "reset_password.php" and
		BN != "request_password_reset.php" and
		BN != "confirm_mail.php"
	) {
?>
<section class="motd"><?=MOTD?></section>
<?
		$_SESSION['motd_seen'] = true;
	}

	// not yet displayed output from previous page with redirect
	if (isset($_SESSION['output'])) {
		if ($_SESSION['output']) {
?>
<section class="messages"><?=$_SESSION['output']?></section>
<div class="clearfix"></div>
<?
		}
		unset($_SESSION['output']);
	}

	session_write_close(); // release session lock

	// output from before the html head
	if ($output) {
?>
<section class="messages"><?=$output?></section>
<div class="clearfix"></div>
<?
	}

	$GLOBALS['html_head_issued'] = true;
}