Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/userpix/index.php
Go to the documentation of this file.
00001 <?php
00002   // This simple script displays all the users with pictures on one page.
00003   // By default it is not linked anywhere on the site.  If you want to
00004   // make it available you should link it in yourself from somewhere.
00005   // Remember also to comment or delete the lines restricting access
00006   // to administrators only (see below)
00007 
00008 
00009 require('../config.php');
00010 
00011 $PAGE->set_url('/userpix/index.php');
00012 
00013 require_login();
00014 
00016 $syscontext = get_context_instance(CONTEXT_SYSTEM);
00017 require_capability('moodle/site:config', $syscontext);
00018 
00019 $title = get_string("users");
00020 $PAGE->set_context($syscontext);
00021 $PAGE->navbar->add($title);
00022 $PAGE->set_title($title);
00023 $PAGE->set_heading($title);
00024 echo $OUTPUT->header();
00025 
00026 $rs = $DB->get_recordset_select("user", "deleted = 0 AND picture > 0", array(), "lastaccess DESC", user_picture::fields());
00027 foreach ($rs as $user) {
00028     $fullname = fullname($user);
00029     echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&amp;course=1\" ".
00030          "title=\"$fullname\">";
00031     echo $OUTPUT->user_picture($user);
00032     echo "</a> \n";
00033 }
00034 $rs->close();
00035 
00036 echo $OUTPUT->footer();
 All Data Structures Namespaces Files Functions Variables Enumerations