adding a way to test the user image border removal code. Needs some speed
[moodle.git] / userpix / index.php
CommitLineData
dbaf630a 1<?php // $Id$
2 // This simple script displays all the users with pictures on one page.
3 // By default it is not linked anywhere on the site. If you want to
4 // make it available you should link it in yourself from somewhere.
5 // Remember also to comment or delete the lines restricting access
6 // to administrators only (see below)
7
8
9 include('../config.php');
10
11 require_login();
12
13/// Remove the following three lines if you want everyone to access it
14 if (!isadmin()) {
15 error("Currently only the administrator can access this page!");
16 }
17
18
19 if (!$users = get_records("user", "picture", "1", "lastaccess DESC", "id,firstname,lastname")) {
20 error("no users!");
21 }
22
23 $title = get_string("users");
24
25 print_header($title, $title, $title);
26
27 foreach ($users as $user) {
e525e3d3 28 $fullname = fullname($user);
29 echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&amp;course=1\"".
30 "title=\"$fullname\">";
31 if ($CFG->slasharguments) { // Use this method if possible for better caching
32 echo '<img src="'. $CFG->wwwroot .'/user/pix.php/'.$user->id.'/f1.jpg"'.
33 ' border="0" width="100" height="100" alt="'.$fullname.'" />';
34 } else {
35 echo '<img src="'. $CFG->wwwroot .'/user/pix.php?file=/'. $user->id .'/f1.jpg"'.
36 ' border="0" width="100" height="100" alt="'.$fullname.'" />';
37 }
38 echo "</a> \n";
dbaf630a 39 }
40
41 print_footer();
05f53652 42
43?>