Skip to content
Snippets Groups Projects
Commit c5f959fe authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

re #3183

Merge request studip/studip!2424
parent 4aa40f97
No related branches found
No related tags found
No related merge requests found
<?php
# Lifter010: TODO
/**
* vote.php - Votecontroller controller
*
* 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 2 of
* the License, or (at your option) any later version.
*/
class BbController extends AuthenticatedController {
function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
if (!$GLOBALS['perm']->have_perm('root')) {
throw new AccessDeniedException();
}
}
public function index_action($page = 1)
{
$this->entries_per_page = Request::int('entries_per_page', 20);
$images = [];
foreach (scandir($GLOBALS['DYNAMIC_CONTENT_PATH'] . '/user') as $file) {
if (mb_strpos($file, '_normal.png') !== FALSE && $file !== 'nobody_normal.png') {
$images[] = [
'time' => @filemtime($GLOBALS['DYNAMIC_CONTENT_PATH'] . '/user/'.$file),
'file' => $file,
'user_id' => mb_substr($file, 0, mb_strrpos($file, '_'))];
}
}
usort($images, function($b, $a) {
return $a['time'] - $b['time'];
});
$this->entries = sizeof($images);
$this->page = $page;
$this->images = array_slice($images, $this->entries_per_page * ($page - 1), $this->entries_per_page);
}
}
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td class="table_header_bold" colspan=2>
<b><?=_("Der geheime Bilderbrowser")?></b>
</td>
</tr>
</table>
<br><br>
<?=_("Unschön dass wir uns hier sehen... diese Seite ist das geheime Easteregg von Stud.IP. Wenn es jemand hierher geschafft hat, der nicht zum Team gehört, dann kündige ich.")?>
<br><br>
<i>Cornelis</i><br><br>
<?
$pagination = $GLOBALS['template_factory']->open('shared/pagechooser');
$pagination->set_attributes([
'perPage' => $entries_per_page,
'num_postings' => $entries,
'page' => $page,
'pagelink' => $controller->url_for('bb/index/%u')
]);
echo $pagination->render();
?>
<br><br>
<? foreach ($images as $image) : ?>
<div style="float: left; width: 250px; border: 1px solid gray; padding: 5px; text-align: center; font-weight: bold; margin: 5px;">
<a href="<?= URLHelper::getLink('dispatch.php/profile?username='. get_username($image['user_id'])) ?>">
<img border="0" src="<?= $GLOBALS['DYNAMIC_CONTENT_URL'] . '/user/' . $image['file'] ?>">
<br>
<?= get_fullname($image['user_id'], 'full' ,true) ?><br>
<?= date('d.m.Y', $image['time']) ?>
</a>
</div>
<? endforeach ?>
<br style="clear: both">
<br>
<?= $pagination->render() ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment